Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Updating the cart removes all addributes and associated cost


DamanC

Recommended Posts

Hi Guys,

 

Have spent all weekend on this to no avail :( I hope you guys can help.

 

I have encountered a bug. Every time the update button is clicked in the shopping cart, weather it be for qty update, removal or even just clicking the button, all of my attributes are lost.

 

Another pair of eyes over this would be great :)

 

This is my catalog/shopping_cart.php

 

 

 

<?php
/*
 $Id: shopping_cart.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2007 osCommerce

 Released under the GNU General Public License
*/

 require("includes/application_top.php");

 if ($cart->count_contents() > 0) {
include(DIR_WS_CLASSES . 'payment.php');
$payment_modules = new payment;
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOPPING_CART);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHOPPING_CART));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<script type="text/javascript" src="iepngfix_tilebg.js"></script>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<style type="text/css">
.ie6_png 			{behavior: url("iepngfix.htc") }
.ie6_png img		{behavior: url("iepngfix.htc") }
</style>
</head>
<body>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" class="<?php echo MAIN_TABLE; ?>" cellspacing="0" cellpadding="0">
<tr>
<td class="<?php echo BOX_WIDTH_TD_LEFT; ?>"><table border="0" class="<?php echo BOX_WIDTH_LEFT; ?>" cellspacing="0" cellpadding="0">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td class="<?php echo CONTENT_WIDTH_TD; ?>"><?php echo panel_top(); ?><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?>

<?php echo tep_draw_top();?>

<?php echo tep_draw_title_top();?>

			<?php echo HEADING_TITLE; ?>

<?php echo tep_draw_title_bottom();?>

<?php
 if ($cart->count_contents() > 0) {
?>

<?php echo tep_draw1_top();?>

<?php
$info_box_contents = array();
$info_box_contents[0][] = array('align' => 'center',
								'params' => ' class="s_cart_head s_cart_head_padd remove"',
								'text' => ''.TABLE_HEADING_REMOVE.'');

$info_box_contents[0][] = array('align' => 'center',
								'params' => ' class="s_cart_head s_cart_head_padd products"',
								'text' => ''.TABLE_HEADING_PRODUCTS.'');

$info_box_contents[0][] = array('align' => 'center',
								'params' => ' class="s_cart_head s_cart_head_padd quantity"',
								'text' => ''.TABLE_HEADING_QUANTITY.'');

$info_box_contents[0][] = array('align' => 'center',
								'params' => ' class="s_cart_head s_cart_head_padd total"',
								'text' => ''.TABLE_HEADING_TOTAL.'');

$any_out_of_stock = 0;
$products = $cart->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
// Push all attributes information in an array
  if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
	while (list($option, $value) = each($products[$i]['attributes'])) {
	  echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
	  $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
								  from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
								  where pa.products_id = '" . (int)$products[$i]['id'] . "'
								   and pa.options_id = '" . (int)$option . "'
								   and pa.options_id = popt.products_options_id
								   and pa.options_values_id = '" . (int)$value . "'
								   and pa.options_values_id = poval.products_options_values_id
								   and popt.language_id = '" . (int)$languages_id . "'
								   and poval.language_id = '" . (int)$languages_id . "'");
	  $attributes_values = tep_db_fetch_array($attributes);

	  $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
	  $products[$i][$option]['options_values_id'] = $value;
	  $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
	  $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
	  $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];
	}
  }
}

for ($i=0, $n=sizeof($products); $i<$n; $i++) {
  if (($i/2) == floor($i/2)) {
	$info_box_contents[] = array('params' => '');
  } else {
	$info_box_contents[] = array('params' => '');
  }

  $cur_row = sizeof($info_box_contents) - 1;
  $p_cart_pic	= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
  $info_box_contents[$cur_row][] = array('align' => 'center',
										 'params' => ' class="s_cart_td"',
										 'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id']));

  $products_name = '<table border="0" cellspacing="10" cellpadding="0" align="center" class="main">' .
				   '<tr><td colspan="2" align="center" class="name name2_padd"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . $products[$i]['name'] . '</a></td></tr>'.
				   '<tr><td align="center">'.tep_draw_prod_pic_top().''.$p_cart_pic.''.tep_draw_prod_pic_bottom().'</td></tr>';

  if (STOCK_CHECK == 'true') {
	$stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']);
	if (tep_not_null($stock_check)) {
	  $any_out_of_stock = 1;

	  $products_name .= $stock_check;
	}
  }

  if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
	reset($products[$i]['attributes']);
	  $products_name .= '';		
	while (list($option, $value) = each($products[$i]['attributes'])) {
	  $products_name .= '<tr><td align="center"><i>  ' . $products[$i][$option]['products_options_name'] . ' - ' . $products[$i][$option]['products_options_values_name'] . '</i><br>';
	}
	  $products_name .= '</td></tr>';		
  }

  $products_name .= '</table>';

  $info_box_contents[$cur_row][] = array('params' => '',
										 'text' => $products_name);

  $info_box_contents[$cur_row][] = array('align' => 'center',
										 'params' => 'class="s_cart_td"',
										 'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="2"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));

  $info_box_contents[$cur_row][] = array('align' => 'center',
										 'params' => 'class="s_cart_td"',
										 'text' => '<span class="productSpecialPrice">' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</span>');
}

new productListingBox($info_box_contents);
?>

<?php
if ($any_out_of_stock == 1) {
  if (STOCK_ALLOW_CHECKOUT == 'true') {
?>

  <table cellpadding="0" cellspacing="0" border="0">
	  <tr><td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td></tr>
  </table>
<?php
  } else {
?>
  <table cellpadding="0" cellspacing="0" border="0">
	  <tr><td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td></tr>
  </table>
<?php
  }
}
?>

<?php  /* echo tep_draw_infoBox2_top(); */ ?>

<div class="cart_line_x padd2_gg"><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></div>

			<table cellspacing="0" cellpadding="0" border="0">
				<tr>
					<td width="80%" align="right" class="cart_total_left"><?php echo SUB_TITLE_SUB_TOTAL; ?></td>
					<td width="20%" align="center" class="cart_total_right main">														
						<span class="productSpecialPrice"><?php echo $currencies->format($cart->show_total()); ?></span>
					</td>
				</tr>
			</table>

<div class="cart_line_x padd2_gg"><?php echo tep_draw_separator('spacer.gif', '1', '1'); ?></div>

			<table cellspacing="0" cellpadding="0" border="0" >
				<tr>
					<td style="padding:15px 20px 9px 20px;" class="button2_marg bg_input"><?php echo tep_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); ?>   <?php

		$back = sizeof($navigation->path)-2;
			if (isset($navigation->path[$back])) {
			echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping1.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; 
			}
			?>   <?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td>
				</tr>
			</table>	

<?php  /* echo tep_draw_infoBox2_bottom(); */ ?>

<?php
$initialize_checkout_methods = $payment_modules->checkout_initialization_method();

if (!empty($initialize_checkout_methods)) {
?>
<table cellpadding="0" cellspacing="0" border="0">
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td align="right" class="main" style="padding-right:50px;"><?php echo TEXT_ALTERNATIVE_CHECKOUT_METHODS; ?></td>
  </tr>
<?php
  reset($initialize_checkout_methods);
  while (list(, $value) = each($initialize_checkout_methods)) {
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td align="right" class="main"><?php echo $value; ?></td>
  </tr>
</table>

<?php echo tep_draw4_bottom();?>

<?php
  }
}
 }else {
?>

<?php echo tep_draw1_top();?>

<?php echo tep_draw_infoBox_top();?>

<?php new infoBox_search_criteria(array(array('text' => TEXT_CART_EMPTY))); ?>

<?php echo tep_draw_infoBox_bottom();?>

<?php echo tep_pixel_trans();?>

<?php  /* echo tep_draw_infoBox2_top(); */ ?>

		<table border="0" width="100%" cellspacing="0" cellpadding="2"><tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table>

<?php  /* echo tep_draw_infoBox2_bottom(); */ ?>

<?php
 }
?>

<?php echo tep_draw1_bottom();?>

<?php echo tep_draw_bottom();?>

</form></td>
<!-- body_text_eof //-->
<td class="<?php echo BOX_WIDTH_TD_RIGHT; ?>"><table border="0" class="<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="0">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

 

 

 

 

 

 

 

 

 

 

 

 

This is my catalog\includes\classes\shopping_cart.php

 

<?php
/*
 $Id: shopping_cart.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 class shoppingCart {
var $contents, $total, $weight, $cartID, $content_type;

function shoppingCart() {
  $this->reset();
}

function restore_contents() {
  global $customer_id;

  if (!tep_session_is_registered('customer_id')) return false;

// insert current cart contents in database
  if (is_array($this->contents)) {
	reset($this->contents);
	while (list($products_id, ) = each($this->contents)) {
	  $qty = $this->contents[$products_id]['qty'];
	  $product_query = tep_db_query("select products_id from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
	  if (!tep_db_num_rows($product_query)) {
		tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . tep_db_input($qty) . "', '" . date('Ymd') . "')");
		if (isset($this->contents[$products_id]['attributes'])) {
		  reset($this->contents[$products_id]['attributes']);
		  while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
			tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')");
		  }
		}
	  } else {
		tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . tep_db_input($qty) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
	  }
	}
  }

// reset per-session cart contents, but not the database contents
  $this->reset(false);

  $products_query = tep_db_query("select products_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
  while ($products = tep_db_fetch_array($products_query)) {
	$this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity']);
// attributes
	$attributes_query = tep_db_query("select products_options_id, products_options_value_id from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "' order by products_options_id");
	while ($attributes = tep_db_fetch_array($attributes_query)) {
	  $this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id'];
	}
  }

  $this->cleanup();
}

function reset($reset_database = false) {
  global $customer_id;

  $this->contents = array();
  $this->total = 0;
  $this->weight = 0;
  $this->content_type = false;

  if (tep_session_is_registered('customer_id') && ($reset_database == true)) {
	tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
	tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "'");
  }

  unset($this->cartID);
  if (tep_session_is_registered('cartID')) tep_session_unregister('cartID');
}

function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) {
  global $new_products_id_in_cart, $customer_id;

  $products_id_string = tep_get_uprid($products_id, $attributes);
  $products_id = tep_get_prid($products_id_string);

  if (defined('MAX_QTY_IN_CART') && (MAX_QTY_IN_CART > 0) && ((int)$qty > MAX_QTY_IN_CART)) {
	$qty = MAX_QTY_IN_CART;
  }

  $attributes_pass_check = true;

  if (is_array($attributes)) {
	reset($attributes);
	while (list($option, $value) = each($attributes)) {
	  if (!is_numeric($option) || !is_numeric($value)) {
		$attributes_pass_check = false;
		break;
	  }
	}
  }

  if (is_numeric($products_id) && is_numeric($qty) && ($attributes_pass_check == true)) {
	$check_product_query = tep_db_query("select products_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
	$check_product = tep_db_fetch_array($check_product_query);

	if (($check_product !== false) && ($check_product['products_status'] == '1')) {
	  if ($notify == true) {
		$new_products_id_in_cart = $products_id;
		tep_session_register('new_products_id_in_cart');
	  }

	  if ($this->in_cart($products_id_string)) {
		$this->update_quantity($products_id_string, $qty, $attributes);
	  } else {
		$this->contents[$products_id_string] = array('qty' => (int)$qty);
// insert into database
		if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$qty . "', '" . date('Ymd') . "')");

		if (is_array($attributes)) {
		  reset($attributes);
		  while (list($option, $value) = each($attributes)) {
			$this->contents[$products_id_string]['attributes'][$option] = $value;
// insert into database
			if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$option . "', '" . (int)$value . "')");
		  }
		}
	  }

	  $this->cleanup();

// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
	  $this->cartID = $this->generate_cart_id();
	}
  }
}

function update_quantity($products_id, $quantity = '', $attributes = '') {
  global $customer_id;

  $products_id_string = tep_get_uprid($products_id, $attributes);
  $products_id = tep_get_prid($products_id_string);

  if (defined('MAX_QTY_IN_CART') && (MAX_QTY_IN_CART > 0) && ((int)$quantity > MAX_QTY_IN_CART)) {
	$quantity = MAX_QTY_IN_CART;
  }

  $attributes_pass_check = true;

  if (is_array($attributes)) {
	reset($attributes);
	while (list($option, $value) = each($attributes)) {
	  if (!is_numeric($option) || !is_numeric($value)) {
		$attributes_pass_check = false;
		break;
	  }
	}
  }

  if (is_numeric($products_id) && isset($this->contents[$products_id_string]) && is_numeric($quantity) && ($attributes_pass_check == true)) {
	$this->contents[$products_id_string] = array('qty' => (int)$quantity);
// update database
	if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . (int)$quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "'");

	if (is_array($attributes)) {
	  reset($attributes);
	  while (list($option, $value) = each($attributes)) {
		$this->contents[$products_id_string]['attributes'][$option] = $value;
// update database
		if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "' and products_options_id = '" . (int)$option . "'");
	  }
	}
  }
}

function cleanup() {
  global $customer_id;

  reset($this->contents);
  while (list($key,) = each($this->contents)) {
	if ($this->contents[$key]['qty'] < 1) {
	  unset($this->contents[$key]);
// remove from database
	  if (tep_session_is_registered('customer_id')) {
		tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'");
		tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'");
	  }
	}
  }
}

function count_contents() {  // get total number of items in cart 
  $total_items = 0;
  if (is_array($this->contents)) {
	reset($this->contents);
	while (list($products_id, ) = each($this->contents)) {
	  $total_items += $this->get_quantity($products_id);
	}
  }

  return $total_items;
}

function get_quantity($products_id) {
  if (isset($this->contents[$products_id])) {
	return $this->contents[$products_id]['qty'];
  } else {
	return 0;
  }
}

function in_cart($products_id) {
  if (isset($this->contents[$products_id])) {
	return true;
  } else {
	return false;
  }
}

function remove($products_id) {
  global $customer_id;

  unset($this->contents[$products_id]);
// remove from database
  if (tep_session_is_registered('customer_id')) {
	tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
	tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
  }

// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
  $this->cartID = $this->generate_cart_id();
}

function remove_all() {
  $this->reset();
}

function get_product_id_list() {
  $product_id_list = '';
  if (is_array($this->contents)) {
	reset($this->contents);
	while (list($products_id, ) = each($this->contents)) {
	  $product_id_list .= ', ' . $products_id;
	}
  }

  return substr($product_id_list, 2);
}

function calculate() {
  global $currencies;

  $this->total = 0;
  $this->weight = 0;
  if (!is_array($this->contents)) return 0;

  reset($this->contents);
  while (list($products_id, ) = each($this->contents)) {
	$qty = $this->contents[$products_id]['qty'];

// products price
	$product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
	if ($product = tep_db_fetch_array($product_query)) {
	  $prid = $product['products_id'];
	  $products_tax = tep_get_tax_rate($product['products_tax_class_id']);
	  $products_price = $product['products_price'];
	  $products_weight = $product['products_weight'];

	  $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
	  if (tep_db_num_rows ($specials_query)) {
		$specials = tep_db_fetch_array($specials_query);
		$products_price = $specials['specials_new_products_price'];
	  }

	  $this->total += $currencies->calculate_price($products_price, $products_tax, $qty);
	  $this->weight += ($qty * $products_weight);
	}

// attributes price
	if (isset($this->contents[$products_id]['attributes'])) {
	  reset($this->contents[$products_id]['attributes']);
	  while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
		$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
		$attribute_price = tep_db_fetch_array($attribute_price_query);
		if ($attribute_price['price_prefix'] == '+') {
		  $this->total += $currencies->calculate_price($attribute_price['options_values_price'], $products_tax, $qty);
		} else {
		  $this->total -= $currencies->calculate_price($attribute_price['options_values_price'], $products_tax, $qty);
		}
	  }
	}
  }
}

function attributes_price($products_id) {
  $attributes_price = 0;

  if (isset($this->contents[$products_id]['attributes'])) {
	reset($this->contents[$products_id]['attributes']);
	while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
	  $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
	  $attribute_price = tep_db_fetch_array($attribute_price_query);
	  if ($attribute_price['price_prefix'] == '+') {
		$attributes_price += $attribute_price['options_values_price'];
	  } else {
		$attributes_price -= $attribute_price['options_values_price'];
	  }
	}
  }

  return $attributes_price;
}

function get_products() {
  global $languages_id;

  if (!is_array($this->contents)) return false;

  $products_array = array();
  reset($this->contents);
  while (list($products_id, ) = each($this->contents)) {
	$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
	if ($products = tep_db_fetch_array($products_query)) {
	  $prid = $products['products_id'];
	  $products_price = $products['products_price'];

	  $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
	  if (tep_db_num_rows($specials_query)) {
		$specials = tep_db_fetch_array($specials_query);
		$products_price = $specials['specials_new_products_price'];
	  }

	  $products_array[] = array('id' => $products_id,
								'name' => $products['products_name'],
								'model' => $products['products_model'],
								'image' => $products['products_image'],
								'price' => $products_price,
								'quantity' => $this->contents[$products_id]['qty'],
								'weight' => $products['products_weight'],
								'final_price' => ($products_price + $this->attributes_price($products_id)),
								'tax_class_id' => $products['products_tax_class_id'],
								'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));
	}
  }

  return $products_array;
}

function show_total() {
  $this->calculate();

  return $this->total;
}

function show_weight() {
  $this->calculate();

  return $this->weight;
}

function generate_cart_id($length = 5) {
  return tep_create_random_value($length, 'digits');
}

function get_content_type() {
  $this->content_type = false;

  if ( (DOWNLOAD_ENABLED == 'true') && ($this->count_contents() > 0) ) {
	reset($this->contents);
	while (list($products_id, ) = each($this->contents)) {
	  if (isset($this->contents[$products_id]['attributes'])) {
		reset($this->contents[$products_id]['attributes']);
		while (list(, $value) = each($this->contents[$products_id]['attributes'])) {
		  $virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$products_id . "' and pa.options_values_id = '" . (int)$value . "' and pa.products_attributes_id = pad.products_attributes_id");
		  $virtual_check = tep_db_fetch_array($virtual_check_query);

		  if ($virtual_check['total'] > 0) {
			switch ($this->content_type) {
			  case 'physical':
				$this->content_type = 'mixed';

				return $this->content_type;
				break;
			  default:
				$this->content_type = 'virtual';
				break;
			}
		  } else {
			switch ($this->content_type) {
			  case 'virtual':
				$this->content_type = 'mixed';

				return $this->content_type;
				break;
			  default:
				$this->content_type = 'physical';
				break;
			}
		  }
		}
	  } else {
		switch ($this->content_type) {
		  case 'virtual':
			$this->content_type = 'mixed';

			return $this->content_type;
			break;
		  default:
			$this->content_type = 'physical';
			break;
		}
	  }
	}
  } else {
	$this->content_type = 'physical';
  }

  return $this->content_type;
}

function unserialize($broken) {
  for(reset($broken);$kv=each($broken);) {
	$key=$kv['key'];
	if (gettype($this->$key)!="user function")
	$this->$key=$kv['value'];
  }
}

 }
?>

 

Many Thanks

 

Daman

Link to comment
Share on other sites

a link to your wbesite to see this happening will be very helpful

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

Hi Lindsay, Thankyou for taking the time to read my cry for help :)

 

The site in question is DUB DUB DUB ukgamingcomputers DOT CO DOT UK

 

You do not need to create an account, as the issue occurs as a guest.

Link to comment
Share on other sites

A development :)

 

Two products;

Metis

 

Dominator

 

The metis product is the problem in question. I had not set any attributes up for any other products, so just have, hence a few for the dominator. The dominator update works flawlessly, but as soon as you do anything with the metis, the metis's attributes drop :(

Link to comment
Share on other sites

ummm I need a test account.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

Another update....

 

It seems if I have any more than 36 option names the bug appears. 36 option names and everything is perfect. 37 and it blows up :(

 

It is irrelevant of the amount of option values. IE im not limited to 1000 option value selections. I have tested it by having 36 option names and say 1005 option values - works fine. 37 option names and 1000 option values - fail.

 

Halp :(

Link to comment
Share on other sites

It looks like you are limited to 255 characters in a product ID (the Dominator had 244 before, when it was working; the Metis had over 300). 255 is the limit of size of a VARCHAR column in MySQL. This suggests that your product ID is getting saved in the database somewhere and then read back. I can't see where that would happen for a guest account in standard osCommerce, so I'm guessing that this is something from a contribution that you added.

 

The product ID is the thing that looks like 100{1}2{3}18{5}27{7}37{9}38{15}50{19}54{25}75{27}121{29}122{31}128{33}134{35}145

{37}150{39}156{40}171{43}172{45}175{47}181{49}184{51}187{56}198{58}216{60}227{62}

242{64}251{68}271{69}307{70}326{72}342{74}356{77}369{80}382{82}386{94}392{102}420

{104}430{106}440{108}445{110}455{112}467{114}487{116}497{118}506{120}519{124}545{

126}555{128}561 -- the first number is the actual product ID from the products table. The next number {1} identifies an option and the 2 following is the value for option {1}. Similarly, the 18 is the value for option {3}, etc.

 

By adroit assignment of options and values, I think that you could fit more than 36. Note that some only take four bytes, e.g. {1}2, while some take eight, e.g. {128}561. However, the real solution would be to change that column to type TEXT so that it could hold more than 255 characters.

 

It's also possible that it is something other than the database that is causing the limit. However, the 255 is suspicious. In shopping_cart.php, if you find

	$products = $cart->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
// Push all attributes information in an array
  if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
	while (list($option, $value) = each($products[$i]['attributes'])) {
	  echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
	  $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
								  from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
								  where pa.products_id = '" . (int)$products[$i]['id'] . "'
								   and pa.options_id = '" . (int)$option . "'
								   and pa.options_id = popt.products_options_id
								   and pa.options_values_id = '" . (int)$value . "'
								   and pa.options_values_id = poval.products_options_values_id
								   and popt.language_id = '" . (int)$languages_id . "'
								   and poval.language_id = '" . (int)$languages_id . "'");
	  $attributes_values = tep_db_fetch_array($attributes);

	  $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
	  $products[$i][$option]['options_values_id'] = $value;
	  $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
	  $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
	  $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];
	}
  }
}

and add immediately after it

print_r(array($attributes_values, $products));

Does that tell you anything interesting?

 

Backup before trying (this is not permanent code; you want to be able to revert it).

Always back up before making changes.

Link to comment
Share on other sites

I think you are onto something :)

 

 

The output for the Metis is

 

Array ( [0] => [1] => Array ( [0] => Array ( [id] => 100{1}2{3}18{5}27{7}37{9}38{15}50{19}54{25}75{27}121{29}122{31}128{33}134{35}145
{37}150{39}156{40}171{43}172{45}175{47}181{49}184{51}187{56}198{58}216{60}227{62}
242{64}251{68}271{69}307{70}326{72}342{74}356{77}369{80}382{82}386{94}392{102}420
{104}430{106}440{108}445{110}455{112}467{114}487{116}497{118}506{120}519{124}545{
126}555{128}561 [name] => Metis - Custom Gaming PC [model] => UKGC Metis [image] => Antec-300.gif [price] => 486.9478 [quantity] => 2 [weight] => 0.00 [final_price] => 486.9478 [tax_class_id] => 1 [attributes] => ) ) )

 

The Dominator output is as normal.

 

I have left the Print code in for your attention.

 

Really appreciate your time :)

Link to comment
Share on other sites

In includes/application_top.php, find code like

	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'])) {

and post it. The code starts with switch and ends with case 'add_product'.

 

Incidentally, you can fix the Metis display by going back and adding another one to the cart with the same options.

 

From includes/classes/application_top.php, look for the add_cart and update_quantity functions:

	function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) {
  global $new_products_id_in_cart, $customer_id;

  $products_id_string = tep_get_uprid($products_id, $attributes);
  $products_id = tep_get_prid($products_id_string);

  if (defined('MAX_QTY_IN_CART') && (MAX_QTY_IN_CART > 0) && ((int)$qty > MAX_QTY_IN_CART)) {
	$qty = MAX_QTY_IN_CART;
  }

  $attributes_pass_check = true;

  if (is_array($attributes)) {
	reset($attributes);
	while (list($option, $value) = each($attributes)) {
	  if (!is_numeric($option) || !is_numeric($value)) {
		$attributes_pass_check = false;
		break;
	  }
	}
  }

  if (is_numeric($products_id) && is_numeric($qty) && ($attributes_pass_check == true)) {
	$check_product_query = tep_db_query("select products_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
	$check_product = tep_db_fetch_array($check_product_query);

	if (($check_product !== false) && ($check_product['products_status'] == '1')) {
	  if ($notify == true) {
		$new_products_id_in_cart = $products_id;
		tep_session_register('new_products_id_in_cart');
	  }

	  if ($this->in_cart($products_id_string)) {
		$this->update_quantity($products_id_string, $qty, $attributes);
	  } else {
		$this->contents[$products_id_string] = array('qty' => (int)$qty);
// insert into database
		if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$qty . "', '" . date('Ymd') . "')");

		if (is_array($attributes)) {
		  reset($attributes);
		  while (list($option, $value) = each($attributes)) {
			$this->contents[$products_id_string]['attributes'][$option] = $value;
// insert into database
			if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$option . "', '" . (int)$value . "')");
		  }
		}
	  }

	  $this->cleanup();

// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
	  $this->cartID = $this->generate_cart_id();
	}
  }
}

function update_quantity($products_id, $quantity = '', $attributes = '') {
  global $customer_id;

  $products_id_string = tep_get_uprid($products_id, $attributes);
  $products_id = tep_get_prid($products_id_string);

  if (defined('MAX_QTY_IN_CART') && (MAX_QTY_IN_CART > 0) && ((int)$quantity > MAX_QTY_IN_CART)) {
	$quantity = MAX_QTY_IN_CART;
  }

  $attributes_pass_check = true;

  if (is_array($attributes)) {
	reset($attributes);
	while (list($option, $value) = each($attributes)) {
	  if (!is_numeric($option) || !is_numeric($value)) {
		$attributes_pass_check = false;
		break;
	  }
	}
  }

  if (is_numeric($products_id) && isset($this->contents[$products_id_string]) && is_numeric($quantity) && ($attributes_pass_check == true)) {
	$this->contents[$products_id_string] = array('qty' => (int)$quantity);
// update database
	if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . (int)$quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "'");

	if (is_array($attributes)) {
	  reset($attributes);
	  while (list($option, $value) = each($attributes)) {
		$this->contents[$products_id_string]['attributes'][$option] = $value;
// update database
		if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "' and products_options_id = '" . (int)$option . "'");
	  }
	}
  }
}

Wrap the pieces of code you post in code tags. In the toolbar above my post, I see five icons to the right of the smilies selector. The rightmost one looks like a curling piece of paper. If I hover over it, it says "Wrap in code tags". If I click on it, it puts [ code ][/ code ] (without the spaces). Put the code in between the tags. One pair of tags for each piece of code you post (I used two pairs, one for application_top.php and one for includes/classes/shopping_cart.php).

Always back up before making changes.

Link to comment
Share on other sites

Now its going over my head :blush:

 

 

includes/application_top.php

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'])) {

 

Im guessing you mean includes/classes/application_top.php for the second piece of code, rather than application_top.php? If so;

 

includes/classes/application_top.php

 

	function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) {
  global $new_products_id_in_cart, $customer_id;

  $products_id_string = tep_get_uprid($products_id, $attributes);
  $products_id = tep_get_prid($products_id_string);

  if (defined('MAX_QTY_IN_CART') && (MAX_QTY_IN_CART > 0) && ((int)$qty > MAX_QTY_IN_CART)) {
	$qty = MAX_QTY_IN_CART;
  }

  $attributes_pass_check = true;

  if (is_array($attributes)) {
	reset($attributes);
	while (list($option, $value) = each($attributes)) {
	  if (!is_numeric($option) || !is_numeric($value)) {
		$attributes_pass_check = false;
		break;
	  }
	}
  }

  if (is_numeric($products_id) && is_numeric($qty) && ($attributes_pass_check == true)) {
	$check_product_query = tep_db_query("select products_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
	$check_product = tep_db_fetch_array($check_product_query);

	if (($check_product !== false) && ($check_product['products_status'] == '1')) {
	  if ($notify == true) {
		$new_products_id_in_cart = $products_id;
		tep_session_register('new_products_id_in_cart');
	  }

	  if ($this->in_cart($products_id_string)) {
		$this->update_quantity($products_id_string, $qty, $attributes);
	  } else {
		$this->contents[$products_id_string] = array('qty' => (int)$qty);
// insert into database
		if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$qty . "', '" . date('Ymd') . "')");

		if (is_array($attributes)) {
		  reset($attributes);
		  while (list($option, $value) = each($attributes)) {
			$this->contents[$products_id_string]['attributes'][$option] = $value;
// insert into database
			if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$option . "', '" . (int)$value . "')");
		  }
		}
	  }

	  $this->cleanup();

// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
	  $this->cartID = $this->generate_cart_id();
	}
  }
}

function update_quantity($products_id, $quantity = '', $attributes = '') {
  global $customer_id;

  $products_id_string = tep_get_uprid($products_id, $attributes);
  $products_id = tep_get_prid($products_id_string);

  if (defined('MAX_QTY_IN_CART') && (MAX_QTY_IN_CART > 0) && ((int)$quantity > MAX_QTY_IN_CART)) {
	$quantity = MAX_QTY_IN_CART;
  }

  $attributes_pass_check = true;

  if (is_array($attributes)) {
	reset($attributes);
	while (list($option, $value) = each($attributes)) {
	  if (!is_numeric($option) || !is_numeric($value)) {
		$attributes_pass_check = false;
		break;
	  }
	}
  }

  if (is_numeric($products_id) && isset($this->contents[$products_id_string]) && is_numeric($quantity) && ($attributes_pass_check == true)) {
	$this->contents[$products_id_string] = array('qty' => (int)$quantity);
// update database
	if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . (int)$quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "'");

	if (is_array($attributes)) {
	  reset($attributes);
	  while (list($option, $value) = each($attributes)) {
		$this->contents[$products_id_string]['attributes'][$option] = $value;
// update database
		if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "' and products_options_id = '" . (int)$option . "'");
	  }
	}
  }
}

 

Thanks once again :)

Link to comment
Share on other sites

Dont know if this helps, but if you go back to the non working product page, and then add another im faced with a 404 :(

 

http://www.ukgamingcomputers.co.uk/metis-c...ion=add_product

 

*dramatic world is going to end mode on*

Anyway, real eager to get this moving, I have been stuck on it since the weekend. Happy to contribute etc, just need it fixed.

*dramatic world is going to end mode off*

Link to comment
Share on other sites

since you say that you didnt add too many addons,why dont you try and start from scratch and work your way up there...

 

also, have you tried the new PRODUCT BUILDER addon which is made for designing and building computeres/

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

Hi Lindsay,

 

Im not going to add the product builder. Im not going to be selling computers that are designed from scratch, well not yet anyway.

 

Regarding to addons, I have about 20 installed. Coupled with products, attributes, header tags, attribute information and everything else It will take me a considerable amount of time to work from scratch again :( Its taken me 9 months already :o

 

I really am utterly stuck :(

 

Any work arounds or ideas to get more than 255 characters out of the product ID is greatly appreciated. Its a big feature for me to have the large amount of options/attributes. Its the reason why I chose OSC over everything else tbh.

Link to comment
Share on other sites

I swear you said "i only have attributes sort order" which i dont think will effect this..

 

What addons do you have, and when did this issue pop up.. which addons were you installing when you noticed this issue? Do you have backups of your website at different points of installation???

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

The issue could have popped up anytime :( I have been populating the attributes, recently and this is the first product that has got to alot of options.

 

Contributions in no particular order

 

SEO URLS

FWR URL Validation

Articles Manager

Sitemap SEO

Google XML SEO

Order Editor

FWR Security Pro

Links Manager II

Paypal IPN

PayPal Express Checkout

PayPal Express Checkout

Admin Notes

Margin Report

Discount Coupons

Extra Info Pages (disabled)

Header Tags SEO

Site Monitor

Attribute Information

Google Analytics

Attribute Price Update

Ultra PICs with Lightbox 2

Contact US enhancement

Attribute Manager

Attribute Sort with Attribute Clone

Security pro

Ip Trap

Product Serial Numbers

 

I should have made myself clearer, The only contribution I could see that I thought could have caused the problem was the attribute sort......

Link to comment
Share on other sites

I would reinstate backups starting with the most recent and go from there.. It could be a little bit of everything.. OR what you can do is get a stock install, install each individual addon (only one at a time) and test it and see which individual one might be causing the error..

 

OR you can hire a programmer to troubleshoot for you. If you want, PM me, i know someone

 

p.s. hate to say this but i hope you learned your lesson.. ALWAYS test all functionality before moving on to the next addon

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

Funny thing is, I always test everything after installing a contribution, however in this case I haven't had that many attributes to play with, until now, the stage of adding products/attributes. :rolleyes:

 

I do really appreciate your input, so much so you had given me an idea;

 

 

I have a new 100% stock install of v2.2 Release Candidate 2a. I have populated it with a test product, 50 options and attributes to simulate my problem. I add the product to the cart and update, the result is the same. Looks like the issue is a stock problem. :angry:

 

 

Bring out the gurus :(

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...