|
Home > Archive > Commerce Server General > September 2005 > Discounts dont apply, CS2002 SP3 & FP1
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 |
Discounts dont apply, CS2002 SP3 & FP1
|
|
|
| Discounts dont apply, CS2002 SP3 & FP1
Having some trouble getting discounts to apply on my site. I have read
a number of posts about this and have tried a number of suggested
solutions to no avail.
I am running and ASP.NET site (1.1) against commerce server 2002 with
service pack 3 and feature pack 1
There are numerous symptoms to this problem but on that may be telling
is the fact that a discount created with the Discount Manager
application does not show in Business Desk.
I have created a simple discount to give the user 1.00 off of a
specific product; in order to test this discount I have created code
which will create a basket, add the discounted item and run the
basket pipeline. My basket pipeline includes the Order Adjust Price
stage with 3 components which are (in order) OrderDiscount,
OrderLevelDiscountApply and RequiredOrderAdjustPriceCy. The code I am
using to test this process can be found below.
private static string DiscountPrice( Guid userId, string
catalogName, string productId)
{
string errorMessages = string.Empty;
string returnValue = string.Empty;
string variantId = null;
OrderContext orders = CommerceContext.Current.OrderSystem;
OrderTemplate discountBasket = orders.CreateOrderTemplate( userId
);
discountBasket.OrderForms.Add(new
Microsoft.CommerceServer.Runtime.Orders.OrderForm( DISCOUNT_PRICES
));
discountBasket.OrderForms[ 0 ].LineItems.Add( new LineItem(
catalogName, productId, variantId, 1 ) );
PipelineInfo pipeInfo = new PipelineInfo( "basket" );
if( CommerceContext.Current.UserProfile != null )
{
pipeInfo.Profiles.Add( "User", CommerceContext.Current.UserProfile
);
}
if( CommerceContext.Current.TargetingSystem.TargetingContextProfile
!= null )
{
pipeInfo.Profiles.Add( "TargetingContext",
CommerceContext.Current.TargetingSystem.TargetingContextProfile);
}
discountBasket.RunPipeline( pipeInfo );
returnValue = discountBasket.OrderForms[ 0 ].LineItems[ 0 ][
"_cy_itemlevel_discounts_subtotal" ].ToString();
return returnValue;
}
I have also looked closely at the log file that is generated for the
pipeline and cannot spot any problems, the output for the
OrderDiscount and OrderLevelDiscountApply are below
PIPELINE:++ component[0x7] about to be called ProgID:
Commerce.OrderDiscount.1
RootObject: ReadValue _currency_decimal_
places VT_NULL __null__ VT_EMPTY __empty
__
RootObject: ReadValue _currency_lcid VT_
I4 0 VT_EMPTY __empty__
RootObject: ReadValue _discounts VT_NULL
__null__ VT_EMPTY __empty__
RootObject: WriteValue _discounts VT_EMP
TY __empty__ VT_DISPATCH PV=[0x8c66b04]
RootObject: ReadValue items VT_DISPATCH
PV=[0xce4aaf0] VT_EMPTY __empty__
RootObject: WriteValue _event VT_EMPTY _
_empty__ VT_BSTR SOLD
RootObject: WriteValue _winners VT_EMPTY
__empty__ VT_DISPATCH PV=[0x8c66a80]
RootObject: ReadValue orderlevel_discoun
ts_applied VT_NULL __null__ VT_EMPTY __e
mpty__
RootObject: ReadValue discounts_clicked
VT_NULL __null__ VT_EMPTY __empty__
Items: ReadItem 0 VT_DISPATCH PV=[0xce4af80] VT_EMPTY __empty__
: ReadValue quantity VT_I4 1 VT_EMPTY __
empty__
: ReadValue _n_unadjusted VT_I4 1 VT_EMP
TY __empty__
: ReadValue _cy_oadjust_adjustedprice VT
_CY 0 VT_EMPTY __empty__
: ReadValue _cy_iadjust_currentprice VT_
CY 41.49 VT_EMPTY __empty__
: ReadValue discounts_applied VT_NULL __
null__ VT_EMPTY __empty__
: ReadValue _product_SKU VT_BSTR 16744 V
T_EMPTY __empty__
: WriteValue _cy_oadjust_adjustedprice V
T_CY 0 VT_CY 0
: WriteValue _n_unadjusted VT_I4 1 VT_I4
1
: WriteValue discounts_applied VT_EMPTY
__empty__ VT_NULL __null__
RootObject: WriteValue orderlevel_discou
nts_applied VT_EMPTY __empty__ VT_NULL _
_null__
RootObject: WriteValue _qualifying_disco
unts VT_EMPTY __empty__ VT_DISPATCH PV=[0x8c66d68]
PIPELINE:-- component [0x7] returned hr: 0x0, IErrorLevel=1 in 10
milliseconds
PIPELINE:++ component[0x8] about to be called ProgID:
Commerce.OrderLevelDiscountApply.1
RootObject: ReadValue _currency_decimal_
places VT_NULL __null__ VT_EMPTY __empty
__
RootObject: ReadValue _currency_lcid VT_
I4 0 VT_EMPTY __empty__
RootObject: ReadValue items VT_DISPATCH
PV=[0xce4aaf0] VT_EMPTY __empty__
Items: ReadItem 0 VT_DISPATCH PV=[0xce4af80] VT_EMPTY __empty__
: ReadValue quantity VT_I4 1 VT_EMPTY __
empty__
: ReadValue _n_unadjusted VT_I4 1 VT_EMP
TY __empty__
: ReadValue _cy_iadjust_currentprice VT_
CY 41.49 VT_EMPTY __empty__
: ReadValue _cy_oadjust_adjustedprice VT
_CY 0 VT_EMPTY __empty__
RootObject: ReadValue _orderlevel_discou
nts_detail VT_NULL __null__ VT_EMPTY __e
mpty__
PIPELINE:-- component [0x8] returned hr: 0x0, IErrorLevel=1 in 0
milliseconds
So at this point I am lost, I have read and tried numerous things
(nothing errors shown when I use the XmlTracer) so I am at a loss,
anyone out there have any ideas?
| |
| Ravi Shankar 2005-09-08, 7:52 am |
| If you use FP1, then you're supposed to use the "Discount Manager" UI and not
the BizDesk modules. Also you're supposed to change the cache name from
"Discounts" to "MarketingDiscounts" in the web.config... it is all documented
in the FP1 help somewhere.
--
Ravi Shankar
"mkw" wrote:
> Discounts dont apply, CS2002 SP3 & FP1
>
> Having some trouble getting discounts to apply on my site. I have read
> a number of posts about this and have tried a number of suggested
> solutions to no avail.
>
> I am running and ASP.NET site (1.1) against commerce server 2002 with
> service pack 3 and feature pack 1
>
> There are numerous symptoms to this problem but on that may be telling
> is the fact that a discount created with the Discount Manager
> application does not show in Business Desk.
>
> I have created a simple discount to give the user 1.00 off of a
> specific product; in order to test this discount I have created code
> which will create a basket, add the discounted item and run the
> basket pipeline. My basket pipeline includes the Order Adjust Price
> stage with 3 components which are (in order) OrderDiscount,
> OrderLevelDiscountApply and RequiredOrderAdjustPriceCy. The code I am
> using to test this process can be found below.
>
> private static string DiscountPrice( Guid userId, string
> catalogName, string productId)
> {
> string errorMessages = string.Empty;
> string returnValue = string.Empty;
> string variantId = null;
>
>
> OrderContext orders = CommerceContext.Current.OrderSystem;
>
> OrderTemplate discountBasket = orders.CreateOrderTemplate( userId
> );
> discountBasket.OrderForms.Add(new
> Microsoft.CommerceServer.Runtime.Orders.OrderForm( DISCOUNT_PRICES
> ));
>
> discountBasket.OrderForms[ 0 ].LineItems.Add( new LineItem(
> catalogName, productId, variantId, 1 ) );
>
> PipelineInfo pipeInfo = new PipelineInfo( "basket" );
>
>
> if( CommerceContext.Current.UserProfile != null )
> {
> pipeInfo.Profiles.Add( "User", CommerceContext.Current.UserProfile
> );
> }
>
> if( CommerceContext.Current.TargetingSystem.TargetingContextProfile
> != null )
> {
> pipeInfo.Profiles.Add( "TargetingContext",
> CommerceContext.Current.TargetingSystem.TargetingContextProfile);
> }
>
> discountBasket.RunPipeline( pipeInfo );
>
> returnValue = discountBasket.OrderForms[ 0 ].LineItems[ 0 ][
> "_cy_itemlevel_discounts_subtotal" ].ToString();
>
> return returnValue;
> }
>
>
>
> I have also looked closely at the log file that is generated for the
> pipeline and cannot spot any problems, the output for the
> OrderDiscount and OrderLevelDiscountApply are below
>
> PIPELINE:++ component[0x7] about to be called ProgID:
> Commerce.OrderDiscount.1
> RootObject: ReadValue _currency_decimal_
places VT_NULL __null__ VT_EMPTY __empty
__
> RootObject: ReadValue _currency_lcid VT_
I4 0 VT_EMPTY __empty__
> RootObject: ReadValue _discounts VT_NULL
__null__ VT_EMPTY __empty__
> RootObject: WriteValue _discounts VT_EMP
TY __empty__ VT_DISPATCH PV=[0x8c66b04]
> RootObject: ReadValue items VT_DISPATCH
PV=[0xce4aaf0] VT_EMPTY __empty__
> RootObject: WriteValue _event VT_EMPTY _
_empty__ VT_BSTR SOLD
> RootObject: WriteValue _winners VT_EMPTY
__empty__ VT_DISPATCH PV=[0x8c66a80]
> RootObject: ReadValue orderlevel_discoun
ts_applied VT_NULL __null__ VT_EMPTY __e
mpty__
> RootObject: ReadValue discounts_clicked
VT_NULL __null__ VT_EMPTY __empty__
> Items: ReadItem 0 VT_DISPATCH PV=[0xce4af80] VT_EMPTY __empty__
> : ReadValue quantity VT_I4 1 VT_EMPTY __
empty__
> : ReadValue _n_unadjusted VT_I4 1 VT_EMP
TY __empty__
> : ReadValue _cy_oadjust_adjustedprice VT
_CY 0 VT_EMPTY __empty__
> : ReadValue _cy_iadjust_currentprice VT_
CY 41.49 VT_EMPTY __empty__
> : ReadValue discounts_applied VT_NULL __
null__ VT_EMPTY __empty__
> : ReadValue _product_SKU VT_BSTR 16744 V
T_EMPTY __empty__
> : WriteValue _cy_oadjust_adjustedprice V
T_CY 0 VT_CY 0
> : WriteValue _n_unadjusted VT_I4 1 VT_I4
1
> : WriteValue discounts_applied VT_EMPTY
__empty__ VT_NULL __null__
> RootObject: WriteValue orderlevel_discou
nts_applied VT_EMPTY __empty__ VT_NULL _
_null__
> RootObject: WriteValue _qualifying_disco
unts VT_EMPTY __empty__ VT_DISPATCH PV=[0x8c66d68]
> PIPELINE:-- component [0x7] returned hr: 0x0, IErrorLevel=1 in 10
> milliseconds
> PIPELINE:++ component[0x8] about to be called ProgID:
> Commerce.OrderLevelDiscountApply.1
> RootObject: ReadValue _currency_decimal_
places VT_NULL __null__ VT_EMPTY __empty
__
> RootObject: ReadValue _currency_lcid VT_
I4 0 VT_EMPTY __empty__
> RootObject: ReadValue items VT_DISPATCH
PV=[0xce4aaf0] VT_EMPTY __empty__
> Items: ReadItem 0 VT_DISPATCH PV=[0xce4af80] VT_EMPTY __empty__
> : ReadValue quantity VT_I4 1 VT_EMPTY __
empty__
> : ReadValue _n_unadjusted VT_I4 1 VT_EMP
TY __empty__
> : ReadValue _cy_iadjust_currentprice VT_
CY 41.49 VT_EMPTY __empty__
> : ReadValue _cy_oadjust_adjustedprice VT
_CY 0 VT_EMPTY __empty__
> RootObject: ReadValue _orderlevel_discou
nts_detail VT_NULL __null__ VT_EMPTY __e
mpty__
> PIPELINE:-- component [0x8] returned hr: 0x0, IErrorLevel=1 in 0
> milliseconds
>
>
> So at this point I am lost, I have read and tried numerous things
> (nothing errors shown when I use the XmlTracer) so I am at a loss,
> anyone out there have any ideas?
>
>
| |
| Zoe Hart [MVP] 2005-09-08, 5:52 pm |
| Discounts set up in Discount Manager will not show up in Biz Desk. That's by
design. The two applications store their discount data in completely
separate tables. If you're running FP1 and installed the Marketing resource,
stick to Discount Manager. As Ravi mentioned, make sure you change the
Discounts cache type from Discounts to MarketingDiscounts.
One diagnostic technique I use a lot is to add the following line sometime
after the pipeline execution:
Microsoft.CommerceServer.Runtime.Diagnostics.DumpUtils.DumpDictionary(yourOrderForm.Dictionary,
new HtmlTextWriter(HttpContext.Current.Response.Output), yourOrderFormName);
That will dump the orderform dictionary out to the screen. There are several
things you can look for. The OrderDiscount component writes out a _winners
simple list that lists all the discounts that were applied to the order. In
your case, it may be empty. It also writes out a _qualifying_discounts
simple list with all the discounts the order qualified for but didn't take
advantage of. (This would be if you had a buy X get Y free type offer and
the order had X in it - the qualifying critera - but not Y - the award.) And
it also writes out a _discounts simple list that lists all of the discounts
that were evaluated. If your discount is not in the _discounts list it will
never be applied to an order. When web.config has the Discounts cache type
set to Discounts, the _discounts list will contain the discounts defined in
BizDesk. When web.config is changed to reflect a Discounts cache type of
MarketingDiscounts, the _discounts list should contain those discounts
defined in Discount Manager.
There are more diagnostic techniques, but that's a start.
--
Zoe Hart
Commerce Server MVP
"mkw" <kw@lobresearch-dot-com.no-spam.invalid> wrote in message
news:CeednYnP2vUKhYLeRVn_vQ@giganews.com...
> Discounts dont apply, CS2002 SP3 & FP1
>
> Having some trouble getting discounts to apply on my site. I have read
> a number of posts about this and have tried a number of suggested
> solutions to no avail.
>
> I am running and ASP.NET site (1.1) against commerce server 2002 with
> service pack 3 and feature pack 1
>
> There are numerous symptoms to this problem but on that may be telling
> is the fact that a discount created with the Discount Manager
> application does not show in Business Desk.
>
> I have created a simple discount to give the user 1.00 off of a
> specific product; in order to test this discount I have created code
> which will create a basket, add the discounted item and run the
> basket pipeline. My basket pipeline includes the Order Adjust Price
> stage with 3 components which are (in order) OrderDiscount,
> OrderLevelDiscountApply and RequiredOrderAdjustPriceCy. The code I am
> using to test this process can be found below.
>
> private static string DiscountPrice( Guid userId, string
> catalogName, string productId)
> {
> string errorMessages = string.Empty;
> string returnValue = string.Empty;
> string variantId = null;
>
>
> OrderContext orders = CommerceContext.Current.OrderSystem;
>
> OrderTemplate discountBasket = orders.CreateOrderTemplate( userId
> );
> discountBasket.OrderForms.Add(new
> Microsoft.CommerceServer.Runtime.Orders.OrderForm( DISCOUNT_PRICES
> ));
>
> discountBasket.OrderForms[ 0 ].LineItems.Add( new LineItem(
> catalogName, productId, variantId, 1 ) );
>
> PipelineInfo pipeInfo = new PipelineInfo( "basket" );
>
>
> if( CommerceContext.Current.UserProfile != null )
> {
> pipeInfo.Profiles.Add( "User", CommerceContext.Current.UserProfile
> );
> }
>
> if( CommerceContext.Current.TargetingSystem.TargetingContextProfile
> != null )
> {
> pipeInfo.Profiles.Add( "TargetingContext",
> CommerceContext.Current.TargetingSystem.TargetingContextProfile);
> }
>
> discountBasket.RunPipeline( pipeInfo );
>
> returnValue = discountBasket.OrderForms[ 0 ].LineItems[ 0 ][
> "_cy_itemlevel_discounts_subtotal" ].ToString();
>
> return returnValue;
> }
>
>
>
> I have also looked closely at the log file that is generated for the
> pipeline and cannot spot any problems, the output for the
> OrderDiscount and OrderLevelDiscountApply are below
>
> PIPELINE:++ component[0x7] about to be called ProgID:
> Commerce.OrderDiscount.1
> RootObject: ReadValue _currency_decimal_places VT_NULL __null__ VT_EMPTY
> __empty__
> RootObject: ReadValue _currency_lcid VT_I4 0 VT_EMPTY __empty__
> RootObject: ReadValue _discounts VT_NULL __null__ VT_EMPTY __empty__
> RootObject: WriteValue _discounts VT_EMPTY __empty__ VT_DISPATCH
> PV=[0x8c66b04]
> RootObject: ReadValue items VT_DISPATCH PV=[0xce4aaf0] VT_EMPTY __empty__
> RootObject: WriteValue _event VT_EMPTY __empty__ VT_BSTR SOLD
> RootObject: WriteValue _winners VT_EMPTY __empty__ VT_DISPATCH
> PV=[0x8c66a80]
> RootObject: ReadValue orderlevel_discounts_applied VT_NULL __null__
> VT_EMPTY __empty__
> RootObject: ReadValue discounts_clicked VT_NULL __null__ VT_EMPTY
> __empty__
> Items: ReadItem 0 VT_DISPATCH PV=[0xce4af80] VT_EMPTY __empty__
> : ReadValue quantity VT_I4 1 VT_EMPTY __empty__
> : ReadValue _n_unadjusted VT_I4 1 VT_EMPTY __empty__
> : ReadValue _cy_oadjust_adjustedprice VT_CY 0 VT_EMPTY __empty__
> : ReadValue _cy_iadjust_currentprice VT_CY 41.49 VT_EMPTY __empty__
> : ReadValue discounts_applied VT_NULL __null__ VT_EMPTY __empty__
> : ReadValue _product_SKU VT_BSTR 16744 VT_EMPTY __empty__
> : WriteValue _cy_oadjust_adjustedprice VT_CY 0 VT_CY 0
> : WriteValue _n_unadjusted VT_I4 1 VT_I4 1
> : WriteValue discounts_applied VT_EMPTY __empty__ VT_NULL __null__
> RootObject: WriteValue orderlevel_discounts_applied VT_EMPTY __empty__
> VT_NULL __null__
> RootObject: WriteValue _qualifying_discounts VT_EMPTY __empty__
> VT_DISPATCH PV=[0x8c66d68]
> PIPELINE:-- component [0x7] returned hr: 0x0, IErrorLevel=1 in 10
> milliseconds
> PIPELINE:++ component[0x8] about to be called ProgID:
> Commerce.OrderLevelDiscountApply.1
> RootObject: ReadValue _currency_decimal_places VT_NULL __null__ VT_EMPTY
> __empty__
> RootObject: ReadValue _currency_lcid VT_I4 0 VT_EMPTY __empty__
> RootObject: ReadValue items VT_DISPATCH PV=[0xce4aaf0] VT_EMPTY __empty__
> Items: ReadItem 0 VT_DISPATCH PV=[0xce4af80] VT_EMPTY __empty__
> : ReadValue quantity VT_I4 1 VT_EMPTY __empty__
> : ReadValue _n_unadjusted VT_I4 1 VT_EMPTY __empty__
> : ReadValue _cy_iadjust_currentprice VT_CY 41.49 VT_EMPTY __empty__
> : ReadValue _cy_oadjust_adjustedprice VT_CY 0 VT_EMPTY __empty__
> RootObject: ReadValue _orderlevel_discounts_detail VT_NULL __null__
> VT_EMPTY __empty__
> PIPELINE:-- component [0x8] returned hr: 0x0, IErrorLevel=1 in 0
> milliseconds
>
>
> So at this point I am lost, I have read and tried numerous things
> (nothing errors shown when I use the XmlTracer) so I am at a loss,
> anyone out there have any ideas?
>
| |
|
| You guys are geniuses!
It was the cache name, I'm good to go.
Thanks for the help, hopefully I can return the favor sometime.
"Zoe Hart [MVP]" wrote:
> Discounts set up in Discount Manager will not show up in Biz Desk. That's by
> design. The two applications store their discount data in completely
> separate tables. If you're running FP1 and installed the Marketing resource,
> stick to Discount Manager. As Ravi mentioned, make sure you change the
> Discounts cache type from Discounts to MarketingDiscounts.
>
> One diagnostic technique I use a lot is to add the following line sometime
> after the pipeline execution:
>
> Microsoft.CommerceServer.Runtime.Diagnostics.DumpUtils.DumpDictionary(yourOrderForm.Dictionary,
> new HtmlTextWriter(HttpContext.Current.Response.Output), yourOrderFormName);
>
> That will dump the orderform dictionary out to the screen. There are several
> things you can look for. The OrderDiscount component writes out a _winners
> simple list that lists all the discounts that were applied to the order. In
> your case, it may be empty. It also writes out a _qualifying_discounts
> simple list with all the discounts the order qualified for but didn't take
> advantage of. (This would be if you had a buy X get Y free type offer and
> the order had X in it - the qualifying critera - but not Y - the award.) And
> it also writes out a _discounts simple list that lists all of the discounts
> that were evaluated. If your discount is not in the _discounts list it will
> never be applied to an order. When web.config has the Discounts cache type
> set to Discounts, the _discounts list will contain the discounts defined in
> BizDesk. When web.config is changed to reflect a Discounts cache type of
> MarketingDiscounts, the _discounts list should contain those discounts
> defined in Discount Manager.
>
> There are more diagnostic techniques, but that's a start.
>
> --
> Zoe Hart
> Commerce Server MVP
>
> "mkw" <kw@lobresearch-dot-com.no-spam.invalid> wrote in message
> news:CeednYnP2vUKhYLeRVn_vQ@giganews.com...
>
>
>
|
|
|
|
|