Jump to content

ican

Recommended Posts

56 minutes ago, Knowband Plugins said:

I think it can be achieved by adding the following line in the template file.


{$product.specific_prices.to}

You also need to use the date_format smarty modifier to print the same in desired format.

 

 

 

Can you please tell me how to use date_format smarty modifier  ?

Link to comment
Share on other sites

  • 2 months later...
On 8/22/2018 at 4:49 PM, Knowband Plugins said:

You can use the modifier in the following way.

{$product.specific_prices.to|date_format:'%d-%m-%Y'}
 

Refer to the URL below for details.

https://stackoverflow.com/questions/3248825/smarty-and-date

 

This is not working for me :(

{$product.specific_prices.to} <--- This line displays the date, but in format '0000-00-00 00:00:00' (Y-m-d H:i:s)
{$product.specific_prices.to|date_format:'%d-%m-%Y'} shows nothing! <--- but this one shows nothing!

Please help, really need this.

Link to comment
Share on other sites

Ok, I solved this:

When date format is set for your language (in BO, International > localization > Languages > Your language), then it is possible to display that date format with the following line:

{dateFormat date=$product.specific_prices.to}


Or display date and time with the following line:

{dateFormat date=$product.specific_prices.to full=1}

Link to comment
Share on other sites

  • 1 month later...
On 12/25/2018 at 4:31 AM, dinesh badrukhiya said:

Add the below lines in related .tpl file.
For example, if you want to show it on product page then go to: 
templates\catalog\product.tpl and add the line.


<span>{dateFormat date=$product.specific_prices.to}</span>

 

Works!

Thank you!

Link to comment
Share on other sites

  • 4 years later...
  • 2 weeks later...
On 9/25/2023 at 5:28 PM, pistachio said:

Hello,

I am having this problem. I need the start and end date to show on page product and I have tried the solutions presented here as well as I have referred to this solved topic but none of them work.

 

I am using version 1.7.6.7 and the classic theme.

 

Would appreciate some insights. Thank you

Hi,

Quote

<div class="specific-price-dates">
    <span>Start Date: {dateFormat date=$product.specific_prices.from}</span>
    <span>End Date: {dateFormat date=$product.specific_prices.to}</span>
</div>

Try this and let me know If it works!

Thanks!
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...