InvisibleCommerce / shipped-suite-magento-module

0 stars 0 forks source link

widget does not display price on incognito #5

Closed stevenou closed 12 months ago

stevenou commented 12 months ago
$(document).ready(function() {
                    $do.get('.shipped-widget', function() {
                        const shippedWidget = new Shipped.Widget(localShippedConfig);
                        let subtotal = 0;
                        customerData.get('cart')().items.map((item)=>{
                            subtotal += item.product_price_value * item.qty;
                        }
                        );

customerData.get('cart') does not work (the first time) in incognito.

stevenou commented 12 months ago

possibly relevant

https://developer.adobe.com/commerce/php/development/cache/page/private-content/ https://magento.stackexchange.com/questions/361015/unable-to-access-custom-data-section-using-customerdata-get-inside-knockoutjs

stevenou commented 12 months ago

resolved by using checkoutConfig instead of customerData.get('cart')