How to remove "DKK" in cart?

Solved

How to remove "DKK" in cart?

stinem123
Trailblazer
157 0 27

Hi, can someone help me remove the "DKK" from the cart page page (both from cart items and cart total) 

The Danish currency is already shown in "kr" so I don't need to have it also shown in "DKK" afterwards.

 

Link for my website.: https://www.melchiorjewelry.com/cart

Thank you so much, hope someone can help me out here!

 

Skærmbillede 2024-09-18 kl. 18.09.00.png

 

 

 

 

.

.

.

.

.

.

.

.

Accepted Solutions (3)

BSSCommerce-B2B
Shopify Partner
1697 508 569

This is an accepted solution.

@stinem123,

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file

3. Paste the below code before </body> on theme.liquid

<script>
if (window.location.pathname === "/cart") {
  document.addEventListener("DOMContentLoaded", (event) => {
  document.querySelectorAll('.cart__form-item-price, .cart__footer-subtotal span').forEach(function(item) {
    item.textContent = item.textContent.replace('DKK', '').trim();
  });
});
}
</script>

Result:

BSSCommerceB2B_0-1726676249392.png

 

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

View solution in original post

BSS-TekLabs
Shopify Partner
2322 688 809

This is an accepted solution.

- Here is the solution for you @stinem123 
- Please follow these steps:
1. Go to Online Store --> Theme --> Edit code.
2. Open your theme.liquid file
3. In theme.liquid, paste the below code before </head> and press 'Save' to save it

<script>
document.addEventListener("DOMContentLoaded", function() {
    // Check if the current page is the cart page
    if (window.location.pathname === "/cart") {
        // Select all price elements (adjust the selector based on your theme)
            let priceElements = document.querySelectorAll("span.cart__form-item-price, span.ff-body.fs-body-200"); 

        // Loop through each price element and remove "DKK"
        priceElements.forEach(function(priceElement) {
            // Replace "DKK" with an empty string and trim extra spaces
            let updatedPrice = priceElement.textContent.replace("DKK", "").trim();
            // Update the price on the page
            priceElement.textContent = updatedPrice;
        });
    }
});
</script>

- Here is the result you will achieve:

BSSTekLabs_0-1726676477288.png

 

- Please press 'Like' and mark it as 'Solution' if you find it helpful. Thank you.

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

View solution in original post

pawankumar
Shopify Partner
618 91 111

This is an accepted solution.

Hi @stinem123 

<script>
if (window.location.pathname === "/cart") {
  document.addEventListener("DOMContentLoaded", (event) => {
  document.querySelectorAll('.cart__form-item-price, .cart__footer-subtotal span').forEach(function(item) {
    item.textContent = item.textContent.replace('DKK', '').trim();
  });
});
}
</script

You can put this code in theme.liquid before body closing tag
it can work
OR
in your cart.liquid or cart_body.liquid or cart-items.liquid or similar file
You will find | money filter, you can replace that with money_without_currency
Both methods work
Just check best suits you

Please don't forget to Like and Mark Solution to the post that helped you.

Thanks!

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan

View solution in original post

Replies 6 (6)

BSSCommerce-B2B
Shopify Partner
1697 508 569

This is an accepted solution.

@stinem123,

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file

3. Paste the below code before </body> on theme.liquid

<script>
if (window.location.pathname === "/cart") {
  document.addEventListener("DOMContentLoaded", (event) => {
  document.querySelectorAll('.cart__form-item-price, .cart__footer-subtotal span').forEach(function(item) {
    item.textContent = item.textContent.replace('DKK', '').trim();
  });
});
}
</script>

Result:

BSSCommerceB2B_0-1726676249392.png

 

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

stinem123
Trailblazer
157 0 27

Thank you so much both of you @BSS-TekLabs @BSSCommerce-B2B 

Worked so well! Thanks!

BSSCommerce-B2B
Shopify Partner
1697 508 569

@stinem123, Glad to help you 😊

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

BSS-TekLabs
Shopify Partner
2322 688 809

This is an accepted solution.

- Here is the solution for you @stinem123 
- Please follow these steps:
1. Go to Online Store --> Theme --> Edit code.
2. Open your theme.liquid file
3. In theme.liquid, paste the below code before </head> and press 'Save' to save it

<script>
document.addEventListener("DOMContentLoaded", function() {
    // Check if the current page is the cart page
    if (window.location.pathname === "/cart") {
        // Select all price elements (adjust the selector based on your theme)
            let priceElements = document.querySelectorAll("span.cart__form-item-price, span.ff-body.fs-body-200"); 

        // Loop through each price element and remove "DKK"
        priceElements.forEach(function(priceElement) {
            // Replace "DKK" with an empty string and trim extra spaces
            let updatedPrice = priceElement.textContent.replace("DKK", "").trim();
            // Update the price on the page
            priceElement.textContent = updatedPrice;
        });
    }
});
</script>

- Here is the result you will achieve:

BSSTekLabs_0-1726676477288.png

 

- Please press 'Like' and mark it as 'Solution' if you find it helpful. Thank you.

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

pawankumar
Shopify Partner
618 91 111

This is an accepted solution.

Hi @stinem123 

<script>
if (window.location.pathname === "/cart") {
  document.addEventListener("DOMContentLoaded", (event) => {
  document.querySelectorAll('.cart__form-item-price, .cart__footer-subtotal span').forEach(function(item) {
    item.textContent = item.textContent.replace('DKK', '').trim();
  });
});
}
</script

You can put this code in theme.liquid before body closing tag
it can work
OR
in your cart.liquid or cart_body.liquid or cart-items.liquid or similar file
You will find | money filter, you can replace that with money_without_currency
Both methods work
Just check best suits you

Please don't forget to Like and Mark Solution to the post that helped you.

Thanks!

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan

tobebuilds
Shopify Partner
447 32 120

Your theme probably has a "Show currency code" option. Check the site settings in the theme editor. If you turn this setting off, the currency codes will not be present in the page HTML at all.

 

JavaScript-based solutions require you to know all the CSS selectors a price can possibly appear in, and they also don't work if the customer has JS disabled.

 

Best,

Tobe

Founder, Regios Discounts app (4.9 stars, 54 reviews)
- Custom discounts made simple
- "Just about any discount you'll ever need"
- Built by an ex-Google software engineer