Plugin method not foundMagento2: plugin around method not workingMagento 2 - Got Error in Adminhtml Controllermain.CRITICAL: Plugin class doesn't existMagento 2 : Block Not Found Errormagento Plugin is not working on CollectRates method shipping method classMagento 2 Fatal error: Uncaught Error: Class not foundMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.3 Can't view module's front end page output?Magento 2 get custom attribute of a single product inside a pluginmagento 2.2 trying to save multi select value in database
What reasons are there for a Capitalist to oppose a 100% inheritance tax?
How to remove border from elements in the last row?
What is required to make GPS signals available indoors?
What is a Samsaran Word™?
Can compressed videos be decoded back to their uncompresed original format?
Is it a bad idea to plug the other end of ESD strap to wall ground?
Is it possible to map the firing of neurons in the human brain so as to stimulate artificial memories in someone else?
Is it possible to create a QR code using text?
Knowledge-based authentication using Domain-driven Design in C#
Why were 5.25" floppy drives cheaper than 8"?
Do creatures with a listed speed of "0 ft., fly 30 ft. (hover)" ever touch the ground?
GFCI outlets - can they be repaired? Are they really needed at the end of a circuit?
How to prevent "they're falling in love" trope
What does the same-ish mean?
How to enclose theorems and definition in rectangles?
Why is the sentence "Das ist eine Nase" correct?
Did 'Cinema Songs' exist during Hiranyakshipu's time?
Car headlights in a world without electricity
How to stretch the corners of this image so that it looks like a perfect rectangle?
Send out email when Apex Queueable fails and test it
How to compactly explain secondary and tertiary characters without resorting to stereotypes?
Does the Idaho Potato Commission associate potato skins with healthy eating?
Is this draw by repetition?
How to coordinate airplane tickets?
Plugin method not found
Magento2: plugin around method not workingMagento 2 - Got Error in Adminhtml Controllermain.CRITICAL: Plugin class doesn't existMagento 2 : Block Not Found Errormagento Plugin is not working on CollectRates method shipping method classMagento 2 Fatal error: Uncaught Error: Class not foundMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.3 Can't view module's front end page output?Magento 2 get custom attribute of a single product inside a pluginmagento 2.2 trying to save multi select value in database
This is my plugin:
<?php
namespace VendorModulePlugin;
use MagentoEmailControllerAdminhtmlEmailTemplateDefaultTemplate;
class MyPlugin
public function afterExecute(DefaultTemplate $template, $result)
$text = $template->getData('template_text');
$text .= '<p>Custom Text</p>';
$template->setData('template_text', $text);
Var dump works. Plugin executes, but I can't get why getData method is not found. Any suggestions?
magento2 after-plugin
add a comment |
This is my plugin:
<?php
namespace VendorModulePlugin;
use MagentoEmailControllerAdminhtmlEmailTemplateDefaultTemplate;
class MyPlugin
public function afterExecute(DefaultTemplate $template, $result)
$text = $template->getData('template_text');
$text .= '<p>Custom Text</p>';
$template->setData('template_text', $text);
Var dump works. Plugin executes, but I can't get why getData method is not found. Any suggestions?
magento2 after-plugin
You can useget_class_methods
to check available methods for your$template
object.
– Jaimin Sutariya
17 hours ago
add a comment |
This is my plugin:
<?php
namespace VendorModulePlugin;
use MagentoEmailControllerAdminhtmlEmailTemplateDefaultTemplate;
class MyPlugin
public function afterExecute(DefaultTemplate $template, $result)
$text = $template->getData('template_text');
$text .= '<p>Custom Text</p>';
$template->setData('template_text', $text);
Var dump works. Plugin executes, but I can't get why getData method is not found. Any suggestions?
magento2 after-plugin
This is my plugin:
<?php
namespace VendorModulePlugin;
use MagentoEmailControllerAdminhtmlEmailTemplateDefaultTemplate;
class MyPlugin
public function afterExecute(DefaultTemplate $template, $result)
$text = $template->getData('template_text');
$text .= '<p>Custom Text</p>';
$template->setData('template_text', $text);
Var dump works. Plugin executes, but I can't get why getData method is not found. Any suggestions?
magento2 after-plugin
magento2 after-plugin
edited 16 hours ago
Ashish Viradiya
1,0811830
1,0811830
asked 17 hours ago
RufusRufus
1366
1366
You can useget_class_methods
to check available methods for your$template
object.
– Jaimin Sutariya
17 hours ago
add a comment |
You can useget_class_methods
to check available methods for your$template
object.
– Jaimin Sutariya
17 hours ago
You can use
get_class_methods
to check available methods for your $template
object.– Jaimin Sutariya
17 hours ago
You can use
get_class_methods
to check available methods for your $template
object.– Jaimin Sutariya
17 hours ago
add a comment |
1 Answer
1
active
oldest
votes
You have done wrong.The original function execute()
does have return @return **void**
.So, for you $result
is void type variable and also how you can $template
variable as your return does not give any parameters like that?. and $template
give MagentoEmailControllerAdminhtmlEmailTemplateDefaultTemplate
class object.
If you want $template
variable data then you have to use
$template = $template->getRequest()->getParam('code');
Actually, You have to explain what you to achieve?
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%2f268299%2fplugin-method-not-found%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
You have done wrong.The original function execute()
does have return @return **void**
.So, for you $result
is void type variable and also how you can $template
variable as your return does not give any parameters like that?. and $template
give MagentoEmailControllerAdminhtmlEmailTemplateDefaultTemplate
class object.
If you want $template
variable data then you have to use
$template = $template->getRequest()->getParam('code');
Actually, You have to explain what you to achieve?
add a comment |
You have done wrong.The original function execute()
does have return @return **void**
.So, for you $result
is void type variable and also how you can $template
variable as your return does not give any parameters like that?. and $template
give MagentoEmailControllerAdminhtmlEmailTemplateDefaultTemplate
class object.
If you want $template
variable data then you have to use
$template = $template->getRequest()->getParam('code');
Actually, You have to explain what you to achieve?
add a comment |
You have done wrong.The original function execute()
does have return @return **void**
.So, for you $result
is void type variable and also how you can $template
variable as your return does not give any parameters like that?. and $template
give MagentoEmailControllerAdminhtmlEmailTemplateDefaultTemplate
class object.
If you want $template
variable data then you have to use
$template = $template->getRequest()->getParam('code');
Actually, You have to explain what you to achieve?
You have done wrong.The original function execute()
does have return @return **void**
.So, for you $result
is void type variable and also how you can $template
variable as your return does not give any parameters like that?. and $template
give MagentoEmailControllerAdminhtmlEmailTemplateDefaultTemplate
class object.
If you want $template
variable data then you have to use
$template = $template->getRequest()->getParam('code');
Actually, You have to explain what you to achieve?
edited 16 hours ago
ABHISHEK TRIPATHI
2,0611728
2,0611728
answered 17 hours ago
Amit Bera♦Amit Bera
59.6k1676177
59.6k1676177
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%2f268299%2fplugin-method-not-found%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
You can use
get_class_methods
to check available methods for your$template
object.– Jaimin Sutariya
17 hours ago