Rich snippets price with variants

  • Posts: 228
  • Thank you received: 4
  • Hikashop Business
1 year 2 months ago #348567

-- HikaShop version -- : 4.7.0

Hello,
I am setting up my rich snippets content for better SEO. I have products that have three variants with different prices, and the 'root' product set to zero.

When I check my rich snippet code the price is being shown as zero.

Is there a way I can show the main variant price in the rich snippet code?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 81509
  • Thank you received: 13064
  • MODERATOR
1 year 2 months ago #348568

Hi,

Normally, it already takes the price of the main variant price.
In product / show.php, the rich snippet uses this code:

<meta itemprop="price" content="<?php echo $this->itemprop_price; ?>" />
And $this->itemprop_price is defined in the product / listing_price.php view file called a few lines before on the main variant.

That code runs except in the variants are displayed as a "list". In that case the rich snippet for the price is not provided.

Could you provide the URL of a page with the situation ?

Please Log in or Create an account to join the conversation.

  • Posts: 228
  • Thank you received: 4
  • Hikashop Business
1 year 2 months ago #348574

Nicolas,
This is the page:

cotsperfumery.under-development.info/sho...h-rose-eau-de-parfum

And some screenshots of my product backend, showing no 'root' price but variant prices.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81509
  • Thank you received: 13064
  • MODERATOR
1 year 2 months ago #348578

Hi,

I see the issue on your website, but I'm not able to reproduce it on my local test website.
It seems to be some kind of customization on your end leading to this.
Because if I look at the HTML on your link, I can see the price is the "price with options", and the zone for the price without options is not being displayed. But the rich snippet for the price is inside the area for the price without options.
So I think you must have customized the view file product / show_default to remove the price area and this led to the rich snippet being missing too.

Please Log in or Create an account to join the conversation.

Time to create page: 0.060 seconds
Powered by Kunena Forum