I want to split cart data based on product dropdown attributes.
I want to show multiple cart data data on cart page.
If anyone knows so please help me.
To split cart data based on product dropdown attributes in Magento 2, you will need to create a custom module with a plugin for the cart block class. Here are the steps you can follow:
Step 1: Create a custom module Create a custom module in your Magento 2 instance by following these steps:
Step 2: Create a plugin for the cart block class In your custom module, create a plugin for the Magento\Checkout\Block\Cart class that will modify the cart items collection based on the selected product attribute. Here are the steps:
Step 3: Modify the cart template to show multiple cart data In your custom module, modify the cart template to show multiple cart data sections based on the selected product attribute. Here are the steps:
That's it! After you have completed these steps, you should be able to split cart data based on product dropdown attributes and show multiple cart data sections on the cart page.