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













0















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?










share|improve this question
























  • You can use get_class_methods to check available methods for your $template object.

    – Jaimin Sutariya
    17 hours ago
















0















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?










share|improve this question
























  • You can use get_class_methods to check available methods for your $template object.

    – Jaimin Sutariya
    17 hours ago














0












0








0


1






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?










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 16 hours ago









Ashish Viradiya

1,0811830




1,0811830










asked 17 hours ago









RufusRufus

1366




1366












  • 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

















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











1 Answer
1






active

oldest

votes


















0














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?






share|improve this answer

























    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
    );



    );













    draft saved

    draft discarded


















    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









    0














    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?






    share|improve this answer





























      0














      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?






      share|improve this answer



























        0












        0








        0







        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?






        share|improve this answer















        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?







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 16 hours ago









        ABHISHEK TRIPATHI

        2,0611728




        2,0611728










        answered 17 hours ago









        Amit BeraAmit Bera

        59.6k1676177




        59.6k1676177



























            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?