-
Notifications
You must be signed in to change notification settings - Fork 217
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
Any way to access cart status messages from the sdk? #859
Comments
I think what you are looking for are promotion.banners. They belong to the checkout object https://github.com/bigcommerce/checkout-sdk-js/blob/master/docs/interfaces/checkout.md#promotions |
Thanks @capsula4, but based on what I'm seeing this is not the right information. I'm referring to the information that appears in Is that what you're referring to also? For example, I have a free shipping promotion created in there that looks like this: When I navigate to the cart page with Also, confusingly there are two discounts appearing in the Do you know what those discounts represent or where they are coming from? I really appreciate your help! |
Hi @capsula4 - just wanted to check in on this. It's actually blocking me from getting our cart finished. If these messages aren't available, I'm going to have to build some hacky workaround to get the data from stencil, but that feels really gross since I wanted to only use the storefront cart api to manage our new cart. I don't want start building the hack if there is a better solution. Any idea? Thanks again! |
Looking at the cart functionality in the default Cornerstone theme, I don't see these messages in the floating cart. They only appear on the cart page itself. I'm guessing that means the information is not available to the floating cart via the API. :( |
Checkout SDK only shows discounts applied to carts, but won't tell you exactly the name of the applied promotion/discount. Would be good to understand what's the exact requirement from your side. |
Thanks @capsula4. The requirement is simply to be able to show messages in the cart for discounts that have been applied. In the BigCommerce control panel you are able to set messages for when a cart-level discount is applied, or a message to promote it. For example, we have a rule set up in the control panel that says when your order total is more than $75, show "Your order qualifies for free standard shipping". Or, when it's below $75, show "Add another $2 your order for free standard shipping". In the context of the cart in stencil, you get access to those cart messages so they can be displayed on the page. We recently rebuilt our own custom cart, and I was planning to use the new storefront cart api to do it, but found a lot of features to be missing. This was one of them. Here's a screenshot of our current cart (on StoreYourBoard.com), when you qualify for free shipping: Here's an example of when you haven't reached free shipping yet: These messages are accessed in stencil via
Then, within my cart api code I fetch a cart like this:
This allows me to build a nice floating cart, and still access the cart status messages I need since they are missing from the API. Does that help? |
Thanks for your feedback. We do expose some of these messages but not all. Could look into expanding the set of messages we expose. |
We have created an internal ticket to track this issue CHECKOUT-5413 |
@capsula4 any update on this? I'm blocked by this issue, too. |
Hey @jeffthemaximum we haven't had time to work on this one as of now. |
Is there any way to access to cart status messages within the sdk? I'm referring to the messages that you can access in stencil via handlebars
{{ cart.status_messages }}
. These are used to indicate discounts the customer may or may not receive depending on what's in their cart.It would be useful if they are in the available via the sdk since they change depending on the cart contents.
The text was updated successfully, but these errors were encountered: