Custom e-mail variables
PREMISE
I have created a custom module which adds an order reference field to the Order class. The module displays this rather than the default order number. This was done to allow for customized format and annual counter reset. While I am able to correctly display this reference number to the customer and admin, emails are still referencing the default order number. WHAT I'VE TRIED I believe the email variables are defined in the XLite\Core\Mail\Order\AOrder class, specifically the __construct fucnction. Code:
<?php I replaced the getOrderNumber() function call wtih a call to the getReference() function of my decorated Order class. RESULTING BEHAVIOUR Even after rebuilding cache, and attempting to send an order update e-mail, the subject line still uses the build-in order number rather than the customized reference number. What am I missing? Did I not decorate the correct class? Did I not decorate it properly? How can I achieve my desired result? Thank you in advance for any assistance you are able to provide. |
Re: Custom e-mail variables
I managed to solve this particular issue. I also opted to add a completely custom field, so that I could still access all the default ones. The issue stemmed from the following call:
Code:
parent::__construct(); Code:
parent::__construct($order); Code:
public function __construct(Order $order) It is also important to note that I also added the following method to my decorated class in order to define and display the custom variable in the pop-up preview. Code:
protected static function defineVariables() |
Re: Custom e-mail variables
While the changes I described work for all the standard order notification e-mails, it does not do the same for notifications created by the Order Messages module or other Modules which access the Order class.
|
All times are GMT -8. The time now is 03:34 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.