1

I input some information at the checkout. It write in mage-cache-storage.enter image description here When I reload checkout page mage-cache-storage are clearing. Why is this happening? How I can fix it? Thanks in advance.

I found core file for testing. Path is: vendor/magento/module-checkout/etc/frontend/sections.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="checkout/cart/add">
        <section name="cart"/>
    </action>
    <action name="checkout/cart/delete">
        <section name="cart"/>
    </action>
    <action name="checkout/index/index">
        <section name="checkout-data"/>
    </action>
    <action name="checkout/cart/updatePost">
        <section name="cart"/>
    </action>
    <action name="checkout/cart/updateItemOptions">
        <section name="cart"/>
    </action>
    <action name="checkout/cart/couponPost">
        <section name="cart"/>
    </action>
    <action name="checkout/cart/estimatePost">
        <section name="cart"/>
    </action>
    <action name="checkout/cart/estimateUpdatePost">
        <section name="cart"/>
    </action>
    <action name="checkout/onepage/saveOrder">
        <section name="cart"/>
        <section name="checkout-data"/>
        <section name="last-ordered-items"/>
    </action>
    <action name="checkout/sidebar/removeItem">
        <section name="cart"/>
    </action>
    <action name="checkout/sidebar/updateItemQty">
        <section name="cart"/>
    </action>
    <action name="rest/*/V1/carts/*/payment-information">
        <section name="cart"/>
        <section name="checkout-data"/>
        <section name="last-ordered-items"/>
    </action>
    <action name="rest/*/V1/guest-carts/*/payment-information">
        <section name="cart"/>
        <section name="checkout-data"/>
    </action>
    <action name="rest/*/V1/guest-carts/*/selected-payment-method">
        <section name="cart"/>
        <section name="checkout-data"/>
    </action>
    <action name="rest/*/V1/carts/*/selected-payment-method">
        <section name="cart"/>
        <section name="checkout-data"/>
    </action>
</config>

And added here

<action name="checkout/*">
 <section name="checkout-data"/>
</action>
  • Please share how you trying to save those data in browser storage – kunj Aug 11 '18 at 9:25
  • @kunj I added in etc/section.xml <action name="checkout/*"> <section name="checkout-data"/> </action> – Павел Кушнеревич Aug 11 '18 at 21:27
  • Which data wants to reload you can do by sections.xml – Prince Yadav Aug 16 '18 at 11:01
  • @PrinceYadav all shipping address and email. But I add <action name="checkout/*"> <section name="checkout-data"/> </action>, but it doesn't work – Павел Кушнеревич Aug 16 '18 at 14:42
  • can you edit on sample code – Prince Yadav Aug 17 '18 at 5:14
3
+50

Magento assumes that customer's private data is changed when a customer sends some state modification request (POST, PUT, DELETE). To minimize the load on server, developers should specify which action (or request) updates which customer data section in etc/section.xml.

<action name="checkout/cart/add">
    <section name="cart"/>
</action>

Also further reading:

  • I added <action name="checkout/*"> <section name="checkout-data"/> </action>, but it doesn't work – Павел Кушнеревич Aug 10 '18 at 11:13

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.