Create new product with woocommerce REST API with javascript (clientside)?

If you’re using SSL (HTTPS URL) you don’t need to use oauth1.0 with oauth signature and everything. All you need to do is pass in the consumer_key and consumer_secret in the url https://localhost/wpShop/wc-api/v2/products?consumer_key=ck_1111111111122123&consumer_secret=cs_232332322233232 That’s it! However, if your URL is NOT SSL, then you have to go to the trouble of creating an HMAC-SHA1 keys … Read more

How to change number field to text field using JS

The original code is using prevAll on the minus button, but the target input appears later in the DOM. PrevAll worked fine for the plus button though, since the targeted input comes before the plus button. The modified code below is tested and working: jQuery(document).ready(function ($) { // Containing selector var parentSelector = $(‘.quantity’); // … Read more

How do I call for two js files into a custom template?

In your theme’s functions.php: function my_theme_slug_enqueue_script(){ if(is_page_template(‘path/to/template/relative/to/theme/directory/root/template_file.php’)){ wp_enqueue_script( ‘some_unique_string_name’, ‘path/to/js/file/script.js’, array(), false, true ); } } add_action( ‘wp_enqueue_scripts’, ‘my_theme_slug_enqueue_script’ ); Change the values in my snippet to your requirements (and you need to call wp_enqueue_script() twice, once for each of your JS files). The third parameter allows you to tell WordPress what other scripts this … Read more