Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lorisnico2000 opened this issue Oct 23, 2023 · 3 comments
Open

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

lorisnico2000 opened this issue Oct 23, 2023 · 3 comments
Labels
10.x related to TYPO3 v13 enhancement

Comments

@lorisnico2000
Copy link

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.

@christianmueller2000
Copy link

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

@christianmueller2000
Copy link

Is there still no update available ?

Please advice, thank you.

@extcode
Copy link
Owner

extcode commented Feb 8, 2024

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.

@rintisch rintisch added the 10.x related to TYPO3 v13 label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.x related to TYPO3 v13 enhancement
Projects
None yet
Development

No branches or pull requests

4 participants