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

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

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?