[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] All products have the user input the pricing
****** message to minivend-users from Mike Heins <mikeh@minivend.com> ******
Quoting scott andreas (scotta@homer-simpson.learnserv.com):
> Hello all,
>
> I'm building an intranet for our company such that our reps will use
> minivend as the vehicle to submit quotes and orders. The problem is that
> all products have pricing based upon what the rep wants to sell the
> product for. Thus, I need a minivend form that will parse the price
> based upon the reps input in a price text field in relation to a sku &
> description.
>
> To make things more complicated I want certain price discounts displayed
> (10% 15% 20% 25% 30%) for that sku such that the rep can either click on
> one of the static discount prices or enter his/her own price for this
> sku.
>
> The only thing I see that comes close to this in the documentation and
> the searches is to use CommonAdjust and a pricing table. But, how does a
> rep input into a form a price in relation to a sku and to have this
> price reflected throughout the cart.
You can use the mv_price modifier for that, along with the
$ atom included in the demo for CommonAdjust.
Direct access to the shopping cart provides this -- obviously you will
want to protect the page which has this code from unauthorized people.
This is really just a programming exercise once you realize you can
manipulate the cart and set mv_price.
Simplified code to set that:
[perl]
my $cart = $Carts->{main};
for( my $i = 0; $i < @$cart; $i++) {
my $line = $i + 1;
my $price;
next unless defined ($price = $CGI->{"rep_price$line"});
$price =~ s/[^\d.]//g;
$cart->[$i]{mv_price} = $price;
}
return;
[/perl]
Now a simple form with that code as target:
[item-list]
SKU [item-code], set price: <INPUT NAME="rep_price[item-increment]">
<P>
[/item-list]
You may have to manipulate your CommonAdjust string appropriately if you
want to do other types of pricing, i.e.
CommonAdjust $ ;pricing:price_group,q2,q5,q10,q25,q100 ;:price
--
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH 45056
phone +1.513.523.8220 fax 7501 <heins@akopia.com>
When the only tool you have is a hammer, all your problems tend to look
like nails. -- Abraham Maslow
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list