Support » Plugin: WooCommerce » Variation Names in “Added to Cart” message

  • Resolved brittanyc

    (@brittanyc)


    I’m in the process of testing updates to an old version of WooCommerce (3.1.2), and I noticed the “Added to Cart” message no longer includes the variation name.

    For example, before I made this update, the message would say “‘[Product Name]-[Variation Name]’ has been added to your cart.”

    Now, it says “‘[Product Name]’ has been added to your cart.”

    After testing on the Twenty Seventeen theme and seeing the same message, I’ve ruled out a theme conflict.

    These are my WooCommerce overrides:
    shopMFA/woocommerce/checkout/review-order.php,
    shopMFA/woocommerce/content-product.php,
    shopMFA/woocommerce/emails/customer-completed-order.php,
    shopMFA/woocommerce/emails/customer-processing-order.php,
    shopMFA/woocommerce/emails/customer-refunded-order.php,
    shopMFA/woocommerce/emails/email-footer.php,
    shopMFA/woocommerce/emails/email-header.php,
    shopMFA/woocommerce/emails/email-styles.php,
    shopMFA/woocommerce/loop/loop-end.php,
    shopMFA/woocommerce/loop/loop-start.php,
    shopMFA/woocommerce/loop/price.php,
    shopMFA/woocommerce/loop/sale-flash.php,
    shopMFA/woocommerce/notices/error.php,
    shopMFA/woocommerce/notices/success.php

    I can get the variation name in the ‘added to cart’ message if I change class-wc-form-handler.php line 917 to:

    wc_add_to_cart_message( array( $variation_id => $quantity ), true );

    Is there a better way to make this change via a filter?

  • You must be logged in to reply to this topic.