Jump to content

Hide price column on new_order.html from mail alerts module


Recommended Posts

The {items} placeholder is built up in MailAlerts::hookNewOrder($params) found in "modules/mailalerts/mailalerts.php". In that method you will see a variable called "$itemsTable" which is built up as an HTML string containing the item list. This is where the price is being set.

 

Probably the best option would be to leave that code as is but create a new $itemsTableNoPrice variable with the layout you want so that you can make the choice in the template as to what you want to show. So basically everywhere you see $itemsTable being assigned, add another line setting $itemsTableNoPrice as you want it to be and then add that variable the templateVars array.

 

Then you can reference {itemsTableNoPrice} in the new_order.html template.

 

Cheers

Edited by codegrunt (see edit history)
Link to comment
Share on other sites

You first need to clarify what template you are dealing with. Mail templates and web page templates in Prestashop use entirely different template mechanisms. For mail messages they unfortunately do not use Smarty but instead a simple replace function for each placeholder. For mail messages especially, it highly depends on what template you are talking about and where it was loaded as to what variables will be available.

 

So what template are you talking about here?

 

Cheers

Link to comment
Share on other sites

If you are talking about "mails/[lang]/order_conf.html", the {products} placeholder is setup in the PaymentModule::validateOrder() method via the variable "$productsList".

 

If you decide you do want to change that method, be sure to use a class override so you do not modify core system files.

 

Cheers

Link to comment
Share on other sites

×
×
  • Create New...