add logo to product pages

  • Posts: 223
  • Thank you received: 1
12 years 10 months ago #35332

is there a way to add a logo (image) to all of the product pages for a particular brand/mfg?

an example of what i want to do can be seen here... product page example

i did this by adding the image to the product description, but trying to avoid adding it to over 1000 items individually.

thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
12 years 10 months ago #35361

I would have suggested the description solution as well.

You could also do it based on the category_pathway parameter of the URL, by adding some php code like that in the file "show" of the view "product" via the menu Display>Views:
if($_GET==127){
echo '<img src=" decorativeplumbingonline.com/images/hans.../productpagelogo.png " />';
}

where 127 is the id of the category.
If you're setting up your brands using the manufacturer feature, the check would be on $this->element->product_manufacturer_id instead of $_GET

Please Log in or Create an account to join the conversation.

  • Posts: 223
  • Thank you received: 1
12 years 10 months ago #35404

not working...

i am trying the category method.

i assume some sort of php tag was/is needed, so i tried adding <?php at the front, and ?> at the end of the line you sent.

any ideas?

thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
12 years 10 months ago #35444

Where did you put the code in the file ?

Please Log in or Create an account to join the conversation.

  • Posts: 223
  • Thank you received: 1
12 years 10 months ago #35487

code is highlighted in red...

<span id="hikashop_product_id_main" class="hikashop_product_id_main">
<input type="hidden" name="product_id" value="<?php echo $this->element->product_id; ?>" />
</span>
</div>
<div id="hikashop_product_bottom_part" class="hikashop_product_bottom_part">

<?php if($_GET==62){
echo '<img src="testsite.decorativeplumbingonline.com/images/catlogo.jpg" />';
} ?>

<div id="hikashop_product_description_main" class="hikashop_product_description_main">
<?php echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$this->element->product_description)); ?>
</div>

<span id="hikashop_product_url_main" class="hikashop_product_url_main">
<?php
if(!empty($this->element->product_url)){
JHTML::_('behavior.modal');
echo JText::sprintf('MANUFACTURER_URL','<a class="modal" rel="{handler: \'iframe\', size: {x: 925, y: 630}}" href="'.$this->element->product_url.'" >'.$this->element->product_url.'</a>');

} ?><br>
</span>

thanks!

Please Log in or Create an account to join the conversation.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
12 years 10 months ago #35526

You didn't add the http:// in the src attribute of the image tag. That's probably why it's not working

Please Log in or Create an account to join the conversation.

  • Posts: 223
  • Thank you received: 1
12 years 10 months ago #35533

nope, still not working...


would this be the syntax for using mfg instead....

<?php if($this->element->product_manufacturer_id==14){
echo '<img src=" testsite.decorativeplumbingonline.com/images/catlogo.jpg " />';
} ?>

Please Log in or Create an account to join the conversation.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
12 years 10 months ago #35536

On which page are you testing this code ?
Is the category_path parameter in the URL 14 ? Otherwise, it's normal that it's not displaying the image.

Please Log in or Create an account to join the conversation.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
12 years 10 months ago #35535

On which page are you testing this code ?
Is the category_path parameter in the URL 14 ? Otherwise, it's normal that it's not displaying the image.

Please Log in or Create an account to join the conversation.

  • Posts: 223
  • Thank you received: 1
12 years 10 months ago #35779

perhaps we are confusing each other, sorry...

lets start again...

can't get it to work....

on the product show.php view i have added the code....

<?php if($_GET==62){
echo '<img src=" testsite.decorativeplumbingonline.com/images/catlogo.jpg " />';
} ?>

with http:// before testsite..., where "62" is the code number for the category.

i inserted the code after...

<div id="hikashop_product_bottom_part" class="hikashop_product_bottom_part">

any ideas?

Please Log in or Create an account to join the conversation.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
12 years 10 months ago #35831

On the page decorativeplumbingonline.com/brushed-nic...category_pathway-127 the category_pathway parameter is 147, not 62. Please try with 127.

Please Log in or Create an account to join the conversation.

  • Posts: 223
  • Thank you received: 1
12 years 10 months ago #35899

nicolas,

somehow we seemed to have gone completely off track here, so let start from the beginning please....

is there a way to add a logo (image) to all of the product pages for a particular brand/mfg?

an example of what i want to do can be seen here... decorativeplumbingonline.com/brushed-nic...category_pathway-127

i did this by adding the image to the product description, but trying to avoid adding it to over 1000 items individually.

the category_pathway of 127 is a sub category of the brand, which is category 62, the mfg id is 14, and i want the image on all products for category 62 (mfg 14)

thank you

Please Log in or Create an account to join the conversation.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
12 years 10 months ago #35955

So you're talking about the manufacturer id being 14 ?
If so, you can do like that:
<?php if($this->element->product_manufacturer_id==14){
echo '<img src="testsite.decorativeplumbingonline.com/images/catlogo.jpg" />';
} ?>

The categories information for products is not loaded on the product page so it's not easy to do. You would first have to do a mysql query to load the categories and if that category is not directly the parent category of the product it's even more complicated to do.

Please Log in or Create an account to join the conversation.

  • Posts: 223
  • Thank you received: 1
12 years 10 months ago #36015

whew!.....

took us a while to get there, but that's the code that works!
gives me exactly what i wanted.

as usual, outstanding support!

thank you!

Last edit: 12 years 10 months ago by plumbingdeals.

Please Log in or Create an account to join the conversation.

Time to create page: 0.071 seconds
Powered by Kunena Forum