i have a plugin for adding an order function to the order model. This worked before, but now it is no longer working. Maybe a problem with update to 2.3.3 or 2.3.4.
module.xml
< ?xml version="1.0"?>
di.xml
Model/Sales/Order.php
namespace MymoduleFormalsalutationModelSales;
class Order extends MagentoSalesModelOrder {
public function getCustomerNameFormal() {
$customerNameFormal = 'test';
// removed logic here
return $customerNameFormal;
}
}
Email template usage (order and invoice template):
{{var order.getCustomerNameFormal()}}
When i open an order, it loads this model. But in the emails it is no longer working.
Has anyone an idea why this happens, was there a change in an update or is this just a bug?
I saw that other variables not working, too.
{{var order.getCreatedAtFormated('long')}}
That is from the “insert variable” function, nut t is empty in email. But some, like address and Order ID are working.
Thank you,
Andreas