In, what feels like a never ending quest to teach myself Magento and use it at a practical level I have finally decided that I should dive into the code and learn how individual components are rendered/found (and in doing so cause myself a real headache!).
I have decided to review how a product image is rendered on the catalog list page, or more specifically, how the link is generated to display the required image.
Ive started at template/catalog/products/list.phtml
and on line 35 I see a product collection is returned and then on line 52 the required url is echo(ed) using $_product->getProductUrl()
.
I have gone into a number of the functions to try and understand what is happening in each, some I understand and others I don't. Using var_dump($_productCollection)
I tried to find the link in there. Unsurprisingly there was a lot of information (i'm sure it's all very useful, but was lost on me) but no links! Is the array in '_selectAttributes'
the answer to finding how the link is generated?
I also noticed '_entityTable'
which has the value 'catalog_product_entity'
looking in that table has not helped find a connection to catalog_product_entity_media_gallery
, which is where I stumbled upon the paths being stored.
My question:
From the information that is provided in the collection how would I track down how the link is being generated?
media/catalog/product/ holds my catalog images, but the folder names are 1-3 and a-z, hence no help in finding required images, is this a database optimisation thing?