1

In which session or object, estimated shipping summary from cart is saving ?

When I checking checkout process, shipping form is pre-filling with that estimated information.

But any idea how we can take these values ?

[SOLVED]

I think Got it,

Magento2 saving data in local storage 'mage-cache-storage'.

Not sure, but I can see values there in shippingAddressFromData Object.

3
  • Are you talking about Cart page shipping method? Commented May 26, 2017 at 12:52
  • Yes, the cart summary box area
    – jpk
    Commented May 26, 2017 at 13:12
  • please let me know if you have any query Commented May 26, 2017 at 13:30

1 Answer 1

0

Shipping method value are saved in localstorage. You can find selected shipping rate from localstorage key, mage-cache-storage and get value from selectedShippingRate

File is responsible for that,

vendor/magento/module-checkout/view/frontend/web/js/view/cart/shipping-rates.js

Here function is called,

selectShippingMethod: function (methodData) {
    selectShippingMethodAction(methodData);
    checkoutData.setSelectedShippingRate(methodData['carrier_code'] + '_' + methodData['method_code']);
    return true;
}

Save logic from checkoutData.setSelectedShippingRate(methodData['carrier_code'] + '_' + methodData['method_code']);

Thanks.

7
  • Thanks. Do you think is it possible to change or call these values by custom javascript ?
    – jpk
    Commented May 29, 2017 at 5:30
  • @jpk Actually what do you want to do? Commented May 29, 2017 at 5:34
  • I have some custom shipping rate calculations based on city and zipcode. So need to set this shipping method and rate only if these inputs are valid. Right now i have done this calculation in cart page with jQuery and got response.. but i cannot able to set this new rate and method via javascript from jquery response.
    – jpk
    Commented May 29, 2017 at 5:39
  • @jpk,may be This is some complicated task. I think you have to ask new question for this issue with brief. May be someone expert do a help for you. Commented May 29, 2017 at 5:43
  • @jpk You can close this question so other users have useful in future. Commented May 30, 2017 at 5:38

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.