- How Do I Enable the Custom JS Plugin?
- How Do I Add Custom JS for the Frontend of my WooCommerce Store?
- How Do I Add Custom JS for the Backend of my WooCommerce Store?
- When Might You Need adding Script to your WooCommerce Store?
How Do I Enable the Custom JS Plugin? #
- Download the Booster for WooCommerce Plugin on your Store.
- Enable and activate the plugin.
- Go to WooCommerce > Settings > Booster > EMAIL & MISC. > Custom JS.
- Select the Enable Module checkbox in the Custom JS Module Options section.
- Click on the Save Changes button.
You need to select the position for your custom JS snippet through the Code Position dropdown in the Options section. You can add it in the Header or the Footer of your website, as per the need of your WooCommerce Store.
How Do I Add Custom JS for the Frontend of my WooCommerce Store? #
There is no need to use <script></script> tag in this input. Just insert the pure JS code and click on the Save Changes button. The code should start working on the front end as you’re expecting.
alert (“A sale on Clothes is ON for Today ONLY. Go to Shop > Clothing to Avail Awesome Discounts.”);
Frontend Preview: A browser notification/alert through Custom JS
How Do I Add Custom JS for the Backend of my WooCommerce Store? #
If you want to add functionality through custom JS in your admin dashboard, you must use the Custom JS – Back end (Admin) input field, present in the Options section on the WooCommerce > Booster Settings > EMAIL & MISC. > Custom JS plugin settings page.
alert (“Welcome, Admin”);
Admin Preview: A browser notification/alert through Custom JS
When Might You Need adding Script to your WooCommerce Store? #
Enable Google Analytics for WooCommerce using Custom JS Plugin #
Insert JS Code for your Plugins or As per the Custom Needs in Header/Footer #
Just like Google Analytics solution, there are other tracking solutions or WordPress/WooCommerce plugins/solutions that might need the insertion of JS code in the site header or footer for working. Use the Custom JS code to get started with them smoothly.
Show Alert Message on a particular page #
Just as we did in the above examples, you can show alert messages to your customers. With the JS’s ability to detect WooCommerce pages through functions and its conditional logic, you can display different alert messages on different pages, as needed.
Show Reminders as Alert Messages to the Admin #
Similar to alert messages to your customers, you can add a reminder or instruction for the admin login too.