Add new Action to a existing Magento route - Magento2Magento 2 create custom block and phtml in Magento_Customer moduleWhere in a custom module can you declare / consolidate all of your custom functionsMagento2 InstallSchema add new column to existing tableMagento2 adding dynamic route nameCustom Contact Form - Override ControllerUse existing PHP, HTML, and JavaScript based website in the same structure, but use Magento 2.1 Functions and tools such as accounts and CartsMy New Route Is Not WorkingAdd new action in cartController.php in magento 1.9Add new action to existing module, routingHow to get selected Order Ids in block from Sales Order Grid? Magento2redirect vers url (route/controller/action) from phtml magento 2

Was the picture area of a CRT a parallelogram (instead of a true rectangle)?

Is the destination of a commercial flight important for the pilot?

Was Spock the First Vulcan in Starfleet?

Can I Retrieve Email Addresses from BCC?

Generic lambda vs generic function give different behaviour

Implement the Thanos sorting algorithm

What will be the benefits of Brexit?

Personal Teleportation as a Weapon

Valid Badminton Score?

If you attempt to grapple an opponent that you are hidden from, do they roll at disadvantage?

What defines a dissertation?

How can I use the arrow sign in my bash prompt?

How do I rename a LINUX host without needing to reboot for the rename to take effect?

At which point does a character regain all their Hit Dice?

Short story about space worker geeks who zone out by 'listening' to radiation from stars

Can criminal fraud exist without damages?

Is expanding the research of a group into machine learning as a PhD student risky?

What to do with wrong results in talks?

Confused about a passage in Harry Potter y la piedra filosofal

What's a natural way to say that someone works somewhere (for a job)?

The plural of 'stomach"

voltage of sounds of mp3files

apt-get update is failing in debian

What is the opposite of 'gravitas'?



Add new Action to a existing Magento route - Magento2


Magento 2 create custom block and phtml in Magento_Customer moduleWhere in a custom module can you declare / consolidate all of your custom functionsMagento2 InstallSchema add new column to existing tableMagento2 adding dynamic route nameCustom Contact Form - Override ControllerUse existing PHP, HTML, and JavaScript based website in the same structure, but use Magento 2.1 Functions and tools such as accounts and CartsMy New Route Is Not WorkingAdd new action in cartController.php in magento 1.9Add new action to existing module, routingHow to get selected Order Ids in block from Sales Order Grid? Magento2redirect vers url (route/controller/action) from phtml magento 2













4















Hello guys how are you?,



Here is my scenario, I want to add a new Action to an existing Magento route, what this mean, for example under the MyAccount section you can find /sales/order/[view, history, etc] right? I want to add a index like a a Order section dashboard.



I try to implement this solution:
https://stackoverflow.com/questions/34908125/magento-2-controller-post-throwing-404-error
without lucky.



Any suggestion?










