• Resolved perlfan

    (@perlfan)


    Hi there, I’m using product variations and attributes such as “Number of pages:”
    Then in the cart/checkout Woocommerce adds another colon, resulting in “Number of pages:: 2”, for example. So I need a way to tell Woocommerce to not add extra colons (I want to keep the colon in the attribute because it’s awkward without).

    Thanks for help. Frank

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • You’ll need make a child theme if you have not already done so.

    Then copy:
    wp-content/woocommerce/templates/cart/cart-item-data.php
    to
    wp-content/themes/(child-theme-slug-here)/woocommerce/cart/cart-item-data.php

    Finally, remove the colon from near the end of line 23 in the copy.

    If your theme has customised this template, it will be found at
    wp-content/themes/theme-name/woocommerce/cart/cart-item-data.php
    so use that as the original.

    I expect this to work on the cart and checkout pages.

    It’s going to apply to all attributes, whether they already have a colon or not.

    Thread Starter perlfan

    (@perlfan)

    Super! That works perfectly! Thanks for helping. Just in case, the file is in
    wp-content/plugins/woocommerce/templates/cart/

    I just followed the instructions for that one file, and apparently it’s sufficient that the change is also adopted in checkout.

    Thanks again, Frank

    That’s great! Glad to hear it worked for you!

    Thanks for sharing it with everybody. 🙂

    I’ll mark this thread as resolved now. If you have any further questions, I recommend creating a new one.

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘remove colon in variations attribute’ is closed to new replies.