• Resolved Ashish Jangra

    (@ashishjangra-1)


    Hello Folks,

    WooCommerce JS triggers removed_from_cart and update_checkout are not working on cart page.

    $( 'body' ).on( 'removed_from_cart', function( e, fragments, cart_hash, button ) {
       console.log('Removed from cart');
     });
    
     $( 'body' ).on( 'update_checkout', function(  ) {
       console.log('Update Cart');
     });

    Thanks in advance!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Paulo P – a11n

    (@paulostp)

    Hello,

    Thanks for reaching out!

    Could you please share additional details on what you’re trying to accomplish?

    Thread Starter Ashish Jangra

    (@ashishjangra-1)

    Hey Paulo,

    Thanks for you reply.

    Here is what i am trying to accomplish

    We would like to track all the customer behavior for a marketing automation tool.

    So whenever any user add or remove any product to/from their cart, We want to track the whole data.

    $( 'body' ).on( 'removed_from_cart', function( e, fragments, cart_hash, button ) {
        datatrack.track('Removed From Cart ', {
          'Product ID':458,
          'Product Name': 'Test Product',
          'Product Category': 'test-cat',
          'Product Categroy ID': 2,
          'price': 200,
          'discount price': 180,
        });
      });

    So this removed_from_cart JS triggers works well with minicart, however it is not working on cart page.

    Hope you are clear!!

    Thanks

    Hi @ashishjangra-1

    Thanks for clarifying the goal.

    removed_from_cart JS triggers works well with minicart, however it is not working on cart page

    As this is a development oriented topic, I’m going to leave it open for a bit to see if anyone is able to chime in to help you out here.

    I can recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    This specific forum is more focused on the default WooCommerce core features.

    Lastly, for direct assistance with code customizations, we recommend consulting with the WooCommerce Customizations Partners. https://woocommerce.com/customizations/

    Seems we’ve not had additional inputs on this thread. Thus, we encourage you to make use of the above resources.

    I’ll go ahead and mark the thread as resolved but please feel free to create a new thread if you have further questions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘removed_from_cart and update_checkout is not working on cart page’ is closed to new replies.