bigcommerce / storefront-data-hooks

Hooks for React Storefront UI Components
MIT License
166 stars 36 forks source link

add 'include=line_items.physical_items.options' to add/update/get-cart requests #53

Closed magicspon closed 3 years ago

jorgemasta commented 3 years ago

Hi @magicspon ,

Can you describe a bit why do we want this?

BigCommerce documentation:

line_items.physical_items.options: The Cart returns an abbreviated result. Use this to return physical items product options. Can also be used in a /POST to have the extended Cart object return.

Should we update the Cart type if we add that new param? https://github.com/bigcommerce/storefront-data-hooks/blob/1245028d416b7998e253920130a9ad0adfc7d4b0/src/api/cart/index.ts#L110-L131

magicspon commented 3 years ago

hi @jorgemasta

Without including this query, the product options aren't included. I would have thought most people would want to be able to show the product options on the cart page.

And, yup, we should probably update the Cart type

jorgemasta commented 3 years ago

Hey @magicspon, we need to think in a more general solution. Something like allowing product options to be passed from the hook. But it is certainly something interesting and we will work on it.

magicspon commented 3 years ago

@jorgemasta agreed.

jorgemasta commented 3 years ago

I have created a new PR to solve this from a different angle #68