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

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form