How can I add custom success pageCall custom phtml on success page without overridehow can i add a function...

How would photo IDs work for shapeshifters?

Is "plugging out" electronic devices an American expression?

How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?

How to make payment on the internet without leaving a money trail?

Why doesn't a const reference extend the life of a temporary object passed via a function?

If a centaur druid Wild Shapes into a Giant Elk, do their Charge features stack?

Can a planet have a different gravitational pull depending on its location in orbit around its sun?

A poker game description that does not feel gimmicky

Calculate Levenshtein distance between two strings in Python

Could a US political party gain complete control over the government by removing checks & balances?

Are cabin dividers used to "hide" the flex of the airplane?

How to manage monthly salary

Prime joint compound before latex paint?

Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?

Does it makes sense to buy a new cycle to learn riding?

Domain expired, GoDaddy holds it and is asking more money

What is the meaning of "of trouble" in the following sentence?

Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?

How could a lack of term limits lead to a "dictatorship?"

aging parents with no investments

Why was the "bread communication" in the arena of Catching Fire left out in the movie?

Why is the design of haulage companies so “special”?

Shall I use personal or official e-mail account when registering to external websites for work purpose?

What is the offset in a seaplane's hull?



How can I add custom success page


Call custom phtml on success page without overridehow can i add a function in magento2 success page?Magento 2 : How to load the order success pageCan we turn the checkout success page into a checkout step in Magento 2?How to test or style the order success page Or how to stop success Page redirecting in Magento2Add Bank Details to success pageHow to customize checkout success pageget payment method in the success page Magento 2 programmaticallyGet order id (not increment id) on success page?How to customize order succes page url and add some order details






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







1















I want to add custom success page by overriding it's phtml.



Can anyone guide me how can I do this?










