posted in error
posted in error
Last edited by jjgtrading; 20 Aug 2008 at 10:28 PM.
Ok, I haven't made much progress but I do recognize specifically whats going wrong.
If the quantity for the base item purchased is greater than what is in stock, the message that says these products are out of stock does come up. If it is only a portion of the product ordered, specifically if two items are ordered in two different attributes but only one is in stock, the message will not show up.
For example, I tried ordering 6 of the same style/product shirts off my site, 3 in white and extra large, and 3 in black and small. Since I only have 1 of the small black in stock page 1 of the checkout process just cycles when you click checkout. No message will be shown. If I try ordering 1 small black and 5 large white of shirt model AA and on the base product page I only enter 5 in stock the message that indicates products are out of stock will show up on both the large and small shirts.
I think this topic has been discussed before, but i never found a resolution for it. Is there any way to make this Stocks by attributes mod use only some attributes but not others? or better yet, link some attributes to other products in the DB all together?
Thank you
Wow. I am sooooooo glad you posted your solution. I had the exact same problem and your fix worked, only the "echo '<p><strong>'.$option_name"... part was further under the foreach loop than I expected. After inserting your IF statement, the stock_attribute column stopped displaying the ",quantityID" and then stock started working correctly again.
The weird thing is I could have sworn the two modules (Attributes by stock and product grid) were working fine together. I have no idea what would have stopped them from working though, so I'll assume I just overlooked the issue in the beginning.
I just download this mod from the Zen-Cart site.
On the admin/products_with_attributes_stock.php and the admin/functions/extra_functions/functions_qty_attribute.php files I had to fix the table calls. Instead of calling the defined tables, the scrips were calling the actual table names.
Stock Attribute v3.01.1 is the version that was on Free Add On page. Obviously, this needs to be updated.
What's the difference between defined tables and actual table names in terms of examples and why it matters?
If I were to guess I'd say that the difference is like that of creating a sql query or referencing a previously created sql query from one of the header_php.php files. My guess doesn't sound close to me.
The difference:
WRONG
CORRECTCode:"SELECT options_id FROM products_attributes WHERE products_id = $products_id..."
When the tables names are defined they include the assigned table prefix.Code:"SELECT options_id FROM " . TABLE_PRODUCTS_ATTRIBUTES . " WHERE products_id = $products_id..."
If you assigned a table prefix to your Zen Cart tables, then not using the defined table name would cause an "table not found" error.Code:define('TABLE_PRODUCTS_ATTRIBUTES', DB_PREFIX . 'products_attributes');
Apparently the Stock by Attributes from mcinallym is compatible with v1.3.8, unlike the StockAttribute from danielcor. So, I guess I will try to use that instead. I guess I'll pay more attention to the version numbers.
However, the issue that I found still needs to be fixed for the older versions.
The version that you originally downloaded was only compatible with Zen Cart versions prior 1.3.5. There's no need to update it, since 1.3.5 was a major security update and anybody using an easrlier version would use their time better by upgrading that trying to fix redunandant mods (there was a heap of other bugs in the older version too that were squeezed out in Stock by Attributes 4.0).
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
Bookmarks