0

What is the solution to add markup for product URL or even home page url? I tried many combinations calling product url, specifying url directly... Still Google structured data tool does not recognize it.

This is what I'm using for other fields like Description and Sku and it works fine according to Google structured data tool.

<?php 
 $_product = $this->getProduct() ?>
 <div style="display:none !important">
   <meta itemprop="description" content="<?php echo $this-
      >escapeHtml($_product->getShortDescription()); ?>">

    <meta itemprop="SKU" content="<?php echo $_product->getSku(); ?>">
  </div>
  • what is your block? – HIren Kadivar Apr 3 at 5:02
  • I'm not sure, it's for the product pages. Do you mean block like offers section, review section...? – AlexT Apr 3 at 18:35
  • <meta itemprop="description" content="<?php echo $block->escapeQuote($block->stripTags($block->getDescription($_product))); ?>" /> <meta itemprop="sku" content="<?php echo $block->stripTags($block->getProduct()->getSku()); ?>" /> – HIren Kadivar Apr 4 at 4:20
  • where does it pull the url in the code? Thank you. – AlexT Apr 4 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.