Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Using Formula In Email Template Snippets Rate Topic   - - - - -

 
  • sholand
  • Senior Member
  • Members
  • Join Date: 16-Jan 07
  • 141 posts

Posted 14 June 2018 - 08:41 PM #1

I am trying to add to the Order confirmation email the expected ship date which is calculated using the order timestamp.

 

This code worked in a previous version of the cart V2.2.3

 

{if $order_info.timestamp+16*24*60*60|date_format:'%A' == "Saturday"}
Your order is expected to ship on or around <b>{$order_info.timestamp+18*24*60*60|date_format:'%A, %m/%d/%Y'}</b>.<br>
{elseif $order_info.timestamp+16*24*60*60|date_format:'%A' == "Sunday"}
Your order is expected to ship on or around <b>{$order_info.timestamp+17*24*60*60|date_format:'%A, %m/%d/%Y'}</b>.<br>
{else}
Your order is expected to ship on or around <b>{$order_info.timestamp+16*24*60*60|date_format:'%A, %m/%d/%Y'}</b>.<br>
{/if}
 
When I put {{order_info.timestamp+16*24*60*60|date_format:'%A'}} in a snippet in comes back with 
ErrorUnknown "date_format" filter at line 284.
 
Any ideas?


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17405 posts

Posted 15 June 2018 - 06:14 AM #2

Unfortunately, Twig templates do not allow to use php functions like Smarty


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.