- Posts: 237
- Thank you received: 5
Rich snippets price with variants
3 years 8 months ago #348567
by ltempest
Rich snippets price with variants was created by ltempest
-- 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
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.
3 years 8 months ago #348568
by nicolas
Replied by nicolas on topic Rich snippets price with variants
Hi,
Normally, it already takes the price of the main variant price.
In product / show.php, the rich snippet uses this code:
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 ?
Normally, it already takes the price of the main variant price.
In product / show.php, the rich snippet uses this code:
Code:
<meta itemprop="price" content="<?php echo $this->itemprop_price; ?>" />
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.
3 years 8 months ago #348574
by ltempest
Replied by ltempest on topic Rich snippets price with variants
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.
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.
Please Log in or Create an account to join the conversation.
3 years 8 months ago #348578
by nicolas
Replied by nicolas on topic Rich snippets price with variants
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.
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.202 seconds