[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Re: price = qty * length * width
Chris -
Thanks for the suggestion - I had started out by looking at CommonAdjust.
What's holding me back with your example is that it is based on values
existing in database tables, as all price adjustment schemes in Minivend
appear to be. The factors in my equation are typed into a field by the
user, so they only exist in session memory at the time the calculation
would need to be performed. I'm pretty sure I can write them to a
user-saved cart, but I do not want the user to have to save before they can
get a line total. Using attribute fields in products or any other database
is out, because the user can type in any number above 0 for either
attribute. I need to be able to the values directly for use as a price
adjustment.
The "type-in" routine for the attribute was provided by another listie:
[if-field length]
Length: <input type=text name=[modifier-name length]
size=10
value="[perl interpolate=1]
$a = q{[item-modifier length]};
$a =~ s/"/"/g;
$a;
[/perl]"></font>
[/if-field]
There is a logical field called "length" in the products database - if it
is non-blank, the above code will be activated in the cart and/or checkout
page to allow the user to type in the length, the same would go for width.
The typed value is persistent from page to page but it is not saved on disk
anywhere, and if the user exits their session, the value is lost. I know
how to get the values on the reciept and report forms, write them to
transactions DB and a user-saved cart, but how do I use them as price
modifiers: price = length * width * quantity?
Any help that anyone can offer is greatly appreciated!
>****** message to minivend-users from "Mr. Christopher F. Miller"
><cfm@maine.com> ******
>
>
>> > I would like to be able to produce a calculated price for a custom cut
>>item
>> > in a cart, based upon the formal qty * length * width. Another Minivend
>> > user was quite helpful with a solution which allows the end user to type a
>
>CommonAdjust products:price, &{Vend::ClientPricing::scrubs();}
>
>For http://www.maine.com/scrubs/Catalog
>
>That makes adjustments based on hem, print and pockets. It's done
>in a custom lib/Vend/ClientPricing.pm module. In that particular
>case, minivend3.11. ClientPricing amounts to:
>
>while (1) {
>if code=this
> do this
> last
>if code=that
> do that
> last
>}
>
>You could also use a catalog routine if you
>don't have access to raw pm files. Safer too. ;^)
>
>
>--
>
>Christopher F. Miller, Publisher cfm@maine.com
>MaineStreet Communications, Inc 208 Portland Road, Gray, ME 04039
>1.207.657.5078 http://www.maine.com/
>Database publishing, e-commerce, office/internet integration, Debian linux.
>-
>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
-
PRINTEX Marking Technologies
12113 Kirkham Rd.
Poway, CA 92064 U.S.A.
(858) 513-2418
(800) 982-1928
(858) 513-2419 fax
edlafrance@printexusa.com
http://www.printexusa.com