<%@ Language=VBScript %> <% '************************************************************************* ' DO NOT MODIFY THIS SCRIPT IF YOU WANT UPDATES TO WORK! ' Function : Shipping Rates Maintenance ' Product : CandyPress Store Administration ' Version : 2.5 ' Modified : February 2004 ' Copyright: Copyright (C) 2004 CandyPress.Com ' See "license.txt" for this product for details regarding ' licensing, usage, disclaimers, distribution and general ' copyright requirements. If you don't have a copy of this ' file, you may request one at webmaster@candypress.com '************************************************************************* Option explicit Response.Buffer = true const adminLevel = 1 %> <% 'Database dim mySQL, cn, rs 'ShipRates dim idShip dim idShipMethod dim locShipZone dim unitType dim unitsFrom dim unitsTo dim addAmt dim addPerc 'ShipMethod dim shipDesc dim status 'Work Fields dim action '************************************************************************* 'Open Database Connection call openDB() 'Store Configuration if loadConfig() = false then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Could not load Store Configuration settings.") end if %>

Shipping - Store Rates Maintenance

<% 'Page Tabs call shipTabs("CR") 'Get action action = trim(Request.QueryString("action")) if len(action) = 0 then action = trim(Request.Form("action")) end if action = lCase(action) if action <> "edit" and action <> "del" and action <> "add" then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Invalid Action Indicator.") end if 'Get idShip if action = "edit" or action = "del" then idShip = trim(Request.QueryString("recId")) if len(idShip) = 0 then idShip = trim(Request.Form("recId")) end if if idShip = "" or not isNumeric(idShip) then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Invalid Record ID.") end if end if 'Get Shipping Rate Record if action = "edit" or action = "del" then mySQL="SELECT * " _ & "FROM shipRates " _ & "WHERE idShip = " & idShip set rs = openRSexecute(mySQL) if rs.eof then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Invalid Record ID.") else idShipMethod = rs("idShipMethod") locShipZone = rs("locShipZone") unitType = rs("unitType") unitsFrom = rs("unitsFrom") unitsTo = rs("unitsTo") addAmt = rs("addAmt") addPerc = rs("addPerc") end if call closeRS(rs) end if 'Edit if action = "edit" then if len(trim(Request.QueryString("msg"))) > 0 then %> <%=Request.QueryString("msg")%>

<% end if %> Edit Shipping Rate  <%call maintNavLinks()%>

Shipping Method
Shipping Zone
Rate Type
Price/Weight From
Price/Weight To
Amount
Percentage

<% end if 'Add if action = "add" then %> Add Shipping Rate  <%call maintNavLinks()%>

Shipping Method
Shipping Zone
Rate Type
Price/Weight From
Price/Weight To
Amount
Percentage

<% end if 'Delete if action = "del" then %> Delete Shipping Rate  <%call maintNavLinks()%>

Shipping Method <% mySQL = "SELECT shipDesc " _ & "FROM shipMethod " _ & "WHERE idShipMethod = " & idShipMethod set rs = openRSexecute(mySQL) Response.Write rs("shipDesc") call closeRS(rs) %>
Zone <%=locShipZone%>
Rate Type <% select case UCase(unitType) case "P" Response.Write "Price" case "W" Response.Write "Weight" case else Response.Write "Unknown" end select %>
Price/Weight From <%=unitsFrom%>
Price/Weight To <%=unitsTo%>
Amount <%=addAmt%>
Percentage <%=addPerc%>

<% end if if action = "edit" or action = "add" then %>
Help and Instructions :
Shipping Method - Mandatory. Select the Shipping Method to which this Shipping Rate record will apply. Shipping Methods are defined and maintained with the Shipping Method Maintenance function.

Shipping Zone - Mandatory. Must be a valid numeric value. Enter the Shipping Zone to which this Shipping Rate record will apply. This value is used in conjunction with the Shipping Zone value entered in the Location Maintenance function. When the customer checks out his order, the customer has to enter a shipping address. The system will then compare the Shipping Zone of the cusomer's Country and State (or Province) with the Shipping Zones in the Shipping Rates file to compute Shipping Rates for the customer's shipping address.

Rate Type - Mandatory. This value indicates if this Shipping Rate record will be used to calculate shipping based on the Total Order Amount (Total Price exluding Discounts and Taxes) or the Total Weight of the Order (Weight).

Price/Weight From and To - Mandatory. These two fields are used to indicate a Price or Weight range (depending on the setting of Rate Type) for this Shipping Rate record. If you selected "Price" as the Rate Type, you will enter a Price range into these fields. If you selected "Weight" as the Rate Type, you will enter a Weight range into these fields.
  • You MUST use the same Unit of Weight (Kilogram, Grams, Pounds, etc.) throughout the store. So, if you enter the Weight in "Pounds" for your Products, you must also enter the Weight in "Pounds" here.
  • If you specify a price range, note that the shipping rate will be calculated on the gross total order amount, excluding any discounts and taxes.
Amount - Optional if a Percentage is entered. This is the amount that will be added to the order for Shipping. You may enter both an Amount as well as a Percentage (the system will calculate both and add the highest value).

Percentage - Optional if Amount is entered. This is the Percentage of the order total which will be added to the order for Shipping. You may enter both an Amount and Percentage (the system will calculate both and add the highest value).

<% end if call closedb() %> <% '********************************************************************* 'Create Navigation Links '********************************************************************* sub maintNavLinks() %> [ List Rates | Add | >Edit | >Delete ] <% end sub %>