0

Im trying to get the order increment id after success place order is triggered. This is my method-renderer file:

define(
[
    'Magento_Checkout/js/view/payment/default',
    'Magento_Checkout/js/model/quote',
    'Magento_Customer/js/model/customer',
    'Magento_Checkout/js/model/full-screen-loader',
    'Magento_Checkout/js/model/totals',
    'Magento_Checkout/js/action/redirect-on-success',
    'Magento_Ui/js/model/messageList',
    'mage/url',
    'mage/translate',
],
function (Component, quote, customer, fullScreenLoader, totals, redirectOnSuccessAction, messageList, url, $t) {
    'use strict';

    return Component.extend({
        defaults: {
            template: 'Module_MyModule/payment/custom_module'
        },
        afterPlaceOrder: function () {
            // HERE I WANT THE ORDER INCREMENT ID
        },

        successPlaceOrder: function () {
            fullScreenLoader.stopLoader();
            this.placeOrder();
        },
        placeOrder: function() {
            let context = this;
            context.successPlaceOrder();
        }
    });
  }
);
1
0

You can catch an event to get order data when the payment is successful. You can try the event: checkout_onepage_controller_success_action

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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