Hi. Recently our team created a custom shipping rates provider for our client (we created a shopify app and we're providing shipping rates endpoint for carrier service API).
But we have a struggle with changing shipping prices on changing order total price.
According to Shopify API Documentation, Shopify will use its' cache if none of these options are changed.
But what must we do if we want to make a free delivery if order total price is changed? Shopify uses cache and if user tried to select a shipment method, but then returned and added some more products to cart - Shopify will display him the same price.
Oh, I think, I understand a solution right now. After the user will change his cart variants - rates will be recached. Sorry for this question.
Do you have any idea about how to pass extra product metadata to CarrierService?
Because, I need product width, height, length to calculate the currect shipping.
i tried to add an app to assign meta data to product. but these data are not getting from CarrierService.
only product weight is getting. if you can help me,it will be greate
@hashik you're not going to like this, but you have no choice it seems. You get a payload from Shopify telling you the products in the checkout and their quantity. You will now want to look up in your internal database, the values stored in those product metafields. In other words, keep a shadow inventory. That will be fast enough to calculate the rates and return values.
Otherwise, you are left making an API call to Shopify to get the product metafields, before you can use those values, which takes time, can be slow, and can therefore screw up the speed with which you calculate and return accurate rates.
So: maintain a shadow inventory with those values you need!