How to override or extend proceed-to-checkout.jsExtending / Overriding JS in Magento 2Extend or override blanks theme jsHow Are the Things Magento 2 calls “mixins” Implemented?How to override Magento 2 js using Mixins?How to override price-utils.js specific method?Magento 2.2.5: How to validate shipping addressExtend a default JS component or Use Mixinhow to override Proceed to Checkout button in cart page in Magento 2Magento_Payment/translate not included in requirejs config for mixinsHow to extend admin js in magento 2 by mixins

How can I tell the difference between unmarked sugar and stevia?

Passing multiple files through stdin (over ssh)

Why doesn't Adrian Toomes give up Spider-Man's identity?

Overlapping String-Blocks

Should an arbiter claim draw at a K+R vs K+R endgame?

What can I, as a user, do about offensive reviews in App Store?

1980s live-action movie where individually-coloured nations on clouds fight

Do simulator games use a realistic trajectory to get into orbit?

What language is software running on the ISS written in?

What is the highest possible temporary AC at level 1, without any help from others?

Recommended tools for graphs and charts

Mathematically, why does mass matrix / load vector lumping work?

How to return a security deposit to a tenant

C++ Arduino IDE receiving garbled `char` from function

Soft question: Examples where lack of mathematical rigour cause security breaches?

How can I get an unreasonable manager to approve time off?

Is it a problem if <h4>, <h5> and <h6> are smaller than regular text?

Why would future John risk sending back a T-800 to save his younger self?

What is wrong with this proof that symmetric matrices commute?

Determining fair price for profitable mobile app business

Someone whose aspirations exceed abilities or means

Compiling C files on Ubuntu and using the executable on Windows

How to hide an urban landmark?

Why was the Sega Genesis marketed as a 16-bit console?



How to override or extend proceed-to-checkout.js


Extending / Overriding JS in Magento 2Extend or override blanks theme jsHow Are the Things Magento 2 calls “mixins” Implemented?How to override Magento 2 js using Mixins?How to override price-utils.js specific method?Magento 2.2.5: How to validate shipping addressExtend a default JS component or Use Mixinhow to override Proceed to Checkout button in cart page in Magento 2Magento_Payment/translate not included in requirejs config for mixinsHow to extend admin js in magento 2 by mixins






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








0















I need to override or extend Magento's proceed-to-checkout.js file in my module.
app/code/Magento/Checkout/view/frontend/web/js/proceed-to-checkout.js



In my modules requirejs-config.js I have tried using a mixin and also replacing the mapping with both...



var config = 
'config':
'mixins':
'Magento_Checkout/js/proceed-to-checkout':
'Mynamespace_Checkout/js/view/proceed-to-checkout-mixin': true



;


AND



var config = 
map:
'*':
proceedToCheckout: 'Mynamespace_Checkout/js/proceed-to-checkout'


;


Neither work and I'm unsure how I should write the mixin as Magento's original proceed-to-checkout.js file simply returns an anonymous function with a jQuery click event listener.



Any idea how I can get this to work in a module?










