I have an application that has both a Theme extension and Checkout UI Extension. I would like to pass some data from the theme extension to the checkout extension.
My first thought was to use the localStorage/sessionStorage, but it seems these are not accessible from within the checkout extension. Any other way to pass the data?
U need to check “attributes” here. Be careful with testing it locally. When u go to your checkout UI extension go back to the page where your theme extension is. And then go back to the checkout page. My case:
run dev server;
go to “…/extensions/dev-console”;
go back to the cart page (here is my theme extension);
that would be because when you use Buy Now button you are bypassing the cart and cart attributes and create an instanct checkout session. So, therefore your POST never gets triggered.
Any idea how we can fix it. Like, is there any alternative we can pass data in cart attribute if user go with Buy Now instead of adding product into cart.
As I can check when user go directly to checkout page with Buy Now button, still the products got added in the cart. Because when we go back to the site we can see the product is present in the cart. It simply means that the cart is updating in both the cases - Add to cart and Buy Now.
Now the question is, can’t we use cart update event to add cart attributes ?