You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi folks,
I am trying to include link of a category on facebook. The open graph object debugger shows that all category fields are correct but the og:image. This extension is missing adding the product.group option. I have tried to edit the block file (MagePal/FbOpenGraphMetaTags/Block/Tags.php) code in the getTags() function as follows but failed to get results:
public function getTags(){
$this->tags['og:url'] = $this->helper('core/url')->getCurrentUrl();
$this->tags['og:site_name'] = Mage::app()->getStore()->getName();
$this->tags['og:type'] = 'website';
$this->tags['og:title'] = $this->getLayout()->getBlock('head')->getTitle();
$this->tags['og:description'] = $this->getLayout()->getBlock('head')->getDescription();
Hi folks,
I am trying to include link of a category on facebook. The open graph object debugger shows that all category fields are correct but the og:image. This extension is missing adding the product.group option. I have tried to edit the block file (MagePal/FbOpenGraphMetaTags/Block/Tags.php) code in the getTags() function as follows but failed to get results:
public function getTags(){
$this->tags['og:url'] = $this->helper('core/url')->getCurrentUrl();
$this->tags['og:site_name'] = Mage::app()->getStore()->getName();
$this->tags['og:type'] = 'website';
$this->tags['og:title'] = $this->getLayout()->getBlock('head')->getTitle();
$this->tags['og:description'] = $this->getLayout()->getBlock('head')->getDescription();
//If on the product page
if($product = Mage::registry('current_product')){
$this->tags['og:type'] = 'product';
$this->tags['og:title'] = $product->getName();
$this->tags['og:description'] = $product->getShortDescription() ? $product->getShortDescription() : $this->tags['og:description'];
$this->tags['og:image'] = $this->helper('catalog/image')->init($product, 'image')->resize(500,500);
}
//If on the category page
elseif($category = Mage::registry('current_category')){
$this->tags['og:type'] = 'product.group';
$this->tags['og:title'] = $category->getName();
$this->tags['og:description'] = 'Helloooooooo';
$this->tags['og:image'] = 'https://images.askmen.com/1080x540/2016/01/14-045822-what_to_wear_in_your_tinder_pics.jpg';
}
foreach($this->getConfigValueArray() as $key => $value){
if(array_key_exists($key, $this->systemConfigTranslation)){
$this->tags[$this->systemConfigTranslation[$key]] = $value;
}
}
I hope if anyone could help me to solve this issue!
The text was updated successfully, but these errors were encountered: