Run discount functions when users log in to their account #321
nboliver-ventureweb
started this conversation in
Feedback: Discounts APIs
Replies: 1 comment 2 replies
-
@nboliver-ventureweb any workarounds in the meantime? I understand the only way would be to trigger a cart update somehow, being modifying a cart attribute what comes to mind |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently when a discount function relies on some piece of customer data (in our case metafields), if the customer builds a cart while logged in, the discount shows in the theme / liquid cart. If they proceed to log out, and then log back in, they will see the cart with no discounts applied - I guess because the function hasn't run again since they logged in?
It seems like it may be possible to work around this by triggering an empty cart update request with the ajax cart API after the user logs in, but this will require some theme wrangling which is inconvenient or impossible depending on the application of the function.
Ideally the customer should see their discounted cart immediately upon logging in, without needing to trigger an update or proceed to checkout.
Beta Was this translation helpful? Give feedback.
All reactions