PDA

View Full Version : Quantity for Product Attributes Mod



michael_s
04-19-2011, 06:00 AM
Fix bug in shopping_cart

Warning: Missing argument 3 for tep_check_stock()


FIND IN catalog/shopping_cart.php


if (STOCK_CHECK == 'true') {

if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
reset($products[$i]['attributes']);
while (list($option, $value) = each($products[$i]['attributes'])) {
$stock_check = tep_check_stock_attribute($products[$i]['id'], $products[$i][$option]['products_attributes_id'], $products[$i]['quantity']);

if (tep_not_null($stock_check)) {
$any_out_of_stock = 1;
$products_name .= '
' . $stock_check;
}

}
} else {
$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;
}
}

}




REPLACE TO:




if (STOCK_CHECK == 'true') {

if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
reset($products[$i]['attributes']);
while (list($option, $value) = each($products[$i]['attributes'])) {
$stock_check = tep_check_stock_attribute($products[$i]['id'], $products[$i][$option]['products_attributes_id'], $products[$i]['quantity']);

if (tep_not_null($stock_check)) {
$any_out_of_stock = 1;
$products_name .= '
' . $stock_check;
}

}
} else {
$stock_check = tep_check_stock($products[$i]['id'], $products[$i][$option]['products_attributes_id'], $products[$i]['quantity']);
if (tep_not_null($stock_check)) {
$any_out_of_stock = 1;
$products_name .= '
' . $stock_check;
}
}

}

More... (http://addons.oscommerce.com/info/3302)