To briefly describe the type of products being sold by the store, they will be custom user generated imagery. Stickers, posters, etc.
My question is regarding how to model the data that makes the most sense. Perhaps I am thinking about it wrong or there is a more standard way to approach the issue. I have tried the following two schemes which are each having issues:
First Scheme with Parent Product:
- Setup one parent SKU for a product – let’s say stickers.
- A user designs a sticker and adds the product to the cart. This adds one quantity of the parent SKU to the cart.
- I populate custom fields on the specific cart_item with a flow and PUT call that contain the href links for the user create image on S3.
This is fine for a single sticker in the cart, but suppose a user creates a second sticker and adds it to the cart. The new sticker would increase the quantity of the SKU and modifying the custom fields will overwrite the values I already have.
Second Scheme Custom Cart Items
- For each sticker added to the cart there is no associated product. Each cart item has a unique SKU
- For each custom item added there are custom url fields for S3 links.
Again for one item this works okay and seems like a solid solution with the unique SKUs to keep track of things. However modifying the cart at all creates issues. If I update the quantity of the cart item the response which includes cart items omits my custom fields.
Additionally if I add a new sticker to the cart it overwrites the entries for the custom fields on the first custom item in the cart and sets the custom fields to null for the new items. I have confirmed in the dashboard entries for my flow it is simply updating the first item in the cart. The following images show the call being made as well as the custom item being added to the cart for reference:
If there is any guidance on the ‘right’ or ‘standard’ way to approach how to manage unique custom products / cart items it would be much appreciated!