| @@ -1,5 +1,10 @@ | ||
| 1 | -(function ($) { | |
| 1 | +(function (factory) { | |
| 2 | + if (typeof window.jQuery === 'undefined') { | |
| 3 | + return; | |
| 4 | + } | |
| 5 | + factory(window.jQuery); | |
| 6 | +})(function ($) { | |
| 2 | 7 | 'use strict'; |
| 3 | 8 | |
| 4 | 9 | const $rulesContainer = $('#ka-woo-rules'); |
| 5 | 10 | if (!$rulesContainer.length || typeof $.fn.select2 === 'undefined') { |
| @@ -20,8 +25,9 @@ | ||
| 20 | 25 | const endpoints = { |
| 21 | 26 | product_in: {url: restRoot + 'kingaddons/v1/ajaxselect2/getPostsByPostType/', params: {query_slug: 'product'}}, |
| 22 | 27 | product_cat_in: {url: restRoot + 'kingaddons/v1/ajaxselect2/getTaxonomies/', params: {query_slug: 'product_cat'}}, |
| 23 | 28 | product_cat_archive_in: {url: restRoot + 'kingaddons/v1/ajaxselect2/getTaxonomies/', params: {query_slug: 'product_cat'}}, |
| 29 | + product_tag_archive_in: {url: restRoot + 'kingaddons/v1/ajaxselect2/getTaxonomies/', params: {query_slug: 'product_tag'}}, | |
| 24 | 30 | product_tag_in: {url: restRoot + 'kingaddons/v1/ajaxselect2/getTaxonomies/', params: {query_slug: 'product_tag'}}, |
| 25 | 31 | products: {url: restRoot + 'kingaddons/v1/ajaxselect2/getPostsByPostType/', params: {query_slug: 'product'}}, |
| 26 | 32 | product_categories: {url: restRoot + 'kingaddons/v1/ajaxselect2/getTaxonomies/', params: {query_slug: 'product_cat'}}, |
| 27 | 33 | product_cat_archives: {url: restRoot + 'kingaddons/v1/ajaxselect2/getTaxonomies/', params: {query_slug: 'product_cat'}}, |
| @@ -131,9 +137,9 @@ | ||
| 131 | 137 | } |
| 132 | 138 | }); |
| 133 | 139 | |
| 134 | 140 | rebuildIndexes(); |
| 135 | -})(jQuery); | |
| 141 | +}); | |
| 136 | 142 | |
| 137 | 143 | (function () { |
| 138 | 144 | 'use strict'; |
| 139 | 145 | |
| @@ -400,9 +406,8 @@ | ||
| 400 | 406 | initSticky(); |
| 401 | 407 | initPayments(); |
| 402 | 408 | }); |
| 403 | 409 | })(); |
| 404 | - | |
| 405 | 410 | |
| 406 | 411 | |
| 407 | 412 | |
| 408 | 413 | |