HI People,
My database is set out as follows, products, sizes, colors, and images, I then use an intermediary table product_variants to link unique products together via primary and foreign keys, for example
SKU PRODUCT_ID COLOR_ID SIZE_ID IMAGE_ID
10113 101 1 3 1
10123 101 2 3 2
on selection of the desired color of a product, i issue a query to retrieve all available sizes for that product with the selected color, however how do i initially display a product to the customers with many variables of a product, which image_id value should i use? i dont just want to select a default color like black or white, because then all my products will show in the catalog as all black or white, i have seen many other retailers do this then use javascript for the user to select another available color for that product on the catalog page which then retrieves the image for that respective unique product, im trying to find the best way to do this, any ideas?
thanks in advance.