Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can't add product to cart.


Guest

Recommended Posts

Posted

I can not add product to my cart.

 

Can some one please helpinkjetboss

 

I have had no problem with OS until I but it on my own server.

 

Here is my includes/config

 

<?php

// Please, note that all changes in this file will be lost

// after reconfiguring application by Plesk

define('HTTP_SERVER', 'http://inkjetboss.com');

define('HTTPS_SERVER', 'http://inkjetboss.com');

define('ENABLE_SSL', 'false');

define('HTTP_COOKIE_DOMAIN', 'inkjetboss.com');

define('HTTPS_COOKIE_DOMAIN', 'inkjetboss.com');

define('HTTP_COOKIE_PATH', '/shopping/');

define('HTTPS_COOKIE_PATH', '/shopping/');

define('DIR_WS_HTTP_CATALOG', '/shopping/');

define('DIR_WS_HTTPS_CATALOG', '/shopping/');

//define('DIR_WS_CATALOG', '/shopping/');

//define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG);

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 our database connection

 

define('DB_SERVER', 'localhost');

define('DB_SERVER_USERNAME', '*********');

define('DB_SERVER_PASSWORD', '*********');

define('DB_DATABASE', '***********');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', '');

?>

 

And here is my admin/includes/config

 

<?php

// Please, note that all changes in this file will be lost

// after reconfiguring application by Plesk

define('HTTP_SERVER', 'http://inkjetboss.com');

define('HTTP_CATALOG_SERVER', 'http://inkjetboss.com');

define('HTTPS_CATALOG_SERVER', 'http://inkjetboss.com');

define('ENABLE_SSL_CATALOG', 'false');

define('DIR_FS_DOCUMENT_ROOT', '/home/httpd/vhosts/inkjetboss.com/httpdocs');

define('DIR_WS_ADMIN', '/shopping/admin/');

define('DIR_FS_ADMIN', '/home/httpd/vhosts/inkjetboss.com/httpdocs/shopping/admin');

define('DIR_WS_CATALOG', '/shopping/');

define('DIR_FS_CATALOG', '/home/httpd/vhosts/inkjetboss.com/httpdocs/shopping/');

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 our database connection

 

define('DB_SERVER', 'localhost');

define('DB_SERVER_USERNAME', '*******');

define('DB_SERVER_PASSWORD', '*******');

define('DB_DATABASE', '**********');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', '');

?>

Posted

I really need someone's help. I install a default store with out adding or changing anything and it still won't keep products in the cart.

 

I am getting desperate.

 

Thanks

Greg

Posted

Hello Greg,

 

Long time no hear. There's one thing I noticed here:

 

I may be wrong (although that never happens ;) ) and I'm sure someone here will correct me, but this part from includes/config:

define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));

Doesn't look right to me, I dunno what thats for but, for you it should be: 'define('DIR_FS_CATALOG', '/home/httpd/vhosts/inkjetboss.com/httpdocs/shopping/'.

 

Not sure tho.

I know you just moved servers, did you mirror the old configs?

 

Noel

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Posted

I tried the new line with no luck.

Yes there are the same execpt for one line

 

define('DIR_WS_HTTP_CATALOG', '/shopping/');

 

That line is not in the old cart, but has to be in the new cart.

 

Thanks

Greg

Posted

Sorry, was looking at the wrong config file. I am looking at the old and new one now

Posted

ok, I compared and made changes to the config files. But it still does not allow me to add to my shopping cart.

 

Anyone please help

Greg

Posted

Check to make sure cookies are being set. Or, for testing, in admin, go to configuration/sessions and set "Force Cookie Use" to False and make sure the session id starts showing up in the URL. Then see if you can keep something in the cart. If so, you have a problem with how cookies are being set.

 

Dan

Dan Stevens

Posted

Ok, I set force cookies. and this the message that the cart gave me. So I changed my settings in IE and it still gave me the same message.

 

Here is the soon to be line cart inkjetboss

And here is the old test cart old test cart

They are on different servers

 

Cookie Usage

 

 

Cookie Privacy and Security

 

 

Cookies must be enabled to purchase online on this store to embrace privacy and security related issues regarding your visit to this site.

 

By enabling cookie support on your browser, the communication between you and this site is strengthened to be certain it is you who are making transactions on your own behalf, and to prevent leakage of your privacy information.

 

 

 

We have detected that your browser does not support cookies, or has set cookies to be disabled.

 

To continue shopping online, we encourage you to enable cookies on your browser.

 

For Internet Explorer browsers, please follow these instructions:

 

Click on the Tools menubar, and select Internet Options

Select the Security tab, and reset the security level to Medium

We have taken this measurement of security for your benefit, and apologize upfront if any inconveniences are caused.

 

Please contact the store owner if you have any questions relating to this requirement, or to continue purchasing products offline.

Posted

Anybody have any ideas on what might need to be fixed

 

Thanks

Greg

Posted

I don't use cookies in my store, granted I didn't get them to work quite right.

 

But right now it looks like a cookie/sessions problem.

 

I thought the config.php default setting for storing sessions was mysql, but you can also try turning cookies back off, and adding this:

 

define('STORE_SESSIONS', 'mysql');

 

You should get a session id in the url then... Unless you installed a SID killer...

 

Try that and let us know how it goes.

 

Noel

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Posted

I was wondering if anyone has set up there own server, I am wodering if this is a cofig problem on the server side of things. Cause this is not my only issue that I have.

 

Anyone please help need to lauch store very soon.

 

Thanks

Greg

Posted

The forms and sessions look ok, so I would suspect a problem with your application_top.php - could you post that here (the shopping cart actions).

 

Matti

Posted

Thank you very much for taking the time to look at this.

 

// Shopping cart actions

if (isset($HTTP_GET_VARS['action'])) {

// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled

if ($session_started == false) {

tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));

}

 

