Sort Shipping Plus Free Shipping Option
Copyright © 2001, William Weiland
Overview
Sort your shipping methods by cost, module name, or method name. The free shipping option can be implemented when the subtotal of the order or the number of products in the order exceeds the thresholds you establish in admin. You can further configure the free shipping option by limiting it to specific countries. You can also remove the free shipping option if certain products are ordered. It also has free shipping override, ie if every product in the basket is in your list of free shipping codes, then shipping is free no matter what the other parameters are set to.
Initial Setup
1) In admin, click Add Modules
2) Click the file upload button
3) Browse to find the sortship.mvc file on your hard drive and upload
4) Click Add to add it to the domain
5) Click the image to the left of your store name
6) Click on the Shipping Configuration link
7) Check the box to the left of Sort Shipping Plus Free Shipping Option
8) Then click the tab at the top for Sort Shipping Plus Free Shipping Option and enter the configuration settings
Configuration Setting
Enter data into the applicable input field.


Sort By
Select the sort order.

Free Method Name
Enter the label you want to appear in Merchant for the free shipping method.

Order Subtotal for Free Shipping
If you want to give free shipping if the sum of the products exceeds a certain amount, enter that amount. If you do not, then put a number higher than an order subtotal would ever get, e.g. 999999.99

Free Shipping Below This Weight
If you want to give free shipping if the weight of the order is less than a certain amount, enter that number. If you do not, then put in 0, as the order would never weigh less than 0.

Number of Items for Free Shipping
If you want to give free shipping if the number of items in the order exceeds a certain amount, enter that number. If you do not, then put a number higher than an order would ever have, e.g. 9999

Availability and Price Groups
If none of the other options above apply, you can still give free shippings to members of specific availability or price groups.

Countries Eligible for Free Shipping
If you want to limit the free shipping option to one or more countries, enter their country code in the input. Separate each with the | delimiter. If you do not want to limit free shipping to specific countries, leave this input blank.

Product Codes Which Cancel Free Shipping
In some cases you may have products that are very heavy or very expensive to ship and you do not want to offer a free shipping option for them. If so, enter their codes into the input. If any of them appear in the order, shipping will not be free and your other shipping modules will calculate the shipping cost.

When Order Contains Only These Product Codes Customer Gets Free Shipping
This option overrides all other trigger amounts above. Enter product codes for all products which have free shipping; e.g. gift certificates, software delivery over the Internet, etc. If every product in the basket is in this list of codes, the free shipping will be available to the customer.


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.

Locate the function MMUI_Order_ShippingPaymentSelection inside the mmui.mv file. Within that function you will see the following several lines. I have put an asterisk at the beginning of the existing lines in Merchant version 4.0 (Merchant version 3.x is similar). The lines which are not asterisk are to be added in three locations shown. The line marked with three asterisks and beginning with the OPTION tag, is to be removed or commented out.
<MvDO FILE = "{g.Module_Root $ 'modules/util/sortship.mvc'}" NAME = "l.ship_ok" VALUE = "{Shipping_List(g.Basket_ID)}">
* <MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindFirst_Type( 'SHIPPING' ) }">
* <MvWHILE EXPR = "{ l.found }">
* <MvDO FILE = "{ g.Module_Root $ Modules.d.module }" NAME = "l.methods" VALUE = "{ ShippingModule_Shipping_Methods() }">
* <MvASSIGN NAME = "l.pos" VALUE = 1>
* <MvASSIGN NAME = "l.method" VALUE = "{ ltrim( rtrim( gettoken( l.methods, ',', l.pos ) ) ) }">
* <MvWHILE EXPR = "{ len( l.method ) }">
* <MvASSIGN NAME = "l.totalmethods" VALUE = "{ l.totalmethods + 1 }">
* <MvASSIGN NAME = "l.code" VALUE = "{ substring( l.method, 1, ( ':' IN l.method ) - 1 ) }">
* <MvASSIGN NAME = "l.name" VALUE = "{ substring( l.method, ( ':' IN l.method ) + 1, len( l.method ) - ( ':' IN l.method ) ) }">
<MvDO FILE = "{g.Module_Root $ 'modules/util/sortship.mvc'}" NAME = "l.ship_added" VALUE = "{Shipping_List_Add(l.code,l.name)}">
*** <OPTION VALUE = "{ encodeentities( Modules.d.code ) $ ':' $ encodeentities( l.code ) }"><MvEVAL EXPR = "{ l.name }"></OPTION>
* <MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
* <MvASSIGN NAME = "l.method" VALUE = "{ ltrim( rtrim( gettoken( l.methods, ',', l.pos ) ) ) }">
* </MvWHILE>
* <MvDO FILE = "{ g.Module_Library_DB }" NAME = "l.found" VALUE = "{ StoreModule_FindNext_Type( 'SHIPPING' ) }">
* </MvWHILE>
<MvDO FILE = "{g.Module_Root $ 'modules/util/sortship.mvc'}" NAME = "l.ship_ok" VALUE = "{Shipping_List_Sort(g.Basket_ID)}">