Add Meta for Facebook with Custom Product PageHow to put Meta Title PageProduct view and search result on the sameFacebook Dynamic Product AdsHtml validation issue for facebook sharing on product pageHow to change dynamic attributes when simple product is selectedFacebook Product ShareEditing Facebook OG: Meta TagsAdd custom product attributes as prefill mask for meta fieldsProduct feed with 2 Facebook PageExport Category name in xml feed Magento 1.9.2

Applicants clearly not having the skills they advertise

How to make thick Asian sauces?

In this example, which path would a monster affected by the Dissonant Whispers spell take?

Do I include animal companions when calculating difficulty of an encounter?

How certain is a caster of when their spell will end?

Why is the relationship between frequency and pitch exponential?

I wrote a scene that the majority of my readers loved. How do I get back to that place while writing my new book?

Who operates delivery flights for commercial airlines?

What do we gain with higher order logics?

Why don't B747s start takeoffs with full throttle?

Avoiding cliches when writing gods

Incremental Ranges!

Shrink exponential fraction argument

Diet Coke or water?

X-shaped crossword

Is there any word or phrase for negative bearing?

Old black and white movie: glowing black rocks slowly turn you into stone upon touch

How to decline physical affection from a child whose parents are pressuring them?

Convert camelCase and PascalCase to Title Case

Is the capacitor drawn or wired wrongly?

Replace only 2nd, 3rd, nth...character and onwards

How were concentration and extermination camp guards recruited?

Count down from 0 to 5 seconds and repeat

Why do guitarists wave their guitars?



Add Meta for Facebook with Custom Product Page


How to put Meta Title PageProduct view and search result on the sameFacebook Dynamic Product AdsHtml validation issue for facebook sharing on product pageHow to change dynamic attributes when simple product is selectedFacebook Product ShareEditing Facebook OG: Meta TagsAdd custom product attributes as prefill mask for meta fieldsProduct feed with 2 Facebook PageExport Category name in xml feed Magento 1.9.2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have this custom product page but the meta information is not correct.



<?php 
$og = [];
$og['title'] = $this->getTitle();
$og['site_name'] = Mage::app()->getStore()->getName();
$og['description'] = strip_tags($this->getDescription());
$og['url'] = $this->helper('core/url')->getCurrentUrl();

if(Mage::registry('current_product')):
$product = Mage::registry('current_product');
$og['title'] = $product->getName();
$og['type'] = 'product';
$og['image'] = $this->helper('catalog/image')->init($product, 'small_image')->resize(100,100);
$og['description'] = strip_tags(($product->getShortDescription()));
$og['price:amount'] = Mage::registry('product')->getFinalPrice();
$og['price:currency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
elseif(Mage::registry('current_category')):
$og['type'] = 'product.group';
elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&
Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) :
$og['type'] = 'website';
else:
$og['type'] = 'article';
endif;
?>


I use that code to Integrate the meta for check different kind of page in the Site. The code consider the Product as an Article Type.


According to the Facebook Share Debugger, it still a missing IMG.
enter image description here



And the page is considered to be an Article Type not a Product Type.
enter image description here










