user1482800
user1482800

Reputation: 83

How to access customer info on PDP page | SCA Kilamanjaro

Is there a way we can access customer info like, email and name on a product detail page and access as a variable (like a handlebar variable)?

Upvotes: 0

Views: 262

Answers (1)

Romeo
Romeo

Reputation: 149

You can use the Profile.Model and then get the instance of the profile model like ProfileModel.getInstance(). There you can get the Customers data.

The other way of doing that via backend is using the Commerce API customer. It is inside the Models.Init module.

These are the methods that is available under Customer API

  • addAddress(address)
  • addCreditCard(creditcard)
  • emailCustomer(subject, body)
  • getAddress(addressid, fields)
  • getAddressBook(fields)
  • getCampaignSubscriptions(fields)
  • getCampaignSubscriptions(subscriptionId,fields)
  • getCreditCard(creditcardid, fields)
  • getCreditCards(fields)
  • getCustomFields()
  • getCustomFieldValues()
  • getFieldValues(fields)
  • isGuest()
  • removeAddress(addressid)
  • removeCreditCard(creditcardid)
  • setLoginCredentials(customer)
  • updateAddress(address)
  • updateCampaignSubscriptions(subscriptions)
  • updateCreditCard(creditcard)
  • updateProfile(customer)

Upvotes: 1

Related Questions