Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Shopify Function to modify cart line item quantity

Solved

Shopify Function to modify cart line item quantity

kylehkhk
Shopify Partner
5 1 2

I would like to use shopify function cart transform api to limit the free gift quantity to always be 1, due to previously some people are able to modify the free gift quantity and get extra free gift. For now, we are using shopify script to do the same function, but since it is going to be deprecated, we try to revamp it to use shopify function.

 

However, in the cart transform api documentation, it seems the update operation does not support a quantity update. Please help to advise what I can do to achieve the same result using shopify function or else. Thanks!

Screenshot 2024-05-23 at 1.51.30 PM.png

Accepted Solution (1)

kylehkhk
Shopify Partner
5 1 2

This is an accepted solution.

A workaround is using right now:

 

Use checkout ui extension useApplyCartLinesChange hook to change the quantity of the line item 

 

Screenshot 2024-06-20 at 9.36.36 AM.png

View solution in original post

Reply 1 (1)

kylehkhk
Shopify Partner
5 1 2

This is an accepted solution.

A workaround is using right now:

 

Use checkout ui extension useApplyCartLinesChange hook to change the quantity of the line item 

 

Screenshot 2024-06-20 at 9.36.36 AM.png