cocart-headless / cocart-get-cart-enhanced

This free add-on enhances the cart response by returning additional data for both the cart and the items added to it.
https://wordpress.org/plugins/cocart-get-cart-enhanced/
GNU General Public License v3.0
5 stars 1 forks source link

Return attributes for other products if not a variation #42

Closed jimishsoni1990 closed 1 year ago

jimishsoni1990 commented 2 years ago

On the cart page, right now for the simple product we do not have the attribute values (We use attributes to provide additional product details like color, material, is dry-clean only etc stuff). For example, a simple t-shirt with gray color. on cart we would like to show the attribute values like "Color: Gray". We get the similar data for variable products in meta array, but if we can have the data for simple products also that would be great.

So this :

"meta": {
         "product_type": "simple",
         "sku": "woo-cap",
         "dimensions": {
           "length": "",
           "width": "",
           "height": "",
           "unit": "cm"
         },
         "weight": 0,
         "variation": [],
         "virtual": false,
         "downloadable": false
       },

becomes this:

"meta": {
         "product_type": "simple",
         "sku": "woo-cap",
         "dimensions": {
             "length": "",
             "width": "",
             "height": "",
             "unit": "cm"
         },
         "weight": 0,
         "variation": {
              "color" : "gray",
              "material" : "cotton",
         },
         "virtual": false,
         "downloadable": false
       },

I hope i explained it properly.

seb86 commented 1 year ago

Thank you for your feedback and sorry for the late response. This will be available once CoCart v4 is released later this year.