share|improve this question




























    4















    Hello guys how are you?,



    Here is my scenario, I want to add a new Action to an existing Magento route, what this mean, for example under the MyAccount section you can find /sales/order/[view, history, etc] right? I want to add a index like a a Order section dashboard.



    I try to implement this solution:
    https://stackoverflow.com/questions/34908125/magento-2-controller-post-throwing-404-error
    without lucky.



    Any suggestion?










    share|improve this question


























      4












      4








      4


      1






      Hello guys how are you?,



      Here is my scenario, I want to add a new Action to an existing Magento route, what this mean, for example under the MyAccount section you can find /sales/order/[view, history, etc] right? I want to add a index like a a Order section dashboard.



      I try to implement this solution:
      https://stackoverflow.com/questions/34908125/magento-2-controller-post-throwing-404-error
      without lucky.



      Any suggestion?










      share|improve this question
















      Hello guys how are you?,



      Here is my scenario, I want to add a new Action to an existing Magento route, what this mean, for example under the MyAccount section you can find /sales/order/[view, history, etc] right? I want to add a index like a a Order section dashboard.



      I try to implement this solution:
      https://stackoverflow.com/questions/34908125/magento-2-controller-post-throwing-404-error
      without lucky.



      Any suggestion?







      magento2 controllers






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 23 '17 at 12:37









      Community

      1




      1










      asked Jun 10 '16 at 13:49









      AleGrinGoAleGrinGo

      236211




      236211




















          1 Answer
          1






          active

          oldest

          votes


















          8














          So, you need to create a custom extension with the following file structure (for example adding new action to checkout/cart/):



          Add action extension structure.



          We need the following files to make it work:



          1) registration.php



          <?php
          MagentoFrameworkComponentComponentRegistrar::register(
          MagentoFrameworkComponentComponentRegistrar::MODULE,
          'Amasty_Checkout',
          __DIR__
          );


          2) composer.json




          "name": "amasty/checkout",
          "description": "Amasty Test",
          "require":
          "php": "~5.5.0,
          "type": "magento2-module",
          "version": "1.0.0",
          "license": [
          "Commercial"
          ],
          "autoload":
          "files": [ "registration.php" ],
          "psr-4":
          "Amasty\Checkout\": ""





          3) module.xml



          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
          <module name="Amasty_Checkout" schema_version="1.0.0" setup_version="1.0.0">
          <sequence>
          <module name="Magento_Checkout"/>
          </sequence>
          </module>




          4) 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 id="checkout">
          <module name="Amasty_Checkout" />
          </route>
          </router>
          </config>


          5) Test.php (adding /test/ action)



          <?php
          namespace AmastyCheckoutControllerCart;

          class Test extends MagentoCheckoutControllerCartAdd


          public function execute()

          die('asdasdasd');




          And this is the result:



          Test action result.






          share|improve this answer

























          • thank you so much for the answer. I didn't have time to check the fix yet. I'll let you now how was

            – AleGrinGo
            Jun 23 '16 at 3:11












          • @Amasty, I want to add new custom tab for customer account.Could you please guide how I can do this?

            – mageDev0688
            May 15 '17 at 11:13











          • @Amasty in routes.xml file you have to specify only id attribute of route node, and you are strongly advised to use a before or after tag's attribute to control the order Magento will check for matches in, to avoid accidental overrides of existing core controllers

            – Cristiano Casciotti
            Jul 12 '17 at 10:04











          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%2f120389%2fadd-new-action-to-a-existing-magento-route-magento2%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









          8














          So, you need to create a custom extension with the following file structure (for example adding new action to checkout/cart/):



          Add action extension structure.



          We need the following files to make it work:



          1) registration.php



          <?php
          MagentoFrameworkComponentComponentRegistrar::register(
          MagentoFrameworkComponentComponentRegistrar::MODULE,
          'Amasty_Checkout',
          __DIR__
          );


          2) composer.json




          "name": "amasty/checkout",
          "description": "Amasty Test",
          "require":
          "php": "~5.5.0,
          "type": "magento2-module",
          "version": "1.0.0",
          "license": [
          "Commercial"
          ],
          "autoload":
          "files": [ "registration.php" ],
          "psr-4":
          "Amasty\Checkout\": ""





          3) module.xml



          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
          <module name="Amasty_Checkout" schema_version="1.0.0" setup_version="1.0.0">
          <sequence>
          <module name="Magento_Checkout"/>
          </sequence>
          </module>




          4) 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 id="checkout">
          <module name="Amasty_Checkout" />
          </route>
          </router>
          </config>


          5) Test.php (adding /test/ action)



          <?php
          namespace AmastyCheckoutControllerCart;

          class Test extends MagentoCheckoutControllerCartAdd


          public function execute()

          die('asdasdasd');




          And this is the result:



          Test action result.






          share|improve this answer

























          • thank you so much for the answer. I didn't have time to check the fix yet. I'll let you now how was

            – AleGrinGo
            Jun 23 '16 at 3:11












          • @Amasty, I want to add new custom tab for customer account.Could you please guide how I can do this?

            – mageDev0688
            May 15 '17 at 11:13











          • @Amasty in routes.xml file you have to specify only id attribute of route node, and you are strongly advised to use a before or after tag's attribute to control the order Magento will check for matches in, to avoid accidental overrides of existing core controllers

            – Cristiano Casciotti
            Jul 12 '17 at 10:04
















          8














          So, you need to create a custom extension with the following file structure (for example adding new action to checkout/cart/):



          Add action extension structure.



          We need the following files to make it work:



          1) registration.php



          <?php
          MagentoFrameworkComponentComponentRegistrar::register(
          MagentoFrameworkComponentComponentRegistrar::MODULE,
          'Amasty_Checkout',
          __DIR__
          );


          2) composer.json




          "name": "amasty/checkout",
          "description": "Amasty Test",
          "require":
          "php": "~5.5.0,
          "type": "magento2-module",
          "version": "1.0.0",
          "license": [
          "Commercial"
          ],
          "autoload":
          "files": [ "registration.php" ],
          "psr-4":
          "Amasty\Checkout\": ""





          3) module.xml



          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
          <module name="Amasty_Checkout" schema_version="1.0.0" setup_version="1.0.0">
          <sequence>
          <module name="Magento_Checkout"/>
          </sequence>
          </module>




          4) 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 id="checkout">
          <module name="Amasty_Checkout" />
          </route>
          </router>
          </config>


          5) Test.php (adding /test/ action)



          <?php
          namespace AmastyCheckoutControllerCart;

          class Test extends MagentoCheckoutControllerCartAdd


          public function execute()

          die('asdasdasd');




          And this is the result:



          Test action result.






          share|improve this answer

























          • thank you so much for the answer. I didn't have time to check the fix yet. I'll let you now how was

            – AleGrinGo
            Jun 23 '16 at 3:11












          • @Amasty, I want to add new custom tab for customer account.Could you please guide how I can do this?

            – mageDev0688
            May 15 '17 at 11:13











          • @Amasty in routes.xml file you have to specify only id attribute of route node, and you are strongly advised to use a before or after tag's attribute to control the order Magento will check for matches in, to avoid accidental overrides of existing core controllers

            – Cristiano Casciotti
            Jul 12 '17 at 10:04














          8












          8








          8







          So, you need to create a custom extension with the following file structure (for example adding new action to checkout/cart/):



          Add action extension structure.



          We need the following files to make it work:



          1) registration.php



          <?php
          MagentoFrameworkComponentComponentRegistrar::register(
          MagentoFrameworkComponentComponentRegistrar::MODULE,
          'Amasty_Checkout',
          __DIR__
          );


          2) composer.json




          "name": "amasty/checkout",
          "description": "Amasty Test",
          "require":
          "php": "~5.5.0,
          "type": "magento2-module",
          "version": "1.0.0",
          "license": [
          "Commercial"
          ],
          "autoload":
          "files": [ "registration.php" ],
          "psr-4":
          "Amasty\Checkout\": ""





          3) module.xml



          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
          <module name="Amasty_Checkout" schema_version="1.0.0" setup_version="1.0.0">
          <sequence>
          <module name="Magento_Checkout"/>
          </sequence>
          </module>




          4) 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 id="checkout">
          <module name="Amasty_Checkout" />
          </route>
          </router>
          </config>


          5) Test.php (adding /test/ action)



          <?php
          namespace AmastyCheckoutControllerCart;

          class Test extends MagentoCheckoutControllerCartAdd


          public function execute()

          die('asdasdasd');




          And this is the result:



          Test action result.






          share|improve this answer















          So, you need to create a custom extension with the following file structure (for example adding new action to checkout/cart/):



          Add action extension structure.



          We need the following files to make it work:



          1) registration.php



          <?php
          MagentoFrameworkComponentComponentRegistrar::register(
          MagentoFrameworkComponentComponentRegistrar::MODULE,
          'Amasty_Checkout',
          __DIR__
          );


          2) composer.json




          "name": "amasty/checkout",
          "description": "Amasty Test",
          "require":
          "php": "~5.5.0,
          "type": "magento2-module",
          "version": "1.0.0",
          "license": [
          "Commercial"
          ],
          "autoload":
          "files": [ "registration.php" ],
          "psr-4":
          "Amasty\Checkout\": ""





          3) module.xml



          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
          <module name="Amasty_Checkout" schema_version="1.0.0" setup_version="1.0.0">
          <sequence>
          <module name="Magento_Checkout"/>
          </sequence>
          </module>




          4) 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 id="checkout">
          <module name="Amasty_Checkout" />
          </route>
          </router>
          </config>


          5) Test.php (adding /test/ action)



          <?php
          namespace AmastyCheckoutControllerCart;

          class Test extends MagentoCheckoutControllerCartAdd


          public function execute()

          die('asdasdasd');




          And this is the result:



          Test action result.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 8 mins ago









          AleGrinGo

          236211




          236211










          answered Jun 17 '16 at 9:02









          AmastyAmasty

          6,16211354




          6,16211354












          • thank you so much for the answer. I didn't have time to check the fix yet. I'll let you now how was

            – AleGrinGo
            Jun 23 '16 at 3:11












          • @Amasty, I want to add new custom tab for customer account.Could you please guide how I can do this?

            – mageDev0688
            May 15 '17 at 11:13











          • @Amasty in routes.xml file you have to specify only id attribute of route node, and you are strongly advised to use a before or after tag's attribute to control the order Magento will check for matches in, to avoid accidental overrides of existing core controllers

            – Cristiano Casciotti
            Jul 12 '17 at 10:04


















          • thank you so much for the answer. I didn't have time to check the fix yet. I'll let you now how was

            – AleGrinGo
            Jun 23 '16 at 3:11












          • @Amasty, I want to add new custom tab for customer account.Could you please guide how I can do this?

            – mageDev0688
            May 15 '17 at 11:13











          • @Amasty in routes.xml file you have to specify only id attribute of route node, and you are strongly advised to use a before or after tag's attribute to control the order Magento will check for matches in, to avoid accidental overrides of existing core controllers

            – Cristiano Casciotti
            Jul 12 '17 at 10:04

















          thank you so much for the answer. I didn't have time to check the fix yet. I'll let you now how was

          – AleGrinGo
          Jun 23 '16 at 3:11






          thank you so much for the answer. I didn't have time to check the fix yet. I'll let you now how was

          – AleGrinGo
          Jun 23 '16 at 3:11














          @Amasty, I want to add new custom tab for customer account.Could you please guide how I can do this?

          – mageDev0688
          May 15 '17 at 11:13





          @Amasty, I want to add new custom tab for customer account.Could you please guide how I can do this?

          – mageDev0688
          May 15 '17 at 11:13













          @Amasty in routes.xml file you have to specify only id attribute of route node, and you are strongly advised to use a before or after tag's attribute to control the order Magento will check for matches in, to avoid accidental overrides of existing core controllers

          – Cristiano Casciotti
          Jul 12 '17 at 10:04






          @Amasty in routes.xml file you have to specify only id attribute of route node, and you are strongly advised to use a before or after tag's attribute to control the order Magento will check for matches in, to avoid accidental overrides of existing core controllers

          – Cristiano Casciotti
          Jul 12 '17 at 10:04


















          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%2f120389%2fadd-new-action-to-a-existing-magento-route-magento2%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

          Disable / Remove link to Product Items in Cart Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How can I limit products that can be bought / added to cart?Remove item from cartHide “Add to Cart” button if specific products are already in cart“Prettifying” the custom options in cart pageCreate link in cart sidebar to view all added items After limit reachedLink products together in checkout/cartHow to Get product from cart and add it againHide action-edit on cart page if simple productRemoving Cart items - ObserverRemove wishlist items when added to cart

          Helsingin valtaus Sisällysluettelo Taustaa | Yleistä sotatoimista | Osapuolet | Taistelut Helsingin ympäristössä | Punaisten antautumissuunnitelma | Taistelujen kulku Helsingissä | Valtauksen jälkeen | Tappiot | Muistaminen | Kirjallisuutta | Lähteet | Aiheesta muualla | NavigointivalikkoTeoksen verkkoversioTeoksen verkkoversioGoogle BooksSisällissota Helsingissä päättyi tasan 95 vuotta sittenSaksalaisten ylivoima jyräsi punaisen HelsinginSuomalaiset kuvaavat sotien jälkiä kaupungeissa – katso kuvat ja tarinat tutuilta kulmiltaHelsingin valtaus 90 vuotta sittenSaksalaiset valtasivat HelsinginHyökkäys HelsinkiinHelsingin valtaus 12.–13.4. 1918Saksalaiset käyttivät ihmiskilpiä Helsingin valtauksessa 1918Teoksen verkkoversioTeoksen verkkoversioSaksalaiset hyökkäävät Etelä-SuomeenTaistelut LeppävaarassaSotilaat ja taistelutLeppävaara 1918 huhtikuussa. KapinatarinaHelsingin taistelut 1918Saksalaisten voitonparaati HelsingissäHelsingin valtausta juhlittiinSaksalaisten Helsinki vuonna 1918Helsingin taistelussa kaatuneet valkokaartilaisetHelsinkiin haudatut taisteluissa kaatuneet punaiset12.4.1918 Helsingin valtauksessa saksalaiset apujoukot vapauttavat kaupunginVapaussodan muistomerkkejä Helsingissä ja pääkaupunkiseudullaCrescendo / Vuoden 1918 Kansalaissodan uhrien muistomerkkim

          Adjektiivitarina Tarinan tekeminen | Esimerkki: ennen | Esimerkki: jälkeen | Navigointivalikko