WooCommerce Booster Custom JS

WooCommerce Booster Custom JS

Separate custom JS for front and back end

Description

With WooCommerce Booster Custom JS module you can add custom JavaScript code to your site’s frontend and/or backend.

Options

WooCommerce Booster Custom JS - Admin Settings

Custom JS – Front end (Customers)
Frontend JavaScript code.

Default: None
Custom JS – Back end (Admin)
Backend JavaScript code.

Default: None

For example, if you want to modify “Billing & Shipping” text on checkout with JavaScript, you can set “Custom JS – Front end (Customers)” option to:

jQuery(document).ready(function() {    jQuery(".woocommerce-checkout div.woocommerce-billing-fields h3").text("Billing");});

Accessible through:

  • WooCommerce > Settings > Booster > Emails & Misc. > Custom JS

Tested on WooCommerce 4.0.0 and WordPress 5.3.2Plugin can be downloaded here. If there are any locked fields in the module, you will need to get Booster Plus to unlock them.

WooCommerce Booster Custom JSWooCommerce Booster Modules

#comment>

#comment>

#comment>#comment>#comment>

Leave a Reply Click here to cancel reply.

#comment>

Comments

2 Comments

  1. dcgraphics September 19, 2018 at 2:30 pm#comment>

    Hello, I tried to add this to the Custom JS and it does not work on the front end. The code does work in the Child/functions.php:
    add_filter( ‘woocommerce_states’, ‘custom_woocommerce_states’ );

    function custom_woocommerce_states( $states ) {
    $states[‘US’] = array(
    ‘AL’ => ‘Alabama’,
    ‘KY’ => ‘Kentucky’,
    ‘TN’ => ‘Tennessee’
    );

    return $states;
    }
    Is there specific JS for this section only as your documentation is very limited?

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

    • Booster Support Team September 20, 2018 at 9:37 pm#comment>

      Hi,

      It looks like code that you’ve posted is actually PHP and not JS. However I’ve just added new module to Booster. Please download the development version here – https://booster.io/dev/. You will need to uninstall the old plugin version first (don’t worry your saved settings won’t disappear). If you are a Booster Plus user – please let me know (on tom@booster.io) your order number, and I will send you the development version for Plus. Now there is new module in “WooCommerce > Settings > Booster > Emails & Misc. > Custom PHP” – your code should work there.

      Please let me know if there any issues and/or questions and if you like Booster, please leave us a rating

      Best regards,
      Tom

      #comment>#comment>Booster Support Team#comment>

    • #comment>

    #comment>

  2. #comment>

#comment>#comment>#comment>#comment>

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.

This site uses Akismet to reduce spam. Learn how your comment data is processed.