Hi,
variants are stored in the tl_iso_products table like any other product, the difference is that they don't have any information except the information that is different from the 'main' product.
This means the variants don't have titles, teasers, alias' etc. They only have attributes like size, colour and price.
So if you fetch a variant by it's ID you don't get a teaser. Instead you need to use the variant's PID to get the teaser from the 'main' product.
To get all the variants for a product you need to do something like this:
Code:
SELECT * FROM tl_iso_products WHERE pid = {ID OF THE PRODUCT}
You can tell which products are variants and which aren't by checking their PID. If the PID is 0 then they are main products, if the PID is anything other than 0 then they're variants.
You can tell which main products have variants by doing a count of how many records exists with a PID that matches the product's ID. If it's more than one then the product has variants.
Hopefully that helps!
Bookmarks