I am still struggling with the problem below, I'm thinking maybe this code is dependant on specific stock settings in the admin? I say this because of the line if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ...

Quote Originally Posted by CheekyCockney View Post
Hi. I have a problem which I believe may have come up before, my 'out of stock items' are able to be checked out using the PayPal Quickpay button. The normal 'Pay button' correctly loops back to the cart with an Out Of Stock message. This is only the case when my products have attributes, with all other products both buttons loop back to the cart.

On page 70 of this thread i found this info but it doesn't seem to have made a difference.

****

Similar patch for making Pay Pal Express not allow checkout with not enough stock according to SBA.

Edit ipn_main_handler.php and find:

Code:
require('includes/application_top.php');

Just below that, add the following code:

Code:

// Stock Check - kiddo hack
if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
$products = $_SESSION['cart']->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {

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)) {
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
break;
}
}
}

This will not make the yellow button un-active, but will send the customer back to the shopping cart so they can change the cart contents so no out of stock items.

***

Any help would be appreciated, thanks in advance!