window.processing = true;

Shop

Not sure where to start? Help me buy

window.sortBy = "manual";
window.processing = false;
window.productCardList = [{"id":6810341048395,"title":"Active Pour Tap - Pure Finish","handle":"active-pour-tap-silver","description":"","published_at":"2023-01-17T12:11:55+00:00","created_at":"2023-01-16T18:14:02+00:00","vendor":"Pinter","type":"Tap","tags":["APTAP","CARTADDON","GIFTINGOVER","PINTER3","REPLACEMENT","SHOPALLCOLLECTION"],"price":2999,"price_min":2999,"price_max":2999,"available":true,"price_varies":false,"compare_at_price":null,"compare_at_price_min":0,"compare_at_price_max":0,"compare_at_price_varies":false,"variants":[{"id":39966932238411,"title":"One-off","option1":"One-off","option2":null,"option3":null,"sku":"APTAP1S","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Active Pour Tap - Pure Finish - One-off","public_title":"One-off","options":["One-off"],"price":2999,"weight":1000,"compare_at_price":null,"inventory_management":"shopify","barcode":"5060904692539","requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/pinter.co.uk\/cdn\/shop\/products\/ActivePourTapcopy2.jpg?v=1678450373"],"featured_image":"\/\/pinter.co.uk\/cdn\/shop\/products\/ActivePourTapcopy2.jpg?v=1678450373","options":["Title"],"media":[{"alt":null,"id":21954627567691,"position":1,"preview_image":{"aspect_ratio":1.0,"height":800,"width":800,"src":"\/\/pinter.co.uk\/cdn\/shop\/products\/ActivePourTapcopy2.jpg?v=1678450373"},"aspect_ratio":1.0,"height":800,"media_type":"image","src":"\/\/pinter.co.uk\/cdn\/shop\/products\/ActivePourTapcopy2.jpg?v=1678450373","width":800}],"requires_selling_plan":false,"selling_plan_groups":[],"content":""}]; callSortingFunction(); function callSortingFunction() { if(window.processing) { setTimeout(function() { callSortingFunction(); },1000); } var sorted_items = getSorted('.card-product', 'data-sort', window.sortBy); $('.listing-shop__inner').html(sorted_items); } function getSorted(selector, attrName, ascordesc) { return $($(selector).toArray().sort(function(a, b){ var aType = a.getAttribute('data-type'); var bType = b.getAttribute('data-type'); var aAvailable = a.getAttribute('data-available'); var bAvailable = b.getAttribute('data-available'); if ((aType === "Pinter" && aAvailable) && (bType === "Tap" || bType === "Co-Pinter")) return -1; else if (aType === "Tap" && aAvailable && bType === "Co-Pinter") return -1; else if (bType === "Pinter" && bAvailable && (aType === "Tap" || aType === "Co-Pinter")) return 1; else if (bType === "Tap" && bAvailable && aType === "Co-Pinter") return 1; else if ((aType === "Tap" || aType === "Pinter" || aType === "Co-Pinter") && aAvailable && (bType !== "Tap" && bType !== "Pinter" && bType !== "Co-Pinter")) return -1; else if ((aType !== "Tap" && aType !== "Pinter" && aType !== "Co-Pinter") && bAvailable && (bType === "Tap" || bType === "Pinter" || bType === "Co-Pinter")) return 1; else if (aAvailable === "false" && bAvailable === "true") return 1; else if (aAvailable === "true" && bAvailable === "false") return -1; var aVal = parseInt(a.getAttribute(attrName)), bVal = parseInt(b.getAttribute(attrName)); if(ascordesc == 'price-ascending'){ return aVal - bVal; } if(ascordesc == 'price-dec'){ return bVal - aVal; } })); }