Jump to content

how to make a product's variant appear as contact for pricing?

Recommended Posts

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
  • Replies 4
  • Views 451
  • Created
  • Last Reply

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.

e926f30eccddd67813036ba4040b25e4.thumb.png.28e713d186fd91b01146cc93457eea27.pngae31c4d81f77d386c0ed6fe19f63c39e.thumb.png.ff69d23ef903cd09e9af6357440c0522.png

Link to comment
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.