List Product By Colors

You're using the wrong hook and based on what you are doing, you don't really understand what you're doing either.



Where is $product_data defined in your hook function?



What you want to use for what you are doing in your hook is the hook for 'get_product_data_more' which passes the product_data array (which you want to use by reference).



The 'get_product_data' hook uses parameters that become part of the SQL query which is used to fill the $product_data variable. Hence you return things like JOIN statements, fields, conditions, etc. It is not the hook you want to use for adding an element to the $product_data array. Use the 'get_product_data_more' hook (you can see it at the end of the fn_get_product_data() function.

[quote name='tbirnseth' timestamp='1318447798' post='123551']

You're using the wrong hook and based on what you are doing, you don't really understand what you're doing either.



Where is $product_data defined in your hook function?



What you want to use for what you are doing in your hook is the hook for 'get_product_data_more' which passes the product_data array (which you want to use by reference).



The 'get_product_data' hook uses parameters that become part of the SQL query which is used to fill the $product_data variable. Hence you return things like JOIN statements, fields, conditions, etc. It is not the hook you want to use for adding an element to the $product_data array. Use the 'get_product_data_more' hook (you can see it at the end of the fn_get_product_data() function.

[/quote]



Man, Thanks a lot!

I have tried using that hook, but obviously something was wrong.

Now it's perfect.


function fn_my_changes_get_product_data_more(&$product_data)
{
$product_id = $product_data['product_id'];
$lang_code = $product_data['lang_code'];
$product_data['main_image_colors'] = fn_get_image_pairs($product_id, 'product', 'MA', true, true, $lang_code);

}

hi all,

i just want to show “More Colors” text bellow the product image on category page, if product have color options.

now images, product name, price is showing. i want to show “more color” text.

can anyone please help me how i can do this?.

please reply…

bellow image show what i wnat is.