cart icon indicating copy to clipboard operation
cart copied to clipboard

Update (special) prices in cart on user login/logout

Open lorisnico2000 opened this issue 2 years ago • 3 comments

Bug Report

Current Behavior I have a Product with a Special Price tied to a usergroup (Using Cart with CartProducts, but as far as i've seen the problem is in cart extension). If i am not logged in and add a product to the cart, the product gets displayed in the cart with the default price. If i now log in with said usergroup and open the cart again, the product still has the default price and not the special price, even if i update the cart or change the quantity.

Expected behavior/output The product should switch to the special price as soon as i log in with the corresponding usergroup.

Environment

  • TYPO3 version(s): 10.4.37
  • cart version: 7.7.4
  • cart_products version: 3.4.5
  • Is your TYPO3 installation set up with Composer (Composer Mode): yes
  • OS: OSX 13.5.1

Possible Solution Maybe in \Extcode\Cart\Controller\Cart\ActionController->restoreSession() check if the user login status changed and then remove and add the products to get the special price.

lorisnico2000 avatar Oct 23 '23 11:10 lorisnico2000

Are there any updates on this case? We should find a solution within a reasonable period of time. Thank you.

christianmueller2000 avatar Nov 06 '23 10:11 christianmueller2000

Is there still no update available ?

Please advice, thank you.

christianmueller2000 avatar Dec 01 '23 09:12 christianmueller2000

The products in the cart session has no relation to the original dataset from the database. I don't think it's very efficient to check every time whether a user has logged in. This should happen when the shopping cart or the mini shopping cart is displayed.

From my point of view, an event that is thrown by the login process would make sense here. An EventListener could then check whether something needs to be recalculated in the shopping cart. To do this, each product and the specific configuration would have to be loaded from the database to check whether the price has changed. This EventListener would then also have to access an event at logout. So far there have been no such events, or I have simply overlooked them. I will check this again after the updates for TYPO3 v12.

extcode avatar Feb 08 '24 22:02 extcode