Request to Recalculate Discounts on User Login/Logout
under review
ヘ
ヘンリー株式会社
We would like to suggest that Shopify implement a feature to automatically recalculate discounts when a user logs in or out. Currently, discounts are recalculated only when cart contents are modified or when users visit the checkout page, leading to confusion. Making this change could enhance user experience significantly.
If you'd like us to add this feature to our app, please upvote and comment on this thread.
P.S. This feature request was generated via AI, based on the conversation with the customer.
Tobe Osakwe
under review
Tobe Osakwe
It could be possible in the future to introduce a workaround for detecting when the logged in/logged out status changes.
We could potentially store a value in
window.sessionStorage
that tracks whether the user were previously logged in/logged out before the current page was loaded. If the status changed, we could forcibly change the cart (maybe by setting an attribute to a random value).However, there is no theme-agnostic/app-agnostic way to refresh the cart display, without refreshing the entire page. For more information, please read this thread: https://regios-technologies-inc.canny.io/feature-requests/p/auto-refresh-cart-display-for-added-products
Tobe Osakwe
For now, we will wait until this feature request gathers sufficient demand to consider implementing this, as it would be complex. Complex features can potentially make the app harder to use, as well as introducing potential bugs. Therefore, we only want to commit to this once the impact is clear.
S
Seun Oyebode
Here's a workaround that was suggested on the Dev community forum thread: "but one workaround would be to make a small cart change after logging in or out, which forces the system to update the discount. You could also prompt the customer to refresh the cart page."
Tobe Osakwe
Here is a thread we have opened with Shopify about this: https://community.shopify.dev/t/request-recalculate-discounts-on-user-login-logout/10359
S
Seun Oyebode
Hi there,
Shopify does not immediately recalculate the discounts when a user logs in/logs out.
The only times Shopify recalculate discounts:
- when the cart contents are modified
- when the customer visits the checkout page
This is a limitation of Shopify itself.
We will close this feature request and reopen it when Shopify provides solution around the limitation.