Jump to content

[SOLVED]Add a estimated date of delivery in order history [SOLVED]


seok

Recommended Posts

  • seok changed the title to [SOLVED]Add a estimated date of delivery in order history [SOLVED]
On 8/3/2023 at 11:02 PM, seok said:

1. post:

I am adding codes in order-detail.tpl to show a estimated date of delivery to customers from that is not available any module compatible with PS 8

My variable of order date is: {$order.details.order_date|date_format:"%A, %e %B of %Y"}

I want to join together {$order.details.order_date} with the code {"+8 days"|strtotime|date_format:"%A, %e %B of %Y"}

 

My full code of smarty now is: 

 {assign var="Delivery_day" value=$smarty.now|date_format:"%u"}
  <b>{l s='Estimated delivery day'}</b>
    {if $Delivery_day == 1}
        {"+8 days"|strtotime|date_format:"%A, %e %B del %Y"}
    {/if}
    {if $Delivery_day == 6}
        {"+9 days"|strtotime|date_format:"%A, %e %B of %Y"}
    {/if}
    {if $Delivery_day > 0 && $Delivery_day < 6}
        {"+8 days"|strtotime|date_format:"%A, %e %B of %Y"}
    {/if}

 

I tried with {"$order.details.order_date+8 days"|strtotime|date_format:"%A, %e de %B del %Y"} but it give me error, i am not expert.

 

Can you help me?

 

2. post:

I'm moving forward, the right code that adds the days is: {$order.details.order_date|replace:'/':'-'|cat:' +8 days'|date_format:'%A, %e %B of %Y'}

Now the conditions "if" is not working, it only read the first "if" for all day of order:

{assign var="Delivery_day" value=$smarty.now|date_format:"%u"}     {if $Delivery_day == 7} *// sunday         {$order.details.order_date|replace:'/':'-'|cat:' +9 days'|date_format:'%A, %e %B of %Y'}     {/if}     {if $order.details.order_date == 5} *// friday         {$order.details.order_date|replace:'/':'-'|cat:' +10 days'|date_format:'%A, %e %B of %Y'}     {/if}     {if $order.details.order_date == 6} *// saturday         {$order.details.order_date|replace:'/':'-'|cat:' +10 days'|date_format:'%A, %e %B of %Y'}     {/if}     if $Delivery_day > 0 && $Delivery_day < 5} *//monday,tuesday,wednesday,thursday         {$order.details.order_date|replace:'/':'-'|cat:' +8 days'|date_format:'%A, %e %B of %Y'}     {/if}

The Assign var is wrong?

Hi.

And you don't want to put the solution here for others?

Thank you

Edited by ps8moduly.cz (see edit history)
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...