Kristy Posted April 1, 2020 Posted April 1, 2020 Site URL: https://www.ffp.com.au Hi I am wanting to hide the add to cart button for all products that have a $0 price. I have used javascript to change the price ($0) to display POA instead but I'm not sure what extra coding I need to add to hide the Add to Cart button on these items. The javascript I am using is - <script> /* Brine: Change 0.00 prices to POA */ window.Squarespace.onInitialize(Y, function(){ var products = document.querySelectorAll('.ProductItem, .ProductList-item'), i, len = products.length; for (i=0; i<len; i++) { var price = products.querySelector('.sqs-money-native'); if (price.textContent === '0.00') { price.parentNode.textContent = 'POA'; } } }); </script> Any help is much appreciated.
tuanphan Posted April 3, 2020 Posted April 3, 2020 If you can add tag to all 0$ products, eg tag: zero you can add this code to Home > Design > Custom CSS to hide add to cart .tag-zero .sqs-add-to-cart-button-wrapper { display: none !important; } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.