[ic] Automatically placing another item in cart when a specific product is ordered

Ed LaFrance interchange-users@interchange.redhat.com
Tue Oct 9 12:47:01 2001


At 10:40 AM 10/09/2001 -0400, you wrote:

>Greetings All,
>
>I have tried to search for this in the archives, but it appears that the 
>search function (from the developer Web site) for this list is broke.  No 
>matter what I try to search on ... even single terms like order and 
>interchange I get (0) zero results.
>
>In any case, here is the question.
>
>I would like certain items in my stores to automatically include another 
>item when ordered.  This would serve to purposes for me.
>
>1) Some of our parts require the charge of a deposit.  As an example, a 
>bottle of pop.  I would like Interchange to say:  when part number 
>pepsi2liter is ordered add the item tencntdeposit to the cart.  In our 
>case we have a core charge on major engine parts.  So when someone orders 
>a rebuild alternator we would like to automatically add to their cart an 
>item called Core Charge Deposit for $350.00
>
>2) If figured we could also use this to add specific parts to an order as 
>a promotion.  Buy a case of filters ... and it will add another filter to 
>the order (with a special part number) at no charge.
>
>In either case, can anyone point me to a model, email discussion or 
>documentation about how this may have been accomplished in the past?
>
>
>Thanks,
>Christopher

Though the docs on the subject have been misplaced, an "order groups" 
feature has been around since Minivend 3.  A look at Order.pm and Cart.pm 
suggests that the code is still there. Here is the doc section for Order 
Groups; good luck!

Order Groups
MiniVend allows you to group items together, making a master item and 
sub-items. This can be used to delete accessories or options when the 
master item is deleted. In its simplest form, you order just one master 
item and all subsequent items are sub-items.


     <FORM ACTION="[process-target]" METHOD=POST>
     <INPUT TYPE=hidden NAME=mv_todo ACTION=refresh>
     <INPUT TYPE=hidden NAME=mv_order_group VALUE="1">
     <INPUT TYPE=hidden NAME=mv_order_item VALUE="00-0011">
     <INPUT TYPE=hidden NAME=mv_order_item VALUE="00-0011a">
     <INPUT TYPE=submit VALUE="Order the Mona Lisa with frame">
     </FORM>

If you wish to stack more than one master item, then you must define 
mv_order_group for all items, with either a 1 value (master) or 0 value 
(sub-item). A master owns all subsequent sub-items until the next master is 
defined.


     <FORM ACTION="[process-target]" METHOD=POST>
     <INPUT TYPE=hidden NAME=mv_todo ACTION=refresh>
     <INPUT TYPE=hidden NAME=mv_order_group VALUE="1">
     <INPUT TYPE=hidden NAME=mv_order_item VALUE="00-0011">
     <INPUT TYPE=hidden NAME=mv_order_group VALUE="0">
     <INPUT TYPE=hidden NAME=mv_order_item VALUE="00-0011a">
     <INPUT TYPE=hidden NAME=mv_order_group VALUE="1">
     <INPUT TYPE=hidden NAME=mv_order_item VALUE="19-202">
     <INPUT TYPE=hidden NAME=mv_order_group VALUE="0">
     <INPUT TYPE=hidden NAME=mv_order_item VALUE="99-102">
     <INPUT TYPE=submit VALUE="Order items">
     </FORM>

When the master item 00-0011 is deleted from the basket, 00-0011a will be 
deleted as well. And when 19-202 is deleted, then 99-102 will be deleted 
from the basket.

NOTE: You cannot use checkboxes for this type of thing, for they do not 
pass a value when unchecked. Use radio groups or select/drop-down buttons.

The attributes mv_mi and mv_si are set to the group and sub-item status of 
each item. The group, contained in the attribute mv_mi, is a meaningless 
yet unique integer. All items in a group will have the same value of mv_mi. 
The attribute mv_si is set to 0 if the item is a master item, and 1 if it 
is a sub-item.

- Ed L.






New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================