Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Saved cart items that have gone out of stock

    I've had a customer telling me today that they couldn't get past the shopping cart page, after much investigation it has become apparent that it is because the item they previously had saved in their cart is now out of stock.

    For some reason the shopping cart in this situation is not flagging a message saying that the item is out of stock.

    Is this normal? If so any way of adding something to provide a message stack to alert the customer a product in their cart is no longer available?
    Phil Rogers
    A problem shared is a problem solved.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Saved cart items that have gone out of stock

    By default, if you have something in the cart and it is out of stock there should be both a messstack displayed and the Product has the *** ...

    Test this out for yourself on your test customer account to ensure you see the message, if you do not, switch to Classic Template, does the message show?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Saved cart items that have gone out of stock

    Thanks Linda, I have SBA installed so assume it's that messing with it.

  4. #4
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Saved cart items that have gone out of stock

    I have narrowed it down, it was not as I thought, I have forced the out of stock item into the cart from scratch and still doesnt show the message, yet oher items that have a drop down option that is out of stock, when adding the message shows fine.

    main difference is that the products that dont display the message are set with an attribute as display only, im wondering if SBA is ignoreing this for stock checking..

    can you point me to where the code is so that I can have a look see if I can work it out?
    Phil Rogers
    A problem shared is a problem solved.

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Saved cart items that have gone out of stock

    The stock is checked on the checkout_shipping
    /includes/modules/pages/checkout_shipping/header_php.php

    Code:
    // Stock Check
      if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
        $products = $_SESSION['cart']->get_products();
        for ($i=0, $n=sizeof($products); $i<$n; $i++) {
          if (zen_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
            zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
            break;
          }
        }
      }
    I do not know what your add-on or template may have changed ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Saved cart items that have gone out of stock

    cheers, i'll check it out, if I get completly stuck i'll post the modified code here to see if you or anyone else can spot it.

    Cheers for your help:)
    Phil Rogers
    A problem shared is a problem solved.

  7. #7
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Saved cart items that have gone out of stock

    Quote Originally Posted by Ajeh View Post
    The stock is checked on the checkout_shipping
    /includes/modules/pages/checkout_shipping/header_php.php

    Code:
    // Stock Check
      if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
        $products = $_SESSION['cart']->get_products();
        for ($i=0, $n=sizeof($products); $i<$n; $i++) {
          if (zen_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
            zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
            break;
          }
        }
      }
    I do not know what your add-on or template may have changed ...
    just noticed that this is the code that redirects back to the shopping cart page. this actually still works. its the code that places the message next to the out of stock items that doesnt. where will that be located?
    Phil Rogers
    A problem shared is a problem solved.

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Saved cart items that have gone out of stock

    You would need to check the header on:
    /includes/modules/shopping_cart/header_php.php

    and the template:
    /includes/templates/template_default/templates/tpl_shopping_cart_default.php

    vs your templates and overrides file:
    /includes/templates/your_template_dir/templates/tpl_shopping_cart_default.php

    for I think this section of code:
    Code:
    <?php
      if ($product['flagShowFixedQuantity']) {
        echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
      } else {
        echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
      }
    ?>
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. Stuck! unable to sell items that show as out of stock
    By Shane78 in forum General Questions
    Replies: 3
    Last Post: 9 Aug 2009, 03:46 PM
  2. Replies: 5
    Last Post: 8 Apr 2009, 08:04 PM
  3. Have Out-of-Stock Items Disappear from cart?
    By peteVA in forum Customization from the Admin
    Replies: 1
    Last Post: 27 Mar 2009, 02:48 PM
  4. My Cart shows Items out of stock Why?
    By touchclothing in forum General Questions
    Replies: 6
    Last Post: 9 Dec 2008, 11:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg