OsCommmerce FAQ (23 Articles)

How to setup osCommerce to use SMTP

osCommerce could be setup to use the SMTP functionality inside its back-end, but there are some manual modifications needed in order to fully setup the SMTP functionality of this application. Follow these steps to complete the setup: Access the osCommerce administrative panel. The URL should be similar to http://yourdomain.com/admin . Go to Configuration > Email Options. Choose "SMTP" as the Transport Method. Also verify these other settings: Email Line Feels: LF Verify E-Mail Addresses Through DNS: false Use MIME HTML When Sending Emails: false Send E-Mails: true Under the General Store configuration you have to check that the Email Address and Email From fields are set with the ones that you want to use for sending the messages. Before we proceed, the phpMailer script must be installed so that we could set the SMTP functionality properly. ( Please backup your files before proceeding with the following steps) To install phpMailer: 1. Download a copy of phpMailer: http://addons.oscommerce.com/info/5233 2. Connect with FTP or File Manager to your osCommerce installation folder and copy the files class.phpmailer.php and class.smtp.php into these folders: /home/cPanel-username/public_html/osCommerce_installation_folder/admin/includes/classes /home/cPanel-username/public_html/osCommerce_installation_folder/includes/classes/ 3. Access the following files and edit them according to the examples provided below: /home/cPanel-username/public_html/osCommerce_installation_folder/includes/classes/email.php /home/cPanel-username/public_html/osCommerce_installation_folder/admin/includes/classes/email.php Inside each of the email.php files you have to locate the following section around line 519: [sourcecode language="php"] if (EMAIL_TRANSPORT == 'smtp') { return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to .   $this->lf . implode($this->lf, $$ } else { return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this$ } } [/sourcecode] Please comment the following lines as described: [sourcecode language="php"] if (EMAIL_TRANSPORT == 'smtp') { //        return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $$ //      } else { //        return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this$ //      } //    } [/sourcecode] Next, copy and paste the following code directly below the last commented line. The Host, Username and Password fields should be set according to your outgoing mail server. Note that the Username fieled should contain the full email address! [sourcecode language="php"] require_once(DIR_WS_CLASSES . "class.phpmailer.php"); $pMail = new PHPMailer(); $pMail->From     = $from_addr; $pMail->FromName = $from_name; $pMail->IsSMTP(); $pMail->Host     = "mail.yourdomain.com";       // replace with your SMTP server $pMail->Username = "account@yourdomain.com";      // replace with your SMTP username $pMail->Password = "password";          // replace with your SMTP password $pMail->SMTPAuth = true;                        // SMTP authentication must be always turned on (true) $pMail->Subject = $subject; $pMail->Body    = $this->output; $pMail->AddAddress($to_addr, $to_name); $pMail->IsHTML(false); return $pMail->Send(); $pMail->ClearAddresses(); $pMail->ClearAttachments(); } } [/sourcecode] The aforementioned changes should be appyed to both of the email.php files so that both the front-end and back-end of your application could successfully sent…

How To Secure OsCommerce

In order to secure OsCommerce please follow these steps: 1. Download all your OsCommerce files 2. Create a backup in case something goes wrong later 3. Scan all the files with an antivirus software and delete the suspicious ones 4. Check manually for suspicious code in your files. If you have doubts about parts of the code, check the original OsCommerce files 5. Make sure there are no .php (.pl, .cgi) files in your images directory. Executable files are not supposed to be there under any circumstances. 6. Once you perform the above steps upload your files to your webserver. 7. Make sure that your installation is the latest OsCommerce version. If not, upgrade it following the official instructions 8. Password protect your admin directory additionally or limit its access by IP 9. Disable the following functions in PHP: disable_functions =exec,passthru,shell_exec,proc_open,popen,curl_exec,curl_multi_exec Besides that, make sure that register_globals and allow_url_include are turned off. 10. Depending on your host and webserver try to find additional protection in mod_security rules or suhosin rules applicable to OsCommerce. The above steps might not be easy to follow and do not always guarantee full protection. That's why it is recommend to seek professional help. If you are interested Siteground will be pleased to offer you its professional web hosting and security services .…

OsCommerce Security Check

If you have any doubts that your OsCommerce security has been compromised please follow these steps: 1. Check if you have any .php files in the images directory. By default OsCommerce does not store any .php files there. 2. Check for suspicious admin users. This can be done by logging in your OsCommerce admin backend and choosing the option 'Administrators' from the Configuration menu. By default there is only one administrator. 3. Download all your files and scan them with an antivirus software. This can help find some popular exploits but not all. The above steps are simple but efficient. However, they are not always enough and it is recommend to seek professional help. If you are interested Siteground will be pleased to offer you its web hosting and security services .…

OsCommerce Admin Login Problems

If you cannot log into your OsCommerce admin area try the following: 1. Open your OsCommerce database through PhpMyAdmin. If you are not sure which it is check the file includes/configure.php and look for a constant called 'DB_DATABASE'. 2. Run the following two queries: CREATE TABLE IF NOT EXISTS administrators (   id int(11) NOT NULL auto_increment,   user_name varchar(32) NOT NULL,   user_password varchar(40) NOT NULL,   PRIMARY KEY  ( id ) ) ; INSERT INTO administrators ( id , user_name , user_password ) VALUES (1, 'adm', '2272bd2219e0bbc353e33f1e774c9d1e:11'); 3. The above will create a new administrator with login 'adm' and password 'pass11'. Usually problems with admin login in OsCommerce are caused after an upgrade, contributions installation or security issues. In some cases the above steps might not help you resolve the problem and it is recommended to seek professional assistance. In case you are interested Siteground is pleased to offer you its Oscommerce hosting package where such issues are easily resolved. …

How to optimize osCommerce for better performance?

osCommerce is one of the most popular free shopping cart applications currently available. Here are some tips on how to improve the performance of your osCommerce shopping cart: Check your website using this online tool . It will give you valuable information on what modifications can be made in order to improve its performance. Reduce the number of products shown on your main page. Optimize your osCommerce database . Keep the number of additional contributions as low as possible. Install only the most necessary ones. Disable all default osCommerce features you are not using. Keep the number of external links as low as possible. …

How to configure osCommerce to work with a new domain?

In order to configure osCommerce to work properly with another domain, you should modify the two configure.php files in includes/ and admin/includes/ folders to reflect the new domain. The settings that should be changed in includes/configure.php are: HTTP_SERVER - you should change this to your new domain name, e.g. http://newdomain.com: define('HTTP_SERVER', 'http://newdomain.com'); HTTP_COOKIE_DOMAIN - again, this should be changed to reflect your new domain name: define('HTTP_COOKIE_DOMAIN', 'newdomain.com'); If you are using SSL you should also modify: HTTPS_SERVER - for example: define('HTTPS_SERVER', 'https://newdomain.com'); HTTPS_COOKIE_DOMAIN - set this to: define('HTTPS_COOKIE_DOMAIN', 'newdomain.com');   In admin/includes/configure.php you should modify:   HTTP_SERVER - you should change this to your new domain name, e.g. http://newdomain.com: define('HTTP_SERVER', 'http://newdomain.com'); HTTP_CATALOG_SERVER - again, this should be changed to your new domain name: define('HTTP_CATALOG_SERVER', 'http://newdomain.com'); If you are using SSL, you should also change HTTPS_CATALOG_SERVER to: define('HTTPS_CATALOG_SERVER', 'https://newdomain.com'); …

E-commerce application comparison: osCommerce vs CRE Loaded

In this article we will list the most important pros and cons of osCommerce and CRE Loaded Standard. Hopefully, this will help you in your choice of a free shopping cart application. CRE Loaded : pros : - very easy to use; - the standard installation includes a lot of extra modules; - well-organized admin area; - better templates and template management; - easy to upgrade; cons : - some of the default modules are rarely used; - on the other hand, some useful modules are part of the paid CRE Loaded package; osCommerce : pros : - easy installation; - a lot of additional contributions which greatly expand the application's functionality; - sufficient documentation and forum support;   cons : - the installation of most contributions requires changes in the application's code and this may lead to problems; - new versions and upgrades are released very rarely; - older versions do not work properly with MySQL 5; - the installation of a new template is actually a complete new osCommerce installation; - upgrading osCommerce is not an easy task;…

E-commerce application comparison: osCommerce vs Zen Cart

osCommerce and Zen Cart are two of the most popular free shopping cart solutions. But which one is better? Which one of these two would be more suitable for your needs. In this article we have tried to make a comparison between osCommerce and Zen Cart. osCommerce : pros : - easy installation; - a lot of additional contributions which greatly expand the application's functionality; - sufficient documentation and forum support;   cons : - the installation of most contributions requires changes in the application's code and this may lead to problems; - new versions and upgrades are released very rarely; - older versions do not work properly with MySQL 5; - the installation of a new template is actually a complete new osCommerce installation; - upgrading osCommerce is not an easy task; Zen Cart : pros : - easier to use with more intuitive admin area; - more secure; - more modules included in the default installation; cons : - mediocre default templates; - upgrading Zen Cart is not an easy task either; - fewer additional modules/contributions;…

