News:

Support the VirtueMart project and become a member

Main Menu

Show Manufacturers information on "category page"

Started by dorex, January 03, 2013, 22:44:41 PM

Previous topic - Next topic

dorex

Hi,

I'm trying to show up the manufacturer image on the category page.
I've read this post: http://forum.virtuemart.net/index.php?topic=95818.0
and I've tried out some of the solutions explained there, but nothing worked out.
The images I'm trying to show should be in the right side of the product div, just before this: <h2><?php echo JHTML::link ($product->link, $product->product_name); ?></h2>

I've tried the following codes, but without success:

1.   I named all the manufacturer images like this: ManufacturerName.jpg (except one of them, all my manufacturer names are one word only, so there's no blanks/spaces or other characters in the image file names).
I went to:     /public_html/templates/MY_TEMPLATE/html/com_virtuemart/category/default.php
and I inserted the following code:

<?php echo <img src="/images/stories/virtuemart/manufacturer/<?php echo $this->product->mf_name ?>.jpg " width="50" height="17"> ?>

right above this line:
<h2><?php echo JHTML::link ($product->link, $product->product_name); ?></h2>


2. After that, I've tried another solution from the post mentioned above, solution suggested by Banquet. I've created a folder ( /images/stories/virtuemart/custom_folder/ ) where I uploaded all the manufacturer images, each one named with the manufacturer ID (1.jpg, 2.jpg, 3.jpg, 4.jpg, etc.).
I went to:     /public_html/templates/MY_TEMPLATE/html/com_virtuemart/category/default.php
and I inserted the following code:

<?php echo <img src="/images/stories/virtuemart/custom_folder/<?php echo $this->product->virtuemart_manufacturer_id ?>.jpg" width="50" height="17"> ?>

right above this line:
<h2><?php echo JHTML::link ($product->link, $product->product_name); ?></h2>

The result in both cases is a blank page, with no error on it. If anyone how can this be done and want to share it is much appreciated.

Thank you.

PHP 5.2.17 - Joomla 2.5.8 - Virtuemart 2.0.16

dorex

Problem solved (Thanks to Banquet)

Create a folder and named it "custom_folder"( /images/stories/virtuemart/custom_folder/ ) where you should upload all the manufacturer images, after you named each one with the Manufacturer ID from Virtuemart (1.jpg, 2.jpg, 3.jpg, 4.jpg, etc.).

Now open 
         /public_html/templates/YOUR_TEMPLATE/html/com_virtuemart/category/default.php   

locate where you want your manufacturer image to show up, and insert the following line :

<img src="/images/stories/virtuemart/custom_folder/<?php echo $product->virtuemart_manufacturer_id ?>.jpg" >

That's it!      Hope it helps someone.
PHP 5.2.17 - Joomla 2.5.8 - Virtuemart 2.0.16