ps_emailalerts icon indicating copy to clipboard operation
ps_emailalerts copied to clipboard

Update ps_emailalerts.php in $template_vars

Open Anton1P opened this issue 10 months ago • 0 comments

The problem I wanted to remake the table in my twig file of the new_order, except that the only variables you created in $template_vars weren't enough, so I suggest you add some variables for more flexibility in customizing the mail template.

The solution ADD somes variables like = '{total_paid_tax_excl}' => $contextLocale->formatPrice($order->total_paid_tax_excl, $currency->iso_code), '{total_products_tax_excl}' => $contextLocale->formatPrice($order->getTotalProductsWithoutTaxes(), $currency->iso_code),

Questions Answers
Description? I wanted to remake the table in my twig file of the new_order, except that the only variables you created in $template_vars weren't enough, so I suggest you add some variables for more flexibility in customizing the mail template.
Type? improvement
BC breaks? no
Deprecations? no
How to test? To test the changes, modify the code in ps_emailalerts.php within the $template_vars section. For instance, change a variable in a Twig file, such as replacing {total_paid} with {total_paid_tax_excl} in new_order.twig. Afterwards, send yourself the respective email type to verify if the modification is correct.

Anton1P avatar Apr 08 '24 14:04 Anton1P