window.processing = true;

Shop

window.sortBy = "best-selling"; window.productCardList = [{"id":9479706149145,"title":"Fresh Glass No1","handle":"fresh-glass-no1","description":"\u003ch4\u003eFresh Beer Glass No1 - Limited Drop\u003c\/h4\u003e\n\u003c!----\u003e","published_at":"2024-05-30T04:21:54-04:00","created_at":"2024-05-29T10:31:01-04:00","vendor":"Pinter","type":"Merchandise","tags":["MERCHANDISE","SHOPALLCOLLECTION"],"price":1500,"price_min":1500,"price_max":1500,"available":false,"price_varies":false,"compare_at_price":null,"compare_at_price_min":0,"compare_at_price_max":0,"compare_at_price_varies":false,"variants":[{"id":48985750896921,"title":"One-off","option1":"One-off","option2":null,"option3":null,"sku":"GLASS1","requires_shipping":true,"taxable":true,"featured_image":null,"available":false,"name":"Fresh Glass No1 - One-off","public_title":"One-off","options":["One-off"],"price":1500,"weight":454,"compare_at_price":null,"inventory_management":"shopify","barcode":"","requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/pinter.com\/cdn\/shop\/files\/Banner__BeerGlassBack.png?v=1717057233","\/\/pinter.com\/cdn\/shop\/files\/Banner__BeerGlassFront.png?v=1717057233"],"featured_image":"\/\/pinter.com\/cdn\/shop\/files\/Banner__BeerGlassBack.png?v=1717057233","options":["Title"],"media":[{"alt":null,"id":38323077480729,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1800,"width":1800,"src":"\/\/pinter.com\/cdn\/shop\/files\/Banner__BeerGlassBack.png?v=1717057233"},"aspect_ratio":1.0,"height":1800,"media_type":"image","src":"\/\/pinter.com\/cdn\/shop\/files\/Banner__BeerGlassBack.png?v=1717057233","width":1800},{"alt":null,"id":38323077447961,"position":2,"preview_image":{"aspect_ratio":1.0,"height":1800,"width":1800,"src":"\/\/pinter.com\/cdn\/shop\/files\/Banner__BeerGlassFront.png?v=1717057233"},"aspect_ratio":1.0,"height":1800,"media_type":"image","src":"\/\/pinter.com\/cdn\/shop\/files\/Banner__BeerGlassFront.png?v=1717057233","width":1800}],"requires_selling_plan":false,"selling_plan_groups":[],"content":"\u003ch4\u003eFresh Beer Glass No1 - Limited Drop\u003c\/h4\u003e\n\u003c!----\u003e"}]; 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; } })); }