Hi,
I have created a plugin for Shopware 5.5 that adds a free text field to my store. It saves on s_order_attributes a reference value for internal payment reference. The input is fillable from the frontend and visible from the backend. Now I’m trying to display this information on the sOrder email template, according to the right sample variables section it should appear when adding {$attributes.name_of_the_attribute} to the email template but it’s not displaying anything and it shows null on this right side sample variables section (which makes sense as the value doesn’t exist yet because no order has been placed)
On my plugin I got:
if (!$crudService->get("s_order_attributes", "name_of_the_attribute")) {
$crudService->update("s_order_attributes", "name_of_the_attribute", "string", [
"displayInBackend" => true,
"label" => "Purchase reference number",
"translatable" => true,
]);
}
$this->rebuildAttributeModels();
I am subscribed to Shopware_Modules_Order_SaveOrder_ProcessDetails, Enlight_Controller_Action_PostDispatch_Frontend_Checkout and sAdmin::sUpdatePayment::after to manage plugin display on the store, do I need to do anything else to get this working on the email templates? Reading the documentation I can see they use Enlight_Controller_Action_PostDispatchSecure_Frontend on https://developers.shopware.com/developers-guide/attribute-system/
Thanks!