3

I have several variable products on our https://alcocovers.com/shop/ The issue I am facing is: upon adding to the cart, Dumpster Tarps has item data listed on cart page, but product Lugger Cover doesn't. Here's a screenshot: enter image description here I thought there was some issue in the cart item data template I am using on the website, but I checked and nothing is broken (for reference here's the template code https://pastebin.com/fswKRZ8a). I disabled all custom templates and the results were the same. I also double checked that both products are setup in exactly the same way so I am at a loss what's the reason(s) behind this. Anyone who has an idea what would be causing this?

Update #1: A friend suggested maybe because Lugger Cover page has only one attribute that's why it doesn't list the item data on cart. But I created a test page and this page also doesn't have item data listed on the cart...

Update #2: I added a third attribute to the test page and now the item data shows up on the cart page. No clue why for products that have one/two attributes used on the product page, the item data doesn't show up on the cart. I rechecked the template files and there's no issue.

Danish Muneer
  • 518
  • 7
  • 19

1 Answers1

4

Try the following, that will display your product variations attributes as separated rows, below the cart item title:

add_filter( 'woocommerce_product_variation_title_include_attributes', '__return_false' );
add_filter( 'woocommerce_is_attribute_in_product_name', '__return_false' );

Code goes in function.php file of your active child theme (or active theme). I hope it will work.


Related:

LoicTheAztec
  • 184,753
  • 20
  • 224
  • 275
  • This actually worked exactly how I wanted because it didn't remove the attributes from the link in product name listed in the cart. – Danish Muneer Oct 01 '18 at 14:21