WordPress.org

Forums

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

  1. fakeartist
    Member
    Posted 1 year 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 1 year 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;
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.