caborela:
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).
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;
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!
I hope this helped.