[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Multiple carts in one basket page... [quantity-name] prevents thi s?
Hi!
I searched through the mail list archive, but didn't find a solution to my
problem...
I have two carts, one for purchases and one for rentals. The purchases one
is the normal "main", the other one is called "rental", and I want them both
on *the same* cart page. Now, in basket.html I have the following code
(short version):
[if items main]
[then]
[item-list main]
<tr>
<td width="80" align="center">
<input type=checkbox
name="[quantity-name]"
onClick="this.form.action='[process-target]',
this.form.submit()" value=0>
</td>
<td valign="top" align="center">
<input type="text"
name=[quantity-name] value="[item-quantity]" size=3>
</td>
<td valign="top" align="left">
[item-field FullDescription]
</td>
<td valign="top" align="right">
[item-price]
</td>
<td valign="top" align="right">
[item-subtotal]
</td>
</tr>
[/item-list]
[/then]
[/if]
[if items rental]
[then]
[item-list rental]
<tr>
<td width="80" align="center">
<input type=checkbox
name="[quantity-name]"
onClick="this.form.action='[process-target]',
this.form.submit()" value=0>
</td>
<td valign="top" align="center">
<input type="text"
name=[quantity-name] value="[item-quantity]" size=3>
</td>
<td valign="top" align="left">
[item-field FullDescription]
</td>
<td valign="top" align="right">
[currency]
[item-field rentalprice]
[/currency]
</td>
<td valign="top" align="right">
[currency]
[calc]
[item-field RentalPrice] *
[item-quantity]
[/calc]
[/currency]
</td>
</tr>
[/item-list]
[/then]
[/if]
I read in the mail archive that if you put the Remove checkbox *after* the
input field for quantity, it won't work, since MiniVend gets two CGI
variables called quantity0 (for the first line), one with a value 1 (or
whatever the quantity is) and another with the value 0 (from the Remove
checkbox). Since it always takes the first value, the item isn't deleted.
I figured that this could be my problem. When I look at the HTML code, I see
the following:
For basket "main":
The Remove checkbox:
<input type=checkbox name="quantity0"
onClick="this.form.action='http://whatever/cgi-bin/demo2/process?tImDLzpC;;3
58', this.form.submit()" value=0>
The quantity:
<input type="text" name=quantity0 value="1" size=3>
For basket "rental":
The Remove checkbox:
<input type=checkbox name="quantity0"
onClick="this.form.action='http://whatever/cgi-bin/demo2/process?tImDLzpC;;3
94', this.form.submit()" value=0>
The quantity:
<input type="text" name=quantity0 value="1" size=3>
Yeah, looks pretty much the same. So, if I change anything in the "rental"
basket, it doesn't reflect and shows the quantity of the "main" basket
instead. Just for fun, I put the "rental" basket before the "main" basket on
the page. And now, if I change something in the "rental" basket, it reflects
in the "main" basket.
All of this is quite logical, once you see it.
But my problem still isn't solved: How do I get different "quantity.."
identifiers? Why doesn't MiniVend change to another identifier within a new
cart? Do I have to do it by hand?
I'm glad for any help...
Regards,
Eric
----------------------------------
Swisscom AG mailto:eric.lewis@swisscom.com
Informatik
Eric Lewis, CIT-AE-742
Postfach phone +41-31/342 79 71
CH-3050 Bern fax +41-31/342 90 69
----------------------------------