I know that I can use variant_id and to additional requests for each line item to get its compare_at_price, but is there a way to add it to the orders/create payload?
And if there’s, what’s the recommended way of doing so?
I think you can add compare_at_price
as line item property
.
Could you please elaborate a bit more on it? How does one add a property to line item?
You will need to update the Shopify theme to add line item property.
I was able to add compare at price as a property to line items of order/create webhook. To implement it I had to add the next line of code to the form which is used to add a product to the car.
<input type="hidden" name="properties[compare_at_price]" value="{{ product.selected_variant.compare_at_price | money_without_currency }}">
Though I wonder, wouldn’t it make sense for Shopify to include compare at price for line items in order/create (and other similar) webhook topics.