2

I want to find jquery code and execute order processing when click on place order in checkout page beacuse i logged in and when I select shipping address and switch to payment step and unchecked of same as shipping address in billing and add new billing address and when I click place order button it automatically checked checkobx of 'My billing address as shipping address'.

2
  • not sure, check this code : skin/frontend/{package}/{theme}/js/opcheckout.js Jan 3, 2017 at 7:42
  • @BabyinMagento I am asking for magento 2 Jan 3, 2017 at 9:06

4 Answers 4

2

These two files.

PATH:

html/vendor/magento/module-checkout/view/frontend/web/js/action/place-order.js:12

.

html/vendor/magento/module-checkout/view/frontend/web/js/view/review/actions/default.js:17

1

PATH :

magento2/pub/static/frontend/Magento/{{THEME}}/en_US/Magento‌​_Checkout/js/action/‌​place-order.js

5
  • He/she is asking for magento 2 not for magento 1
    – ND17
    Jan 3, 2017 at 8:07
  • I am asking magento 2 Jan 3, 2017 at 9:06
  • Where is this skin/frontend/base/default/js/opcheckout.js path in magento 2 ? Jan 4, 2017 at 5:54
  • If you tell me where is located after click place order jquery ajax process data I will accept your answer and up vote for you Jan 4, 2017 at 5:58
  • Here is the place order js , PATH : magento2/pub/static/frontend/Magento/{{THEME}}/en_US/Magento_Checkout/js/action/place-order.js Jan 4, 2017 at 12:13
1

Click on place order button in checkout page called on the file :

/vendor/magento/module-checkout/view/frontend/web/js/action/place-order.js

/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/**
 * @api
 */
define([
    'Magento_Checkout/js/model/quote',
    'Magento_Checkout/js/model/url-builder',
    'Magento_Customer/js/model/customer',
    'Magento_Checkout/js/model/place-order'
], function (quote, urlBuilder, customer, placeOrderService) {
    'use strict';

    return function (paymentData, messageContainer) {
        var serviceUrl, payload;

        payload = {
            cartId: quote.getQuoteId(),
            billingAddress: quote.billingAddress(),
            paymentMethod: paymentData
        };

        if (customer.isLoggedIn()) {
            serviceUrl = urlBuilder.createUrl('/carts/mine/payment-information', {});
        } else {
            serviceUrl = urlBuilder.createUrl('/guest-carts/:quoteId/payment-information', {
                quoteId: quote.getQuoteId()
            });
            payload.email = quote.guestEmail;
        }

        return placeOrderService(serviceUrl, payload, messageContainer);
    };
});
-2

try to add custom code here

/module-checkout/view/frontend/web/js/view/shipping-address/address-renderer/default.js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.