ukvapeclub Posted March 9, 2015 Share Posted March 9, 2015 Hi guys, Sorry if this has already been brought up, but I can't seem to find it. I want to include what I'd call a tag in my email template for when we receive a new order (template new_order under mailalerts) to show whether or not it's the customer's first order. I know this info is kicking around in the database somewhere as it's shown on the "orders" page in the back office ("new client" column). Is there something I can do in the email template similar to the way you can use {firstname} {lastname} etc? I'm assuming this isn't a built-in thing and I'm going to have to modify a php file somewhere. Thanks in advance! Link to comment Share on other sites More sharing options...
fred-vinapresta Posted March 9, 2015 Share Posted March 9, 2015 (edited) Hi, you can try to modifiy the mailalerts file (or create a module that use actionValidateOrder hook). in this function that sends the mail : you can add : $new_customer = 1; $customer_orders = Order::getCustomerOrders((int)$this->context->customer->id); if (count($customer_orders) > 1) $new_customer = 0; then in the data array sent to the email template, you can add a line: '{new_customer}' => $new_customer ? '<span>new customer</span>' : '', Edited March 9, 2015 by fred-vinapresta (see edit history) 1 Link to comment Share on other sites More sharing options...
ukvapeclub Posted March 9, 2015 Author Share Posted March 9, 2015 Thanks Fred, that gives me something to work with! I'll let you know when I've wrapped by head around it Link to comment Share on other sites More sharing options...
ukvapeclub Posted March 9, 2015 Author Share Posted March 9, 2015 After much frustration, and finally realising I was editing the wrong php file (there's a mailalert.php and a mailalerts.php, go figure) I've got this working. Many thanks again Fred, you're a star. Link to comment Share on other sites More sharing options...
Sashok Posted June 16, 2023 Share Posted June 16, 2023 hi from 2023 from Ukraine ) worked on PS 8.0.4 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