share|improve this question





























    1















    I want to add custom success page by overriding it's phtml.



    Can anyone guide me how can I do this?










    share|improve this question

























      1












      1








      1








      I want to add custom success page by overriding it's phtml.



      Can anyone guide me how can I do this?










      share|improve this question














      I want to add custom success page by overriding it's phtml.



      Can anyone guide me how can I do this?







      magento2 order-success-page






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 17 hours ago









      Muhammad AnasMuhammad Anas

      419215




      419215






















          4 Answers
          4






          active

          oldest

          votes


















          4














          Copy This File :-



          vendor/magento/module-checkout/view/frontend/templates/success.phtml


          And Paste In Your Theme :-



          app/design/frontend/your/theme/Magento_Checkout/view/frontend/templates/


          After This You Can Change Success Page As Per Your Requirement






          share|improve this answer


























          • Magento_Catalog or Magento_Checkout ?

            – Muhammad Anas
            17 hours ago











          • Magento_Checkout

            – Ronak Rathod
            17 hours ago











          • Thanks Ronak Rathod, will try this one

            – Muhammad Anas
            17 hours ago











          • most welcome...

            – Ronak Rathod
            17 hours ago





















          3














          You can do it by overriding or extending checkout_onepage_success.xml with your custom module.
          Follow these steps:





          1. Create your Success.php Block file in vendormoduleBlockOnePage




          <?php
          namespace vendormoduleBlockOnePage;
          class Success extends MagentoFrameworkViewElementTemplate
          {
          public function getCustomSuccess()
          {
          return 'Your custom contents.';
          }
          }




          1. Create checkout_onepage_success.xml layout file in vendormoduleviewfrontendlayout




          <?xml version="1.0"?>
          <body>
          <referenceContainer name="order.success.additional.info">
          <block class="vendormoduleBlockOnePageSuccess"
          name="custom.order.success"
          template="Vendor_Module::order/success.phtml"
          after="-">
          </block>
          </referenceContainer>
          </body>




          1. Lastly, create phtml template file in vendormoduleviewfrontendtemplatesordersuccess.phtml




          <?php /* @var $block vendormoduleBlockOnePageSuccess */?>
          <?php echo __('This is a custom content.'); ?>
          <?php echo $block->getCustomSuccess(); ?>


          After done with the above steps, run the upgrade command and redeploy static view files.






          share|improve this answer



















          • 1





            Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago



















          3














          you need to copy



          vendor/magento/module-checkout/view/frontend/templates/success.phtml


          into



          app/design/frotend/<your package name/<your theme name>/Magento_Checkout/templates/success.phtml


          then do cache flush using below command



          php bin/mageno c:f


          Then check it






          share|improve this answer
























          • Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago



















          3














          Go to magento core file given path and Copy This File




          vendor/magento/module-checkout/view/frontend/templates/success.phtml




          And Paste In below path




          app/design/frontend/theme_package/theme_name/Magento_Checkout/view/frontend/templates/




          Run below command




          php bin/magento c:c



          php bin/magento c:f






          You can also do it in module way




          app/code/Namespace/Modulename/view/frontend/layout/checkout_onepage_success.xml




          <?xml version="1.0"?>
          <body>
          <referenceContainer name="order.success.additional.info">
          <block class="NamespaceModulenameBlockSuccess"
          name="test.order.success"
          template="Namespace_Modulename::order/success.phtml"
          after="-">
          </block>
          </referenceContainer>
          </body>



          app/code/Namespace/Modulename/view/frontend/templates/order/success.phtml




          <?php echo __('Custom template file content.'); ?>
          <?php echo $block->getSomething(); ?>


          I hope it helps






          share|improve this answer


























          • Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago











          • you are welcome. +1 for your appreciation :)

            – Chirag Patel
            17 hours ago












          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%2f269161%2fhow-can-i-add-custom-success-page%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          4 Answers
          4






          active

          oldest

          votes








          4 Answers
          4






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          Copy This File :-



          vendor/magento/module-checkout/view/frontend/templates/success.phtml


          And Paste In Your Theme :-



          app/design/frontend/your/theme/Magento_Checkout/view/frontend/templates/


          After This You Can Change Success Page As Per Your Requirement






          share|improve this answer


























          • Magento_Catalog or Magento_Checkout ?

            – Muhammad Anas
            17 hours ago











          • Magento_Checkout

            – Ronak Rathod
            17 hours ago











          • Thanks Ronak Rathod, will try this one

            – Muhammad Anas
            17 hours ago











          • most welcome...

            – Ronak Rathod
            17 hours ago


















          4














          Copy This File :-



          vendor/magento/module-checkout/view/frontend/templates/success.phtml


          And Paste In Your Theme :-



          app/design/frontend/your/theme/Magento_Checkout/view/frontend/templates/


          After This You Can Change Success Page As Per Your Requirement






          share|improve this answer


























          • Magento_Catalog or Magento_Checkout ?

            – Muhammad Anas
            17 hours ago











          • Magento_Checkout

            – Ronak Rathod
            17 hours ago











          • Thanks Ronak Rathod, will try this one

            – Muhammad Anas
            17 hours ago











          • most welcome...

            – Ronak Rathod
            17 hours ago
















          4












          4








          4







          Copy This File :-



          vendor/magento/module-checkout/view/frontend/templates/success.phtml


          And Paste In Your Theme :-



          app/design/frontend/your/theme/Magento_Checkout/view/frontend/templates/


          After This You Can Change Success Page As Per Your Requirement






          share|improve this answer















          Copy This File :-



          vendor/magento/module-checkout/view/frontend/templates/success.phtml


          And Paste In Your Theme :-



          app/design/frontend/your/theme/Magento_Checkout/view/frontend/templates/


          After This You Can Change Success Page As Per Your Requirement







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 17 hours ago

























          answered 17 hours ago









          Ronak RathodRonak Rathod

          1,227213




          1,227213













          • Magento_Catalog or Magento_Checkout ?

            – Muhammad Anas
            17 hours ago











          • Magento_Checkout

            – Ronak Rathod
            17 hours ago











          • Thanks Ronak Rathod, will try this one

            – Muhammad Anas
            17 hours ago











          • most welcome...

            – Ronak Rathod
            17 hours ago





















          • Magento_Catalog or Magento_Checkout ?

            – Muhammad Anas
            17 hours ago











          • Magento_Checkout

            – Ronak Rathod
            17 hours ago











          • Thanks Ronak Rathod, will try this one

            – Muhammad Anas
            17 hours ago











          • most welcome...

            – Ronak Rathod
            17 hours ago



















          Magento_Catalog or Magento_Checkout ?

          – Muhammad Anas
          17 hours ago





          Magento_Catalog or Magento_Checkout ?

          – Muhammad Anas
          17 hours ago













          Magento_Checkout

          – Ronak Rathod
          17 hours ago





          Magento_Checkout

          – Ronak Rathod
          17 hours ago













          Thanks Ronak Rathod, will try this one

          – Muhammad Anas
          17 hours ago





          Thanks Ronak Rathod, will try this one

          – Muhammad Anas
          17 hours ago













          most welcome...

          – Ronak Rathod
          17 hours ago







          most welcome...

          – Ronak Rathod
          17 hours ago















          3














          You can do it by overriding or extending checkout_onepage_success.xml with your custom module.
          Follow these steps:





          1. Create your Success.php Block file in vendormoduleBlockOnePage




          <?php
          namespace vendormoduleBlockOnePage;
          class Success extends MagentoFrameworkViewElementTemplate
          {
          public function getCustomSuccess()
          {
          return 'Your custom contents.';
          }
          }




          1. Create checkout_onepage_success.xml layout file in vendormoduleviewfrontendlayout




          <?xml version="1.0"?>
          <body>
          <referenceContainer name="order.success.additional.info">
          <block class="vendormoduleBlockOnePageSuccess"
          name="custom.order.success"
          template="Vendor_Module::order/success.phtml"
          after="-">
          </block>
          </referenceContainer>
          </body>




          1. Lastly, create phtml template file in vendormoduleviewfrontendtemplatesordersuccess.phtml




          <?php /* @var $block vendormoduleBlockOnePageSuccess */?>
          <?php echo __('This is a custom content.'); ?>
          <?php echo $block->getCustomSuccess(); ?>


          After done with the above steps, run the upgrade command and redeploy static view files.






          share|improve this answer



















          • 1





            Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago
















          3














          You can do it by overriding or extending checkout_onepage_success.xml with your custom module.
          Follow these steps:





          1. Create your Success.php Block file in vendormoduleBlockOnePage




          <?php
          namespace vendormoduleBlockOnePage;
          class Success extends MagentoFrameworkViewElementTemplate
          {
          public function getCustomSuccess()
          {
          return 'Your custom contents.';
          }
          }




          1. Create checkout_onepage_success.xml layout file in vendormoduleviewfrontendlayout




          <?xml version="1.0"?>
          <body>
          <referenceContainer name="order.success.additional.info">
          <block class="vendormoduleBlockOnePageSuccess"
          name="custom.order.success"
          template="Vendor_Module::order/success.phtml"
          after="-">
          </block>
          </referenceContainer>
          </body>




          1. Lastly, create phtml template file in vendormoduleviewfrontendtemplatesordersuccess.phtml




          <?php /* @var $block vendormoduleBlockOnePageSuccess */?>
          <?php echo __('This is a custom content.'); ?>
          <?php echo $block->getCustomSuccess(); ?>


          After done with the above steps, run the upgrade command and redeploy static view files.






          share|improve this answer



















          • 1





            Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago














          3












          3








          3







          You can do it by overriding or extending checkout_onepage_success.xml with your custom module.
          Follow these steps:





          1. Create your Success.php Block file in vendormoduleBlockOnePage




          <?php
          namespace vendormoduleBlockOnePage;
          class Success extends MagentoFrameworkViewElementTemplate
          {
          public function getCustomSuccess()
          {
          return 'Your custom contents.';
          }
          }




          1. Create checkout_onepage_success.xml layout file in vendormoduleviewfrontendlayout




          <?xml version="1.0"?>
          <body>
          <referenceContainer name="order.success.additional.info">
          <block class="vendormoduleBlockOnePageSuccess"
          name="custom.order.success"
          template="Vendor_Module::order/success.phtml"
          after="-">
          </block>
          </referenceContainer>
          </body>




          1. Lastly, create phtml template file in vendormoduleviewfrontendtemplatesordersuccess.phtml




          <?php /* @var $block vendormoduleBlockOnePageSuccess */?>
          <?php echo __('This is a custom content.'); ?>
          <?php echo $block->getCustomSuccess(); ?>


          After done with the above steps, run the upgrade command and redeploy static view files.






          share|improve this answer













          You can do it by overriding or extending checkout_onepage_success.xml with your custom module.
          Follow these steps:





          1. Create your Success.php Block file in vendormoduleBlockOnePage




          <?php
          namespace vendormoduleBlockOnePage;
          class Success extends MagentoFrameworkViewElementTemplate
          {
          public function getCustomSuccess()
          {
          return 'Your custom contents.';
          }
          }




          1. Create checkout_onepage_success.xml layout file in vendormoduleviewfrontendlayout




          <?xml version="1.0"?>
          <body>
          <referenceContainer name="order.success.additional.info">
          <block class="vendormoduleBlockOnePageSuccess"
          name="custom.order.success"
          template="Vendor_Module::order/success.phtml"
          after="-">
          </block>
          </referenceContainer>
          </body>




          1. Lastly, create phtml template file in vendormoduleviewfrontendtemplatesordersuccess.phtml




          <?php /* @var $block vendormoduleBlockOnePageSuccess */?>
          <?php echo __('This is a custom content.'); ?>
          <?php echo $block->getCustomSuccess(); ?>


          After done with the above steps, run the upgrade command and redeploy static view files.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 17 hours ago









          magefmsmagefms

          2,5612426




          2,5612426








          • 1





            Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago














          • 1





            Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago








          1




          1





          Thanks for the answer. +1

          – Muhammad Anas
          17 hours ago





          Thanks for the answer. +1

          – Muhammad Anas
          17 hours ago











          3














          you need to copy



          vendor/magento/module-checkout/view/frontend/templates/success.phtml


          into



          app/design/frotend/<your package name/<your theme name>/Magento_Checkout/templates/success.phtml


          then do cache flush using below command



          php bin/mageno c:f


          Then check it






          share|improve this answer
























          • Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago
















          3














          you need to copy



          vendor/magento/module-checkout/view/frontend/templates/success.phtml


          into



          app/design/frotend/<your package name/<your theme name>/Magento_Checkout/templates/success.phtml


          then do cache flush using below command



          php bin/mageno c:f


          Then check it






          share|improve this answer
























          • Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago














          3












          3








          3







          you need to copy



          vendor/magento/module-checkout/view/frontend/templates/success.phtml


          into



          app/design/frotend/<your package name/<your theme name>/Magento_Checkout/templates/success.phtml


          then do cache flush using below command



          php bin/mageno c:f


          Then check it






          share|improve this answer













          you need to copy



          vendor/magento/module-checkout/view/frontend/templates/success.phtml


          into



          app/design/frotend/<your package name/<your theme name>/Magento_Checkout/templates/success.phtml


          then do cache flush using below command



          php bin/mageno c:f


          Then check it







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 17 hours ago









          Sunil PatelSunil Patel

          1,3681612




          1,3681612













          • Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago



















          • Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago

















          Thanks for the answer. +1

          – Muhammad Anas
          17 hours ago





          Thanks for the answer. +1

          – Muhammad Anas
          17 hours ago











          3














          Go to magento core file given path and Copy This File




          vendor/magento/module-checkout/view/frontend/templates/success.phtml




          And Paste In below path




          app/design/frontend/theme_package/theme_name/Magento_Checkout/view/frontend/templates/




          Run below command




          php bin/magento c:c



          php bin/magento c:f






          You can also do it in module way




          app/code/Namespace/Modulename/view/frontend/layout/checkout_onepage_success.xml




          <?xml version="1.0"?>
          <body>
          <referenceContainer name="order.success.additional.info">
          <block class="NamespaceModulenameBlockSuccess"
          name="test.order.success"
          template="Namespace_Modulename::order/success.phtml"
          after="-">
          </block>
          </referenceContainer>
          </body>



          app/code/Namespace/Modulename/view/frontend/templates/order/success.phtml




          <?php echo __('Custom template file content.'); ?>
          <?php echo $block->getSomething(); ?>


          I hope it helps






          share|improve this answer


























          • Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago











          • you are welcome. +1 for your appreciation :)

            – Chirag Patel
            17 hours ago
















          3














          Go to magento core file given path and Copy This File




          vendor/magento/module-checkout/view/frontend/templates/success.phtml




          And Paste In below path




          app/design/frontend/theme_package/theme_name/Magento_Checkout/view/frontend/templates/




          Run below command




          php bin/magento c:c



          php bin/magento c:f






          You can also do it in module way




          app/code/Namespace/Modulename/view/frontend/layout/checkout_onepage_success.xml




          <?xml version="1.0"?>
          <body>
          <referenceContainer name="order.success.additional.info">
          <block class="NamespaceModulenameBlockSuccess"
          name="test.order.success"
          template="Namespace_Modulename::order/success.phtml"
          after="-">
          </block>
          </referenceContainer>
          </body>



          app/code/Namespace/Modulename/view/frontend/templates/order/success.phtml




          <?php echo __('Custom template file content.'); ?>
          <?php echo $block->getSomething(); ?>


          I hope it helps






          share|improve this answer


























          • Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago











          • you are welcome. +1 for your appreciation :)

            – Chirag Patel
            17 hours ago














          3












          3








          3







          Go to magento core file given path and Copy This File




          vendor/magento/module-checkout/view/frontend/templates/success.phtml




          And Paste In below path




          app/design/frontend/theme_package/theme_name/Magento_Checkout/view/frontend/templates/




          Run below command




          php bin/magento c:c



          php bin/magento c:f






          You can also do it in module way




          app/code/Namespace/Modulename/view/frontend/layout/checkout_onepage_success.xml




          <?xml version="1.0"?>
          <body>
          <referenceContainer name="order.success.additional.info">
          <block class="NamespaceModulenameBlockSuccess"
          name="test.order.success"
          template="Namespace_Modulename::order/success.phtml"
          after="-">
          </block>
          </referenceContainer>
          </body>



          app/code/Namespace/Modulename/view/frontend/templates/order/success.phtml




          <?php echo __('Custom template file content.'); ?>
          <?php echo $block->getSomething(); ?>


          I hope it helps






          share|improve this answer















          Go to magento core file given path and Copy This File




          vendor/magento/module-checkout/view/frontend/templates/success.phtml




          And Paste In below path




          app/design/frontend/theme_package/theme_name/Magento_Checkout/view/frontend/templates/




          Run below command




          php bin/magento c:c



          php bin/magento c:f






          You can also do it in module way




          app/code/Namespace/Modulename/view/frontend/layout/checkout_onepage_success.xml




          <?xml version="1.0"?>
          <body>
          <referenceContainer name="order.success.additional.info">
          <block class="NamespaceModulenameBlockSuccess"
          name="test.order.success"
          template="Namespace_Modulename::order/success.phtml"
          after="-">
          </block>
          </referenceContainer>
          </body>



          app/code/Namespace/Modulename/view/frontend/templates/order/success.phtml




          <?php echo __('Custom template file content.'); ?>
          <?php echo $block->getSomething(); ?>


          I hope it helps







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 17 hours ago

























          answered 17 hours ago









          Chirag PatelChirag Patel

          2,504423




          2,504423













          • Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago











          • you are welcome. +1 for your appreciation :)

            – Chirag Patel
            17 hours ago



















          • Thanks for the answer. +1

            – Muhammad Anas
            17 hours ago











          • you are welcome. +1 for your appreciation :)

            – Chirag Patel
            17 hours ago

















          Thanks for the answer. +1

          – Muhammad Anas
          17 hours ago





          Thanks for the answer. +1

          – Muhammad Anas
          17 hours ago













          you are welcome. +1 for your appreciation :)

          – Chirag Patel
          17 hours ago





          you are welcome. +1 for your appreciation :)

          – Chirag Patel
          17 hours ago


















          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%2f269161%2fhow-can-i-add-custom-success-page%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

          El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

          Castillo d'Acher Características Menú de navegación

          Connecting two nodes from the same mother node horizontallyTikZ: What EXACTLY does the the |- notation for...