VirtueMart 1.1.x [ Old version - no longer supported ] > Themes & Layout Problems and Customization VM 1.1
How to add product images in the search result page
Margaret:
which page is responsible for the search result layout? i would like to add the image product in the left of every search result
Joseph Kwan:
search result use the default browse template. Most browse template already has the product image there.
Margaret:
in my templates i see that i have yoo_switch as the default template. do you know where i can find the file responsible for the search?
Joseph Kwan:
I'm not 100% sure what you want to do. If you can see images in the category product listing, you should already see the images in the search page. They use the same template.
All the templates are found in your theme directory /components/com_virtuemart/themes/{your theme}/templates
Of course you need to replace {your theme} with theme name of your site.
Margaret:
im searching in /www/components/com_virtuemart/themes/default/templates but cant find a php file responsible for the search result display. do you have any idea of any other place i should look?
EDIT: i think i found the right folder
/www/components/com_search/views/search/tmpl
and this is the code that displays every search result
--- Code: ---foreach( $this->results as $result ) : ?>
<fieldset>
<div>
<span class="small<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
<?php echo $this->pagination->limitstart + $result->count.'. ';?>
</span>
<?php if ( $result->href ) :
if ($result->browsernav == 1 ) : ?>
<a href="<?php echo JRoute::_($result->href); ?>" target="_blank">
<?php else : ?>
<a href="<?php echo JRoute::_($result->href); ?>">
<?php endif;
echo $this->escape($result->title);
if ( $result->href ) : ?>
</a>
<?php endif;
if ( $result->section ) : ?>
<br />
<span class="small<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
(<?php echo $this->escape($result->section); ?>)
</span>
<?php endif; ?>
<?php endif; ?>
</div>
<div>
<?php echo $result->text; ?>
</div>
<?php
if ( $this->params->get( 'show_date' )) : ?>
<div class="small<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
<?php echo $result->created; ?>
</div>
<?php endif; ?>
</fieldset>
<?php endforeach; ?>
--- End code ---
but i cant understand how i can alter it to display product image also
Navigation
[0] Message Index
[#] Next page
Go to full version