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

Why does Arabsat 6A need a Falcon Heavy to launch

Why does Kotter return in Welcome Back Kotter

If a Gelatinous Cube takes up the entire space of a Pit Trap, what happens when a creature falls into the trap but succeeds on the saving throw?

What is the intuition behind short exact sequences of groups; in particular, what is the intuition behind group extensions?

prove that the matrix A is diagonalizable

What's the difference between 'rename' and 'mv'?

Were any external disk drives stacked vertically?

Arrow those variables!

Why is consensus so controversial in Britain?

Is "remove commented out code" correct English?

Why do I get two different answers for this counting problem?

Did Shadowfax go to Valinor?

How can saying a song's name be a copyright violation?

Why can't we play rap on piano?

Anagram holiday

Stopping power of mountain vs road bike

Doing something right before you need it - expression for this?

90's TV series where a boy goes to another dimension through portal near power lines

Will google still index a page if I use a $_SESSION variable?

Python: return float 1.0 as int 1 but float 1.5 as float 1.5

How to show the equivalence between the regularized regression and their constraint formulas using KKT

Is it possible to run Internet Explorer on OS X El Capitan?

What mechanic is there to disable a threat instead of killing it?

Is Lorentz symmetry broken if SUSY is broken?



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






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








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
    2 days 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
    2 days 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 2 days ago









Ashish Viradiya

1,1581831




1,1581831










asked 2 days ago









RufusRufus

1366




1366












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

    – Jaimin Sutariya
    2 days ago


















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

    – Jaimin Sutariya
    2 days ago

















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

– Jaimin Sutariya
2 days ago






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

– Jaimin Sutariya
2 days 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 2 days ago









        ABHISHEK TRIPATHI

        2,1241828




        2,1241828










        answered 2 days 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

            Sum ergo cogito? 1 nng

            三茅街道4182Guuntc Dn precexpngmageondP