Questions tagged [customer-data]

Use this tag on the questions about the customer-data.js library used in the Magento 2

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Why does my free-shipping.phtml template only show in my minicart when i'm in checkout/cart page?

I have a custom free-shipping.phtml template which shows the amount remaining until free shipping. I can see it only in my minicart when i'm in checkout/cart page. I referenced the container with the ...
Zaki Azizi's user avatar
0 votes
1 answer
316 views

How to update and change existing customer address data using CSV

How to update and change existing customer address data using CSV. Also I have tried importing customer data using CSV but it creates a new address and not an existing address. system->import->...
Bhavin007's user avatar
0 votes
0 answers
51 views

JavaScript not executed when it has Magento_Customer/js/customer-data dependencia in define

I have a JS file like this: define([ 'jquery', 'underscore', 'matchMedia', 'text!ajaxcart/template/modal-slide.html', 'text!ajaxcart/template/modal-popup.html', ...
Eliacim DAVILA - CENSERE's user avatar
1 vote
1 answer
538 views

Magento_Customer/js/customer-data not returning product items data

I am in the process of upgrading magento 2.3.5 ( commerce version ) to 2.4.4 ( commerce version ) commerce version also known as enterprise edition On testing the 2.4.4 version I noticed that the code ...
Mohd Farhan Bin Ramli's user avatar
1 vote
1 answer
366 views

Unable to access custom data section using customerData.get() inside KnockoutJS component

I am following this in order to create new section https://developer.adobe.com/commerce/php/development/cache/page/private-content/ All is working if I request '{localhost}/customer/section/load', the ...
Ilja Polanskis's user avatar
0 votes
1 answer
277 views

Cannot create property 'cart' on string '{}lax'

I have a very annoying problem: randomly our customers get the next javascript error, which hangs the shopping process, it also appears in the cart view. Has anyone had this problem? what's happening ...
Bob's user avatar
  • 15
0 votes
0 answers
324 views

Override third party module customerData class defined in di.xml arguments

I have a third party module that has this class app/code/Vendor/ModuleName/CustomerData/Popup.php and that class is defined in the frontend/di.xml file like this <type name="Magento\...
Korbin's user avatar
  • 298
0 votes
1 answer
576 views

Magento2 Customer-data-js uncaught-error-object-object

getting below console error when customer LoggedIn in Magento 2.4.1. Uncaught Error: [object Object] at Object. (customer-data.js:86) at fire (jquery.js:3099) at Object.fireWith [as rejectWith] (...
Vamsi Krishna's user avatar
2 votes
1 answer
2k views

Magento 2 - Can not get the customer data from customer-data.js file in Magento 2.3.6 p1

I'm using Magento 2.3.6 p1. And I want to observe the customers when they logged in. I used this in my Js file but it returned undefined when I console.log the first name value. It happened both when ...
Nguyen Duc Tung's user avatar
1 vote
2 answers
416 views

Recover customer data on product page

I am trying to recover customer data on product page as I cannot pass by php because of full page cache I want to do it in js. I added an phtml block on my page in footer, catalog_product_view.xml <...
Océane's user avatar
  • 38
0 votes
1 answer
150 views

Customer Login not working after data migration From Magento 1.4.1 to Magento 2.3.3

I have migrated data from Magento 1.4.1 to Magento 2.3.3 using Magento Data Migration tool. Data has migrated successfully but Magento 1 customer login not working in Magento 2.3.3. I know there is a ...
Pritam Biswas's user avatar
3 votes
2 answers
3k views

Magento2 : require('Magento_Customer/js/customer-data') not loading always

I am trying to get the cart items in phtml file (product detail page) using jquery script. Here is the script: require([ 'jquery', 'jquery/ui'], function($,item){ item = require('Magento_Customer/js/...
Rahul Singh's user avatar
  • 1,650
-1 votes
1 answer
210 views

Append section data in ajax add to cart

How we can add our own section data after ajax add to cart and use it display in pupup. I want to add my data here in the response. https://prnt.sc/q9v5tq and when add to cart done i want to show it ...
MageLerner's user avatar
1 vote
0 answers
169 views

Magento 2: How to show loader while customer-data is loading from server?

define([ 'Magento_Ui/js/form/form', 'Magento_Customer/js/customer-data' ], function (Component, customerData) { 'use strict'; return Component.extend({ isLoggedIn: function () {...
Milind Singh's user avatar
  • 1,584
3 votes
2 answers
895 views

Javascript customer data, options is undefined in Firefox

I have tis issue with the customer-data Javascript object. Her is (a par of my code) define([ 'jquery', "Magento_Customer/js/customer-data" ], function ($, customerData) { 'use strict'; ...
Arno Vande Cappelle's user avatar
2 votes
1 answer
1k views

How to call customerData js in phtml on a specific page after page load

I need to call some js in a phtml file only on product details page. I need to check some customer attribute there and show a popup accordingly. The issue I am facing is that somehow I am unable to ...
Narendra Vyas's user avatar
0 votes
1 answer
381 views

I am getting Cannot read property 'sectionLoadUrl' of undefined in particular form in magento 2.3.0

This getting this error on a particular form in Magento 2.3.0. I think this error causes invalid form key sometimes when submitting the form. How to solve this following error. Uncaught TypeError: ...
Kowsigan Atsayam's user avatar
1 vote
0 answers
364 views

Magento 2 TypeError: options is undefined in firefox

After working for few day I noticed that I am getting this issue in my Firefox and not in Chrome. TypeError: options is undefined If I do cache clean and check in Firefox it works for the first ...
fernandus's user avatar
  • 484
1 vote
2 answers
2k views

How to Override WishList Customer Data in magento 2

i Want to Override Magento\Wishlist\CustomerData\Wishlist public function getSectionData() { $counter = $this->getCounter(); return [ 'counter' => $counter, ...
Waqar Ali's user avatar
  • 2,319
0 votes
1 answer
859 views

How do you pass more / custom parameters to the customer bind / private data in knockout

So this is an extension of this question Magento 2.3 display logged in/out message using private content Default behavior is that data-bind="scope: 'customer' has a few properties eg data_id: ...
Dominic Pixie's user avatar
1 vote
2 answers
1k views

Magento 2.3 display logged in/out message using private content

Does anyone have an example on how to display a logged in vs logged out message on frontend to customer that's not affected by cache without using the cache=false tag and hole punching the whole page ...
Dominic Pixie's user avatar
0 votes
1 answer
266 views

sectionLoadUrl error while updating cart price total Magento 2

I am updating the cart total price dynamically without page reload. I wrote code in js file require( [ 'Magento_Checkout/js/model/cart/cache', 'Magento_Checkout/js/model/cart/totals-processor/...
summu's user avatar
  • 847
0 votes
1 answer
240 views

Overriding CustomerData/Cart.php removes Total from MiniCart Magento 2

I have overridden \vendor\magento\module-checkout\CustomerData\Cart.php file in my custom plugin using di.xml using below code: <preference for="Magento\Checkout\CustomerData\Cart" ...
Khushbu's user avatar
  • 825
0 votes
1 answer
151 views

Questions about using knockout

I would like add a feature to show a data like the "Welcome username". So i searched about how it works and i followed this tutorial I'm blocked because i'm always getting the error unable to process ...
help's user avatar
  • 53
1 vote
2 answers
2k views

Magento 2 origData null in customer_save_before

I have created an observer on the customer_save_before event. Surprisingly $observer->getEvent()->getCustomer()->getOrigData() is null. Is my expectation wrong? This is also happening for ...
Radu's user avatar
  • 460
0 votes
1 answer
39 views

Show product catalog based on Customer

how can I show catalog products based on customer custom field ? I've done di.xml I've done this but is doesn't filter . This is what I have in ListProduct.php (used in di.xml) protected function ...
Morgan Tartreau's user avatar
1 vote
1 answer
534 views

Magento2 : Getting error in console customer-data.js:86

I am using Magento2.1.9 getting this error in our console i am trying to different solutions but not fix it.please if any one know reply me
Rv Singh's user avatar
  • 1,617
2 votes
1 answer
2k views

Unable de reload customer data section

I discover that some native route are listed in the section xml file without any section : <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
Pierre Gauthier's user avatar
0 votes
1 answer
400 views

How to render HTML entities in the wishlist sidebar

I have added the © symbol to product names in Magento 2. These all appear fine on the category and product pages, however when I add an item to my wishlist the product name appears with the text &...
Ryan Copeland's user avatar
0 votes
2 answers
1k views

Unable to call function in ajax success in magento2

I have found below error: > Uncaught TypeError: Cannot read property 'set' of undefined. Code: <script> require(['jquery','Magento_Customer/js/customer-data','domReady!'], function ($, ...
Unknown's user avatar
  • 581
0 votes
1 answer
4k views

In magento 2 How to get all customer data without using object manager? [closed]

In customer module need to show all customer data whatever I want?
Ajithkumar's user avatar
1 vote
1 answer
2k views

Magento 2 :What is the different between invalidate and reload if they both update the sections?

If some section should be updated then customerData.invalidate(sections) if you sure, that you really need update some section you can always do something like this: customerData.reload(['cart'], ...
Eugene Kapelko's user avatar
4 votes
4 answers
3k views

Get wishlist item's array

I made an add to wishlist with ajax module and I want to indicate if the product is already in wishlist without breaking the full page cache. I know the wishlist object is in customer-data but I can't ...
Vlad Patru's user avatar
  • 1,200
2 votes
3 answers
9k views

customer-data.js error: .../section/load/?sections=instant-purchase&... JS error

I keep getting a JS error in my site, it's an ajax get request to http://domain.com/customer/section/load/?sections=instant-purchase&update_section_id=false&_=1517327157790 which results in a "...
Lez's user avatar
  • 2,907
3 votes
2 answers
20k views

How to force reloading of a customer data section?

I'm using CustomerData library to display private content (Magento docs). I see that in etc/frontend/sections.xml I can configure which requests would result in requesting the data from the server ...
Jānis Elmeris's user avatar
11 votes
6 answers
29k views

Magento 2 customer-data.js:90:23 [object Object]

I'm using Magento 2.2 with Porto theme and getting an [object Object] javascript error at customer-data.js line 90 in the console after logging into the store and refreshing the page or switching to ...
Lez's user avatar
  • 2,907