Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2011
    Posts
    46
    Plugin Contributions
    0

    Default Sold Out based on two quantity fields

    Hello. It's me again.

    I really like the way Zen Cart works with the "sold out" function. My problem is that I have two different stocking quantities, products_quantity and products_quantity2, each for different quantities available at a different location. Is there a way to have the "sold out" function/information show up based on checking to see if both of those quantities are 0?

    Also, if possible, I would like to be able to mark the items like this:

    If products_quantity > 0, no marking.
    If products_quantity = 0 & products_quantity2 >0, mark it: ***WAREHOUSE ITEM***.
    If products_quantity = 0 & products_quantity2 =0, don't allow them to add it to the cart.

    Thanks.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    67,929
    Plugin Contributions
    6

    Default Re: Sold Out based on two quantity fields

    You could customize in the function_general.php the:
    function zen_get_buy_now_button($product_id, $link, $additional_link = false) {

    look through that code and look at all the return values and which relate to products_quantity ...
    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: v1.5.3]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #3
    Join Date
    Dec 2011
    Posts
    46
    Plugin Contributions
    0

    Default Re: Sold Out based on two quantity fields

    You and Zen Cart ROCK!!!

    That is all.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    67,929
    Plugin Contributions
    6

    Default Re: Sold Out based on two quantity fields

    Thanks for the update that you were able to solve this ...
    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: v1.5.3]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  5. #5
    Join Date
    Apr 2010
    Posts
    277
    Plugin Contributions
    0

    Default Re: Sold Out based on two quantity fields

    thanks ajeh
    i was in a similar position and this worked, can you point me in right direction as to where the stock check is during checkout, as say i have no stock in zen quantity but have 1 item in my 2nd stock qty, i still want to limit the sale to 1 but at present it only checks zencart std stock qty

    hope this makes sense

    bryan

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    67,929
    Plugin Contributions
    6

    Default Re: Sold Out based on two quantity fields

    You could look in the:
    /includes/modules/pages/checkout_shipping/header_php.php

    where the stock is validated and customize the code for your extra quantity field:
    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;
          }
        }
      }
    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: v1.5.3]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  7. #7
    Join Date
    Apr 2010
    Posts
    277
    Plugin Contributions
    0

    Default Re: Sold Out based on two quantity fields

    i ended up editing functions_lookup

    in the Return a product's stock count section

    does this sound ok, it seems to work and so far and i cant see it affecting anything else

    bryan

 

 

Similar Threads

  1. Products with zero quantity showing as Sold Out
    By miguel991 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 22 Dec 2010, 09:36 PM
  2. Products Quantity? Updating all vs showing Sold Out
    By rooisnor in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 13 Jul 2008, 09:58 PM
  3. 0 quantity is Sold Out = don't want to see this
    By braad in forum Setting Up Categories, Products, Attributes
    Replies: 8
    Last Post: 22 Nov 2007, 10:37 AM
  4. Quantity sold out?
    By FreshP in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 30 Apr 2007, 09:54 PM

Bookmarks

Posting Permissions

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