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

          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