Create an account to edit articles | See Formatting Syntax for Wiki syntax | We look forward to your contribution!
You are here: The ProductCart Encyclopedia » How To's » How to set a second default shipping provider
How to set a second default shipping provider
The issue
In the Shipping Setting section of the ProductCart Control Panel you can define your default shipping provider. Shipping services from that provider are shown first during checkout. However, if you have multiple shipping providers active on the store, and no eligible shipping services for a certain order can be shown from the default shipping provider, there is no way to tell ProductCart which other shipping provider should become the default one (i.e. which one should be shown first on the shipping selection step of the checkout page).
The solution
You can set a second, default shipping provider by making some simple code changes.
Edit opc_ChooseShpmnt.asp
- Download the file “opc_chooseShpmnt.asp” from the “pc” folder, using your FTP software
- Make a backup copy
- Open it in Notepad
- Perform a complete Find/Replace on the variable “scDefaultProvider”, changing it to “TempDefaultProvider”
- Save the file
Edit ShipRates.asp
- Download the file “ShipRates.asp” from the “pc” folder, using your FTP software
- Make a backup copy
- Open it in Notepad or your favorite HTML editor
- Locate the code
if instr(strOptionShipmentType, scDefaultProvider) AND scDefaultProvider<>"" AND iShipmentTypeCnt>1 then strDefaultProvider=scDefaultProvider end if - Replace with:
if instr(strOptionShipmentType, scDefaultProvider) AND scDefaultProvider<>"" AND iShipmentTypeCnt>1 then strDefaultProvider=scDefaultProvider TempDefaultProvider = scDefaultProvider else If instr(strOptionShipmentType, "UPS") Then strDefaultProvider="UPS" TempDefaultProvider = strDefaultProvider End If end if - Replace the hardcoded “UPS” with one of the following as your second, default shipping provider:
- UPS = UPS
- FEDEX = FedEx
- CP = Canada Post
- CUSTOM = Custom Shipping Options
- Save the file
Upload
Upload the edited files to the “pc” folder.
Make sure to note these files change in a log of changes that you have made to your store, so that you can reapply them when you update your copy of ProductCart (see synchronizing files during a ProductCart update).
Trace: • Starting a ProductCart Session • Technical notes on tax data files • Understanding Session Time-outs or Loss of Session • Securing version 2 stores • Adding a Facebook Like Button to your storefront • Adding tracking code to the Order Completion page • Adding A New Payment Gateway • ProductCart and IE 9 • Properly sanitizing strings in ProductCart • How to set a second default shipping provider