Correction in Product Pricing Display

Topic summary

A user seeks help removing ‘Dhr.’ (likely ‘Dhs.’) from product pricing displays on their Shopify store. They’ve identified currency-related settings but need code-level assistance.

Store Details:

  • URL: careandcoofficial.com
  • Issue appears in product pricing format showing both ‘Dhs.’ and ‘AED’

Solution Attempts:

  • Another user provided JavaScript code to insert in theme.liquid before the </body> tag
  • Initial code snippet didn’t resolve the issue
  • A revised JavaScript solution was provided that:
    • Targets price elements with classes .price-item--regular and .price-item--sale
    • Uses regex to match and hide ‘Dhs.’ while preserving the numerical price and ‘AED’
    • Creates a hidden span element for the ‘Dhs.’ text

Status: The discussion remains open as the user hasn’t confirmed whether the second code solution successfully resolved the pricing display issue.

Summarized with AI on October 30. AI used: claude-sonnet-4-5-20250929.

Dear, Shopify support, partners, users, hope you are doing great!

I need assistance with making changes to my product pricing display on Shopify. Specifically, I want to remove ‘Dhr.’ from the pricing. Could you please guide me on how to do this?

And I found one option in currency related settings, here’s the image:

I appreciate your support and look forward to your response.

Best regards,

Abdullah

1 Like

what’s your store url ?

1 Like

The product page:

https://www.careandcoofficial.com/products/biometric-padock

The main URL:

https://www.careandcoofficial.com/

Go to your online store → edit code → theme.liquid file and before tag paste this code there


1 Like

I really appreciate your support but there’s nothing changed actually, so I’ll look forward to know further tweaks in code and solutions, thanks.

Regards,

Abdullah.

remove the old code and use this

document.addEventListener("DOMContentLoaded", function () {
    function addDhsSpan(priceElement) {
        if (priceElement) {
            let text = priceElement.textContent.trim();
            let match = text.match(/(Dhs\.)\s*(\d+[.,]?\d*\s*AED)/);
            
            if (match) {
                priceElement.textContent = match[2]; 
                
                const dhsSpan = document.createElement("span");
                dhsSpan.className = "dhs-span";
                dhsSpan.textContent = match[1]; // Store "Dhs."
                dhsSpan.style.display = "none";
                
                priceElement.prepend(dhsSpan); 
            }
        }
    }

    const regularPrices = document.querySelectorAll(".price-item--regular");
    const salePrices = document.querySelectorAll(".price-item--sale");

    regularPrices.forEach(addDhsSpan);
    salePrices.forEach(addDhsSpan);
});
1 Like