seok Posted August 3, 2023 Share Posted August 3, 2023 (edited) Solved Edited August 5, 2023 by seok (see edit history) Link to comment Share on other sites More sharing options...
seok Posted August 4, 2023 Author Share Posted August 4, 2023 (edited) 0 help from forum, i solved my needs Edited August 5, 2023 by seok solved (see edit history) Link to comment Share on other sites More sharing options...
ps8modules Posted August 6, 2023 Share Posted August 6, 2023 (edited) 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 August 6, 2023 by ps8moduly.cz (see edit history) Link to comment Share on other sites More sharing options...
seok Posted August 8, 2023 Author Share Posted August 8, 2023 Check it, works in all ps versions: Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now