Entries Tagged as 'E-commerce'

zen cart Warning: session_start() No such file or directory (2) in /dir/public_html/includes/functions/sessions.php on line 102

The error comes up when trying to use file based session storage instead of database. Apparently, the configuration for what directory to store the session is not in the configuration files but in the database table “configuration”.

If you upgrade your php to version 5.2.1, the database session storage breaks. Therefore, I had to switch to file system based storage. But the catch was that I no longer could log into admin as the session could not start. The configuration.php files did not have this constant.

The way to fix this is to log into your database and update the session directory record.

“UPDATE configuration SET configuration_value=’/your/new/direcotory/’ WHERE configuration_title=’session directory’;”

System Specs:
php.5.2.1
zencart 1.3.5
apache 1.3.37
MySQL 5.0.45

Zencart and Ultimate URL - 1054 Unknown column ‘c.parent_id’ in ‘on clause’

Configuration:

Linux
Apache 1.3
Mysql 5
PHP 5
Zencart 1.3.5
Chemo Ultimate URL for Zencart 1.3.5

Problem:

After installation, the error message
1054 Unknown column ‘c.parent_id’ in ‘on clause’
shows up on any page in the catalog.

Fix:

Make the following change to /include/classes/seo.url.php
Original:

SELECT c.categories_id as id, c.parent_id, cd.categories_name as cName, cd2.categories_name as pName
FROM “.TABLE_CATEGORIES.” c,
“.TABLE_CATEGORIES_DESCRIPTION.” cd
LEFT JOIN “.TABLE_CATEGORIES_DESCRIPTION.” cd2
ON c.parent_id=cd2.categories_id AND cd2.language_id=’”.(int)$this->languages_id.”‘
WHERE c.categories_id=cd.categories_id
AND cd.language_id=’”.(int)$this->languages_id.”‘”;

Change:

“SELECT c.categories_id as id, c.parent_id, cd.categories_name as cName, cd2.categories_name as pName
FROM
“.TABLE_CATEGORIES_DESCRIPTION.” cd,
“.TABLE_CATEGORIES.” c
LEFT JOIN “.TABLE_CATEGORIES_DESCRIPTION.” cd2
ON c.parent_id=cd2.categories_id AND cd2.language_id=’”.(int)$this->languages_id.”‘
WHERE c.categories_id=cd.categories_id
AND cd.language_id=’”.(int)$this->languages_id.”‘”;

Zen Cart New Product Type Using Ultimate SEO URL Package

This post is to help those who are using Zen Cart and are using new product types with Ultimate SEO URL package installed. There are a couple of things to change in order to make everything work together as it took me a couple of hours to figure out. I hope this will help others save these couple of hours of hair pulling.

Prerequisite:

Zen Cart installed
New product type added
Ultimate SEO URL package installed
Goal:

Have the URLs for the products using the new product type show URLs in this format.

http://www.domain.com/[product name]-p-[product id].html

Changes Required:

NOTE: [handler_name] is the new product type name added.

  1. File - seo.url.php
    Original:
    $seo_pages = array(
    FILENAME_DEFAULT,
    FILENAME_PRODUCT_INFO,
    FILENAME_POPUP_IMAGE,
    FILENAME_PRODUCT_REVIEWS,
    FILENAME_PRODUCT_REVIEWS_INFO,
    );Result:

    $seo_pages = array(
    FILENAME_DEFAULT,
    FILENAME_PRODUCT_INFO,
    FILENAME_POPUP_IMAGE,
    FILENAME_PRODUCT_REVIEWS,
    FILENAME_PRODUCT_REVIEWS_INFO,
    FILENAME_[handler name]_INFO
    );
  2. File - seo.url.php
    Original:
    $this->reg_anchors = array(
    ‘products_id’ => ‘-p-’,
    ‘cPath’ => ‘-c-’,
    ‘manufacturers_id’ => ‘-m-’,
    ‘pID’ => ‘-pi-’,
    ‘products_id_review’ => ‘-pr-’,
    ‘products_id_review_info’ => ‘-pri-’,Result:
    $this->reg_anchors = array(
    ‘products_id’ => ‘-p-’,
    ‘cPath’ => ‘-c-’,
    ‘manufacturers_id’ => ‘-m-’,
    ‘pID’ => ‘-pi-’,
    ‘products_id_review’ => ‘-pr-’,
    ‘products_id_review_info’ => ‘-pri-’,
    ‘[handler name]_id’ => ‘-pji-’,

  3. File - seo.url.php -> function parse_parameters
    Find “case ‘products_id’:”
    Within this case statement, add the following.case ($page == FILENAME_[handler name]_INFO):
    $url = $this->make_url($page, $this->get_product_name($p2[1]), ‘[
    handler_name]_id’, $p2[1], ‘.html’, $separator);
    break;
  4. File - [webroot]/includes/filenames.php
    Add the following definition.define(’FILENAME_[handler name]_INFO’, ‘[handler name]_info’);
  5. File - [webroot]/.htaccess
    Add the following rewrite rule.RewriteRule ^(.*)-pji-(.*).html$ index\.php?main_page=[
    handler_name]_info&products_id=$2&%{QUERY_STRING} [L]