Magento - 将比较按钮更改为Facebook按钮

时间:2013-01-29 18:25:16

标签: magento button compare magento-1.7

我想将facebook中的比较按钮更改为添加按钮/链接中的按钮以及addto wishlist添加到购物车链接/按钮。

/app/design/frontend/default/theme/template/catalog/product/view/addto.phtml

我想在类别和产品视图中进行更改。

以下是addto.phtml的代码

 ?>

<?php $_product = $this->getProduct(); ?>
<?php $_wishlistSubmitUrl = $this->helper('wishlist')->getAddUrl($_product); ?>

<ul class="add-to-links">
<?php if ($this->helper('wishlist')->isAllow()) : ?>
    <li><a rel="tooltip" data-placement="top" title="<?php echo $this->__('Add to Wishlist') ?>" href="<?php echo $_wishlistSubmitUrl ?>" onclick="productAddToCartForm.submitLight(this, this.href); return false;" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
<?php endif; ?>
<?php
    $_compareUrl = $this->helper('catalog/product_compare')->getAddUrl($_product);
?>
<?php if($_compareUrl) : ?>
    <li><a rel="tooltip" data-placement="top" title="<?php echo $this->__('Add to Compare') ?>" href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
<?php endif; ?>
</ul>

提前致谢

1 个答案:

答案 0 :(得分:0)

<?php $_product = $this->getProduct(); ?>
<?php $_wishlistSubmitUrl = $this->helper('wishlist')->getAddUrl($_product); ?>

<ul class="add-to-links">
<?php if ($this->helper('wishlist')->isAllow()) : ?>
    <li><a rel="tooltip" data-placement="top" title="<?php echo $this->__('Add to Wishlist') ?>" href="<?php echo $_wishlistSubmitUrl ?>" onclick="productAddToCartForm.submitLight(this, this.href); return false;" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
<?php endif; ?>
    <li>
        <!-- put fb code here eg -->
        <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fmageigniter.com&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=true&amp;font&amp;colorscheme=light&amp;action=like&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>
    </li>
</ul>