MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] ordering non-unique [item-code]




----- Original Message -----
From: Otis Gospodnetic <otis@dominis.com>
To: <minivend-users@minivend.com>
Sent: Thursday, October 21, 1999 2:55 PM
Subject: [mv] ordering non-unique [item-code]
> My DB design (MySQL) is a little different, it seems, and I'm not sure how
> to go about placing items in a shopping basket.
> Here is the situation.
> Each product has a unique product_id. However, each product can have
> multiple versions of itself. Products in my case are magazine
subscriptions,
> and each magazine can sell either as 1 year subscription or 2 year
> subscription, etc. So you have 1 product, but it sells in multiple
versions
> (and prices).
>
> So on my flypage, where I show details about the magazine, and all
> variations of it that can be ordered I do this:
>
> [sql type=list query="
> SELECT sub_length, issues_per_year, price
> FROM product_term
> WHERE product_id = '[item-code]'"]
>
> <INPUT TYPE=radio  NAME="mv_order_item"  VALUE="[item-code]">
> [sql-param issues_per_year]
> [sql-param sub_length]
> $[sql-param price]
> [order [item-code]]Add to Cart
>
> This would give a user the choice to order, say, a 1 year subscription OR
a
> 2 year subscription.
> So 2 choices, two things that a customer can order.
> Both choices have the same [item-code]
>
> So the problem is that when a customer clicks on the 'Add to Cart' link, I
> will be able to tell the product_id of the product in the cart (using
> [item-code]), but I will not be able to tell which variation of the
product
> the customer ordered.
> Was it the 1 year OR the 2 year subscription?
>
> Is there any way to make this work?
> Is there any way to pass a field other than [item-code] to the [order]
tag?
>
> I tried creating another unique field (term_id) which I added to each
> version of the product like this:
> (products table):
> product_id | term_id | product_name ...
> 164        | 164-1   | PC Magazine
> 164        | 164-2   | PC Magazine
>
> Which is tied to another table with values for that variation of the
> product, like this:
> (product_term table):
> product_id | term_id | subscription_length | no_issues | price
> 164        | 164-1   | 1 year              | 12        | 19.99
> 164        | 164-2   | 2 years             | 12        | 29.99
>
> So I tried doing [order [sql-param term_id]]Add to Cart - but that did not
> work, of course, because MiniVend couldn't find a product with
> code/key/product_id 164-1 or 164-2 :(
>
> Hilfe bitte, if you have any ideas.
>
First off, I haven't tried to do sql with minivend, but I know how to do
what you're talking about without sql.  Here's the idea:
You can add a subscription_term accessory field to the database, in the same
way that you would add size or color, since accessories can affect the price
of items.  For example:

products.asc: (prices are for standard 1 year subscription)
product_id | name | subscription_term | price
164 | Time Magazine | 12mo=1 year,24mo=2 years | 19.99
165 | Life Magazine | 12mo=1 year,24mo=2 years,36mo=3 years | 19.99

pricing.asc:  (this is where you input the prices for alternate terms)
product_id | 12mo | 24mo | 36mo
164        |        | +10.00 |
165        |        | =29.99 | +19.00

In the above example, both Time and life cost 29.99 for 2 years, and Life
costs 38.99 for 3 years.  As you can see, you can use relative or absolute
pricing.  In this case, the 12mo column was unnecessary.

You will also need to make sure that minivend knows to keep track of your
subscription_term, by setting the following in catalog.cfg:
CommonAdjust    ==subscription_term:pricing
Usemodifier  subscription_term

With all of this set, you can have minivend make a select box (or radio
buttons etc by changing parameters) in your item list with the simple
command:
[item-accessories subscription_term]
It will remember what term was chosen, and you can later access it with
this:
[item-modifier subscription_term]

Anyway, that's the basics.  For more detail, look in the Product Pricing
section of the minivend docs, particularly at the CommonAdjust Examples and
Item Attributes subsections.
Hope this helps.  I'm not sure how using sql changes things, but it
shouldn't be too different.  Have fun.

===============================
Pounding away on my keyboard
in the dark.

                    Cameron
-------------------------------
email: scrumper@earthling.net
ICQ: 13571506
===============================



Search for: Match: Format: Sort by: