I am using the goodrelations mod and while it is very nice, the image for the product in featured products, top ten products and such are not schema ready. I am banging my head on how to remove the text from price and just get the price to be in itemprop="price"
Output: <div class="PricesalesPrice" style="display : block;" >Sales price: <span class="PricesalesPrice" >$29.85</span>
I am using overrides in my template/html folder
File default_products.php and I think its in this area that the output for the span is
<?php
if (VmConfig::get ( 'show_prices' ) == '1') {
if (!empty($product->prices)){
if (!empty($product->prices['salesPrice'])) { ?>
<a itemprop="url" href="<?php echo JRoute::_ ( 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id )?>" >
<div class="product-price price">
<div class="price-class" itemprop="price">
<?php echo $this->currency->createPriceDiv('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices); ?>
<?php
$SalesPrice = number_format((float)$product->prices['salesPrice'], 2, '.', '');
$BasePrice = number_format((float)$product->prices['basePriceWithTax'], 2, '.', '');
if ($SalesPrice !== $BasePrice and $product->prices['discountAmount'] > 0) { ?>
<span class="price-before-dicount">
<?php echo $this->currency->createPriceDiv( 'basePriceWithTax', '', $product->prices ); ?>
</span>
<?php } ?>
<div class="product-discount">
<?php
$SalesPrice = number_format((float)$product->prices['salesPrice'], 2, '.', '');
$BasePrice = number_format((float)$product->prices['basePriceWithTax'], 2, '.', '');
if ($SalesPrice !== $BasePrice and $product->prices['discountAmount'] > 0) {
if($templateparams->get('discount')==1) {
$DiscountAmount = $product->prices['discountAmount'];
$ActualPrice = $product->prices['priceWithoutTax'] + $product->prices['discountAmount'];
$Discount = $DiscountAmount / $ActualPrice * 100;
$Discount = number_format((float)$Discount, 2, '.', '').'%';
echo '('.JText::_('COM_VIRTUEMART_CART_SUBTOTAL_DISCOUNT_AMOUNT').': '; echo $Discount.')';
} if($templateparams->get('discount')==2) {
$DiscountAmount = $product->prices['discountAmount'];
$ActualPrice = $product->prices['salesPrice'] + $product->prices['discountAmount'];
$Discount = $DiscountAmount / $ActualPrice * 100;
$Discount = number_format((float)$Discount, 2, '.', '').'%';
echo '('.JText::_('COM_VIRTUEMART_CART_SUBTOTAL_DISCOUNT_AMOUNT').': '; echo $Discount.')';
}
} ?>
</div>
</div>
</div>
</a>
<?php }
}
} ?>
Virtuemart needs to separate the div for salesPrice and price. This one change could make a world of difference for adding schema markup.
Anyone know where or what I need to edit to make that change? Honestly I am surprised that VM doesn't have this already built in. This is a store product and you would think everyone who owns an online store would like to be found on the search better.