Add to Compare on Product List

On homepage, we have JM Product List module displaying products. Now If I want Add to Compare / Add to wishlist Options along with Add to compare, what should I do.

1 answer

Profile photo of thangnn1510 0.00 $tone October 15, 2010

Hi Joomlagt!
Sorry for our late to answer your question.
To add "Add to Compare / Add to wishlist " options to JM product list module please do the following:
-- open \app\design\frontend\default\defaulttemplate\joom lart\jmproducts\list.phtml
-- Find these code:


<?php if($_product->isSaleable()){ ?>
     <button class="form-button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')">
      <span><?php echo $this->helper("catalog")->__('Add to Cart') ?></span>
       <?php } else { ?>
          div class="out-of-stock"><?php echo $this->helper("catalog")->__('Out of stock') ?></div>
        <?php } ?>

-- Add these code below them:


<p class="add-to">
	<?php if ($this->helper('wishlist')->isAllow()) : ?>
	<a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-cart">
	<?php echo $this->__('Add to Wishlist') ?>
	<?php endif; ?>
	<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
	<br />
	<a href="<?php echo $_compareUrl ?>"><?php echo $this->__('Add to Compare') ?></a>
	<?php endif; ?>

Hope this help!


Please login or Register to Submit Answer

Written By