Feature #11187
Updated by Pavan Kumar Murala 6 days ago
Review the existing Category Page and Product Page variant creation and implementation before starting the cart integration. The objective is Backend Tasks Implement API support to implement add a complete end-to-end flow where a customer can select a specific product variant, add it variant to the cart, and ensure that cart. Store the selected variant details are maintained consistently throughout ID/details with the Cart, Checkout, cart item. Fetch and Order flow. The selected variant should also be linked to validate the correct product inventory, so that variant-specific price from the quantity of backend. Ensure the particular correct variant price is reduced after a successful order. Implementation Scope used for: 1. Review Existing Variant Implementation Cart item price Review the existing variant creation and configuration in the Category Page. Subtotal calculation Review the variant creation/edit functionality in the Product Page. Order calculation Understand the existing variant structure, attributes, pricing, SKU, stock, and quantity management. Checkout total Reuse the existing Validate variant implementation wherever possible instead of creating a separate structure. 2. Product Page → Add availability/stock before adding to Cart cart. Allow Prevent incorrect or manipulated variant prices from being submitted by the customer frontend. Update cart/order APIs to select a specific product variant. Display return the selected variant details and corresponding price. Add Ensure the selected variant and price are preserved when moving from cart to the cart. checkout. Store all required Frontend Tasks Implement variant information with selection on the cart item, including: product page. Product ID Variant ID Variant name/details Variant attributes/options SKU, if applicable Variant price Quantity Product information required for display 3. Cart Page Display the exact variant selected by the customer. variant's price dynamically. Display Add the corresponding variant-specific price. Maintain the selected variant when increasing/decreasing quantity. Ensure quantity updates are applied to the specific variant, not to the parent product. Prevent different variants of the same product from being incorrectly merged. Validate variant availability and stock while updating the cart. 4. Checkout Page Display: Carry the selected variant details from Cart → Checkout. Display the same: Product name Variant Selected variant Variant attributes Variant-specific price Price Quantity Total price Ensure checkout calculations use the actual backend correct variant price. Revalidate variant availability/stock before order placement. Prevent the frontend from modifying the variant price. 5. Order Placement Store the selected variant details in the order when the customer places the order. Ensure the order item maintains the relationship between: Parent Product Specific Variant Variant SKU Variant attributes Variant price Ordered quantity The order history/details page should display the exact variant purchased. 6. Variant Inventory / Quantity Reduction After a successful order, reduce the quantity from the specific selected variant. Do not reduce the quantity from other variants of the same product. Example: Product: T-Shirt Red / M → 10 available Red / L → 8 available Blue / M → 5 available If the customer orders Red / M – Qty 2, only Red / M inventory should be reduced: Red / M → 8 available Ensure stock is not reduced from displayed on the parent product or another variant. cart page. Handle insufficient stock and prevent orders when Pass the selected variant does not have enough quantity. Backend Requirements Update cart APIs information correctly to support variant-based cart items. Update the checkout APIs to return variant-specific information. page. Update order creation APIs to store variant information. Implement server-side price validation using the variant's current price. Implement variant-level stock validation. Implement variant-level inventory reduction after successful order placement. Ensure transactional/consistent inventory updates to avoid incorrect stock reduction in concurrent orders. Frontend Requirements Update product variant selection. Update Add to Cart functionality. Display variant-specific information on Cart. Display variant-specific information on Checkout. Display variant information in Order Details/Order History. Handle variant quantity updates and stock validation. Ensure the complete UI flow remains consistent. Acceptance Criteria Existing Category Page and Product Page correct variant implementation is reviewed and understood. Customer can select a specific variant and add it to cart. Correct variant details are stored with the cart item. Correct variant price is displayed throughout on the flow. checkout page. Different variants of the same product Ensure checkout totals are handled independently. Cart → Checkout maintains calculated using the same selected variant information. Order stores the exact variant purchased. Order details display the correct variant. Only the purchased variant's quantity is reduced after successful order placement. Variant stock cannot become negative. Backend validates price, variant availability, and stock. The complete flow works successfully: Category → Product → Select Variant → Add to Cart → Cart → Checkout → Place Order → Order Details → Variant Stock Reduction price.