Get order object inside email_order_set_template_vars_before event observerOrder email, how to get the product IdChange Order Confirmation Email For Specific OrdersHow to get cart item details in event observer?Can't get order object in sales_order_place_after observer methodIs it possible to have multiple sales email templates for one site?How to change the email template depending on shipping method?How to set custom value in default Email template Magento 2Which event observer will be triggered before customer mail send in Magento 2?Get Customer from Order inside Observer functionCustom email sent with template empty in observer after order
Way of refund if scammed?
Salesforce bug enabled "Modify All"
What does it mean when みたいな is at the end of a sentence?
Is a world with one country feeding everyone possible?
Are there historical examples of audiences drawn to a work that was "so bad it's good"?
How can I reduce the size of matrix?
Why is unzipped file smaller than zipped file
Can a UK national work as a paid shop assistant in the USA?
How to tease a romance without a cat and mouse chase?
Is there an idiom that means that you are in a very strong negotiation position in a negotiation?
Can diplomats be allowed on the flight deck of a commercial European airline?
Efficient Algorithms for Destroyed Document Reconstruction
Three knights or knaves, three different hair colors
How does the Earth's center produce heat?
Caught with my phone during an exam
Wifi light switch needs neutral wire. Why? AND Can that wire be a skinny one?
Adobe Illustrator: How can I change the profile of a dashed stroke?
Why is this integration method not valid?
What is this dime sized black bug with white on the segments near Loveland Colorodao?
Why did Nick Fury not hesitate in blowing up the plane he thought was carrying a nuke?
Why the work done is positive when bringing 2 opposite charges together?
mmap: effect of other processes writing to a file previously mapped read-only
What is the required burn to keep a satellite at a Lagrangian point?
Computing elements of a 1000 x 60 matrix exhausts RAM
Get order object inside email_order_set_template_vars_before event observer
Order email, how to get the product IdChange Order Confirmation Email For Specific OrdersHow to get cart item details in event observer?Can't get order object in sales_order_place_after observer methodIs it possible to have multiple sales email templates for one site?How to change the email template depending on shipping method?How to set custom value in default Email template Magento 2Which event observer will be triggered before customer mail send in Magento 2?Get Customer from Order inside Observer functionCustom email sent with template empty in observer after order
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have observer for email_order_set_template_vars_before where i am setting some email template variable to use in order confirmation email.
Now i want to find which products customer has ordered in that order and depending on that set value for email template variable.
So how can i access order object inside this observer method?
magento2 event-observer email-templates
add a comment |
I have observer for email_order_set_template_vars_before where i am setting some email template variable to use in order confirmation email.
Now i want to find which products customer has ordered in that order and depending on that set value for email template variable.
So how can i access order object inside this observer method?
magento2 event-observer email-templates
add a comment |
I have observer for email_order_set_template_vars_before where i am setting some email template variable to use in order confirmation email.
Now i want to find which products customer has ordered in that order and depending on that set value for email template variable.
So how can i access order object inside this observer method?
magento2 event-observer email-templates
I have observer for email_order_set_template_vars_before where i am setting some email template variable to use in order confirmation email.
Now i want to find which products customer has ordered in that order and depending on that set value for email template variable.
So how can i access order object inside this observer method?
magento2 event-observer email-templates
magento2 event-observer email-templates
asked May 15 at 7:30
KhushbuKhushbu
13113
13113
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I found answer myself. Sharing here so it may help someone.
We can get Order object inside execute method of observer as below:
public function execute(MagentoFrameworkEventObserver $observer)
$transport = $observer->getTransport();
$order=$transport['order'];
$orderId=$order->getEntityId(); /** We can call any method of $order as usual **/
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f274649%2fget-order-object-inside-email-order-set-template-vars-before-event-observer%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I found answer myself. Sharing here so it may help someone.
We can get Order object inside execute method of observer as below:
public function execute(MagentoFrameworkEventObserver $observer)
$transport = $observer->getTransport();
$order=$transport['order'];
$orderId=$order->getEntityId(); /** We can call any method of $order as usual **/
add a comment |
I found answer myself. Sharing here so it may help someone.
We can get Order object inside execute method of observer as below:
public function execute(MagentoFrameworkEventObserver $observer)
$transport = $observer->getTransport();
$order=$transport['order'];
$orderId=$order->getEntityId(); /** We can call any method of $order as usual **/
add a comment |
I found answer myself. Sharing here so it may help someone.
We can get Order object inside execute method of observer as below:
public function execute(MagentoFrameworkEventObserver $observer)
$transport = $observer->getTransport();
$order=$transport['order'];
$orderId=$order->getEntityId(); /** We can call any method of $order as usual **/
I found answer myself. Sharing here so it may help someone.
We can get Order object inside execute method of observer as below:
public function execute(MagentoFrameworkEventObserver $observer)
$transport = $observer->getTransport();
$order=$transport['order'];
$orderId=$order->getEntityId(); /** We can call any method of $order as usual **/
answered May 15 at 8:19
KhushbuKhushbu
13113
13113
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f274649%2fget-order-object-inside-email-order-set-template-vars-before-event-observer%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown