Reformat Product Price

Look Demo

Simplify the format of any price. Example: transform “$8.00” into “$8”. This plugin uses code injection and works with the Brine template family.

How To Install

From your Squarespace account, go to Site Code Injection. Copy and paste the code below into the Footer Code Injection box.

<!-- Reformat Product Price (15,000.00 -> 1500) --> 
<!-- Author: Dmitry Kiselyov @_dmitrykiselyov --> 
<script src=""></script>
(function() {
  ready('.product-price:not(.product-price-clone)', reformatPrice);
  function reformatPrice(price) {
    var priceClone = price.cloneNode(true);
    price.parentNode.insertBefore(priceClone, price.nextElementSibling); = 'none';
    function reformat() {
      priceClone.innerHTML = price.innerHTML;
      var target = priceClone.children[0] || priceClone;
      target.textContent = target.textContent.replace(',', '').replace(/\.\d{2}/, '');
    function watch() {
      var observer = new MutationObserver(reformat);
      observer.observe(price, { childList: true });
<!-- end Reformat Product Price -->


You do not need to change any of the values or properties.


No notes.

CommerceMoov Labs