Today, I have completed working on cart functionality of
Functionality
Users adds a product to cart by choosing a SKU (Dropdown widget) from "Product Detailed Page" Display cart as soon as product is added to the cart The list view of cart contain - Product Image, Name, SKU selected, Value and
Count Controller - If user wish to increase or decrease the Qty
List of SKUs under that Product - If user wish to change the SKU in the cart itself
Total value of Cart
Taxes and
PAY NOW button
Here is how I did it:
Step - 1
Collections: Products ProductSKU (Sub-Collection under Products) Cart - Add reference of Product & ProductSKU
Step - 2 Create a Data Type - ProductSKU Add Field - productSKU by selecting Doc Reference to ProductSKU collection
Step - 3 Create a component for Count Controller and add following parameters: 1. Qty - Type - Integer 2. CartRef - Type - Doc Reference (Cart) 3. ProductSKU - Data (ProductSKU)
Step - 4 Create a component for Cart and add a list view Add required details like Product Image, Price etc., Add Count Controller Component
Step - 5 Pass dynamic values to the Count Controller component from the Cart where you have added the Count Controller Component in previous step
Once you do these steps, you will be able to access the ProductSKU fields through JSON while adding action when Count Controller value changes. Below is the screenshot from my app for your reference.