SEO, AdWords, affiliates, advertising, and promotions
Below code give Estimated delivery dates in numbers (9/8/2022). I want to show in this formate: Sep 8, 2022
What changes should I do in this code?
<tr> <td style="width: 509px;"> <div style="text-align: center;"><span style="color: #8d0505;"> Order today and you'll receive your package on:<strong> <script>// <![CDATA[ var currentTime = new Date(); currentTime.setDate(currentTime.getDate() + 14); var month = currentTime.getMonth() + 1; var day = currentTime.getDate(); var year = currentTime.getFullYear(); document.write(month + "/" + day + "/" + year); // ]]></script> </strong>* </span> </div> </td> </tr>
Solved! Go to the solution
This is an accepted solution.
Hi @keyurdodiya ,
I’m Richard Nguyen - CRO Expert at PageFly- Free Landing Page Builder. I hope that my recommendations based on 6 years of providing solutions for more than 100.000 merchants can be beneficial to you in improving your store performance.
About your question, you can try to apply this code to try!
<tr>
<td style="width: 509px;">
<div style="text-align: center;"><span style="color: #8d0505;"> Order today and you'll receive your package on:<strong>
<script>// <![CDATA[
Date.prototype.monthNames = [
"January", "February", "March",
"April", "May", "June",
"July", "Aug", "Sep",
"October", "November", "December"
];
Date.prototype.getMonthName = function() {
return this.monthNames[this.getMonth() + 1];
};
Date.prototype.getShortMonthName = function () {
return this.getMonthName().substr(0, 3);
};
// usage:
var d = new Date();
var currentTime = new Date();
currentTime.setDate(currentTime.getDate() + 14);
var day = currentTime.getDate();
var year = currentTime.getFullYear();
document.write(d.getMonthName() + ' ' + day + ", " + year);
// ]]>
</script>
</strong>* </span>
</div>
</td>
</tr>
Hope this can help you!
If you are looking for some tips to boosts your conversion rate, you can take a look at this article.
Please let me know if it works by giving it a Like or marking it as a solution!
➜ Optimize your Shopify store with PageFly Page Builder (Free plan available)
All features are available from Free plan. Live Chat Support is available 24/7.
This is an accepted solution.
Hi @keyurdodiya ,
I’m Richard Nguyen - CRO Expert at PageFly- Free Landing Page Builder. I hope that my recommendations based on 6 years of providing solutions for more than 100.000 merchants can be beneficial to you in improving your store performance.
About your question, you can try to apply this code to try!
<tr>
<td style="width: 509px;">
<div style="text-align: center;"><span style="color: #8d0505;"> Order today and you'll receive your package on:<strong>
<script>// <![CDATA[
Date.prototype.monthNames = [
"January", "February", "March",
"April", "May", "June",
"July", "Aug", "Sep",
"October", "November", "December"
];
Date.prototype.getMonthName = function() {
return this.monthNames[this.getMonth() + 1];
};
Date.prototype.getShortMonthName = function () {
return this.getMonthName().substr(0, 3);
};
// usage:
var d = new Date();
var currentTime = new Date();
currentTime.setDate(currentTime.getDate() + 14);
var day = currentTime.getDate();
var year = currentTime.getFullYear();
document.write(d.getMonthName() + ' ' + day + ", " + year);
// ]]>
</script>
</strong>* </span>
</div>
</td>
</tr>
Hope this can help you!
If you are looking for some tips to boosts your conversion rate, you can take a look at this article.
Please let me know if it works by giving it a Like or marking it as a solution!
➜ Optimize your Shopify store with PageFly Page Builder (Free plan available)
All features are available from Free plan. Live Chat Support is available 24/7.
Hi @PageFly-Richard & @keyurdodiya thank you both for this shopify DIY delivery date on product page!!
Could you give a step by step explanation where to put the above code?
I use the OOTS FLEX-Theme.
thank you both in advance for a hint
Chris
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