Personalized checkout and custom promotions with Shopify Scripts
We have been working with Hydrogen Storefront to create a headless store and have come across a problem. We use custom properties on our products that tell our scripts what kind of discounts to offer.
As an example:
price_breaks[] = 123:456:flat_rate
price_breaks[] = 123:789:flat_rate
price_breaks[] = 123:112:precentage
Would normally in Shopify be sent as an Html encoded string to the cart, and true to form it would be decoded as an array. However, when using Hydrogen attributes in the cart, they seem to only allow for a single key, value pair relationships ( when added with linesAdd function). The above array would come through to our store as just the last line:
e.g. price_breaks[] = 123:112:precentage
This is a real headache for our script migrations. It means we need to convert all of our Shopify store scripts, it would be much easier if array data could be sent via Hydrogen.
.
Did you manage to accomplish this? I'm having the same issue
Not yet, still investigating the best way to fix it.
Excuse me.. I'm also using custom cart_attribute, but I'm not able to find that cart_attribute that I POST with graphQL in shopify backend. Am i missing something?
User | RANK |
---|---|
4 | |
1 | |
1 | |
1 | |
1 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023