Add new link in my account (Magento 2)Add new link to customer account pageMagento 2 Custom Tab on Customer AccountHow can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?main.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Controller override issue Magento 2Add new link to customer account pageMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 Can't view module's front end page output?

What is Tony Stark injecting into himself in Iron Man 3?

Why would the IRS ask for birth certificates or even audit a small tax return?

Dukha vs legitimate need

Naming Characters after Friends/Family

What is "desert glass" and what does it do to the PCs?

Linear Combination of Atomic Orbitals

PTiJ: How should animals pray?

Why do phishing e-mails use faked e-mail addresses instead of the real one?

Has a sovereign Communist government ever run, and conceded loss, on a fair election?

How to chmod files that have a specific set of permissions

Are small insurances worth it

The past tense for the quoting particle って

Is divide-by-zero a security vulnerability?

Deal the cards to the players

Was it really inappropriate to write a pull request for the company I interviewed with?

“I had a flat in the centre of town, but I didn’t like living there, so …”

I can't die. Who am I?

Can inspiration allow the Rogue to make a Sneak Attack?

Quitting employee has privileged access to critical information

Calculate total length of edges in select Voronoi diagram

Does the US political system, in principle, allow for a no-party system?

Why doesn't "adolescent" take any articles in "listen to adolescent agonising"?

Split a number into equal parts given the number of parts

What can I do if someone tampers with my SSH public key?



Add new link in my account (Magento 2)


Add new link to customer account pageMagento 2 Custom Tab on Customer AccountHow can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?main.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Controller override issue Magento 2Add new link to customer account pageMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 Can't view module's front end page output?













0















I am trying to add refer a friend link in the customer account page.
I followed these links.




Add new link to customer account page



Magento 2 Custom Tab on Customer Account




It doesnt work for me



customer_account.xml



 <referenceBlock name="customer_account_navigation">
<block class="MagentoFrameworkViewElementHtmlLinkCurrent" name="refer-a-friend">
<arguments>
<argument name="path" xsi:type="string">customer/refer</argument>
<argument name="label" xsi:type="string">Refer a Friend</argument>
</arguments>
</block>
</referenceBlock>


routes.xml in app/code/YX/Customer/etc/frontend/routes.xml



<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route frontName="yx_customer" id="yx_customer">
<module name="YX_Customer"/>
</route>
</router>
</config>


customer_refer_index.xml in app/code/Vendor/Module/view/frontend/layout/customer_refer_index.xml



 <?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="customer_account"/>
<body>
<referenceContainer name="content">
<block class="YXCustomerBlockFriend"
name="referFriend"
template="Magento_Customer::account/refer_a_friend.phtml"
/>
</referenceContainer>
</body>




Block file in app/code/YX/Customer/Block/Friend



class Friend extends Template


public function __construct(Context $context)

parent::__construct($context);




Controller app/code/YX/Customer/Controller/Refer/Index.php



class Index extends MagentoFrameworkAppActionAction


protected $resultPageFactory;


public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkViewResultPageFactory $resultPageFactory
)
$this->resultPageFactory = $resultPageFactory;
parent::__construct($context);



public function execute()

return $this->resultPageFactory->create();




refer-a-friend.phtml



<div > Hello this is my template. I can do anything inside this file.</div>


I have no idea what I am doing wrong.










share|improve this question




























    0















    I am trying to add refer a friend link in the customer account page.
    I followed these links.




    Add new link to customer account page



    Magento 2 Custom Tab on Customer Account




    It doesnt work for me



    customer_account.xml



     <referenceBlock name="customer_account_navigation">
    <block class="MagentoFrameworkViewElementHtmlLinkCurrent" name="refer-a-friend">
    <arguments>
    <argument name="path" xsi:type="string">customer/refer</argument>
    <argument name="label" xsi:type="string">Refer a Friend</argument>
    </arguments>
    </block>
    </referenceBlock>


    routes.xml in app/code/YX/Customer/etc/frontend/routes.xml



    <?xml version="1.0" ?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
    <route frontName="yx_customer" id="yx_customer">
    <module name="YX_Customer"/>
    </route>
    </router>
    </config>


    customer_refer_index.xml in app/code/Vendor/Module/view/frontend/layout/customer_refer_index.xml



     <?xml version="1.0" ?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="customer_account"/>
    <body>
    <referenceContainer name="content">
    <block class="YXCustomerBlockFriend"
    name="referFriend"
    template="Magento_Customer::account/refer_a_friend.phtml"
    />
    </referenceContainer>
    </body>




    Block file in app/code/YX/Customer/Block/Friend



    class Friend extends Template


    public function __construct(Context $context)

    parent::__construct($context);




    Controller app/code/YX/Customer/Controller/Refer/Index.php



    class Index extends MagentoFrameworkAppActionAction


    protected $resultPageFactory;


    public function __construct(
    MagentoFrameworkAppActionContext $context,
    MagentoFrameworkViewResultPageFactory $resultPageFactory
    )
    $this->resultPageFactory = $resultPageFactory;
    parent::__construct($context);



    public function execute()

    return $this->resultPageFactory->create();




    refer-a-friend.phtml



    <div > Hello this is my template. I can do anything inside this file.</div>


    I have no idea what I am doing wrong.










    share|improve this question


























      0












      0








      0








      I am trying to add refer a friend link in the customer account page.
      I followed these links.




      Add new link to customer account page



      Magento 2 Custom Tab on Customer Account




      It doesnt work for me



      customer_account.xml



       <referenceBlock name="customer_account_navigation">
      <block class="MagentoFrameworkViewElementHtmlLinkCurrent" name="refer-a-friend">
      <arguments>
      <argument name="path" xsi:type="string">customer/refer</argument>
      <argument name="label" xsi:type="string">Refer a Friend</argument>
      </arguments>
      </block>
      </referenceBlock>


      routes.xml in app/code/YX/Customer/etc/frontend/routes.xml



      <?xml version="1.0" ?>
      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
      <router id="standard">
      <route frontName="yx_customer" id="yx_customer">
      <module name="YX_Customer"/>
      </route>
      </router>
      </config>


      customer_refer_index.xml in app/code/Vendor/Module/view/frontend/layout/customer_refer_index.xml



       <?xml version="1.0" ?>
      <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
      <update handle="customer_account"/>
      <body>
      <referenceContainer name="content">
      <block class="YXCustomerBlockFriend"
      name="referFriend"
      template="Magento_Customer::account/refer_a_friend.phtml"
      />
      </referenceContainer>
      </body>




      Block file in app/code/YX/Customer/Block/Friend



      class Friend extends Template


      public function __construct(Context $context)

      parent::__construct($context);




      Controller app/code/YX/Customer/Controller/Refer/Index.php



      class Index extends MagentoFrameworkAppActionAction


      protected $resultPageFactory;


      public function __construct(
      MagentoFrameworkAppActionContext $context,
      MagentoFrameworkViewResultPageFactory $resultPageFactory
      )
      $this->resultPageFactory = $resultPageFactory;
      parent::__construct($context);



      public function execute()

      return $this->resultPageFactory->create();




      refer-a-friend.phtml



      <div > Hello this is my template. I can do anything inside this file.</div>


      I have no idea what I am doing wrong.










      share|improve this question
















      I am trying to add refer a friend link in the customer account page.
      I followed these links.




      Add new link to customer account page



      Magento 2 Custom Tab on Customer Account




      It doesnt work for me



      customer_account.xml



       <referenceBlock name="customer_account_navigation">
      <block class="MagentoFrameworkViewElementHtmlLinkCurrent" name="refer-a-friend">
      <arguments>
      <argument name="path" xsi:type="string">customer/refer</argument>
      <argument name="label" xsi:type="string">Refer a Friend</argument>
      </arguments>
      </block>
      </referenceBlock>


      routes.xml in app/code/YX/Customer/etc/frontend/routes.xml



      <?xml version="1.0" ?>
      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
      <router id="standard">
      <route frontName="yx_customer" id="yx_customer">
      <module name="YX_Customer"/>
      </route>
      </router>
      </config>


      customer_refer_index.xml in app/code/Vendor/Module/view/frontend/layout/customer_refer_index.xml



       <?xml version="1.0" ?>
      <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
      <update handle="customer_account"/>
      <body>
      <referenceContainer name="content">
      <block class="YXCustomerBlockFriend"
      name="referFriend"
      template="Magento_Customer::account/refer_a_friend.phtml"
      />
      </referenceContainer>
      </body>




      Block file in app/code/YX/Customer/Block/Friend



      class Friend extends Template


      public function __construct(Context $context)

      parent::__construct($context);




      Controller app/code/YX/Customer/Controller/Refer/Index.php



      class Index extends MagentoFrameworkAppActionAction


      protected $resultPageFactory;


      public function __construct(
      MagentoFrameworkAppActionContext $context,
      MagentoFrameworkViewResultPageFactory $resultPageFactory
      )
      $this->resultPageFactory = $resultPageFactory;
      parent::__construct($context);



      public function execute()

      return $this->resultPageFactory->create();




      refer-a-friend.phtml



      <div > Hello this is my template. I can do anything inside this file.</div>


      I have no idea what I am doing wrong.







      magento2 customer-account page link






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 7 hours ago







      summu

















      asked 8 hours ago









      summusummu

      1618




      1618




















          0






          active

          oldest

          votes











          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%2f264916%2fadd-new-link-in-my-account-magento-2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          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%2f264916%2fadd-new-link-in-my-account-magento-2%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

          六本木駅

          Integral that is continuous and looks like it converges to a geometric seriesTesting if a geometric series converges by taking limit to infinitySummation of arithmetic-geometric series of higher orderGeometric series with polynomial exponentHow to Recognize a Geometric SeriesShowing an integral equality with series over the integersDiscontinuity of a series of continuous functionsReasons why a Series ConvergesSum of infinite geometric series with two terms in summationUsing geometric series for computing IntegralsLimit of geometric series sum when $r = 1$

          Joseph Lister