On some themes, the add to cart button may show as sold out when the product is in stock.
Themes with this issue:
- Debutify
You can add code to the theme.liquid file after our app’s two lines of code to have the add to cart button show correctly.
<script>
/* Fix add to cart text */
function bcpoChange(v) {
setTimeout(function () {
if (v.inventory_quantity > 0) {
bcpo.addToCart.html('Add to Cart').attr('disabled', false);
} else {
bcpo.addToCart.html('Sold out').attr('disabled', 'disabled');
}
}, 0);
}
</script>
You can also translate the ‘Add to Cart’ and ‘Sold out’ text in the code above if your website is in a different language