Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1
    Join Date
    Mar 2012
    Location
    Sterling, PA 18463
    Posts
    5
    Plugin Contributions
    0

    Default Out of Stock When Placing Order - IS Checking by Product and Attribute.

    When placing product order with attributes. The store is checking stock by the Product and it's Attributes instead of just checking by Product.
    I have an item "Custom 14 Karat Gold Namepins Round Wire" with a stock of 1 item, the item has 3 attributes fields "NAME", "CHAIN", "CHRYSTAL HEARTS". the Namepin is priced by character by the name field.

    If you add more than 1 item to your cart with identical attributes an error "(Products marked with *** are out of stock)" will appear. if you change an attribute or the name on the namepin, the item gets added to the cart. The problem is I only have 1 product in stock.

    the url is: http://www.shamrockstables.org/cart/

    I've uploaded a screen shot
    Name:  Zen_Cart_v150_error.jpg
Views: 200
Size:  23.8 KB

    This is on a linux server.
    ZenCart V 1.5
    Mysql Version: '5.0.95'

  2. #2
    Join Date
    Mar 2012
    Location
    Sterling, PA 18463
    Posts
    5
    Plugin Contributions
    0

    Default Re: Out of Stock When Placing Order - IS Checking by Product and Attribute.

    I reproduced this bug with a fresh (Pristine) install of ZenCart V1.5 on another virtual domain.

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

    Default Re: Out of Stock When Placing Order - IS Checking by Product and Attribute.

    Working on a solution for you ... it will be a while ...
    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 ...

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

    Default Re: Out of Stock When Placing Order - IS Checking by Product and Attribute.

    See if this works for you ...

    Make sure the Product is marked as:
    Product Qty Min/Unit Mix: Yes
    Then edit the file:
    /includes/modules/pages/shopping_cart/header_php.php

    and add the code in RED:
    Code:
        $flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
    // bof: extra check on stock
        if ($flagStockCheck != true) {
          if ( (zen_get_products_stock($products[$i]['id']) - ($_SESSION['cart']->in_cart_mixed($products[$i]['id']) - $_SESSION['cart']->get_quantity($products[$i]['id']))) <= 0) {
            $flagStockCheck = '<span class="markProductOutOfStock">' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '</span>';
          } else {
            $flagStockCheck = '';
          }
        }
    // eof: extra check on stock
        if ($flagStockCheck == true) {
          $flagAnyOutOfStock = true;
        }
    See if that works on the shopping_cart page ...

    I am still working out something for the checkout ...
    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
    Mar 2012
    Location
    Sterling, PA 18463
    Posts
    5
    Plugin Contributions
    0

    Default Re: Out of Stock When Placing Order - IS Checking by Product and Attribute.

    It flags the item and still adds it to the cart, then it still allows customer to check out with items.

    Cart is in testing and dev so your welcome to create a test account on the cart to for testing.
    Last edited by dboling; 7 Mar 2012 at 03:08 AM.

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

    Default Re: Out of Stock When Placing Order - IS Checking by Product and Attribute.

    Now edit the file:
    /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;
          } else {
    // bof: extra check on stock
            if ( (zen_get_products_stock($products[$i]['id']) - ($_SESSION['cart']->in_cart_mixed($products[$i]['id']) - $_SESSION['cart']->get_quantity($products[$i]['id']))) <= 0) {
              zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
              break;
            }
    // eof: extra check on stock
          }
        }
      }
    // if no shipping destination address was selected, use the customers own address as default
    /includes/modules/pages/checkout_payment/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;
        } else {
    // bof: extra check on stock
          if ( (zen_get_products_stock($products[$i]['id']) - ($_SESSION['cart']->in_cart_mixed($products[$i]['id']) - $_SESSION['cart']->get_quantity($products[$i]['id']))) <= 0) {
            zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
            break;
          }
    // eof: extra check on stock
        }
      }
    }
    
    // get coupon code
    /includes/modules/pages/checkout_confirmation/header_php.php

    Code:
    if (STOCK_CHECK == 'true') {
      for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
        if ($stock_check[$i] = zen_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) {
          $flagAnyOutOfStock = true;
        }
      }
      // Out of Stock
      if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($flagAnyOutOfStock == true) ) {
        zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
        } else {
    // bof: extra check on stock
          if ( (zen_get_products_stock($order->products[$i]['id']) - ($_SESSION['cart']->in_cart_mixed($order->products[$i]['id']) - $_SESSION['cart']->get_quantity($order->products[$i]['id']))) <= 0) {
            zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
            break;
          }
    // eof: extra check on stock
      }
    }
    
    // update customers_referral with $_SESSION['gv_id']
    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
    Mar 2012
    Location
    Sterling, PA 18463
    Posts
    5
    Plugin Contributions
    0

    Default Re: Out of Stock When Placing Order - IS Checking by Product and Attribute.

    Still adds it to the cart, but stops it at check out.

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

    Default Re: Out of Stock When Placing Order - IS Checking by Product and Attribute.

    That is all it does ... flag the products that cause the problem and not allow checkout until the quantity is fixed ...
    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 ...

  9. #9
    Join Date
    Mar 2012
    Location
    Sterling, PA 18463
    Posts
    5
    Plugin Contributions
    0

    Default Re: Out of Stock When Placing Order - IS Checking by Product and Attribute.

    Thanks, You were quick to find a solution for the bug and fix it. It'll help a lot of people keep from selling products they don't have.

    Wish I was working so I could afford to send you a donut and coffee.

    Who do I send a request for a few more generic flat rate shipping modules ?

    One flat.php for usps flatrate boxs and packages aren't enough.
    I took flat.php and edited it and it worked fine, but wouldn't go past the select shipping page.

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

    Default Re: Out of Stock When Placing Order - IS Checking by Product and Attribute.

    You would have to post a new thread and what you are trying to do and perhaps the code that you are using to see why it is broken with details on how to you need it to work and maybe someone will look at it and try to help you ...

    Otherwise, you can look at the Recommended services for any that help write custom code for hire ...
    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 ...

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Requiring some text (attribute) when placing order...
    By rebekah in forum Setting Up Categories, Products, Attributes
    Replies: 15
    Last Post: 12 Dec 2011, 09:11 AM
  2. Stock By Attributes & Attribute order
    By laurenjj in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 10 Jul 2011, 12:00 AM
  3. Stock by Attribute setup and product has stock when added to card says out of stock
    By kwrosenzweig in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 9 Jun 2011, 06:18 PM
  4. error when checking out with stock by attribute mod
    By zoaconner in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 2 Feb 2010, 07:02 AM
  5. Replies: 4
    Last Post: 22 Jan 2010, 10:43 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
  •