Have your say in Community Polls: What was/is your greatest motivation to start your own business?

How can I eliminate cents from product prices?

How can I eliminate cents from product prices?

ELYSIAN_CLO
Excursionist
41 0 2

Hi all, 

 

Currently editing my website and I would like to remove the cents on the price, For example, it's $50.00, I just want to be $50. 

 

Also, is there any way to remove the home page on Dawn theme? So it can go straight to the ALL COLLECTION page instead of having to go through the enter page.

 

my website is elysianclo.store

Replies 2 (2)

enzoyuna2023
Shopify Partner
39 10 6

Hi,

1. To remove the cents on the price.  Go to Settings -> Store details Find section "Store currency" and click "change formating".

enzoyuna2023_0-1700788941474.png

 

{{amount_no_decimals_with_comma_separator}}

See here to more options https://help.shopify.com/en/manual/markets/pricing/currency-formatting

 

2. To Redirect from homepage to collection page

Go to your Shopify admin, then navigate to "Online Store" > Themes > Customize your theme.

In Homepage add new Section with "Custom Liquid" and write this code: 

 

{% if request.path == '/' and request.design_mode != true %}
  <script>
    window.location.href = '{{ "collections/all" | shopify_url }}'; 
  </script>
{% endif %}

 

Like this example.

enzoyuna2023_1-1700789596269.png

 

Note: Change the URL depend on what is you need.

Available for hire : novayadi85[at]gmail.com
Chat on WhatsApp
Buy me coffee

MuhammadAqib
Shopify Partner
14 1 1

Hey,
1. In your Shopify Admin go to online store > themes > actions > edit code and search theme.liquid file.
2. In your theme.liquid file, find the </body> (press CTRL + F  on Windows or command + F on Mac)
3. paste this code right above the </body> tag:

 

<script>
function updatePrice(){
var prices = document.querySelectorAll(`.price-item`);


if (!prices)return;

for (var each of prices){
each.innerText = each.innerText.replace('.00', '');
}
}

 window.onload = function() {
setTimeout(updatePrice, 50);
            }

</script>