foxnetwork Posted September 24, 2023 Share Posted September 24, 2023 I am trying to add to the invoice summary tab and extra position for due by date and add 30 days to the current date I need this for invoice customers so they have thirty days. I have added files in invoice tpl file and it adds it to the invoice but with the current date. Bottom line. <tr> <td class="center small white">{$title|escape:'html':'UTF-8'}</td> <td class="center small white">{dateFormat date=$order->invoice_date full=0}</td> <td class="center small white">{$order->getUniqReference()}</td> <td class="center small white">{dateFormat date=$order->date_add full=0}</td> <td class="center small white">{dateFormat date=$order->date_add full=0}</td> Does anyone know where to change this so I can make the date appear 30 days later I am using prestashop 8.1 Thanks for any help Link to comment Share on other sites More sharing options...
Yelish Posted September 25, 2023 Share Posted September 25, 2023 Hello, how are you? You would need to create your own PHP function within the Tools class and access it from Smarty as you're currently doing, making the necessary changes to the function. If this relates to a module, you could extend the class and, in that way, avoid modifying the Tools class. Link to comment Share on other sites More sharing options...
ps8modules Posted September 25, 2023 Share Posted September 25, 2023 Hi. You don't have to create any weird function, but just create an override of the HTMLInvoice.php file and the tpl template. It is easy. You use a php function and set your own variable in the TPL. Link to comment Share on other sites More sharing options...
Yelish Posted September 25, 2023 Share Posted September 25, 2023 Thanks, buddy, but overrides are frowned upon by PrestaShop. Let's create cleaner code. Regards. Link to comment Share on other sites More sharing options...
ps8modules Posted September 25, 2023 Share Posted September 25, 2023 17 minutes ago, Yelish said: Thanks, buddy, but overrides are frowned upon by PrestaShop. Let's create cleaner code. Regards. Thank you. 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