share|improve this question




























    0















    I have this custom product page but the meta information is not correct.



    <?php 
    $og = [];
    $og['title'] = $this->getTitle();
    $og['site_name'] = Mage::app()->getStore()->getName();
    $og['description'] = strip_tags($this->getDescription());
    $og['url'] = $this->helper('core/url')->getCurrentUrl();

    if(Mage::registry('current_product')):
    $product = Mage::registry('current_product');
    $og['title'] = $product->getName();
    $og['type'] = 'product';
    $og['image'] = $this->helper('catalog/image')->init($product, 'small_image')->resize(100,100);
    $og['description'] = strip_tags(($product->getShortDescription()));
    $og['price:amount'] = Mage::registry('product')->getFinalPrice();
    $og['price:currency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
    elseif(Mage::registry('current_category')):
    $og['type'] = 'product.group';
    elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&
    Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) :
    $og['type'] = 'website';
    else:
    $og['type'] = 'article';
    endif;
    ?>


    I use that code to Integrate the meta for check different kind of page in the Site. The code consider the Product as an Article Type.


    According to the Facebook Share Debugger, it still a missing IMG.
    enter image description here



    And the page is considered to be an Article Type not a Product Type.
    enter image description here










    share|improve this question
























      0












      0








      0








      I have this custom product page but the meta information is not correct.



      <?php 
      $og = [];
      $og['title'] = $this->getTitle();
      $og['site_name'] = Mage::app()->getStore()->getName();
      $og['description'] = strip_tags($this->getDescription());
      $og['url'] = $this->helper('core/url')->getCurrentUrl();

      if(Mage::registry('current_product')):
      $product = Mage::registry('current_product');
      $og['title'] = $product->getName();
      $og['type'] = 'product';
      $og['image'] = $this->helper('catalog/image')->init($product, 'small_image')->resize(100,100);
      $og['description'] = strip_tags(($product->getShortDescription()));
      $og['price:amount'] = Mage::registry('product')->getFinalPrice();
      $og['price:currency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
      elseif(Mage::registry('current_category')):
      $og['type'] = 'product.group';
      elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&
      Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) :
      $og['type'] = 'website';
      else:
      $og['type'] = 'article';
      endif;
      ?>


      I use that code to Integrate the meta for check different kind of page in the Site. The code consider the Product as an Article Type.


      According to the Facebook Share Debugger, it still a missing IMG.
      enter image description here



      And the page is considered to be an Article Type not a Product Type.
      enter image description here










      share|improve this question














      I have this custom product page but the meta information is not correct.



      <?php 
      $og = [];
      $og['title'] = $this->getTitle();
      $og['site_name'] = Mage::app()->getStore()->getName();
      $og['description'] = strip_tags($this->getDescription());
      $og['url'] = $this->helper('core/url')->getCurrentUrl();

      if(Mage::registry('current_product')):
      $product = Mage::registry('current_product');
      $og['title'] = $product->getName();
      $og['type'] = 'product';
      $og['image'] = $this->helper('catalog/image')->init($product, 'small_image')->resize(100,100);
      $og['description'] = strip_tags(($product->getShortDescription()));
      $og['price:amount'] = Mage::registry('product')->getFinalPrice();
      $og['price:currency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
      elseif(Mage::registry('current_category')):
      $og['type'] = 'product.group';
      elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&
      Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) :
      $og['type'] = 'website';
      else:
      $og['type'] = 'article';
      endif;
      ?>


      I use that code to Integrate the meta for check different kind of page in the Site. The code consider the Product as an Article Type.


      According to the Facebook Share Debugger, it still a missing IMG.
      enter image description here



      And the page is considered to be an Article Type not a Product Type.
      enter image description here







      magento-1.9 facebook meta






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 21 '16 at 1:39









      AlenAlen

      1991214




      1991214




















          2 Answers
          2






          active

          oldest

          votes


















          0














          Try to use this snippet, that works on sites I´ve worked on and is build up a little different then the one you use right now.



          Just give it a try maybe.



          <?php if(Mage::registry('current_product')): ?>
          <?php $product = Mage::registry('current_product'); ?>
          <meta property="og:title" content="<?php echo ($product->getName()); ?>" />
          <meta property="og:type" content="product" />
          <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?>" />
          <meta property="og:url" content="<?php echo Mage::registry('product')->getProductUrl(); ?>" />
          <meta property="og:description" content="<?php echo strip_tags(($product->getShortDescription())); ?>" />
          <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
          <?php elseif(Mage::registry('current_category')): ?>
          <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
          <meta property="og:type" content="product.group" />
          <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
          <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
          <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
          <?php elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&
          Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) : ?>
          <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
          <meta property="og:type" content="website" />
          <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
          <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
          <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
          <?php else: ?>
          <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
          <meta property="og:type" content="article" />
          <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
          <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
          <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
          <?php endif; ?>





          share|improve this answer

























          • the only problem is that the code if(Mage::registry('current_product')) is not consider. the product page is being detect as "Article" mentioned on above post.

            – Alen
            Apr 26 '16 at 9:33











          • I updated it and you should try again

            – Klettseb
            Apr 27 '16 at 14:21


















          0














          You can add this snippet into tag in app/design/frontend/Theme_name/Theme_name/template/page/html/head.phtml



          <?php /* Open Graph Protocol for Facebook and SEO START */ ?>
          <?php if(Mage::registry('current_product')): ?>
          <?php $product = Mage::registry('current_product'); ?>
          <meta property="og:title" content="<?php echo ($product->getName()); ?>" />
          <meta property="og:type" content="product" />
          <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?>" />
          <meta property="og:url" content="<?php echo Mage::registry('product')->getProductUrl(); ?>" />
          <meta property="og:description" content="<?php echo strip_tags(($product->getShortDescription())); ?>" />
          <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
          <?php elseif(Mage::registry('current_category')): ?>
          <?php $category = Mage::registry('current_category'); ?>
          <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
          <meta property="og:type" content="product.group" />
          <meta property="og:image" content="<?php echo $category->getImageUrl(); ?>" />
          <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
          <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
          <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
          <?php elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) : ?>
          <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
          <meta property="og:type" content="website" />
          <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
          <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" /><meta property="og:site_name" content="<?php echoMage::app()->getStore()->getName(); ?>" />
          <?php else: ?>
          <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
          <meta property="og:type" content="article" />
          <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
          <meta property="og:description" content="<?php echo strip_tags($this-> getDescription()) ?>" />
          <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
          <?php endif; ?>
          <?php /* Open Graph Protocol for Facebook and SEO END */ ?>


          It will surely help you.






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f111841%2fadd-meta-for-facebook-with-custom-product-page%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Try to use this snippet, that works on sites I´ve worked on and is build up a little different then the one you use right now.



            Just give it a try maybe.



            <?php if(Mage::registry('current_product')): ?>
            <?php $product = Mage::registry('current_product'); ?>
            <meta property="og:title" content="<?php echo ($product->getName()); ?>" />
            <meta property="og:type" content="product" />
            <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?>" />
            <meta property="og:url" content="<?php echo Mage::registry('product')->getProductUrl(); ?>" />
            <meta property="og:description" content="<?php echo strip_tags(($product->getShortDescription())); ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php elseif(Mage::registry('current_category')): ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="product.group" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&
            Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) : ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="website" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php else: ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="article" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php endif; ?>





            share|improve this answer

























            • the only problem is that the code if(Mage::registry('current_product')) is not consider. the product page is being detect as "Article" mentioned on above post.

              – Alen
              Apr 26 '16 at 9:33











            • I updated it and you should try again

              – Klettseb
              Apr 27 '16 at 14:21















            0














            Try to use this snippet, that works on sites I´ve worked on and is build up a little different then the one you use right now.



            Just give it a try maybe.



            <?php if(Mage::registry('current_product')): ?>
            <?php $product = Mage::registry('current_product'); ?>
            <meta property="og:title" content="<?php echo ($product->getName()); ?>" />
            <meta property="og:type" content="product" />
            <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?>" />
            <meta property="og:url" content="<?php echo Mage::registry('product')->getProductUrl(); ?>" />
            <meta property="og:description" content="<?php echo strip_tags(($product->getShortDescription())); ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php elseif(Mage::registry('current_category')): ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="product.group" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&
            Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) : ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="website" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php else: ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="article" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php endif; ?>





            share|improve this answer

























            • the only problem is that the code if(Mage::registry('current_product')) is not consider. the product page is being detect as "Article" mentioned on above post.

              – Alen
              Apr 26 '16 at 9:33











            • I updated it and you should try again

              – Klettseb
              Apr 27 '16 at 14:21













            0












            0








            0







            Try to use this snippet, that works on sites I´ve worked on and is build up a little different then the one you use right now.



            Just give it a try maybe.



            <?php if(Mage::registry('current_product')): ?>
            <?php $product = Mage::registry('current_product'); ?>
            <meta property="og:title" content="<?php echo ($product->getName()); ?>" />
            <meta property="og:type" content="product" />
            <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?>" />
            <meta property="og:url" content="<?php echo Mage::registry('product')->getProductUrl(); ?>" />
            <meta property="og:description" content="<?php echo strip_tags(($product->getShortDescription())); ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php elseif(Mage::registry('current_category')): ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="product.group" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&
            Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) : ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="website" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php else: ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="article" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php endif; ?>





            share|improve this answer















            Try to use this snippet, that works on sites I´ve worked on and is build up a little different then the one you use right now.



            Just give it a try maybe.



            <?php if(Mage::registry('current_product')): ?>
            <?php $product = Mage::registry('current_product'); ?>
            <meta property="og:title" content="<?php echo ($product->getName()); ?>" />
            <meta property="og:type" content="product" />
            <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?>" />
            <meta property="og:url" content="<?php echo Mage::registry('product')->getProductUrl(); ?>" />
            <meta property="og:description" content="<?php echo strip_tags(($product->getShortDescription())); ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php elseif(Mage::registry('current_category')): ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="product.group" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&
            Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) : ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="website" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php else: ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="article" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php endif; ?>






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 27 '16 at 14:21

























            answered Apr 25 '16 at 11:54









            KlettsebKlettseb

            3,03531851




            3,03531851












            • the only problem is that the code if(Mage::registry('current_product')) is not consider. the product page is being detect as "Article" mentioned on above post.

              – Alen
              Apr 26 '16 at 9:33











            • I updated it and you should try again

              – Klettseb
              Apr 27 '16 at 14:21

















            • the only problem is that the code if(Mage::registry('current_product')) is not consider. the product page is being detect as "Article" mentioned on above post.

              – Alen
              Apr 26 '16 at 9:33











            • I updated it and you should try again

              – Klettseb
              Apr 27 '16 at 14:21
















            the only problem is that the code if(Mage::registry('current_product')) is not consider. the product page is being detect as "Article" mentioned on above post.

            – Alen
            Apr 26 '16 at 9:33





            the only problem is that the code if(Mage::registry('current_product')) is not consider. the product page is being detect as "Article" mentioned on above post.

            – Alen
            Apr 26 '16 at 9:33













            I updated it and you should try again

            – Klettseb
            Apr 27 '16 at 14:21





            I updated it and you should try again

            – Klettseb
            Apr 27 '16 at 14:21













            0














            You can add this snippet into tag in app/design/frontend/Theme_name/Theme_name/template/page/html/head.phtml



            <?php /* Open Graph Protocol for Facebook and SEO START */ ?>
            <?php if(Mage::registry('current_product')): ?>
            <?php $product = Mage::registry('current_product'); ?>
            <meta property="og:title" content="<?php echo ($product->getName()); ?>" />
            <meta property="og:type" content="product" />
            <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?>" />
            <meta property="og:url" content="<?php echo Mage::registry('product')->getProductUrl(); ?>" />
            <meta property="og:description" content="<?php echo strip_tags(($product->getShortDescription())); ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php elseif(Mage::registry('current_category')): ?>
            <?php $category = Mage::registry('current_category'); ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="product.group" />
            <meta property="og:image" content="<?php echo $category->getImageUrl(); ?>" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) : ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="website" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" /><meta property="og:site_name" content="<?php echoMage::app()->getStore()->getName(); ?>" />
            <?php else: ?>
            <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
            <meta property="og:type" content="article" />
            <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
            <meta property="og:description" content="<?php echo strip_tags($this-> getDescription()) ?>" />
            <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
            <?php endif; ?>
            <?php /* Open Graph Protocol for Facebook and SEO END */ ?>


            It will surely help you.






            share|improve this answer



























              0














              You can add this snippet into tag in app/design/frontend/Theme_name/Theme_name/template/page/html/head.phtml



              <?php /* Open Graph Protocol for Facebook and SEO START */ ?>
              <?php if(Mage::registry('current_product')): ?>
              <?php $product = Mage::registry('current_product'); ?>
              <meta property="og:title" content="<?php echo ($product->getName()); ?>" />
              <meta property="og:type" content="product" />
              <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?>" />
              <meta property="og:url" content="<?php echo Mage::registry('product')->getProductUrl(); ?>" />
              <meta property="og:description" content="<?php echo strip_tags(($product->getShortDescription())); ?>" />
              <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
              <?php elseif(Mage::registry('current_category')): ?>
              <?php $category = Mage::registry('current_category'); ?>
              <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
              <meta property="og:type" content="product.group" />
              <meta property="og:image" content="<?php echo $category->getImageUrl(); ?>" />
              <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
              <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
              <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
              <?php elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) : ?>
              <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
              <meta property="og:type" content="website" />
              <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
              <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" /><meta property="og:site_name" content="<?php echoMage::app()->getStore()->getName(); ?>" />
              <?php else: ?>
              <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
              <meta property="og:type" content="article" />
              <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
              <meta property="og:description" content="<?php echo strip_tags($this-> getDescription()) ?>" />
              <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
              <?php endif; ?>
              <?php /* Open Graph Protocol for Facebook and SEO END */ ?>


              It will surely help you.






              share|improve this answer

























                0












                0








                0







                You can add this snippet into tag in app/design/frontend/Theme_name/Theme_name/template/page/html/head.phtml



                <?php /* Open Graph Protocol for Facebook and SEO START */ ?>
                <?php if(Mage::registry('current_product')): ?>
                <?php $product = Mage::registry('current_product'); ?>
                <meta property="og:title" content="<?php echo ($product->getName()); ?>" />
                <meta property="og:type" content="product" />
                <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?>" />
                <meta property="og:url" content="<?php echo Mage::registry('product')->getProductUrl(); ?>" />
                <meta property="og:description" content="<?php echo strip_tags(($product->getShortDescription())); ?>" />
                <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
                <?php elseif(Mage::registry('current_category')): ?>
                <?php $category = Mage::registry('current_category'); ?>
                <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
                <meta property="og:type" content="product.group" />
                <meta property="og:image" content="<?php echo $category->getImageUrl(); ?>" />
                <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
                <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
                <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
                <?php elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) : ?>
                <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
                <meta property="og:type" content="website" />
                <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
                <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" /><meta property="og:site_name" content="<?php echoMage::app()->getStore()->getName(); ?>" />
                <?php else: ?>
                <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
                <meta property="og:type" content="article" />
                <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
                <meta property="og:description" content="<?php echo strip_tags($this-> getDescription()) ?>" />
                <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
                <?php endif; ?>
                <?php /* Open Graph Protocol for Facebook and SEO END */ ?>


                It will surely help you.






                share|improve this answer













                You can add this snippet into tag in app/design/frontend/Theme_name/Theme_name/template/page/html/head.phtml



                <?php /* Open Graph Protocol for Facebook and SEO START */ ?>
                <?php if(Mage::registry('current_product')): ?>
                <?php $product = Mage::registry('current_product'); ?>
                <meta property="og:title" content="<?php echo ($product->getName()); ?>" />
                <meta property="og:type" content="product" />
                <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?>" />
                <meta property="og:url" content="<?php echo Mage::registry('product')->getProductUrl(); ?>" />
                <meta property="og:description" content="<?php echo strip_tags(($product->getShortDescription())); ?>" />
                <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
                <?php elseif(Mage::registry('current_category')): ?>
                <?php $category = Mage::registry('current_category'); ?>
                <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
                <meta property="og:type" content="product.group" />
                <meta property="og:image" content="<?php echo $category->getImageUrl(); ?>" />
                <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
                <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" />
                <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
                <?php elseif((Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) : ?>
                <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
                <meta property="og:type" content="website" />
                <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
                <meta property="og:description" content="<?php echo strip_tags($this->getDescription()) ?>" /><meta property="og:site_name" content="<?php echoMage::app()->getStore()->getName(); ?>" />
                <?php else: ?>
                <meta property="og:title" content="<?php echo $this->getTitle() ?>" />
                <meta property="og:type" content="article" />
                <meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>" />
                <meta property="og:description" content="<?php echo strip_tags($this-> getDescription()) ?>" />
                <meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />
                <?php endif; ?>
                <?php /* Open Graph Protocol for Facebook and SEO END */ ?>


                It will surely help you.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jul 19 '17 at 6:00









                Pasupathi ThangavelPasupathi Thangavel

                1233




                1233



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f111841%2fadd-meta-for-facebook-with-custom-product-page%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form