Ecommerce Template PHP version instructions
- What you need
- Setting the database connection
- Setting up your PHP template on a Yahoo! Hosting account
- Getting Started
- FrontPage Issues
- Shipping Calculations
- Setting up Payment Providers
- Security Considerations
- Advanced tweaks and options
For the PHP / mySQL versions of the Ecommerce Plus Templates, you need a server that has a minimum of PHP version 4.1 and a mySQL database. To use the UPS shipping feature it will also be necessary for your host to have cURL component installed. If you have a windows server then please see our templates in Microsoft Access / ASP version here.
To set the database connection, please open the file vsadmin/db_conn_open.php in a text editor. You need to fill in the details in the spaces provided. The 4 pieces of information that you need to provide are the username and password for database access, the name of the database and the address of the database. If you are in any doubt about these, please ask your host who will provide you with the information. Then fill in the gaps between the quotes as shown.
$db_username = "loginname"; // Your database login username
$db_password = "loginpassword"; // Your database login password
$db_name = "databasename"; // The name of the database you wish to use
$db_host = "localhost";
The last parameter $db_host is normally "localhost".
However, it can also be a URL like
$db_host = "db.myhost.com";
Once this information has been correctly entered, you can install
the database tables and data. To do this, just open the file createdb.php
in a browser by entering the address for instance
Obviously replacing "www.yoursite.com" with whatever is the URL of your site. Then click on the button to "Install Ecommerce Plus" and your database will be created. Please remember to delete this file from your web after running it, as otherwise others could use it to destroy your information.
Firstly log in to your Yahoo! Web hosting control panel. You should
have been provided with details about how to log in here by Yahoo!
Now, on the right hand side under "Expert Web Site Tools" you should see a link like
Activate and maintain your database.
. . . and you need to click on this link.
You will now need to click to activate your mySQL database.
Now on the left hand side you need to click under the heading "Database Setup" on the link "Install Admin Tool". After agreeing to the license terms, you are recommended to install the admin tool in a new folder, for instance "phpadmin". You can use the "Create Directory" box to do this, and once the new directory is created then click on "Install phpMyAdmin" next to the new directory name.
Now you need to open the phpMyAdmin tool in your browser by using the link that is shown on your Yahoo! Hosting panel, for instance it will be something like
http://www.yoursite.com/phpadmin if you used our suggestion for a directory name. You will need to login using the username and password that you used to activate your database.
Now in the box labelled "Create new database" choose a name for your new database, and we recommend something like "vsproducts".
Now you need to enter this information in your vsadmin/db_conn_open.php script.
$db_username = "username"; // Your database login username
$db_password = "yourpassword"; // Your database login password
$db_name = "vsproducts"; // The name of the database you wish to use
$db_host = "mysql"; // The db host is always mysql using Yahoo! Hosting
The last step here is that Yahoo requires you to set up a new folder in the root of your store (where your index.php file resides) called "tmp" - you'll need to make it public and give it world access rights (CHMOD 777).
Now open the createdb.php script in your browser, for instance . . .
And you should be all set!
One last point about Yahoo! Hosting, you may find that your currency symbols do not appear, and if not then you just need to make this simple change in your vsadmin/includes.php script as detailed here.
Once the database connection is correctly set, you can access the admin area by opening the page /vsadmin/admin.php in your browser. The default username and password are mystore / changeme. Take time to go through the admin pages and configure the settings for your requirements as detailed below.
One point to note when naming your pages is that all your pages need to have the .php extension. This is because there is important code before the opening HTML tag which needs a .php extension to be executed.
There are a couple of issues with the FrontPage version when using PHP only. Frontpage extensions do not work with pages with the .php extension, so this means that FrontPage Includes and FrontPage Navigation does not work. We have found a neat way around these issues, but there are a couple of things to bear in mind.
First, for include pages, we have just used PHP includes. It's already set up for you, and you will find the included pages in the includes folder. Unlike FrontPage includes however, all links will be relative to the file that is doing the including. So, for this reason we recommend you use links relative to the site root if you want to use the same include files in folders and sub folders.
Examples of different ways to link pages are . . .
- This is a relative link: mypage.php
- This is a link relative to the site root: /mypage.php
- This is an absolute link: http://www.mysite.com/mypage.php
If Frontpage doesn't recognize the .PHP pages, you'll need to configure it like this:
- In Frontpage go to Tools>Options>Configure Editors
- Choose "Add"
- Put PHP for file type
- Put the same information as you have for htm, html etc. - this is usually
Editor Name: FrontPage
8 kinds of shipping calculations are provided.
- No shipping - Shipping costs are not added....(more information)
- Flat rate shipping - Shipping costs can be set individually per product.... (more information)
- Weight based shipping - Here, shipping is calculated by product weight according to the shipping zone to easily facilitate international shipping. If Weight based shipping is selected, then the country zone can be set in the countries admin panel, and new zones can be edited by following the Edit Postal Zones link in the main admin panel.... (more information)
- Price based shipping - Same as above but based on price rather than weight changes.... (more information)
- UPS Shipping.... More information
- USPS shipping.... More information
- Canada Post.... more information
- FedEx Shipping.... more information
- DHL Shipping ... more information
- Royal Mail Shipping ... more information
To set up the details for Payment Providers, chose the link Edit Payment Providers on the admin home page. The available payment providers will be show on this page, with the active ones in bold. Please note it is possible to have more than one payment provider active at a time, so, for instance giving you the opportunity to use both a Credit Card based system like 2Checkout together with a system like PayPal. If more than one is chosen then your customers are given the choice of payment service in the checkout phase.
For all payment providers you need to ensure that on the store admin settings the URL to your web site is correct. To set this go to the main admin page, admin.php, and chose the Edit Admin Settings link.
Choose from the list below for detailed instructions on setting up for the individual payment providers.
- Payment providers
- Amazon Payments
- Verified by Visa
- Payflow Link
- Payflow Pro
- PayPal Payments Standard
- PayPal Payments Advanced
- PayPal Payments Pro
- Total Web Solutions
- All payment processors
If you chose this option, then your customers can make an order without actually having to go through a payment routine. You can use this option if you wish to take orders that are then paid by bank transfer, check etc at a later date.
The default login and password for the admin area is mystore /
changeme. You are encouraged to change this immediately.
Fraud is always a factor in online sales unfortunately. Always double check with your payment providers admin area to ensure that a sale has been properly processed before shipping products.
Please do read through our checklist here before going live with a site.