Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- //This function will put the current inventory count in an element with an ID of "foxyshop_inventory_count" - you have to create the element
- //Put this snippet in your single product template
- function foxyshop_after_variation_modifiers(new_code, new_codeadd, new_price, new_price_original, new_ikey, current_product_id) {
- if (typeof arr_foxyshop_inventory == "undefined") arr_foxyshop_inventory = [];
- inventory_match_count = -1;
- if (new_code != "" && typeof arr_foxyshop_inventory[current_product_id] != 'undefined') {
- for (i=0; i<arr_foxyshop_inventory[current_product_id].length; i++) {
- if (arr_foxyshop_inventory[current_product_id][i][0] == inventory_code) inventory_match_count = i;
- }
- }
- if (inventory_match_count >= 0) {
- newcount = parseInt(arr_foxyshop_inventory[current_product_id][inventory_match_count][1]);
- jQuery("#foxyshop_inventory_count").html(newcount);
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement