Full service web hosting, great prices and support. Starts at $1.99/month!
Results 1 to 9 of 9

Thread: Can not add items to shopping cart

  1. #1
    sjleather
    Guest


    Default Can not add items to shopping cart

    I've been working with a new installation for about a month now and I've been unable to get items to add to the shopping cart at all. No matter what changes I've made to configure.php or my supporting server's directory security, I always get "Your Shopping Cart is empty!" when I try to add an item via buy now or add to cart. I get no errors in my browser or in my log files.

    All my files are currently in my https directory and my configure.php file reflects this.

    osCommerce 2.2-MS2
    PHP Version 4.3.2 (Zend: 1.3.0)
    Apache/2.0.46 (Red Hat)
    MySQL 3.23.58
    using Plesk 7.0.4 to manage server which auto-installed osCommerce

  2. #2
    osCMax Developer


    Can not add items to shopping cart


    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    23,134
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    michael_s     $ 10.00
    Rep Power
    597


    Default RE: Can not add items to shopping cart

    This is a common symptom if your session settings are incorrect for your server, or your cookie domain settings are wrong.

    What is your servers root path, your home path? Post a copy of your configure.php (minus the database info).

  3. #3
    sjleather
    Guest


    Default RE: Can not add items to shopping cart

    Server's root path
    /home/httpd/vhosts/sjleather.com/httpsdocs/osCommerce/
    Home path
    /home/httpd/vhosts/sjleather.com/

    My configure.php files are different, I wasn't sure if I was supposed to match the fields up from one to the other as some of the admin utilities change only one of them. I couldn't find any reference to which one is used when.

    I'm currently using a shared ssl certificate for testing.

    configure.php from includes directory:
    define('HTTP_SERVER', 'https://www.sjleather.com');
    define('HTTPS_SERVER', 'https://www.sjleather.com');
    define('ENABLE_SSL', 'true');
    define('HTTP_COOKIE_DOMAIN', 'www.sjleather.com');
    define('HTTPS_COOKIE_DOMAIN', '');
    define('HTTP_COOKIE_PATH', '/osCommerce/');
    define('HTTPS_COOKIE_PATH', '');
    define('DIR_WS_HTTP_CATALOG', '/osCommerce/');
    define('DIR_WS_HTTPS_CATALOG', '/osCommerce/');
    define('DIR_WS_IMAGES', 'images/');
    define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
    define('DIR_WS_INCLUDES', 'includes/');
    define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
    define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
    define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
    define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
    define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

    define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
    define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));
    define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
    define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

    define('STORE_SESSIONS', 'mysql');

    configure.php from admin/includes

    define('HTTP_SERVER', 'https://www.sjleather.com');
    define('HTTPS_SERVER', 'https://www.sjleather.com');
    define('HTTP_CATALOG_SERVER', 'https://www.sjleather.com');
    define('HTTPS_CATALOG_SERVER', 'https://www.sjleather.com');

    define('HTTP_COOKIE_DOMAIN', 'www.sjleather.com');
    define('HTTPS_COOKIE_DOMAIN', '');
    define('HTTP_COOKIE_PATH', '/osCommerce/');
    define('HTTPS_COOKIE_PATH', '');
    define('DIR_WS_HTTP_CATALOG', '/osCommerce/');
    define('DIR_WS_HTTPS_CATALOG', '/osCommerce/');

    define('ENABLE_SSL_CATALOG', 'true');
    define('DIR_FS_DOCUMENT_ROOT', '/home/httpd/vhosts/sjleather.com/httpsdocs');
    define('DIR_WS_ADMIN', '/osCommerce/admin/');
    define('DIR_FS_ADMIN', '/home/httpd/vhosts/sjleather.com/httpsdocs/osCommerce/admin');
    define('DIR_WS_CATALOG', '/osCommerce/');
    define('DIR_FS_CATALOG', '/home/httpd/vhosts/sjleather.com/httpsdocs/osCommerce/');
    define('DIR_WS_IMAGES', 'images/');
    define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
    define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
    define('DIR_WS_INCLUDES', 'includes/');
    define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
    define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
    define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
    define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
    define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
    define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
    define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
    define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
    define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
    define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

    define('STORE_SESSIONS', 'mysql');

  4. #4
    osCMax Developer


    Can not add items to shopping cart


    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    23,134
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    michael_s     $ 10.00
    Rep Power
    597


    Default RE: Can not add items to shopping cart

    All of these are wrong:
    Code:
    define('HTTP_COOKIE_DOMAIN', 'www.sjleather.com'); 
    define('HTTPS_COOKIE_DOMAIN', ''); 
    define('HTTPS_COOKIE_PATH', '');
    Based on your domain and path info, they should be:

    Code:
    define('HTTP_COOKIE_DOMAIN', 'sjleather.com'); 
    define('HTTPS_COOKIE_DOMAIN', 'sjleather.com'); 
    define('HTTPS_COOKIE_PATH', '/osCommerce/');
    The admin configure.php is used for the Admin panel and the catalog configure.php file is used for the catalog.

  5. #5
    sjleather
    Guest


    Default

    Made those changes and still get an empty cart when trying to add items.

    Not sure if it's relevant but I do get sessions stored in the sql sessions table with the session ID that's generated in the browser when I have define('STORE_SESSIONS', 'mysql'); set and I have files appear in the cache directory when I have define('STORE_SESSIONS', ''); set. Either way, I still don't get items in my cart. I'm not quite sure how to read the "value" field in the session database but here's one for a cart I just tried to add an item to:

    cart|O:12:"shoppingcart":5:{s:8:"contents";a:0:{}s :5:"total";i:0;s:6:"weight";
    i:0;s:6:"cartID";N;s:12:"content_type";b:0;}langua ge|s:7:"english";
    languages_id|s:1:"1";currency|s:3:"USD";navigation |O:17:"navigationhistory":
    2:{s:4:"path";a:1:{i:0;a:4:{s:4:"page";s:9:"index. html";s:4:"mode";
    s:3:"SSL";s:3:"get";a:0:{}s:4:"post";a:0:{}}}s:8:" snapshot";
    a:0:{}}new_products_id_in_cart|s:7:"107{3}8";

    (carriage returns added for readability)

  6. #6
    osCMax Developer


    Can not add items to shopping cart


    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    23,134
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    michael_s     $ 10.00
    Rep Power
    597


    Default

    What are your sessions settings in the admin? Turn force cookies to true and see if that helps. Also, try setting recreate session to true as well. Test it after forcing cookies, if it works, great. If not, then also test the recreate session setting...

  7. #7
    sjleather
    Guest


    Default

    By default this was my session information:

    Session Directory /home/httpd/vhosts/sjleather.com/httpsdocs/tmp/
    Force Cookie Use False
    Check SSL Session ID False
    Check User Agent False
    Check IP Address False
    Prevent Spider Sessions False
    Recreate Session False

    I tried alternately changing Force Cookie and Recreate Session and also turned them on together with no luck. Also tried both ways with cache set to mysql and file system.

    I have been exiting and restarting my browser and clearing the browser cache inbetween tests to there's no question of browser issues. (Using both IE6 and Firefox 1.04 for testing)

  8. #8
    sjleather
    Guest


    Default

    Thanks for all your help.
    With the server admin, I finally figured out it was a problem related to register_globals.
    I pulled down a fix from the community contributions site and made the code modifications.

  9. #9
    HipHopServers
    Guest


    Default

    I would help if you told people what contribution you used for the fix.

Similar Threads

  1. Sort the items in shopping cart, in Descending Order
    By sarath26 in forum osCMax v2 Features Discussion
    Replies: 0
    Last Post: 12-27-2006, 07:37 AM
  2. Template Help "Shopping Cart 0 items"
    By ALElder in forum osCmax v2 Customization/Mods
    Replies: 4
    Last Post: 10-22-2006, 04:33 PM
  3. Add items to shopping cart outside store.
    By akasharkbow in forum osCmax v2 Customization/Mods
    Replies: 0
    Last Post: 03-12-2006, 12:16 PM
  4. Cart Items Display
    By Ttownsend in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 11-22-2004, 11:54 PM
  5. Cannot add items to cart
    By futuretek in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 01-08-2004, 06:48 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •