|
Home > Archive > Commerce Server General > April 2005 > Pipeline problem with diferent pricing for different customer grou
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 |
Pipeline problem with diferent pricing for different customer grou
|
|
|
| Hi:
I have a commerce site and I am trying to create differnt pricing based on
the session id that I create at login. I added a scriptor before Validate
Ship-To in the plan pipeline here is the code:
'The following entry points are available (shown in VBScript format):
function MSCSExecute(config, orderform, context, flags)
if Orderform.[_shopper_type] = "1" then
for each item in orderform.items
item.[_product_list_price] = item.[_product_list_price] * .75
next
else
if Orderform.[_shopper_type] = "2" then
for each item in orderform.items
item.[_product_list_price] = item.[_product_list_price] * .5
next
else
for each item in orderform.items
item.[_product_list_price] = item.[_product_list_price]
next
end if
end if
MSCSExecute = 1
end function
sub MSCSOpen(config)
end sub
sub MSCSClose()
end sub
and in my basket.asp I added this:
Set Orderform = Server.CreateObject("Commerce.Dictionary")
Orderform.[_shopper_type] = "1"
but it does not working the only condition it recognises is the last one in
my pipeline which is:
else
for each item in orderform.items
item.[_product_list_price] = item.[_product_list_price]
would you please tell me what am I doing wrong or is there a better way to
do this.
Best Regards
| |
|
| Bobby,
Here are few thing you can try :
1) Dump the values to a log file before you call this component and
make sure you are getting the right value for
Orderform.[_shopper_type]. There is a Dumporder.vbs file that comes
with CS2002. You can use this to write log.
2) I have done this kind of discount in my projects, but i have put
this code in Basket pipeline. Try putting it in basket pipeline.
3) Create the dictionary variable as Orderform.[shopper_type] instead
of Orderform.[_shopper_type]. Dont start with underscore character.
Hope this helps,
Regards
Ravi
| |
| Matt Nield 2005-04-18, 7:53 am |
| Hi There,
Looking at what you are trying to do, you seem to have a very consistent
requirement for changing prices. As a suggestion, why not use Virtual
Catalogs and Catalog Sets to achieve this? When building the virtual
catalogs for shopper type 1 and 2, you can then apply a 75% and 50% pricing
rule (respectively) across the two new virtual catalogs and use the
shopper_type to drive the user catalog set. IT will also give you al little
more control if you wish to restrict products for these types of user.
Hope this helps and you get it sorted
Regards
Matt
"bobby" <bobby@discussions.microsoft.com> wrote in message
news:EEAD32A5-FE4B-4366-A1F9-13E91CF2E290@microsoft.com...
> Hi:
> I have a commerce site and I am trying to create differnt pricing based on
> the session id that I create at login. I added a scriptor before Validate
> Ship-To in the plan pipeline here is the code:
> 'The following entry points are available (shown in VBScript format):
>
> function MSCSExecute(config, orderform, context, flags)
>
>
> if Orderform.[_shopper_type] = "1" then
> for each item in orderform.items
> item.[_product_list_price] = item.[_product_list_price] * .75
> next
> else
>
> if Orderform.[_shopper_type] = "2" then
> for each item in orderform.items
> item.[_product_list_price] = item.[_product_list_price] * .5
> next
> else
>
> for each item in orderform.items
> item.[_product_list_price] = item.[_product_list_price]
> next
>
> end if
> end if
>
> MSCSExecute = 1
>
> end function
>
> sub MSCSOpen(config)
>
> end sub
>
>
> sub MSCSClose()
>
> end sub
>
> and in my basket.asp I added this:
> Set Orderform = Server.CreateObject("Commerce.Dictionary")
> Orderform.[_shopper_type] = "1"
> but it does not working the only condition it recognises is the last one
> in
> my pipeline which is:
> else
>
> for each item in orderform.items
> item.[_product_list_price] = item.[_product_list_price]
> would you please tell me what am I doing wrong or is there a better way to
> do this.
> Best Regards
|
|
|
|
|