How can I see the exact version of my osCommerce?

In order to check the version of your osCommerce, you should open the includes/ application_top.php file located in your osCommerce installation folder. Look for these two lines: // define the project version   define('PROJECT_VERSION', ' osCommerce Online Merchant v2.2 RC2a '); The value after PROJECT_VERSION defines your current osCommerce version.…

I’m getting a 1054 error in my osCommerce after a website/account transfer

Sometimes, after a website or account transfer, your osCommerce may give a 1054 - Unknown column 'p.products_id' in 'on clause ' error when browsing your products  or when using the search tool. The most common reason for this issue is that your account has been moved from a server running MySQL 4 to a server running MySQL 5. As a solution, you can try applying this osCommerce contribution . In most cases, this will resolve the 1054 problem. If, however, the problem persists, the best solution would be to have your account  migrated to a server running MySQL 4. If you are a SiteGround customer, you can request this migration by posting a support ticket.…

How to transfer my osCommerce from one host to another?

Transferring your osCommerce application includes copying your files and database and modifying the two configure.php files in includes/ and admin/includes/ folders to work with the new server settings. The most important settings which should be modified in includes/configure.php are: HTTP_SERVER - you should set this to your domain name, e.g. http://yourdomain.com: define('HTTP_SERVER', 'http://yourdomain.com'); DIR_FS_CATALOG - the absolute path to your shop, e.g. /home/user/public_html/shop/: define('DIR_FS_CATALOG', '/home/user/public_html/shop'); DB_SERVER - you should set this to localhost : define('DB_SERVER', 'localhost'); DB_SERVER_USERNAME - the username with privileges to access the shop database: define('DB_SERVER_USERNAME', 'user_osc1'); DB_SERVER_PASSWORD - the password for accessing the database: define('DB_SERVER_PASSWORD', 'oscpassword'); DB_DATABASE - the shop database: define('DB_DATABASE', 'user_osc1'); In admin/includes/configure.php , along with the settings above, you should also modify: DIR_FS_DOCUMENT_ROOT - the absolute path to your shop, e.g. /home/user/public_html/shop/: define('DIR_FS_DOCUMENT_ROOT', '/home/user/public_html/shop/'); DIR_FS_ADMIN - the absolute path to the admin folder, e.g. /home/user/public_html/shop/admin/: define('DIR_FS_ADMIN', '/home/user/public_html/shop/admin/'); Some older versions of osCommerce require register_globals to be enabled in order for the shop to function. If you get an error about register_globals being disabled, please check this article to see how to enable…

How to add a banner in osCommerce?

You can easily add a custom banner to your osCommerce shop from the application's admin area > Tools > Banner Manager . More information on how to manage your osCommerce shop can be found in our osCommerce tutorial .…

How to generate the necessary certificates for PayPal IPN?

The PayPal IPN contribution for osCommerce offers OpenSSL public/private key encryption to securely send the order information to PayPal during checkout. Here is information on how to generate the necessary certificates: 1. You should have OpenSSL installed on your computer. Linux distrubutions should have it installed by default, and a Windows version can be downloaded from here . 2. You should generate a private key using this command: openssl genrsa -out my-prvkey.pem 1024 This will create a 1024-bit RSA private key in the file my-prvkey.pem . 3. You should generate a public certificate using this command: openssl req -new -key my-prvkey.pem -x509 -days 365 -out my-pubcert.pem This will create a public certificate in the file my-pubcert.pem . 4. Then you should upload your public certificate to the PayPal website: 4.1. Log in to your PayPal account. 4.2. Click the Profile tab. 4.3. In the Seller Preferences column you should click the Encrypted Payment Settings link. The Website Payment Certificates page should appear. 4.4. Scroll down to the Your Public Certificates section and click the Add button. The Add Certificate page should appear. 4.5. Click the Browse button and select the public certificate that you want to upload to PayPal from your local computer. 4.6. Click the Add button. After you upload the public certificate successfully, it appears in the Your Public Certificates section of the Website Payment Certificates page. 5. A certificate ID will be assigned to your public certificate. You need this certificate ID to encrypt your payment buttons by using PayPal's Encrypted Website Payments program. For more information about PayPal's certificates and their integration please check the official integration documentation…

How to configure osCommerce to work with SSL?

