Magento 2.3 - Onepage checkout : on click of payment method ajax call removes items from order summaryOnepage Checkout - Get selected payment methodShipping price in one page checkout - order review return zeroOnepage checkout update payment section on radio button clickRemove “CHECKOUT METHOD” from onepageMagento 2.1.4: Order Summary Modal on Checkout BreakpointCheckout Order Summary Update Selected Payment MethodCan't validate Post Code on checkout pageMagento 2 checkout payment method add subtitleHide Shipping Method Title from Order SummaryMagento 2: i need update order summary when click custom option payment method checkmo

How do I get a list of only the files (not the directories) from a package?

Is there a way to save this session?

Explain Ant-Man's "not it" scene from Avengers: Endgame

Looking for an old image of designing a cpu with plan laid out / being edited on a literal floor

Applicants clearly not having the skills they advertise

Are there mythical creatures in the world of Game of Thrones?

Should this code fail to compile in C++17?

How do I get a cleat that's stuck in a pedal, detached from the shoe, out?

Can a helicopter mask itself from Radar?

How can I offer a test ride while selling a bike?

What is a natural deduction proof from ~(A↔B) to ~(A→B)?

Scala list with same adjacent values

How to write a vulnerable moment without it seeming cliche or mushy?

What is the intuition behind uniform continuity?

What is the right way to float a home lab?

Can The Malloreon be read without first reading The Belgariad?

Can an old DSLR be upgraded to match modern smartphone image quality

If Sweden was to magically float away, at what altitude would it be visible from the southern hemisphere?

Can you use a concentration spell while using Mantle of Majesty?

How can I grammatically understand "Wir über uns"?

How should I push back against my job assigning "homework"?

Recording the inputs of a command and producing a list of them later on

How can a single Member of the House block a Congressional bill?

The deliberate use of misleading terminology



Magento 2.3 - Onepage checkout : on click of payment method ajax call removes items from order summary


Onepage Checkout - Get selected payment methodShipping price in one page checkout - order review return zeroOnepage checkout update payment section on radio button clickRemove “CHECKOUT METHOD” from onepageMagento 2.1.4: Order Summary Modal on Checkout BreakpointCheckout Order Summary Update Selected Payment MethodCan't validate Post Code on checkout pageMagento 2 checkout payment method add subtitleHide Shipping Method Title from Order SummaryMagento 2: i need update order summary when click custom option payment method checkmo






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








0















I have one ajax call on payment method select:
select-payment-method.js



define(
[
'Magento_Checkout/js/model/quote',
'Magento_Checkout/js/model/full-screen-loader',
'jquery',
'Magento_Checkout/js/action/get-totals'
],
function (quote, fullScreenLoader, jQuery, getTotalsAction)
'use strict';
return function (paymentMethod)
quote.paymentMethod(paymentMethod);

fullScreenLoader.startLoader();
var tooltipText = "";
jQuery.ajax('/module_name/checkout/applyPaymentMethod',
data: payment_method: paymentMethod,
complete: function()
getTotalsAction([]);
fullScreenLoader.stopLoader();

);



);


ApplyPaymentMethod.php -> execute()



$result = $this->resultJsonFactory->create();

$pMethod = $this->getRequest()->getParam('payment_method');

$quote = $this->checkoutSession->getQuote();

$quote->getPayment()->setMethod($pMethod['method']);

$quote->setTotalsCollectedFlag(false);
$quote->collectTotals();
$this->quoteResource->save($quote);

return $result->setData(['quote' => $quote->getData()]);


Result: Total calculation getting correct but it removes items rendered in order summary section.



See Screenshot!
Before select payment method:
enter image description here



After select payment method:
enter image description here



any help would be appreciated. Thank you!










