Updating product properties before adding to cart - shopify theme app extension
Solution:
What's the best way to store this information? Using product.options doesn't seem ideal, since each product can only have 3 options. So it seems like the options are either product metafield or as a tag?
Product options are not supposed to store such pieces of information. Options are options and any app (most likely) shouldn't touch it. It could mess up many parts of the theme and disallow merchants to add more options to the product.
Line item properties aren't used for that purpose either. Usually, they are helpful for storing data that needs to be used in integrations/promotions.
Your best choice is meta fields. You should also look into Checkout UI Extensions API (https://shopify.dev/api/checkout-extensions/checkout/extension-points/api#appmetafieldentrytarget) which in case of publishing app will be welcome from Shopify's perspective
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.