Support » Plugin: WooCommerce » Overriding woocommerce_add_to_cart_message filter?

  • Hi, I try to override woocommerce_add_to_cart_message filter that is inside woocommerce-functions.php.

    I add this in my functions.php

    add_filter( 'woocommerce_add_to_cart_message', 'woocommerce_add_to_cart_message_custom' );
    function woocommerce_add_to_cart_message_custom( $product_id ) {
    global $woocommerce;
    .....
    }

    but a connection was reset problem arises.

    What am I missing here?

    http://wordpress.org/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Maybe you can try this:

    add_filter( 'woocommerce_add_to_cart_message','custom_add_to_cart_message' );
    function custom_add_to_cart_message() {
      global $woocommerce;
      ....
      return $message;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Overriding woocommerce_add_to_cart_message filter?’ is closed to new replies.