Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

shopping cart adding 10 items


4print

Recommended Posts

Posted

Good Morning

 

Everytime i add a sigle item to the shopping cart it adds in multiples of ten.

 

could someone please point me in the right direction for a fix.

 

many thanks

Christian

Posted
Good Morning

 

Everytime i add a sigle item to the shopping cart it adds in multiples of ten.

 

could someone please point me in the right direction for a fix.

 

many thanks

Christian

 

 

After further reading http://www.oscommerce.com/forums/index.php?sho...g+cart+quantity

 

i have checked in my includes\application_top.php and near the add_product and buy_now cases of the action swtich. By default the osc adds 1 when it calls the add_cart function

 

this is set to 1 in both instances yet it adds 10 instead of one?

 

Mostly confused.

Christian

Posted
/includes/application_top.php is where the cart adding stuff goes on.

 

 

Hi burt

 

This is what i'm seeing.

 

// 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;

 

really cant see why its showing 10 and not 1

Posted
Hi burt

 

This is what i'm seeing.

 

// 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;

 

really cant see why its showing 10 and not 1

 

 

Hello again.. For anyone who comes across this problem i found the answer.

 

There was a mistake in includes/languages/english.php

 

wrong version

// shopping_cart box text in includes/boxes/shopping_cart.php
define('BOX_HEADING_SHOPPING_CART', 'Shopping Cart');
define('BOX_SHOPPING_CART_EMPTY', '0 items');

 

Correct version

 

// shopping_cart box text in includes/boxes/shopping_cart.php
define('BOX_HEADING_SHOPPING_CART', 'Shopping Cart');
define('BOX_SHOPPING_CART_EMPTY', [b]' items')[/b];

 

 

Hope this helps anyone, thanks to those who passed by and took alook.

 

Christian

Archived

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

×
×
  • Create New...