sohelrana09 / magento2-module-delivery-date

Order Delivery date extension will allow customer to choose preferable delivery date for order.
71 stars 61 forks source link

try to add two fields but its getting only one fields data in console #2

Open sandeepsharma12412 opened 7 years ago

sandeepsharma12412 commented 7 years ago

Hello ,

I am try to add two fields in shipping form but when i am add second fields it not getting the value of second fields i am checked it in console it display the extension_attributes: only one values i am pass value like same in view/frontend/web/js / shipping-save-processor-default-override.js define( [ 'ko', 'jquery', 'Magento_Checkout/js/model/quote', 'Magento_Checkout/js/model/resource-url-manager', 'mage/storage', 'Magento_Checkout/js/model/payment-service', 'Magento_Checkout/js/model/payment/method-converter', 'Magento_Checkout/js/model/error-processor' ], function (ko, $, quote, resourceUrlManager, storage, paymentService, methodConverter, errorProcessor) { 'use strict'; return { saveShippingInformation: function() { var payload = {

            addressInformation: {
                    shipping_address: quote.shippingAddress(),
                    shipping_method_code: quote.shippingMethod().method_code,
                    shipping_carrier_code: quote.shippingMethod().carrier_code,
                    extension_attributes: {
                        delivery_date: $('[name="delivery-date"]').val(),
                         specific_delivery: $('[name="specific_delivery"]').val()
                    }
                }
            };

            return storage.post(
                resourceUrlManager.getUrlForSetShippingInformation(quote),
                JSON.stringify(payload)
            ).done(
                function (response) {
                    quote.setTotals(response.totals);
                    paymentService.setPaymentMethods(methodConverter(response.payment_methods));
                }
            ).fail(
                function (response) {
                    errorProcessor.process(response);
                }
            );
        }
    };
}

); could you please help me to resolved it.