The fix for the includes/modules/pages/shopping_cart/header.php is rather simple, and it may have been a problem with the merge that I did. Just make sure the stock with attributes code is after the second closing bracket "}" as shown below:
Code:
} //end foreach [attributes]
} //end if [attributes]
// stock by attributes
if ( STOCK_CHECK == 'true' ) {
// Added to allow individual stock of different attributes
unset($attributes);
if(is_array($products[$i]['attributes'])){
$attributes = $products[$i]['attributes'];
} else {
$attributes = '';
}
$flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity'],$attributes);
$stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);
if ($flagStockCheck == true) {
$flagAnyOutOfStock = true;
}
}
// end stock by attributes
Here is the code for the /admin/includes/functions/extra_functions/products_with_attributes_stock.php
Code:
<?php
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
if (function_exists('zen_register_admin_page')) {
if (!zen_page_key_exists('products_with_attributes_stock')) {
zen_register_admin_page('products_with_attributes_stock', 'BOX_CATALOG_PRODUCTS_WITH_ATTRIBUTES_STOCK','FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK', '', 'catalog', 'Y', 6);
}
}
?>
I also found that the ajax part of the code does not work in v1.5 and so I removed it (kept the css file but renamed it). This means that to update the stock, you will have to edit each individually. This is not really a problem for me as I don't have that many products with attributes (less than 30).
Bookmarks