I have 3 products, 2 already in cart and for 3rd i click on Buy Now button i.e Dynamic Checkout. Thus, the 3rd product in checkout page is totally separated from cart products.
Now i want to add a line item property to the dynamically checked out product, since i am focusing on the product which is not in cart, so /cart/change.js wont be useful.
How can i add a line item property for the product in checkout page of payment_method step ?
P.S- I have access to checkout.liquid
Hi @LakshayLakshay
add a line item property for the product in checkout page of payment_method step
XYproblem, what is the goal? why are you doing X at the payment step.
Afaik , I thought a dynamic checkout had it’s own cart session useable with /cart/change.js .
Since this is at the payment_method step you also cannot leverage [line-item scripts change_properties method](https://help.shopify.com/en/manual/checkout-settings/script-editor/shopify-scripts#:~:text=item%20has%20changed.-,.change_properties,-(hash%20new_properties%2C%20{%20message) if your not able to change the cart.
?
However standard line item property form fields should be carrying through with dynamic checkouts.
See https://community.shopify.com/c/shopify-discussions/dynamic-checkout-and-line-item-properties/m-p/1396024/highlight/true#M268450
Shopify has a complete lack of clear docs and staff clarification on this though,
So If the above does not work I’d contact the Plus stores MSM and ask them to document this bug|limitation, and also try and see if the next version of checkoutscripts can be leveraged keeping in mind though it is in closed beta.
Workaround -
Simplest working technique is to use cart attributes instead
https://shopify.dev/themes/architecture/layouts/checkout-liquid#capture-checkout-attributes
Then use an automation app like usemechanic to edit orders to apply line item properties to specific items from those cart attributes on such orders using dynamic checkout. Hypothetical - This automation may also be possible in the next version of the Flow app for Plus stores, consult the stores MSM for your use case.
Barring all the above a clunky advanced workaround would be doing UI sleight of hand so customers are still on a previous step but presented as if on the payment UI. Make note that the chosen payment method not exposed in current checkoutscripts line item scripts
1 Like