With the Stock by Attrib mod installed, Google button allows checkout if not enough stock based on attrib. Here is small patch to fix for Google Checkout:
In googlecheckout/gcheckout.php find:
Code:
// Stock Check
if (STOCK_CHECK == 'true') {
if (zen_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
$flagAnyOutOfStock = true;
}
}
Replace this code with:
Code:
// Stock Check - kiddos hack
if (STOCK_CHECK == 'true') {
unset($attributes);
if(is_array($products[$i]['attributes'])){
$attributes = $products[$i]['attributes'];
} else {
$attributes = '';
}
if (zen_check_stock($products[$i]['id'], $products[$i]['quantity'], $attributes)) {
$flagAnyOutOfStock = true;
}
}
Now "out of stock" in cart because of SBA shortage will show gray-out Google button and proper "out of stock" reason message.
Happy hacking.
Bookmarks