diff --git a/src/view/frontend/templates/initiate-storage.phtml b/src/view/frontend/templates/initiate-storage.phtml index 40600eb2..eb5ae418 100644 --- a/src/view/frontend/templates/initiate-storage.phtml +++ b/src/view/frontend/templates/initiate-storage.phtml @@ -26,9 +26,11 @@ $localStorageViewModel = $block->getData('hyva_react_checkout_localstorage'); var storageData = { customer: { billing_address_id: 'cart_billing_address', - shipping_address_id: 'cart_shipping_address', + shipping_address_id: 'cart_shipping_address' }, - is_billing_same_as_shipping: storageConfig.isBillingSameAsShipping, + cart: { + is_billing_same_as_shipping: storageConfig.isBillingSameAsShipping + } }; if (!isLoggedIn) { @@ -52,7 +54,7 @@ $localStorageViewModel = $block->getData('hyva_react_checkout_localstorage'); storageData.customer.billing_address_id = billingAddressId; storageData.customer.shipping_address_id = shippingAddressId; - storageData.is_billing_same_as_shipping = billingAddressId === shippingAddressId; + storageData.cart.is_billing_same_as_shipping = billingAddressId === shippingAddressId; window.localStorage.setItem(storageKey, JSON.stringify(storageData)); } diff --git a/src/view/frontend/templates/luma/initiate-storage.phtml b/src/view/frontend/templates/luma/initiate-storage.phtml index 79f0d9dc..6bf24095 100644 --- a/src/view/frontend/templates/luma/initiate-storage.phtml +++ b/src/view/frontend/templates/luma/initiate-storage.phtml @@ -26,9 +26,11 @@ $localStorageViewModel = $block->getData('hyva_react_checkout_localstorage'); var storageData = { customer: { billing_address_id: 'cart_billing_address', - shipping_address_id: 'cart_shipping_address', + shipping_address_id: 'cart_shipping_address' }, - is_billing_same_as_shipping: storageConfig.isBillingSameAsShipping, + cart: { + is_billing_same_as_shipping: storageConfig.isBillingSameAsShipping + } }; if (!isLoggedIn) { @@ -64,7 +66,7 @@ $localStorageViewModel = $block->getData('hyva_react_checkout_localstorage'); storageData.customer.billing_address_id = billingAddressId; storageData.customer.shipping_address_id = shippingAddressId; - storageData.is_billing_same_as_shipping = billingAddressId === shippingAddressId; + storageData.cart.is_billing_same_as_shipping = billingAddressId === shippingAddressId; window.localStorage.setItem(storageKey, JSON.stringify(storageData)); }