[ic] Display Quantity Discount in Flypage

Steve Graham interchange-users@interchange.redhat.com
Wed Feb 27 18:25:00 2002


Hello,

Thanks for the code - I guess to do what I need I will have to teach myself 
Perl. Once, I get the results I need I will post it to this group. I'm sure 
what you have supplied will help.

Thanks again,
Steve


>From: "Ron Phipps" <rphipps@reliant-solutions.com>
>Reply-To: interchange-users@interchange.redhat.com
>To: <interchange-users@interchange.redhat.com>
>Subject: RE: [ic] Display Quantity Discount in Flypage
>Date: Tue, 26 Feb 2002 22:23:24 -0800
>
> > From: interchange-users-admin@interchange.redhat.com
>[mailto:interchange-
> > users-admin@interchange.redhat.com] On Behalf Of Steve Graham
> >
> > Hello,
> >
> > I would like to display all the different quantity breaks each item
>has,
> > and
> > if it doesn't have any don't display, in each items flypage. I have IC
> > 4.8.3
> > calculating the prices correctly with commonadjust, now I want to show
>the
> > potential buyers the qty breaks.
>
>You are in luck, I just did this the other day for a new site :)
>
> > I see that [item-price q1], [item-price q5] etc... will show the
>breaks,
> > but
> > I have discounts of 1,2,3,5,6,10,12,15,20,25....various up to to 250
>opr
> > more.
> > If an item has only breaks at say 1,6,12 then I don't want to display
>all
> > the redundant breaks in-between.
>
>This usertag will output radio buttons for each quantity break and it
>looks like this:
>
>1 for $239.00
>2 for $470.00 (Save $4.00 each!)
>
>The user then can use the radio buttons to pick how many at the quantity
>price they would like to purchase.  The usertag I think needs some
>tweaking to use the "price" tag instead of the "data" tag, but it worked
>in the cases I needed.
>
>Call it with the following inside a flypage:
>
>[build-pricing-selection sku="[item-code]" table="pricing"]
>
>Have fun :)
>-Ron
>
>UserTag build-pricing-selection Order sku table
>UserTag build-pricing-selection Routine <<EOR
>sub {
>	my ($sku, $price_db) = @_;
>	my @price_breaks = (2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 25, 50,
>100);
>	my $break;
>	my $break_price;
>	my $orig_price;
>	my $price;
>	my $out = '';
>	my $savings;
>
>	$orig_price = $Tag->data("products", "price", $sku);
>
>	for $break (@price_breaks)
>	{
>		$break_price = "";
>		$break_price = $Tag->data($price_db, "q$break", $sku);
>
>		if ($break_price != "")
>		{
>			$price = $break_price * $break;
>			$savings = ($orig_price - $break_price);
>
>			$price = $Tag->currency(0, 0, $price);
>			$savings = $Tag->currency(0, 0, $savings);
>			$out .= <<EOF;
>				<input type="radio"
>name="mv_order_quantity" value="$break">$break for $price (Save $savings
>each!)<br>
>EOF
>		}
>	}
>
>	return $out;
>}
>EOR
>
>_______________________________________________
>interchange-users mailing list
>interchange-users@interchange.redhat.com
>http://interchange.redhat.com/mailman/listinfo/interchange-users


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx