Hey everyone!
I am wondering if anyone could help me with this as I have been struggling for quite a bit now.
I have a magento 1.9 web store where all the prices are hidden with CSS (brochure website).
Problem?
Google still indexes rich snippets of the products and spits the "dummy prices" to Search Engine Results Page.
I am a fresher to .php and .xml.
Dont get overwhelmed with info here, just want to make it informative.
What have I figured out ?
That the layout of the product page is in: theme_name/default/template/page/1column.phtml
1) That is where the product page container is defined as:
<div class="col-main">
<?php echo $this->getChildHtml('global_messages') ?>
<?php echo $this->getChildHtml('content') ?>
</div>
2) Then in page.xml I find “content”:
<block type="core/text_list" name="content" as="content" translate="label">
<label>Main Content Area</label>
</block>
3) And in catalog.xml line 189 I find
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
Where under it I find:
- Product.info.media
- Product.info.upsell
- Product.info.additional
- Product.attributes
- Product.info.addto
- Product.info.addtocart
…and couple of more blocks…
4) Inspect element looks like:
I know the div product-type-data is being pulled through from: App/design/frontend/theme_name/default/template/catalog/product/view.phtml
<div <?php if ($useRichSnippets) echo $helperSnippets->getOfferItemscope(); ?>>
<div class="product-type-data<?php echo $productTypeClasses; ?>"><?php echo $this->getChildHtml('product_type_data'); ?></div>
<?php echo $this->getTierPriceHtml(); ?>
<?php echo $priceProperties; ?>
</div> <?php //end: offers ?>
5) The price-box div is being pulled through from: Base/default/template/catalog/product/price.phtml (if you need full code let me know)
<?php if ($price): ?>
<div class="price-box">
Can anyone help me understand:
a) What would be the solution to remove the price block or what needs to be done that google would stop indexing the price?
b) Could I comment out the product-type-data in view.phtml and would it work?
Any comments and remarks would be highly appreciated
Many thanks ++
(additional image just in case it helps)
UPDATE - GOT IT SORTED
i went to the view.phtml file and edited this
from line 347 removed " <div <?php if ($useRichSnippets) echo $helperSnippets->getOfferItemscope(); ?>>
" - this line removes <div itemprop="offers" itemscope itemprop="http://schema.org/offer" style=" content:display;>
on front end
from line 353 removed <?php echo $priceProperties; ?>
THIS LINE ACTUALLY GIVES LINES ON THE FRONT END: "META ITEMPROP="PRICEcURRENCY" CONTENT="GBP">
and <META ITEMPROP="PRICE" CONTENT="992">
from line 355 removed " </div> <?php //end: offers ?>
" THIS IS JUST A CLOSING DIV FOR THE 347 LINE.
thanks everyone who looked