I am looking everywhere in the Admin panel and in the file manager. I can not find where to remove the social media icons from under the "Add to Cart" button. Can someone please point me in the right direction?
Magento – How to remove Social Media Icons from Product View page
magento-1.9.2.0social-buttonstemplate
Related Solutions
Please add following code in your view.phtml file
<?php echo $this->getTierPriceHtml() ?>
For your requirement,you need to some modification
at module.phtml and Mymodule.php.
Instead of loading all product at myfunction() and you need to send product Object
to call from list.phtml and product/view.phtml
.
Like: setProduct($project)
.
<?php class Companysocial_Mymodule_Block_Mymodule extends Mage_Core_Block_Template { protected $_product = null; public function setProduct($product) { $this->_product = $product; return $this; } public function myfunction() { return $this->_product; }
}
Then add below code at module.phtml:
$product=$this->myfunction()
$sku = $product->getSku();
$productUrl = $product->getProductUrl();
$productImage = $product->getImageUrl(); ?>
<a href="javascript:popWin('https://plus.google.com/share?url=<?php echo urlencode($productUrl); ?>', 'google', 'width=640,height=480,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes');" title="<?php echo $this->__('Share on Google Plus') ?>">Google Plus</a>
<a href="javascript:popWin('https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode($productUrl); ?>&t=<?php echo urlencode($productName); ?>', 'facebook', 'width=640,height=480,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes');" title="<?php echo $this->__('Share on Facebook') ?>">Facebook</a>
<a href="javascript:popWin('http://twitter.com/home/?status=<?php echo urlencode($productName . ' (' . $productUrl . ')'); ?>', 'twitter', 'width=640,height=480,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes');" title="<?php echo $this->__('Tweet') ?>">Twitter</a>
<a href="javascript:popWin('https://pinterest.com/pin/create/button/?url=<?php echo urlencode($productUrl); ?>&media=<?php echo urlencode($productImage); ?>&description=<?php echo urlencode($productName); ?>', 'pinterest', 'width=640,height=480,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes');" title="<?php echo $this->__('Pin it') ?>">Pinterest</a>
Let call this code at list.phtml.
<?php echo $this->getLayout()->createBlock('mymodule/mymodule') ->setProduct($_product)->setTemplate('mymodule/mymodule.phtml')->toHtml();
?>
You need to call this code below each product in list.phtml
Also you can call share block using below code:
<?php echo $this->getLayout()->createBlock('mymodule/mymodule')->setProduct($_product)->setTemplate('mymodule/mymodule.phtml')->toHtml(); ?>
Note that in my process you does not need mymodule.xml
Best Answer
Add the following to catalog_product_view.xml in your theme