In order to configure osCommerce to work with SSL you should open the file public_html/catalog/includes/ configure.php and make the following changes: define('HTTP_SERVER', 'http://www.yourdomain.com'); // eg, http://localhost - should not be empty for productive servers define('HTTPS_SERVER', 'https://yourdomain.com'); // eg, https://localhost - should not be empty for productive servers define('ENABLE_SSL', true); // secure webserver for checkout procedure define('HTTP_COOKIE_DOMAIN', 'www.yourdomain.com'); define('HTTPS_COOKIE_DOMAIN', 'yourdomain.com'); define('HTTP_COOKIE_PATH', '/catalog/'); define('HTTPS_COOKIE_PATH', '/catalog/'); define('DIR_WS_HTTP_CATALOG', '/catalog/'); define('DIR_WS_HTTPS_CATALOG', '/catalog/'); Similar to the above changes have to be made in the file public_html/catalog/admin/includes/ configure.php which is responsible for the admin area configuration. In the above example we are configuring an osCommerce installation in the catalog directory with domain yourdomain.com . You should adjust the above settings to your details. If you are having problems configuring osCommerce to work with SSL, contact your host for assistance. SiteGround provides the best osCommerce hosting and such requests are handled with ease.…

How to install eCommerce on my hosting account?

By default all Siteground accounts come with no pre-installed applications. An Ecommerce pack may include several features and most often begins with an OsCommerce, a CreLoaded or a Zencart installation. You can have easily installed one of the above by following our Shopping Carts tutorial .…

osCommerce does not use the private SSL

After purchasing your private SSL you have to manually reconfigure your application to use it. For more information how to configure the SSL for osCommerce please check this link: https://www.siteground.com/kb/How_to_configure_osCommerce_to_work_with_SSL/ …

ZenCart / osCommerce / CRELoaded shows security warnings

After a ZenCart / osCommerce / CRELoaded installation you may receive the following warning: "Warning: I am able to write to the configuration file: /home/user/public_html/includes/configure.php. This is a potential security risk..." In order to fix this issue you can follow these steps: Log in your cPanel and go to the File manager; First navigate to your store's directory and then go to the includes directory where you will find the configure.php file; Click on the file in question and from the top right menu change its permissions to 444; You will have to change similarly the permissions of the file configure.php in your store's admin/includes directory. If you don't have cPanel, you can change the permissions using your favorite FTP client .…

How to install a different template to an existing OsCommerce?

osCommerce does not support a template installer option, as Joomla CMS or phpBB forum do, for instance. Installing a new template for osCommerce is actually a new installation of the osCommerce files . The installation of the template will not affect your database which means you will not lose your data and products.…

The requested URL /account.php was not found on this server.

This issue is most commonly caused by incorrectly configured SSL settings for your OS Commerce. If you don not have private SSL and your OS Commerce is enabled you will receive this error. Enabling/disabling SSL in osCommerce is quite straightforward. You have to edit / includes/ configure.php to disable SSL and the code takes care of the rest. This is an example of SSL enabled configuration: // Define the webserver and path parameters // * DIR_FS_* = Filesystem directories (local/physical) // * DIR_WS_* = Webserver directories (virtual/URL) define('HTTP_SERVER', 'http://www.yourdomain.com'); // eg, http://localhost - should not be empty for productive servers define('HTTPS_SERVER', 'https://yourdomain.com'); // eg, https://localhost - should not be empty for productive servers define('ENABLE_SSL', true); // secure webserver for checkout procedure? define('HTTP_COOKIE_DOMAIN', 'www.yourdomain.com'); define('HTTPS_COOKIE_DOMAIN', 'yourdomain.com'); define('HTTP_COOKIE_PATH', '/catalog/'); define('HTTPS_COOKIE_PATH', '/catalog/'); define('DIR_WS_HTTP_CATALOG', '/catalog/'); define('DIR_WS_HTTPS_CATALOG', '/catalog/'); In order to disable the SSL you will have to replace define('ENABLE_SSL', true ); with define('ENABLE_SSL', false ); …

osCommerce error ‘Cannot reassign this’

The error appears because your OS Commerce is based on PHP4 rather than PHP5. To resolve the error message, you should follow the instructions below: 1. Go to your cPanel . Refer to SiteGround cPanel access guide. 2. Click on the File Manager icon. 3. Click on the folder icon next to public_html folder name. 4. Click on the folder icon next to the folder in which your osCommerce is installed 5. Find ../catalog/admin/includes/classes/ upload.php file and click on it 6. In the upper right corner you will see several management options for upload.php file. Click on Edit File 7. Open the file and find the line (about 30 lines down) that says: // self destruct $this = null; And change it to: // self destruct // $this = null; unset($this); This should solve your problem. If you find modifying the code yourself difficult, ask your host for assistance. SiteGround provides the best osCommerce hosting and such issues are resolved in minutes.…