Ecommerce Templates > WordPress > Troubleshooting Ecommerce Templates WordPress integration

Troubleshooting Ecommerce Templates WordPress integration

Wordpress shopping cart software

We have compiled a list of the most common problems reported with the Ecommerce Templates WordPress integration.

If you are having an issue and don't find it addressed below, please do post on our support forum and one of the developers will be able to help you out.

 

No incfunctions.php file

If you receive this error on your store pages it means that the PHP include lines haven't been added to the file header.php or that you have updated your theme and the header.php file has been overwritten.

In WordPress go to Appearance > Editor page and choose Header (header.php). The very first line will probably be

<?php

immediately after that add

session_cache_limiter('none');
session_start();
ob_start();
include "vsadmin/db_conn_open.php";
include "vsadmin/inc/languagefile.php";
include "vsadmin/includes.php";
include "vsadmin/inc/incfunctions.php";
include "vsadmin/inc/metainfo.php";

so the page now begins like this

<?php
session_cache_limiter('none');
session_start();
ob_start();
include "vsadmin/db_conn_open.php";
include "vsadmin/inc/languagefile.php";
include "vsadmin/includes.php";
include "vsadmin/inc/incfunctions.php";
include "vsadmin/inc/metainfo.php";

It may be the header.php begins with a doctype declaration like this

<!DOCTYPE html>

...if that is the case add the lines above so the beginning of header.php now looks like this

<?php
session_cache_limiter('none');
session_start();
ob_start();
include "vsadmin/db_conn_open.php";
include "vsadmin/inc/languagefile.php";
include "vsadmin/includes.php";
include "vsadmin/inc/incfunctions.php";
include "vsadmin/inc/metainfo.php"; ?><!DOCTYPE html>

The content of the store pages shows correctly but the title shows as "Page Not Found"

If the title of the page shows as "Page not found" but the content shows correctly it just means that the page isn't available in your WordPress admin under All Pages - just add the page there using the correct permalink for that page. You don't necessarily need to add it to any of your menus but it will need to be listed there.

The menus I create in WordPress aren't being shown on my site

This may well happen if you server is running an older version of PHP / mySQL. Make sure your server is running a minimum version of PHP v5.3 (v5.0 with mySQLi installed) If you are not sure of that a quick note to your host should sort it out. Once you have been updated to 5.3 or above check your vsadmin/db_conn_open.php file is set up to use the mySQLi connection required by this integration. It should look like this

<?php

// You host should be able to provide you with these settings if you do not know them already

$db_username = "xxxxx_username"; // Your database login username
$db_password = "PaSsWoRd123"; // Your database login password
$db_name = "xxxxx_dbname"; // The name of the database you wish to use
$db_host = "localhost"; // The address of the database. Often this is localhost, but may be for example db.yoursite.com

//////////////////////////////////////////////////
// Please do not edit anything below this line. //
//////////////////////////////////////////////////

$GLOBALS['ectdatabase'] = new mysqli($db_host, $db_username, $db_password, $db_name);
if(mysqli_connect_error()){
ob_clean();
print '<html><head><title>Database connect error</title></head><body><div style="margin:20px;clear:both">Database Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error() . '</div>';
print('<div style="margin:20px;clear:both">You need to set your database connection in vsadmin/db_conn_open.php</div>');
print '<div style="margin:20px;clear:both">For help setting your database connection please see...<br />';
print '<a href="https://www.ecommercetemplates.com/phphelp/ecommplus/instructions.asp#dbconn" target="_blank">https://www.ecommercetemplates.com/phphelp/ecommplus/instructions.asp#dbconn</a></div>';
print '<div style="margin:20px;clear:both">We also have a support forum here...<br />';
print '<a href="https://www.ecommercetemplates.com/support/" target="_blank">https://www.ecommercetemplates.com/support/</a></div>';
die('</body></html>');
}
?>

If it doesn't copy the above into db_conn_open.php and put back your values for the user, database, password and host.

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'user'@'localhost' (using password: YES) in /home/mysite/public_html/vsadmin/db_conn_open.php on line 14

This probably means that the user you set up hasn't been assigned to the database or that it doesn't have full permissions for the database it was assigned to. Go to your hosting control panel and make the user has been assigned and has full permissions for the store database.

Table 'xxx_xxx' doesn't exist

Make sure you have run the file createdb.php in your browser. After running the file you should get a successful message which means all the store database tables have been created.

Error message on cart.php: The PHP session has not been started. This can cause problems with the shopping cart function. For help please go to https://www.ecommercetemplates.com/support/

The most likely reason for this is that your header.php doesn't start with the following code

<?php
session_cache_limiter('none');
session_start();
ob_start();

When I add to cart the shopping cart shows empty

Check the address bar when adding to cart. It could be you are switching to the URL with / without the "www" eg the products page is not using the www but the cart page is. It may be you need to make a change to your .htaccess file, our developers can help with that on the support forum but do also check that in your store control panel, your Store URL is set correctly in the main admin settings page.

Changes I makes to vsadmin/includes.php don't show up on my store

The syntax is slightly different for the includes.php file in WordPress. For example on a regular PHP if you wanted to turn on the "Email a Friend" feature, you would add

$useemailfriend=TRUE;

to the list but for the WordPress integration that should be

$GLOBALS['useemailfriend']=TRUE;

Other examples would be

$GLOBALS['emailfromname']="Your Store Name";

$GLOBALS['actionaftercart']=3;

etc.