Liquid, JavaScript, themes, sales channels
Hi ,
Somebody tried to add code to update cart button based on variant inventory, but it was not done fully. Here is the code -- it fails because inv_qty array is not defined.
var bcd1=inv_qty[ variant.id ];
if(bcd1<1){
var html23='<span id="AddToCartText-product-template-pre">Pre order</span>';
cache.$addToCartText.html(html23);
}
else{
cache.$addToCartText.html(theme.strings.addToCart);
}
I'd try to either comment this part of code by wrapping it with /* ... */, or add the code I "invented" in this forum post: https://community.shopify.com/c/Shopify-Design/Display-variant-inventory-quantity-on-product-page-Bo...
My code must be added somewhere in product template.
User | RANK |
---|---|
25 | |
24 | |
12 | |
10 | |
9 |
Thanks to all who participated in our AMA with 2H Media on planning your 2023 marketing bu...
By Jacqui Mar 30, 2023Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023