WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Overriding woocommerce_add_to_cart_message filter? (2 posts)

  1. fakeartist
    Member
    Posted 8 months ago #

    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/

  2. terrytsang
    Member
    Posted 8 months ago #

    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;
    }

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.