Developer forum

Forum » Development » Orderline subscriber and customernumber

Orderline subscriber and customernumber

Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hi,

I'm subscribing to the notification Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.Line.Added, in order to update the unitprice of the product added.

In addition I'm using full impersonation and would like to get the customernumber from the Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.Line.AddedArgs, using args.Cart.CustomerNumber, but this is empty when using impersonation - even though a customernumber is present at both the primary and the secondary user.

Is this a bug or am I'm missing something? I'm using DW 9.4.15

--
Best regards
Kurt Moskjaer Andersen


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Kurt

The customer number is not present until a specific step in the cart - I do not think it is related to impersonation.

But you can just use User.Current property: https://doc.dynamicweb.com/api/html/25aa3b0f-43c4-65ea-948c-131abd318626.htm

Votes for this answer: 1
 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hi Nicolai,

This is a B2B-site, so all customers are created as users in advance, so all customers do have a customernumber.
I've tried without impersonation and then I had a non-empty customernumber.

I'll use the User.GetCurrentExtranetUser().CustomerNumber instead. Thanks :)

/Kurt

 

 

You must be logged in to post in the forum