cancel
Showing results for 
Search instead for 
Did you mean: 

retrieve NPOrder object with current cart

Former Member
0 Kudos

Hi,

Is there a way to pull out current cart into a NPOrder object on my aspx page within the commerce website?

Thanks,

David

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Here is the code to get current card into NPOrder.

myCart = New NPOrder(AccountID, CartType.Cart)

Thanks,

David

Former Member
0 Kudos

Hi David,

This will fail if the user is not logged in.

You should use the constructor with user and session:

order = new NPOrder(UserID, SessionID);

Both user and session can be found in NPBasePage.


NPBasePage bp = (NPBasePage)Page;

NPOrder o = new NPOrder(bp.UserID, bp.SessionID);