Skip to the content.

WooCommerce jQuery Events

WooCommerce provides a variety of useful jQuery events that allow you to trigger custom actions on your store. By leveraging these events, you can easily customize your store’s behavior and enhance the shopping experience.

Table of Contents

Basic Usage

To use these events, you can listen for them using the following structure:

$(document.body).on('woocommerce_event', function() {
    // Your custom function
});

Simply replace 'woocommerce_event' with the desired event from the list below.

WooCommerce jQuery Events

Cart and Checkout Events

Order Meta Box Events

Product Variation Meta Box Events

Product Meta Box Events

Settings Events

Sample Usage

Here’s a basic example of how to use WooCommerce jQuery events in your store:

$(document.body).on('added_to_cart', function() {
    console.log('Product has been added to the cart!');
});

This code logs a message to the console when a product is added to the cart.

Disclaimer

[!IMPORTANT] Please note that not all of these events have been fully tested, and some may not work as expected. If you encounter any issues or have suggestions for improvements, feel free to contribute.