| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Custom e-mail variables | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
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:
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.
__________________
X-Cart version 5.4.1.46 PHP version 7.4.33 MySQL version 15.1 Apache version 2.4.56 cURL version 7.74.0 |
|||||||||
#2
|
|||||||||
|
|||||||||
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:
Code:
Code:
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:
__________________
X-Cart version 5.4.1.46 PHP version 7.4.33 MySQL version 15.1 Apache version 2.4.56 cURL version 7.74.0 Last edited by The Knotty Celt : 11-04-2020 at 09:31 AM. Reason: Missed Step. Clarified abiguity. |
|||||||||
|
#3
|
|||||||||
|
|||||||||
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.
__________________
X-Cart version 5.4.1.46 PHP version 7.4.33 MySQL version 15.1 Apache version 2.4.56 cURL version 7.74.0 |
|||||||||
|
|||
X-Cart forums © 2001-2020
|