[ic] Looking for someone to change some code on our cart

interchange-users@icdevgroup.org interchange-users@icdevgroup.org
Tue Apr 22 17:03:00 2003


Hello all!

I am looking for a developer that would like to do some coding on a site to
accomplish some price calculating changes.

My client wants to have the pricing calculate differently based on the
logged in member.  But I need to be able to set different price levels per
item.  For example, she sells headsets and gives companies a specific
discount on all headsets, but does not give a discount on accessories.

I was thinking that using the retail / wholesale concept and expanding it to
6 price points would be ideal as long as we could edit all 6 price points in
the item editing area of the admin section.  Then use the price_level field
to set what discount set that member would get.

I found this string which describes one possibility of getting to where I
need to be, but probably won't accommodate the fact that not all items will
be discounted a %.

I am willing to pay to have this done by someone.  Please email me if you
would like to bid on it - - and please send info on how you plan to achieve
it.  Detailed explanations of what was changed and where would be required
upon completion.

Or if you know how to do it, and don't have time to do it yourself, please
send instructions.  I will compensate the person that gets me the most
detailed and easy to use directions.

I just don't have much time to test and tune on this and would like to get
something working in the next week or so.

Thanks,
Tessa Gripp
tessa@ashfordwebs.com

Jani Tolonen <jani@mysql.com> writes:

> Hi!
>
> I'm using Interchange version 4.8.5
>
> I'm looking for a way to set discount for all items per customer group
> basis. My idea was to use the 'Price Level' -labeled field in table
> 'userdb' (the real name of the field is 'price_level').
>
> In the demo foundation this field contains values such as:
>
> - Retail
> - Dealer
> - Distributor
> - Wholesaler
> - Small business
> - Large corporate
> - Private person
> - Governmental or educational
>
> What I would like to do is to set a certain discount % to all of these
> groups and it would apply to all items.
>
> For example:
>
> customer group discount %
> ============== ==========
> Retail 10%
> Dealer 20%
> Private 0%
>
> Let's assume item 'A' costs 100 USD.  If a customer who is a member of
> 'Retail' group buys this item, he would get it for 90 USD. Customer
> from 'Dealer' group would get it for 80 USD and 'Private' for 100 USD.
>
> In case of many items is purchased at once and pricing is for example
> 100 USD for one item and 90 USD for 2 items, and the customer buys 2
> items, the discount % would be taken from the quantity price.
>
> Is this doable?
>
> If not, is it planned for a future version of Interchange?
>
> I'd be grateful for any input!

I use the following code for that in profiles.login. You need to use
the [discount-price] and [item-discount-subtotal] tags in place of
the regular ones in templates/components/cart and all other places
where the price appears.

__NAME__ Logout_choice

[if type=explicit compare="[userdb function=logout clear='[cgi
clear_values]']"]
[discount ALL_ITEMS][/discount]
[set mv_no_count]1[/set]
[set mv_no_session_id]1[/set]
[if cgi clear_cart]
[calc] @$Items = (); return; [/calc]
mv_nextpage=[either][cgi mv_successpage][or][cgi mv_nextpage][/either]
[else]
mv_nextpage=[either][cgi mv_failpage][or][cgi mv_nextpage][/either]
[/else]
[/if]

__END__

__NAME__ Logout

[if type=explicit compare="[userdb function=logout clear=1]"]
[discount ALL_ITEMS][/discount]
[set mv_no_count]1[/set]
[set mv_no_session_id]1[/set]
mv_nextpage=[either][cgi mv_successpage][or][cgi mv_nextpage][/either]
[else]
mv_nextpage=[either][cgi mv_failpage][or][cgi mv_nextpage][/either]
[/else]
[/if]

__END__

__NAME__ Login

[if type=explicit compare="[userdb login]"]
[perl tables=userdb]
return unless $Session->{logged_in};
$pl = $Tag->data('userdb','price_level',$Session->{username});
$dc = 0;
if ($pl eq 'dealer') {
    $dc = $Variable->{DISCOUNT_DEALER};
} elsif ($pl eq 'distributor') {
    $dc = $Variable->{DISCOUNT_DISTRIBUTOR};
}
if ($dc) {
    $Tag->discount('ALL_ITEMS', "\$s - int(\$s * $dc)");
}
[/perl]
[set mv_no_count][/set]
[set mv_no_session_id][/set]
mv_nextpage=[either][cgi mv_successpage][or][cgi mv_nextpage][/either]
[else]
mv_nextpage=[either][cgi mv_failpage][or][cgi mv_nextpage][/either]
[/else]
[/if]

__END__

__NAME__ Change_password

[if type=explicit compare="[userdb change_pass]"]
mv_nextpage=[either][cgi mv_successpage][or][cgi mv_nextpage][/either]
[else]
mv_nextpage=[either][cgi mv_failpage][or][cgi mv_nextpage][/either]
[/else]
[/if]

__END__


Ciao
        Racke

--
Free resources for Interchange programming NOW !!!
Don't hesitate to contact me if you need my professional help.
Your core developer and consultant for the most sophisticated,
flexible and extensible Open Source eCommerce software.