share|improve this question




























    0















    I need to override or extend Magento's proceed-to-checkout.js file in my module.
    app/code/Magento/Checkout/view/frontend/web/js/proceed-to-checkout.js



    In my modules requirejs-config.js I have tried using a mixin and also replacing the mapping with both...



    var config = 
    'config':
    'mixins':
    'Magento_Checkout/js/proceed-to-checkout':
    'Mynamespace_Checkout/js/view/proceed-to-checkout-mixin': true



    ;


    AND



    var config = 
    map:
    '*':
    proceedToCheckout: 'Mynamespace_Checkout/js/proceed-to-checkout'


    ;


    Neither work and I'm unsure how I should write the mixin as Magento's original proceed-to-checkout.js file simply returns an anonymous function with a jQuery click event listener.



    Any idea how I can get this to work in a module?










    share|improve this question
























      0












      0








      0








      I need to override or extend Magento's proceed-to-checkout.js file in my module.
      app/code/Magento/Checkout/view/frontend/web/js/proceed-to-checkout.js



      In my modules requirejs-config.js I have tried using a mixin and also replacing the mapping with both...



      var config = 
      'config':
      'mixins':
      'Magento_Checkout/js/proceed-to-checkout':
      'Mynamespace_Checkout/js/view/proceed-to-checkout-mixin': true



      ;


      AND



      var config = 
      map:
      '*':
      proceedToCheckout: 'Mynamespace_Checkout/js/proceed-to-checkout'


      ;


      Neither work and I'm unsure how I should write the mixin as Magento's original proceed-to-checkout.js file simply returns an anonymous function with a jQuery click event listener.



      Any idea how I can get this to work in a module?










      share|improve this question














      I need to override or extend Magento's proceed-to-checkout.js file in my module.
      app/code/Magento/Checkout/view/frontend/web/js/proceed-to-checkout.js



      In my modules requirejs-config.js I have tried using a mixin and also replacing the mapping with both...



      var config = 
      'config':
      'mixins':
      'Magento_Checkout/js/proceed-to-checkout':
      'Mynamespace_Checkout/js/view/proceed-to-checkout-mixin': true



      ;


      AND



      var config = 
      map:
      '*':
      proceedToCheckout: 'Mynamespace_Checkout/js/proceed-to-checkout'


      ;


      Neither work and I'm unsure how I should write the mixin as Magento's original proceed-to-checkout.js file simply returns an anonymous function with a jQuery click event listener.



      Any idea how I can get this to work in a module?







      checkout javascript mixins






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 30 at 11:40









      HollyHolly

      2,35933782




      2,35933782




















          1 Answer
          1






          active

          oldest

          votes


















          1














          Try following way:




          app/code/SR/MagentoCommunity/view/frontend/requirejs-config.js




          var config = 
          map:
          '*':
          "Magento_Checkout/js/proceed-to-checkout": 'SR_MagentoCommunity/js/proceed-to-checkout'


          ;



          app/code/SR/MagentoCommunity/view/frontend/web/js/proceed-to-checkout.js




          define([
          'jquery',
          'Magento_Customer/js/model/authentication-popup',
          'Magento_Customer/js/customer-data'
          ], function ($, authenticationPopup, customerData)
          'use strict';

          return function (config, element)
          console.log('new');
          $(element).click(function (event)
          var cart = customerData.get('cart'),
          customer = customerData.get('customer');

          event.preventDefault();

          if (!customer().firstname && cart().isGuestCheckoutAllowed === false)
          authenticationPopup.showModal();

          return false;

          $(element).attr('disabled', true);
          location.href = config.checkoutUrl;
          );

          ;
          );


          Clear static content if you are not in developer mode.






          share|improve this answer























          • Perfect, thanks!

            – Holly
            May 30 at 12:49











          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%2f276727%2fhow-to-override-or-extend-proceed-to-checkout-js%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









          1














          Try following way:




          app/code/SR/MagentoCommunity/view/frontend/requirejs-config.js




          var config = 
          map:
          '*':
          "Magento_Checkout/js/proceed-to-checkout": 'SR_MagentoCommunity/js/proceed-to-checkout'


          ;



          app/code/SR/MagentoCommunity/view/frontend/web/js/proceed-to-checkout.js




          define([
          'jquery',
          'Magento_Customer/js/model/authentication-popup',
          'Magento_Customer/js/customer-data'
          ], function ($, authenticationPopup, customerData)
          'use strict';

          return function (config, element)
          console.log('new');
          $(element).click(function (event)
          var cart = customerData.get('cart'),
          customer = customerData.get('customer');

          event.preventDefault();

          if (!customer().firstname && cart().isGuestCheckoutAllowed === false)
          authenticationPopup.showModal();

          return false;

          $(element).attr('disabled', true);
          location.href = config.checkoutUrl;
          );

          ;
          );


          Clear static content if you are not in developer mode.






          share|improve this answer























          • Perfect, thanks!

            – Holly
            May 30 at 12:49















          1














          Try following way:




          app/code/SR/MagentoCommunity/view/frontend/requirejs-config.js




          var config = 
          map:
          '*':
          "Magento_Checkout/js/proceed-to-checkout": 'SR_MagentoCommunity/js/proceed-to-checkout'


          ;



          app/code/SR/MagentoCommunity/view/frontend/web/js/proceed-to-checkout.js




          define([
          'jquery',
          'Magento_Customer/js/model/authentication-popup',
          'Magento_Customer/js/customer-data'
          ], function ($, authenticationPopup, customerData)
          'use strict';

          return function (config, element)
          console.log('new');
          $(element).click(function (event)
          var cart = customerData.get('cart'),
          customer = customerData.get('customer');

          event.preventDefault();

          if (!customer().firstname && cart().isGuestCheckoutAllowed === false)
          authenticationPopup.showModal();

          return false;

          $(element).attr('disabled', true);
          location.href = config.checkoutUrl;
          );

          ;
          );


          Clear static content if you are not in developer mode.






          share|improve this answer























          • Perfect, thanks!

            – Holly
            May 30 at 12:49













          1












          1








          1







          Try following way:




          app/code/SR/MagentoCommunity/view/frontend/requirejs-config.js




          var config = 
          map:
          '*':
          "Magento_Checkout/js/proceed-to-checkout": 'SR_MagentoCommunity/js/proceed-to-checkout'


          ;



          app/code/SR/MagentoCommunity/view/frontend/web/js/proceed-to-checkout.js




          define([
          'jquery',
          'Magento_Customer/js/model/authentication-popup',
          'Magento_Customer/js/customer-data'
          ], function ($, authenticationPopup, customerData)
          'use strict';

          return function (config, element)
          console.log('new');
          $(element).click(function (event)
          var cart = customerData.get('cart'),
          customer = customerData.get('customer');

          event.preventDefault();

          if (!customer().firstname && cart().isGuestCheckoutAllowed === false)
          authenticationPopup.showModal();

          return false;

          $(element).attr('disabled', true);
          location.href = config.checkoutUrl;
          );

          ;
          );


          Clear static content if you are not in developer mode.






          share|improve this answer













          Try following way:




          app/code/SR/MagentoCommunity/view/frontend/requirejs-config.js




          var config = 
          map:
          '*':
          "Magento_Checkout/js/proceed-to-checkout": 'SR_MagentoCommunity/js/proceed-to-checkout'


          ;



          app/code/SR/MagentoCommunity/view/frontend/web/js/proceed-to-checkout.js




          define([
          'jquery',
          'Magento_Customer/js/model/authentication-popup',
          'Magento_Customer/js/customer-data'
          ], function ($, authenticationPopup, customerData)
          'use strict';

          return function (config, element)
          console.log('new');
          $(element).click(function (event)
          var cart = customerData.get('cart'),
          customer = customerData.get('customer');

          event.preventDefault();

          if (!customer().firstname && cart().isGuestCheckoutAllowed === false)
          authenticationPopup.showModal();

          return false;

          $(element).attr('disabled', true);
          location.href = config.checkoutUrl;
          );

          ;
          );


          Clear static content if you are not in developer mode.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 30 at 12:40









          Sohel RanaSohel Rana

          24.3k34664




          24.3k34664












          • Perfect, thanks!

            – Holly
            May 30 at 12:49

















          • Perfect, thanks!

            – Holly
            May 30 at 12:49
















          Perfect, thanks!

          – Holly
          May 30 at 12:49





          Perfect, thanks!

          – Holly
          May 30 at 12:49

















          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%2f276727%2fhow-to-override-or-extend-proceed-to-checkout-js%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?