Results 1 to 10 of 1125

Hybrid View

  1. #1
    Join Date
    Feb 2009
    Posts
    4
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Hi all,

    I'm running Zen Cart 1.3.8a with the Product attributes with Stock, latest version. It seemed to be working.

    However now, when I set a quantity for a single variant. It marks all of the variants as out of stock.

    You guys experienced this before.

    Thanks in advance.

    Rich

  2. #2
    Join Date
    Feb 2009
    Posts
    4
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Quote Originally Posted by rhlee View Post
    Hi all,

    I'm running Zen Cart 1.3.8a with the Product attributes with Stock, latest version. It seemed to be working.

    However now, when I set a quantity for a single variant. It marks all of the variants as out of stock.

    You guys experienced this before.

    Thanks in advance.

    Rich
    I found the bugger.

    products_with_attributes_stock.php line 234
    Code:
    				for ($i = 0;$i < sizeof($arrNew);$i++) {
    					$strAttributes = implode(",", $arrNew[$i]);
    					$query = 'insert into `'.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.'` (`products_id`,`stock_attributes`,`quantity`) values ('.$products_id.',"'.$strAttributes.'",'.$quantity.') ON DUPLICATE KEY UPDATE `stock_attributes` = "'.$strAttributes.'", `quantity` = '.$quantity;
    					$db->Execute($query);
    				}
    should be

    Code:
    				for ($i = 0;$i < sizeof($arrNew);$i++) {
    					sort($arrNew[$i])
    					$strAttributes = implode(",", $arrNew[$i]);
    					$query = 'insert into `'.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.'` (`products_id`,`stock_attributes`,`quantity`) values ('.$products_id.',"'.$strAttributes.'",'.$quantity.') ON DUPLICATE KEY UPDATE `stock_attributes` = "'.$strAttributes.'", `quantity` = '.$quantity;
    					$db->Execute($query);
    				}
    Otherwise the attributes will display in the wrong order on the field

 

 

Similar Threads

  1. v139h Stocks of certain products disappearing automatically
    By Lowwi in forum General Questions
    Replies: 4
    Last Post: 11 Aug 2015, 09:09 PM
  2. Installing Stocks by Attribute
    By dragon03kf in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 26 Oct 2008, 07:42 PM
  3. Stocks by attributes
    By hcd888 in forum General Questions
    Replies: 1
    Last Post: 12 May 2008, 08:52 AM
  4. Multiple stocks per product
    By jaycode in forum General Questions
    Replies: 4
    Last Post: 5 Aug 2007, 11:55 AM
  5. Products with attribute stocks
    By Svanis in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 5 Jul 2006, 03:19 AM

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