Re: Extracting customer id from POS modal render extension

Solved

Extracting customer id from POS modal render extension

aamandeep
Shopify Partner
4 1 2

Hi Shopify Experts,

 

I am trying to extract customer id who has been logged into the POS application in the pos extension - 'pos.home.modal.render', but unable to do so:

 

Somewhere I noticed that below could work to extract customer details, but not working for me:

  • api.cart.subscribable.initial.customer.id
  • api.cart.subscribable.initial.customer.email
  • api.cart.subscribable.initial.customer.firstName
  • api.cart.subscribable.initial.customer.lastName

 

Thanks for your support.

 

Accepted Solution (1)
aamandeep
Shopify Partner
4 1 2

This is an accepted solution.

Eventually able to get customer id, but I had to subscribe to customer events using below code-base:

api.cart.subscribable.subscribe(cart => {console.log(cart.customer)})

View solution in original post

Replies 2 (2)
aamandeep
Shopify Partner
4 1 2

After putting this code snippet in the extension file - index.js, extension stopped working - it is throwing error

aamandeep
Shopify Partner
4 1 2

This is an accepted solution.

Eventually able to get customer id, but I had to subscribe to customer events using below code-base:

api.cart.subscribable.subscribe(cart => {console.log(cart.customer)})