Shopify themes, liquid, logos, and UX
HI Members,
I am using Empire theme for me site https://dreamzhub.in/collections/home-accessories/products/multifunctional-mandoline-slicer . This theme don't have much option to design the product page. So i want to use some custom code.
I want to change the item sold last 10 days section.
In this section i want to show random numbers like 30 40 55 sold in last hour or 2 hours like this. Don't want to show actual value in last 10 days.
Thanks in Advance.
Solved! Go to the solution
This is an accepted solution.
Hi @naveen1989
Use the below script to implement the same, put this code in main-product.liquid at the appropriate location.
<div>Item sold last <span id="_ordercount"></span> days section.</div>
Below script at the bottom of liquid file.
<script>
let x = Math.floor((Math.random() * 100) + 1);
document.getElementById("_ordercount").innerHTML = x;
</script>
This will return the value between 1-100, you can change the value.
hope this will help...
Hi @naveen1989
You an do this using javascript, while refresh javascript will fetch the random number between the given numbers.
can you please share the code ?
This is an accepted solution.
Hi @naveen1989
Use the below script to implement the same, put this code in main-product.liquid at the appropriate location.
<div>Item sold last <span id="_ordercount"></span> days section.</div>
Below script at the bottom of liquid file.
<script>
let x = Math.floor((Math.random() * 100) + 1);
document.getElementById("_ordercount").innerHTML = x;
</script>
This will return the value between 1-100, you can change the value.
hope this will help...
Hi can you help me in this issue
By 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, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024