Close

rich snippets support in QuickTabs

shayt
11 years ago
#2266 Quote
Avatar
  • 46
Hi,

i want to add a support for rich snippets / microdata with schema.org vocabulary

and i follow the changes in -
http://nopcommerce.codeplex.com/SourceControl/changeset/ee4cf473a13a

but in files :
Views/Catalog/ProductTemplate.SingleVariant.cshtml, line 89
Views/Catalog/ProductTemplate.VariantsInGrid.cshtml, line 63

there is a change for the full description, and this line is in comment because of QuickTabs.
so i guess i need to change the code of QuickTabs,
please explain what i need to change.

Thanks,
Shay
Boyko
11 years ago
#2273 Quote
Avatar
  • Moderator
  • 1570
shayt wrote:
Hi,

i want to add a support for rich snippets / microdata with schema.org vocabulary

and i follow the changes in -
http://nopcommerce.codeplex.com/SourceControl/changeset/ee4cf473a13a

but in files :
Views/Catalog/ProductTemplate.SingleVariant.cshtml, line 89
Views/Catalog/ProductTemplate.VariantsInGrid.cshtml, line 63

there is a change for the full description, and this line is in comment because of QuickTabs.
so i guess i need to change the code of QuickTabs,
please explain what i need to change.

Thanks,
Shay


Hi Shay,

Please note that this is new functionality and it is not supported in the current version.
We can't guarantee that this will work for nopCommerce 2.8. It will definitely work in nopCommerce 3.0 once it is released.

Anyway you can try to modify the view of the Quick Tabs.
Plugins\SevenSpikes.Nop.Plugins.NopQuickTabs\Views\ProductTab\_ProductTabs.cshtml

The changes you need to make in the view should go on different places depending on if you have Ajax enabled or not from the administration of the Tabs.

Thanks
Regards,
Nop-Templates.com Team
shayt
11 years ago
#2277 Quote
Avatar
  • 46
thanks,
i did a little hard-coded until it will be official.
and it assume that the first tab is full description
and the second is review
and no third tab.

@foreach (var pair in divs)
            {
                if (@pair.Key == "tabs-description")
                {
                    <div id="@pair.Key" itemprop="description">
                        @Html.Raw(@pair.Value)                    
                    </div>
                }
                else
                {
                    <div id="@pair.Key" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
                        @Html.Raw(@pair.Value)                    
                    </div>
                }                
            }


shayt
11 years ago
#2309 Quote
Avatar
  • 46
and this is the code regarding the rating.

Ron Palmer - thank you very much for sharing your code.

in the nopQuickTabs plugin folder navigate to the themes, select the theme you are using, then go to views > ProductTab> _ProductReviews.cshtml

Create a variable "int ReviewCount = Model.Items.Count;" under "int ratingPercent = review.Rating * 20;"
and then under <div style="width: @(ratingPercent)%"></div> add the following code.

                            
@*hidden microdata info*@
                          @{
                                  decimal ratingValue = ratingPercent / (decimal)20;
                          }
                            <meta itemprop="ratingValue" style="display:none;" content="@ratingValue.ToString("0.0", new CultureInfo("en-US"))">
                          <span itemprop="reviewCount" style="display:none;">@ReviewCount</span>
IvanStoyanov
11 years ago
#2320 Quote
Avatar
  • Moderator
  • 269
shayt wrote:
and this is the code regarding the rating.

Ron Palmer - thank you very much for sharing your code.

in the nopQuickTabs plugin folder navigate to the themes, select the theme you are using, then go to views > ProductTab> _ProductReviews.cshtml

Create a variable "int ReviewCount = Model.Items.Count;" under "int ratingPercent = review.Rating * 20;"
and then under <div style="width: @(ratingPercent)%"></div> add the following code.

                            
@*hidden microdata info*@
                          @{
                                  decimal ratingValue = ratingPercent / (decimal)20;
                          }
                            <meta itemprop="ratingValue" style="display:none;" content="@ratingValue.ToString("0.0", new CultureInfo("en-US"))">
                          <span itemprop="reviewCount" style="display:none;">@ReviewCount</span>


Great work!
Thank you for choosing our products! Your feedback is important to us!