Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter stefan0s

    (@stefan0s)

    Thank you. It works fine!

    • This reply was modified 3 years, 1 month ago by stefan0s.
    • This reply was modified 3 years, 1 month ago by stefan0s.
    Thread Starter stefan0s

    (@stefan0s)

    Thank you nmerii for your response. The event is triggering and works good!

    One last querstion. During “Add to cart” i am using “woocommerce_add_to_cart_validation” filter and on my case i don’t allow wishlist item to be added to cart, so i return wc_add_notice(‘Custom Error.’).

    add_filter( ‘woocommerce_add_to_cart_validation’, function($passed, $product_id, $quantity){
    $custom_logic = true;
    if($custom_logic) {
    wc_add_notice( __(‘Custom Error.’, ‘woo’ ), ‘error’ );
    return false;
    }
    return $passed;
    }, 10, 3 );

    On “nmgr_add_to_cart_response” response object, i don’t see that error message to display it on my custom header info. The response.fragments.notice is undefined.

Viewing 2 replies - 1 through 2 (of 2 total)