FBDSC Configure

From FreeBert Wiki

Jump to: navigation, search

[edit] Configuring The Deluxe PHP Shopping Cart to run on your server

Once you have uploaded all the Free PHP Shopping Cart files to a directory on your web server, you are ready to configure the package to run on your server. To do so, you will need to edit the Local_Settings.php file, and possibly the Common_CountryCodes.php file.

[edit] Local_Settings.php

The Local_Settings.php file is located in the cart script's root directory (if you uploaded your cart files to http://www.youdomain.com/FBDSC/, the script root directory would be '/FBDSC/'). In the Local_Settings.php file, you will see there are several settings that can be set, grouped into a couple of sections.

a) - General Settings - The general settings relate to the general setup of your cart script:

  • $Site_Domain - this should be the full domain of the root of your site

Example: 'http://www.freebert.com/'
Tip: be sure to end your domain with a '/'

  • $Site_Title - self explanatory
  • $Site_Script_Root_Directory - the name of the directory the script files reside in.

Example: if you uploaded the script files to http://www.youdomain.com/FBDSC/, set Site_Script_Root_Directory = 'FPHPSC/'
Tip: be sure to end your Site_Script_Root_Directory with a '/'

  • $CSS_Filename - the name of the CSS file you want the script to use. Enter the filename of the file only, and be sure that that file exists in the /css/ folder in your script directory. The package includes 2 default CSS files in the css directory, called WhiteBack.css and BlackBack.css. Try switching between these two to change the basic color scheme of your site.
  • $Session_Prefix - a short prefix to add to session variable calls - if you don't understand this leave it as FPHPSC_
  • $Invoice_Prefix - a short prefix to numerical part of the invoice number - if you don't understand this leave it as DSC (keep to 3 characters or less)
  • $Email_Notifications - The email address you want all email notifcations to be sent to (or sent from when sent to customers)
  • $Admin_Username - The login username used to get into the secure Admin section
  • $Admin_Password - The login password used to get into the secure Admin section

NOTE: It is very important to change the admin username and password settings ASAP!

  • $Currency_Symbol - The symbol used to represent your currency (ex $, £, etc)
  • $Currency_Code - The short text description of your currency (USD, CAD, GBP, etc)
  • $Max_RePop_Ord_Age_Days - Set Maximum order age (in days) that can be used to populate cart with items from a saved order
  • $Num_Results_Per_Page - The number of results displayed in various admin section search result pages
  • $Default_CountryCode - The country selected by default in new customer forms - see /inc/Funsctions/Common_CountryCodes.php for all CountryCodes


b) - Database Connection Info - The database connection info allows the script to connect to your SQL database. You web-server-provider can provide you with the details

  • $FBDSC_DB_S - The server address of your database
  • $FBDSC_DB_U - The username used to login to your database
  • $FBDSC_DB_P - The password used to login to your database
  • $FBDSC_DB_DB - The database name
  • $FBDSC_DB_Prefix - The prefix is a setting that allows you to place a short bit of text infront of all database tables created and used by the Deluxe Shopping Cart Script. If you do not understand what this is, leave it as "FBDSC_"


c) - Taxes - The taxes Settings section allows you to specify specific taxes to orders made in a given country, and/or a given state within a given country. For example, for Canadian sellers in British Columbia, they need to charge all orders with Canadian addresses the federal(GST) tax AS WELL AS charge all orders with British Columbian address the local provincial (PST) tax
Specify a tax for a country by specifiying the CountryCode for that country, and the tax rate. You can specifiy as many taxes as you wish.

Example: Taxes defined for Canadians Sellers in British Columbia:

 // Define Taxes By stating a CountryCode, or a CountyCode & StateCode
 $TaxesArray = array(
 // Define 5% GST tax for all Canadian Addresses
 array(
 'Canadian GST', // REQUIRED: Tax Title
 'CA', // REQUIRED: Tax Applies to addresses with CountryCode
 , // OPTIONAL: Tax Applies to addresses with StateCode (leave empty  for all)
 '5' // REQUIRED: Tax Rate percent without percent sign
 ),
 // Define 7% PST tax for Canadian addresses in British Columbia
 array(
 'BC PST', // REQUIRED: Tax Title
 'CA', // REQUIRED: Tax Applies to addresses with CountryCode
 'BC', // OPTIONAL: Tax Applies to addresses with StateCode (leave empty  for all)
 '7' // REQUIRED: Tax Rate percent without percent sign 
 )
 );


Specify a tax for a specific state in a country by first specifying some states for that Country in the Common_CountryCode.php file (see below for details on specifying states). Once you have setup the required states in Common_CountryCodes, specifiy the tax by first specifying the country code, and then the state code, and then the tax rate.

d) Order Status - The possible status' an order might have (i.e. Active, Complete, Cancelled, Refunded, etc). The default values should be sufficient for most uses.

e) Shipping Types - The possible shipping methods an order might be shipped by (i.e. Ground, UPS, FedEX, etc). Make sure there is a an entry for each possible shipping methiod you might employ to ship an item.

[edit] Common_CountryCodes.php

The Common_CountryCodes.php file is located: /script root directory/inc/functions/Common_CountryCode.php (if you uploaded your cart files to http://www.youdomain.com/FBDSC/, the script root directory would be '/FBDSC/').

a) Countries & Country Codes The Common_CountryCodes.php file contains the list of all countries, along with their "country code". For example, Canada's country code is CA, USA's country code is US, etc. Unless there are any changes to the world map, the list of countries probably won't need to be changed.

b) States / Provinces The Common_CountryCodes.php file also contains the place to setup any / all relevant states. For most countries, you are probably only interested in the State/Province for shipping purposes. However, for your own country, you may want to apply specific taxes to customers in specific states. To facilitate that you can define the states for a given country (and then apply taxes to 1, some, or all of those states).
There are two things to note regarding states:
i) - If you define a state / province for a country, you must define ALL states / provinces for that country. When a customer views the create customer account form, the script checks for any defined state for the currently selected country. If there are no states defined for that country, a simple text box is display to allow the user to enter their state / province. However, if there ARE states defined for that selected country, the text box will be replaced with a drop down box displaying all states that you have defined for that country. If you forget to define 1 state for a country which you defined all the others, customers from that state will not be able to properly select their state.
ii) - If you want to change taxes for a given state, you will need to define that state, and thus all states for that country.

Personal tools