1

Checkout Shipping address page I need set custom item row total..how can i do??? enter image description here

0

1 Answer 1

0

In your js file (it can be your extended uiComponent):

    define(
        [
            'jquery',
            'Magento_Checkout/js/model/quote',
            'Magento_Checkout/js/model/url-builder',
            'mage/storage',
            'Magento_Customer/js/model/customer'
        ],
        function ($, quote, urlBuilder, storage, customer) {
            'use strict';

            return function (deferred, messageContainer) {
                var serviceUrl;
                /**
                 * Checkout for guest and registered customer.
                 */
                if (!customer.isLoggedIn()) {
                    serviceUrl = urlBuilder.createUrl('/guest-carts/:cartId/payment-information', {
                        cartId: quote.getQuoteId()
                    });
                } else {
                    serviceUrl = urlBuilder.createUrl('/carts/mine/payment-information', {});
                }

                storage.get(
                    serviceUrl, false
                ).done(
                    function (response) {
                        // set items totals
                        response.totals.items.forEach(function (item, index) {
                            item.row_total = 0;
                            item.row_total_incl_tax = 0;
                            item.row_total_with_discount = 0;
                        });

                        quote.setTotals(response.totals);
                    }
                ).fail(
                    function (response) {
                        //
                    }
                );
            };
        }
    );

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.