Support » Plugin: WooCommerce » Removing attributes in product title

  • Resolved danina84

    (@danina84)


    Hi,
    I would like to remove the attributes from the product title(on all pages like cart, checkout, emails etc). I found this

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

    but this adds the attributes underneath the product, and I don’t want to show the attribute at all in the title or underneath. Is this possible? Thanks!

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

    (@lorro)

    I would use the code to remove the attributes from product titles, and then use some custom css to hide them on cart and checkout. This works for me:

    .cart .variation,
    .woocommerce-checkout-review-order-table .variation {
      display:none;
    }

    If it doesn’t work for your theme, please post the url for your site.

    The attributes would still be visible in the html markup if the user chooses to look and can follow markup.

    To hide them in emails, you’ll need to make a custom copy of email-order-items.php and put it at:
    wp-content/your-child-theme-name/woocommerce/emails/email-order-items.php
    and in the copy, comment out the line: wc_display_item_meta( $item );

    Ultimately some php skills or a developer may be needed to get this to work.

    danina84

    (@danina84)

    Thanks! I guess there is no other way to do it…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Removing attributes in product title’ is closed to new replies.