katelynnavli Posted February 18, 2021 Share Posted February 18, 2021 Site URL: https://shopavli.squarespace.com/speakers/d131 On the general browsing pages of our site's shop all $0 listings appear as 'contact for pricing', but when an variant is selected is changes to $0.00 on the product page. I currently have this in our footer code injection: <script> window.addEventListener('DOMContentLoaded', (event) => { var products = document.querySelectorAll('.product-price'), sf, len = products.length; for (sf=0; sf<len; sf++){ var price = products[sf].querySelector('.sqs-money-native'); if (price.textContent === '0.00') { price.parentNode.textContent = 'contact for pricing'; } } }); </script> Link to comment
tuanphan Posted February 19, 2021 Share Posted February 19, 2021 Hi, You want text "Contact for pricing" appear even click variant dropdown option? 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!) Link to comment
katelynnavli Posted February 19, 2021 Author Share Posted February 19, 2021 When no specific model is selected, the price is replace with the text "contact for pricing". When I select a model the price shows as normally and is not replace with text. I can't figure out how to make the price be replaced with text when a specific model has been selection. Attached images for context. Link to comment
tuanphan Posted February 28, 2021 Share Posted February 28, 2021 On 2/22/2021 at 10:23 PM, katelynnavli said: bump Hi. If you haven't solved this yet, follow this step Step 1. Add tag: contact-pricing for these products Step 2. Share link to a product where you need to place contact for pricing text, I will test some code 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!) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.