Skip to Content
author's profile photo Former Member
Former Member

Automatically process coupons on shopping cart

Hi,

Following a very useful post on this subject I am halfway towards satisfactorily processing coupons automatically when shopping.aspx loads.

I find that sometimes the code works and other times it fails. The discount is also lost when saving a cart and retrieving it.

I have noticed that clearing the cart - so that there is no current cart ensures that the discount gets applied so the issue is with a cart pre-existing ... but exactly what else needs to be tested in the code to ensure that it fires every time shopping.aspx is loaded? I can see that this may be tied up with CustomerKey but how?

{

NPBasePage bp = (NPBasePage)Page;

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

NPOrderDiscount disc = new NPOrderDiscount("5%Discount", bp.ConnectionString);

NPOrderDiscount disc1 = new NPOrderDiscount("10%Discount", bp.ConnectionString);

try

{

disc.QualifyDiscount(order);

}

// account was not authorised to use the disc code

catch (Exception discex)

{

}

try

{

disc1.QualifyDiscount(order);

}

catch (Exception discex)

{

}

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 22, 2009 at 06:58 AM

    Additionally, I noted in the API help that there was reference to the OrderDiscount.DsiplayType field in Webtools, which indicates two values :automatic and manual. This is not visible in the Admin UI.

    Is this functionality still operational or a remnant from an earlier version which is no longer supported?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.