if (DISPLAY_CART == 'true') {

$goto = FILENAME_SHOPPING_CART;

$parameters = array('action', 'cPath', 'products_id', 'pid');

} else {

$goto = basename($PHP_SELF);

if ($HTTP_GET_VARS['action'] == 'buy_now') {

$parameters = array('action', 'pid', 'products_id');

} else {

$parameters = array('action', 'pid');

}

}

switch ($HTTP_GET_VARS['action']) {

// customer wants to update the product quantity in their shopping cart

case 'update_product' : for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) {

if (in_array($HTTP_POST_VARS['products_id'][$i], (is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) {

$cart->remove($HTTP_POST_VARS['products_id'][$i]);

} else {

if (PHP_VERSION < 4) {

// if PHP3, make correction for lack of multidimensional array.

reset($HTTP_POST_VARS);

while (list($key, $value) = each($HTTP_POST_VARS)) {

if (is_array($value)) {

while (list($key2, $value2) = each($value)) {

if (ereg ("(.*)\]\[(.*)", $key2, $var)) {

$id2[$var[1]][$var[2]] = $value2;

}

}

}

}

$attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ? $id2[$HTTP_POST_VARS['products_id'][$i]] : '';

} else {

$attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : '';

}

$cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false);

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

// customer adds a product from the products page

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

// performed by the 'buy now' button in product listings and review page

case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) {

if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));

} else {

$cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

case 'notify' : if (tep_session_is_registered('customer_id')) {

if (isset($HTTP_GET_VARS['products_id'])) {

$notify = $HTTP_GET_VARS['products_id'];

} elseif (isset($HTTP_GET_VARS['notify'])) {

$notify = $HTTP_GET_VARS['notify'];

} elseif (isset($HTTP_POST_VARS['notify'])) {

$notify = $HTTP_POST_VARS['notify'];

} else {

tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));

}

if (!is_array($notify)) $notify = array($notify);

for ($i=0, $n=sizeof($notify); $i<$n; $i++) {

$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'");

$check = tep_db_fetch_array($check_query);

if ($check['count'] < 1) {

tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())");

}

}

tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));

} else {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

break;

case 'notify_remove' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) {

$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");

$check = tep_db_fetch_array($check_query);

if ($check['count'] > 0) {

tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");

}

tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))));

} else {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

break;

case 'cust_order' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) {

if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) {

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid']));

} else {

$cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1);

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

}

}

 

 

 

Thanks Again

Greg

Posted

I was just reading php.net and looking through my files and found that my register_globals is turned off. Would this keep my shopping cart from holding products and Easypopulate from working correctly. I don't know enough about php yet.

 

If anyone knows please reply, deadline getting closer

 

Greg

Posted

Yes - register_globals must be on.

 

Matti

Posted

ok, turned them on, does something need to be restarted? The server or apache?

 

Thanks

Greg

  • 2 weeks later...
Posted

Hello, I have the same problem.

Site is installed on a Plesk server.

Did what you suggest on the two config.php files

 

No Luck

 

Any more help will be greatly appreciated.

 

thanks

Posted

Just read the register_global post, where do i turn it on? I don't see any entries. Any help will be appreciated. thanks

Posted

My hosting company has been sold and when migrated, I now get the register_global fatal error.

 

How do I change it to "on?"

Posted

register_global can be turned on in the php.ini file and then apache has to be restarted. You will have to have root access to be able to do this or ask your hosting service to do this.

 

Greg

  • 3 weeks later...
Posted

I was wondering what is the best setup,

 

seems there are users on my ite that could not make an account with my old sessions settings.

 

to cookie or not too cookie?

 

also what is the best settings for the rest of the sessions?

 

trying to make it most compatible

 

 

thanks

 

Bill Horton

Bill Horton

  • 2 months later...
Posted

Hi!

I'm using version MS2.2. I have done every thing and am feeling gutted. My config file seems ok. Register_Global is ON in php.ini. SSL is not shared. Still I get "empty shopping cart" at login. Following is the config file:

<?php

/*

$Id: configure.php,v 1.14 2003/07/09 01:15:48 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

// Define the webserver and path parameters

// * DIR_FS_* = Filesystem directories (local/physical)

// * DIR_WS_* = Webserver directories (virtual/URL)

define('HTTP_SERVER', 'http://www.annova.biz'); // eg, http://localhost - should not be empty for productive servers

define('HTTPS_SERVER', 'https://annova.biz'); // eg, https://localhost - should not be empty for productive servers

define('ENABLE_SSL', true); // secure webserver for checkout procedure?

define('HTTP_COOKIE_DOMAIN', 'www.annova.biz');

define('HTTPS_COOKIE_DOMAIN', 'https://annova.biz');

define('HTTP_COOKIE_PATH', '');

define('HTTPS_COOKIE_PATH', '');

define('DIR_WS_HTTP_CATALOG', '/cart/catalog/');

define('DIR_WS_HTTPS_CATALOG', '/cart/catalog/');

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_DOCUMENT_ROOT', '/home/annova/annova-www');

define('DIR_FS_CATALOG', '/home/annova/annova-www/cart/catalog');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

// define our database connection

define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers

define('DB_SERVER_USERNAME', 'xxxxxxx');

define('DB_SERVER_PASSWORD', 'xxxxxxxxxx);

define('DB_DATABASE', 'xxxxxxxxx');

define('USE_PCONNECT', 'false'); // use persistent connections?

define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'

?>

 

Is this problem occuring because of any bug in the application_top.php?

Please help you wise guys.. Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...