Shopify themes, liquid, logos, and UX
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!
.
.
.
.
.
.
.
.
Solved! Go to the solution
This is an accepted solution.
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:
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
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:
- 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
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!
This is an accepted solution.
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:
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
Thank you so much both of you @BSS-TekLabs @BSSCommerce-B2B
Worked so well! Thanks!
@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
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:
- 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
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!
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
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024