Jump to content

toddjames

Member
  • Posts

    2
  • Joined

  • Last visited

Everything posted by toddjames

  1. Hi, I've spent ages figuring this out for my site. So thought that you'd like the code too. 1. To remove the decimals from pricing in 7.1. e.g. so that £100.00 becomes £100 add the below script to your footer using code injection: <script> document.addEventListener("DOMContentLoaded", function() { // Selecting the price elements var priceAmounts = document.querySelectorAll('.pricing-plan-price-amount'); priceAmounts.forEach(function(price) { var text = price.textContent; var updatedText = text.split('.')[0]; // This removes the decimal part price.textContent = updatedText; }); // Keeping the billing period text intact var billingPeriods = document.querySelectorAll('.pricing-plan-price-billing-period'); billingPeriods.forEach(function(period) { // We don't need to change this, but we include it to avoid accidentally altering it var text = period.textContent; period.textContent = text; }); }); </script> 2. To remove the comma from pricing. E.g. so that £1,000 becomes £1000 add the below script to your footer using code injection: <script> document.addEventListener("DOMContentLoaded", function() { // Selecting the price elements var priceAmounts = document.querySelectorAll('.pricing-plan-price-amount'); priceAmounts.forEach(function(price) { var text = price.textContent; var updatedText = text.split('.')[0]; // Removes the decimal part updatedText = updatedText.replace(/,/g, ''); // Removes commas price.textContent = updatedText; }); // Keeping the billing period text intact var billingPeriods = document.querySelectorAll('.pricing-plan-price-billing-period'); billingPeriods.forEach(function(period) { // No change needed here var text = period.textContent; period.textContent = text; }); }); </script>
  2. Hi, I've spent ages figuring this out for my site. So thought that you'd like the code too. 1. To remove the decimals from pricing in 7.1. e.g. so that £100.00 becomes £100 add the below script to your footer using code injection: <script> document.addEventListener("DOMContentLoaded", function() { // Selecting the price elements var priceAmounts = document.querySelectorAll('.pricing-plan-price-amount'); priceAmounts.forEach(function(price) { var text = price.textContent; var updatedText = text.split('.')[0]; // This removes the decimal part price.textContent = updatedText; }); // Keeping the billing period text intact var billingPeriods = document.querySelectorAll('.pricing-plan-price-billing-period'); billingPeriods.forEach(function(period) { // We don't need to change this, but we include it to avoid accidentally altering it var text = period.textContent; period.textContent = text; }); }); </script> 2. To remove the comma from pricing. E.g. so that £1,000 becomes £1000 add the below script to your footer using code injection: <script> document.addEventListener("DOMContentLoaded", function() { // Selecting the price elements var priceAmounts = document.querySelectorAll('.pricing-plan-price-amount'); priceAmounts.forEach(function(price) { var text = price.textContent; var updatedText = text.split('.')[0]; // Removes the decimal part updatedText = updatedText.replace(/,/g, ''); // Removes commas price.textContent = updatedText; }); // Keeping the billing period text intact var billingPeriods = document.querySelectorAll('.pricing-plan-price-billing-period'); billingPeriods.forEach(function(period) { // No change needed here var text = period.textContent; period.textContent = text; }); }); </script>
×
×
  • 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.