share|improve this question




























    0















    I have one ajax call on payment method select:
    select-payment-method.js



    define(
    [
    'Magento_Checkout/js/model/quote',
    'Magento_Checkout/js/model/full-screen-loader',
    'jquery',
    'Magento_Checkout/js/action/get-totals'
    ],
    function (quote, fullScreenLoader, jQuery, getTotalsAction)
    'use strict';
    return function (paymentMethod)
    quote.paymentMethod(paymentMethod);

    fullScreenLoader.startLoader();
    var tooltipText = "";
    jQuery.ajax('/module_name/checkout/applyPaymentMethod',
    data: payment_method: paymentMethod,
    complete: function()
    getTotalsAction([]);
    fullScreenLoader.stopLoader();

    );



    );


    ApplyPaymentMethod.php -> execute()



    $result = $this->resultJsonFactory->create();

    $pMethod = $this->getRequest()->getParam('payment_method');

    $quote = $this->checkoutSession->getQuote();

    $quote->getPayment()->setMethod($pMethod['method']);

    $quote->setTotalsCollectedFlag(false);
    $quote->collectTotals();
    $this->quoteResource->save($quote);

    return $result->setData(['quote' => $quote->getData()]);


    Result: Total calculation getting correct but it removes items rendered in order summary section.



    See Screenshot!
    Before select payment method:
    enter image description here



    After select payment method:
    enter image description here



    any help would be appreciated. Thank you!










    share|improve this question
























      0












      0








      0








      I have one ajax call on payment method select:
      select-payment-method.js



      define(
      [
      'Magento_Checkout/js/model/quote',
      'Magento_Checkout/js/model/full-screen-loader',
      'jquery',
      'Magento_Checkout/js/action/get-totals'
      ],
      function (quote, fullScreenLoader, jQuery, getTotalsAction)
      'use strict';
      return function (paymentMethod)
      quote.paymentMethod(paymentMethod);

      fullScreenLoader.startLoader();
      var tooltipText = "";
      jQuery.ajax('/module_name/checkout/applyPaymentMethod',
      data: payment_method: paymentMethod,
      complete: function()
      getTotalsAction([]);
      fullScreenLoader.stopLoader();

      );



      );


      ApplyPaymentMethod.php -> execute()



      $result = $this->resultJsonFactory->create();

      $pMethod = $this->getRequest()->getParam('payment_method');

      $quote = $this->checkoutSession->getQuote();

      $quote->getPayment()->setMethod($pMethod['method']);

      $quote->setTotalsCollectedFlag(false);
      $quote->collectTotals();
      $this->quoteResource->save($quote);

      return $result->setData(['quote' => $quote->getData()]);


      Result: Total calculation getting correct but it removes items rendered in order summary section.



      See Screenshot!
      Before select payment method:
      enter image description here



      After select payment method:
      enter image description here



      any help would be appreciated. Thank you!










      share|improve this question














      I have one ajax call on payment method select:
      select-payment-method.js



      define(
      [
      'Magento_Checkout/js/model/quote',
      'Magento_Checkout/js/model/full-screen-loader',
      'jquery',
      'Magento_Checkout/js/action/get-totals'
      ],
      function (quote, fullScreenLoader, jQuery, getTotalsAction)
      'use strict';
      return function (paymentMethod)
      quote.paymentMethod(paymentMethod);

      fullScreenLoader.startLoader();
      var tooltipText = "";
      jQuery.ajax('/module_name/checkout/applyPaymentMethod',
      data: payment_method: paymentMethod,
      complete: function()
      getTotalsAction([]);
      fullScreenLoader.stopLoader();

      );



      );


      ApplyPaymentMethod.php -> execute()



      $result = $this->resultJsonFactory->create();

      $pMethod = $this->getRequest()->getParam('payment_method');

      $quote = $this->checkoutSession->getQuote();

      $quote->getPayment()->setMethod($pMethod['method']);

      $quote->setTotalsCollectedFlag(false);
      $quote->collectTotals();
      $this->quoteResource->save($quote);

      return $result->setData(['quote' => $quote->getData()]);


      Result: Total calculation getting correct but it removes items rendered in order summary section.



      See Screenshot!
      Before select payment method:
      enter image description here



      After select payment method:
      enter image description here



      any help would be appreciated. Thank you!







      magento2 onepage-checkout magento2.3 payment order-summary






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 24 at 9:43









      Ronak ChauhanRonak Chauhan

      4,24911651




      4,24911651




















          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%2f275975%2fmagento-2-3-onepage-checkout-on-click-of-payment-method-ajax-call-removes-it%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%2f275975%2fmagento-2-3-onepage-checkout-on-click-of-payment-method-ajax-call-removes-it%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