did you look in your database to see does the sort column exist ?
looks like its wanting to add the customid after the sort column in that table
checking my database there is sort column then custom id column
bn
did you look in your database to see does the sort column exist ?
looks like its wanting to add the customid after the sort column in that table
checking my database there is sort column then custom id column
bn
if you find sort column missing you could try the following in your admin -> install sql patches
remember backup as im no expert !!
ALTER TABLE products_with_attributes_stock ADD sort int(11) NOT NULL default 0 after quantity;
then run the stock by attributes install again
hope this helps
bn
Looks like two lines in the installation script need to be swapped:
In the installation file on lines 416 and 417 re-order the lines:
to:Code:alterSBAtableCustomid();//Call function to Alter table products_with_attributes_stock to add customid alterSBAtabeSort();//Call function to Alter table products_with_attributes_stock sort field
Code:alterSBAtabeSort();//Call function to Alter table products_with_attributes_stock sort field alterSBAtableCustomid();//Call function to Alter table products_with_attributes_stock to add customid
Backup Files and Databases First. GitHub
Suggestions, Plugins, etc. used at your own risk.
Thanks, all. I think I'm good now!
Hi,
There is a field called stock_attributes in the table of products_with_attributes_stock.
There are some numbers in this field and I have no idea what they refer to.
Can someone please give me some clue?
Thanks in advance!
Those are references to the products attributes, it is how the mod is able to trace the product ID to the applicable attribute.
The IDs are extracted (based on) a products attributes from the table "products_attributes" the IDs are from the field "products_attributes_id"
Note that if there are attribute combinations, than there will be two or more references there separated by comma.
This sample query (used only to help explain the example) may help you understand:
Here we do a SELECT query from three tables "products", "products_attributes", and Products_options".
The resultant IDs from the select query are than inserted into this mods new table "products_with_attributes_stock" into the applicable fields (products_id, stock_attributes, quantity).
This is just an example query, for explanation of the new tables field data, you should never run query's you do not fully trust or understand or have not tested on a TEST system!Code:INSERT INTO products_with_attributes_stock (products_id, stock_attributes, quantity) SELECT p.products_id, pa.products_attributes_id, p.products_quantity FROM products p LEFT JOIN products_attributes pa ON (p.products_id = pa.products_id) LEFT JOIN products_options_values pv ON (pa.options_values_id = pv.products_options_values_id) WHERE pa.products_attributes_id is not null AND pa.options_values_id > 0 ORDER BY p.products_id, pa.products_attributes_id ON DUPLICATE KEY UPDATE `products_id` = products_with_attributes_stock.products_id;
I hope this helped.
Backup Files and Databases First. GitHub
Suggestions, Plugins, etc. used at your own risk.
Thanks, potteryhouse!![]()
Hey all - running into a slight problem with SBA regarding products with multiple drop downs. Not sure how it needs to be properly set up in order to have the correct stock for each item (ie. "Black" in "Youth Large"). Right now it'll show certain items as being in stock even when they are sold out in the backend.
I set this up at the recommendation of our hosting company, GeekHost. For the record, they're absolutely amazing with what they do and even though this is not a module they made they've been super helpful with this problem.
For clarity, the product also has a "White" color on the product page. See pics for reference. Any help on this to optimize the backend would be greatly appreciated!
![]()
On just one product entry, for a test, I suggest you try removing (delete the SBA entry) for the Stock IDs 1487 to 1491, these are the single entry items, it looks to me like you need the attribute combinations, that will be left. Than set the quantities as you need and test. The mod looks at this table, first for combinations, than for single entries, to find stock available.
Just a suggestion.
Backup Files and Databases First. GitHub
Suggestions, Plugins, etc. used at your own risk.
Bookmarks