Commerce Server General - Problems with OrderDiscount in pipeline

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > February 2004 > Problems with OrderDiscount in pipeline





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Problems with OrderDiscount in pipeline
Brian Newton

2004-02-23, 1:35 pm

Hey all,

I'm having an issue with implementing discounts. I put in
a discount (in the bizdesk) wherein the user gets 10% off
the order subtotal if they purchase over 50 dollars.

Whenever the user does anything, I'm running the basket
pipeline of course, calculating discounts, totals etc. It
works fine for the most part. If the user has less than 50
dollars, it does no discount, if they have over 50
dollars, it gives them 10%. Even if I change the value of
the basket from under 50 to over 50, by increasing the
quantity of an item for example, it will rightly go from 0
discount to 10% of the subtotal.

However, if I take the total of the basket back below 50,
after the discount has already been applied, it throws an
error at me. This is something the user might do. Decide
they want 2 of a 20 dollar item instead of 3, and it
should remove the 10% discount. Instead, it gives me this
error:

Component Execution failed for component[0x7] hr:
0x80004005 ProgID: Commerce.OrderDiscount.1 Dictionary
error: Value for key 'MessageManager' in dictionary 'Pipe
Context' is missing (orderform=default)

I found this on MSDN, "The OrderDiscount component uses a
list to ensure integrity in the process. The component
stores a list of discounts that were applied and the last
time the discount was modified. If, on the next request,
discounts that were applied no longer apply, the
pur_dicountremoved error is added to the _Basket_Errors
list."

So it sounds like when a discount no longer applies to a
product, it records an error, and it's having trouble
recording that error... what'm I doing wrong? I'm using
all the basic components at teh default settings.
Michael O'Donovan [MSFT]

2004-02-26, 6:34 am

Hi Brian,

A MessageManager object is used by the pipline to display information/error
messages in the correct language of the current user. To set this up for a
ASP .Net CS2002 site you need to do the following 2 steps (you can also copy
this from the retail2002 site). Also I would highly recommed reading some
documentation on how resource files (.resx) can be used by an ASP .Net web
application to support multi-lingual site strings.

In summary.

1. You need to add entries to your web.config. These entries are standard
keywords that are used by the pipeline to display error messages.
2. You need to add a .resx file with the entries from the web.config and
their appropriate display text.

E.g in web config (note the culture name is for English in the US - replace
with your locale. And the namespace and assembly names match those of the
current project - in this case the retail 2002 site).

<messageManager>
<cultures default="en-US"
baseName="Microsoft.CommerceServer.Site.ProjectResources"
assembly="Microsoft.CommerceServer.Retail2002">
<culture id="en-US"/>

</cultures>
<resources>
<resource id="pur_badsku"/>
<resource id="pur_badplacedprice"/>
<resource id="pur_discount_changed"/>
<resource id="pur_discount_removed"/>
<resource id="pur_noitems"/>
<resource id="pur_badshipping"/>
<resource id="pur_badhandling"/>
<resource id="pur_badtax"/>
<resource id="pur_badcc"/>
<resource id="pur_badpayment"/>
<resource id="pur_badverify"/>
<resource id="pur_out_of_stock"/>
<resource id="pur_AddItem"/>
<resource id="pur_VariantPrice"/>
<resource id="unknown_shipping_method"/>
</resources>
</messageManager>


And then in the ProjectResources.en-US.resx file, make sure you have entries
for all of the above. (Note the locale name in the filename - en-US -
replace with your locale name)
e.g
<data name="pur_badsku">
<value>Please note that one or more items were removed from your
order because the product is no longer sold.</value>
</data>
<data name="pur_badplacedprice">
<value>Please note that prices of products in your order have been
updated.</value>
</data>
<data name="pur_discount_changed">
<value>One or more discounts have changed.</value>
</data>
<data name="pur_discount_removed">
<value>One or more discounts no longer apply.</value>
</data>
<data name="pur_noitems">
<value>An order must have at least one item.</value>
</data>
<data name="pur_badshipping">
<value>Unable to complete order: cannot compute shipping
cost.</value>
</data>
<data name="pur_badhandling">
<value>Unable to complete order: cannot compute handling
cost.</value>
</data>
<data name="pur_badtax">
<value>Unable to complete order: cannot compute tax.</value>
</data>
<data name="pur_badcc">
<value>The credit-card number you provided is not valid. Please
verify your payment information or use a different card.</value>
</data>
<data name="pur_badpayment">
<value>There was a problem authorizing your credit. Please verify
your payment information or use a different card.</value>
</data>
<data name="pur_badverify">
<value>Changes to the data require your review. Please review and
re-submit.</value>
</data>
<data name="pur_out_of_stock">
<value>At least one item is out of stock.</value>
</data>
<data name="pur_AddItem">
<value>Added item to the order.</value>
</data>
<data name="pur_VariantPrice">
<value>Price on variant</value>
</data>
<data name="unknown_shipping_method">
<value>The selected shipping option is not currently available.
Please choose another shipping option.</value>
</data>

Hope this helps



--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brian Newton" <anonymous@discussions.microsoft.com> wrote in message
news:01e201c3fa7b$6f99d5e0$a301280a@phx.gbl...
> Hey all,
>
> I'm having an issue with implementing discounts. I put in
> a discount (in the bizdesk) wherein the user gets 10% off
> the order subtotal if they purchase over 50 dollars.
>
> Whenever the user does anything, I'm running the basket
> pipeline of course, calculating discounts, totals etc. It
> works fine for the most part. If the user has less than 50
> dollars, it does no discount, if they have over 50
> dollars, it gives them 10%. Even if I change the value of
> the basket from under 50 to over 50, by increasing the
> quantity of an item for example, it will rightly go from 0
> discount to 10% of the subtotal.
>
> However, if I take the total of the basket back below 50,
> after the discount has already been applied, it throws an
> error at me. This is something the user might do. Decide
> they want 2 of a 20 dollar item instead of 3, and it
> should remove the 10% discount. Instead, it gives me this
> error:
>
> Component Execution failed for component[0x7] hr:
> 0x80004005 ProgID: Commerce.OrderDiscount.1 Dictionary
> error: Value for key 'MessageManager' in dictionary 'Pipe
> Context' is missing (orderform=default)
>
> I found this on MSDN, "The OrderDiscount component uses a
> list to ensure integrity in the process. The component
> stores a list of discounts that were applied and the last
> time the discount was modified. If, on the next request,
> discounts that were applied no longer apply, the
> pur_dicountremoved error is added to the _Basket_Errors
> list."
>
> So it sounds like when a discount no longer applies to a
> product, it records an error, and it's having trouble
> recording that error... what'm I doing wrong? I'm using
> all the basic components at teh default settings.



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com