|
Stocking virtual shelves
Following on from the previous tutorial in which we installed osCommerce to our server, you should be familiar with the fact that the shopping cart installs into two independent components: the actual shop the customer sees within the ‘main/catalog’ directory and the administration pages contained, by default, within the ‘/catalog/admin’ folder.
Even with a default installation, digging through the pages makes it clear how complex and comprehensive the osCommerce shopping cart actually is. Only when you have a reasonable grasp of what the store pages provide by default should you consider entering the administration pages to begin modifying to reflect your own store identity and the products you wish to offer.
There is, of course, a third component to the shopping cart, in the form of the MySQL database that will contain all your store’s records, including customers, sales and products. The admin interface provides controls for managing this element, though you’ll probably also have access through a front-end application, such as phpMyAdmin, if the thought of tweaking your database directly is daunting.
Personalise your database Once you’re ready to begin customising the content of your osCommerce store, head into the admin pages and turn towards the Configuration area. The initial ‘My Store’ section provides self-explanatory fields that enable you to begin personalising the database and take over ownership from the default sample content.
The Catalog section provides controls that define the product categories your store will come to offer. Although it may be tempting to spend time populating the section, it’s recommended that you wait until you’ve configured the remaining options. This is to avoid duplication, because subsequent options will include adding or removing database columns and, with a large catalogue of products, you may need to edit each entry yet again. Move on instead to the Modules section, from where you can define the types of payment your store will accept, the shipping rates and how the order totals are calculated.
The Customers Orders section can also be bypassed for the moment, as this will ultimately contain client information, order details and so on. The Locations/Taxes section should be completed first by choosing those countries you’ll be dealing with, and their related tax classes and rates.
The Localisation section is another important category to update, as you’ll undoubtedly want to change the default US Dollar currency. The original installation only provides access to Euro and US Dollar currencies. To add UK Sterling, click the ‘New Currency’ button and complete the necessary fields then check the ‘Set as Default’ option to override the US bias. Your new currency should be set with a value of 1.00, which means you’ll need to manually amend the equivalent values for the Euro and US Dollar to reflect any foreign prices that you intend to make available.
The Reports category, like Customers, can be ignored until your store becomes functional, because this provides information on products viewed and purchased, and so on. However, the Tools section should be visited regularly, not least for backing up your database. This won’t back up your store’s reliant PHP and HTML pages, so take care to include such a procedure within your regular routine.
Configure your store Although much of the configuration of your new store can be done using the Admin front-end interface, there will be occasions when you need to dig into the code of a particular page to further configure your new store. To do this, you’ll need a reasonable understanding of where you can find specific controls amid a mass of files and folders. Before you rush in to change attributes and variables, bear in mind that any previous changes may have altered some settings in your server files, which you’ll need to download before you continue to edit and upload local versions.
During the installation process, you will have copied the contents of the entire osCommerce pages into the ‘../catalog’ folder of your server. This contains the mass of PHP files your customers will execute as they browse your new store. Any changes here will alter page layout. The ‘../catalog/images’ folder contains the graphic files your store relies on, such as icons, arrows and product images. The ‘../catalog/includes/’ directory contains a number of important files used to control specific elements of your page layout. Changes you’ll no doubt want to make here include the ‘../catalog/includes/english.php’ file – a quick glance through the well-commented code will reveal many of the more obvious changes you may want to apply, such as changing the page title throughout your site to reflect your particular business.
Similarly, you can modify the ‘../includes/english/conditions.php’ file to create your own Terms of Use statement, or the ‘privacy.php’ file within the same directory for privacy notice information. The most immediate change to make is that of the default homepage text, which can be done through the ‘index.php’ file within the ‘../includes/English/’ directory. The default help copy is great for troubleshooting your original installation but will be unintelligible to your site visitors. Open the file and amend the entire contents of the ‘TEXT_MAIN’ definition and your store will soon begin to look more enticing. Another important change as you claim ownership of the store is to replace the default logo contained at the head of the page. Upload your preferred logo to the ‘../catalog/images/’ directory and open the ‘../catalog/includes/header.php’ file for editing. Scroll to line 57, where you’ll find a reference for the TEP_IMAGE. Switch ‘oscommerce.gif’ for your new logo filename and make any required changes to the dimensions. You can also change the equivalent image within your admin pages by editing the ‘../admin/includes/header.php’ file at line 19.
Further modification of the homepage layout can be made to the ‘../includes/column_left.php’ and ‘column_right.php’ files, which enable you to determine which boxes appear along the edges of your layout. Feel free to mix and match these from one side to the other to balance your page layout, or delete or comment them out if you don’t feel they’re relevant to your product listings.
The final essential files you’ll need to be aware of are those we introduced last month. The ‘configure.php’ files located within the ‘../includes’ and ‘../admin/includes’ directories contain important global information about your store, the admin area and their relationship to the underlying database. The admin version, for example, enables you to change the default path for your admin pages, which you should already have changed from its default ‘../admin’ location for security reasons.
For the ultimate customisation of your store, you should turn to the primary CSS file, ‘stylesheet.css’, located within the main ‘../catalog’ folder. This is a lengthy document that may be tricky to adapt and, though it’s well commented, a back-up should be made before any changes are applied. You should get used to the main settings before you jump into this because, in the next tutorial, we’ll take a look at additional components you may want to add to your osCommerce shopping cart, including templates and themes.
|