[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: i need help with a pricing scheme
"kenshin" <kenshin@planetanime.com> WROTE -
>Hello all,
>
>I hope someone can help me with a problem i've been wrestling with for some
>time now, but as of yet i have not been able to come up with an adaquate
>solution.
>
>I'm running minivend 3.12 (although i'll be glad to upgrade if it will help)
>running on a solaris box (SunOS 5.7) and perl 5.005.
>
>Here is the situation:
>products in our database are divided by categories. e.g. VHS, DVD, CD, etc.
>I want to be able to discount various categories independent of each other.
>e.g. all DVD is 20% off. All VHS is 30% off. etc.
>
>What i have so far:
>Get the discounts in the basket and thru the check out is no problem. I use
>the [discount] tag and some if/then magic it all works like it should.
>
>My problem:
>I want those discounts to show up on other pages, i.e. flypage, results,
>browse.
>
>My current work around:
>I have hard coded the regular price and discounted price in my products
>database and if a discounted price exists then show it instead but with some
>extra indication that the particular item is being discounted (e.g. the
>price in red instead of black).
>
>What i would like to do:
>I would be nice if i could just check the category of the current item and
>if it matches one that should be discounted to discount it and show the new
>price.
>I've tried this using minivend's if/then statements but i haven't been able
>to make it work correctly.
>
>I would like to do this using [perl] but i haven't been able to find any
>examples that use perl's if/then in minivend so i'm not sure what would be
>to correct way to approach it in this situation.
>
>Any help would be appreciated.
>
>thanks,
>mike k.
>kenshin@planetanime.com
>
Mike -
According to the docs, Minivend can maintain any number of arbitrary
databases. You could create a database - discbycat for example (discount
by category) which contains two fields per row: a category name and and
discount percent.
Your page source code could then check the category of the currently
displayed item(s) against the discbycat file, and if it finds a matching
entry, apply the corresponding discount to the price. At the same time,
the display attributes (color, style) could be modified if desired. You
could even display the unmodified price alongside the discounted one.
Sorry, but I don't have any code samples for you, this is just a conceptual
approach but it should work. Read up on DATABASES, [data] and [discount]
in the docs and you should get some ideas on how to proceed.
Good Luck!
Ed LaFrance
-
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