Buy X Number Items Get 1 Free
Copyright © 1999, William Weiland
Overview
The Buy X Items - Get 1 Free module gives the shopper a discount based on a predetermined qualifying number of items. In the admin module, the store owner sets the number of items it requires in order for the lowest priced item to be free.
Initial Setup
Use the Merchant admin upload feature to upload the get1free.mv(c) module. Once uploaded, click the Add button to add it to the mall/domain.

In admin, under your store, click on the link for Utilities Configuration Screen. Assign the module and Update it to install it in your store.

Click the link for Buy X Number Items Get 1 Free to enter the configuration setting.


Configuration Setting
Enter data into the applicable input field.

Quantity
For every increment of the number entered, an item's value reduces the total sale. For example, if the number is 5 and the customer buys 5, the lowest priced item is free. If the customer buys 10, the lowest priced two items are free.

If you run a special and then end the special for awhile, do not unassign the module. Rather up the quantity to a number that would not likely be ordered. That way the validation check will still occur and any residual baskets will not qualify with the new setting.


Editing Requirements (skip if using the OpenUI)
If you are using the Miva Merchant User Interface (mmui) you will need to make some very simple edits to the core files. Be sure to do that with a text editor (NO WYSIWYG editors) such as Programmer's File Editor (PFE) so as not to damage the mv files. ALWAYS BACKUP your unmodified mv files in case you make a mistake.

In the mmui.mv file MMUI_DisplayBasket function there are two areas where you will insert code.

1) Insert the following line as the first line after the beginning of the MMUI_DisplayBasket function.
<MvDO FILE = "{g.Module_Root$'modules/util/get1free.mv'}" NAME = "l.freeitemtotal" VALUE = "{FreeItem_Insert()}">

2) A few lines before the end of this MMUI_DisplayBasket function you will see a table row which contains the Total: for the basket. Add the following just before the <TR> tag:
<MvDO FILE="{g.Module_Root$'modules/util/get1free.mv'}" NAME="g.discountbasket" VALUE="{Display_FreeBasket(l.editable)}">