VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: michybetti1085 on May 15, 2020, 16:26:40 PM

Title: Prices in virtuemart, on google images change !!!!!
Post by: michybetti1085 on May 15, 2020, 16:26:40 PM
Hi I have a problem on my father's site ... who uses virtuemart for sale ... in practice the prices read by google images are absurd, I explain

this is the link of the Zepparda product

https://www.calzolerialarapida.it/zeppe-donna/zeppe-donna-in-sughero-alte.html

however if you search zepparda on google images, the product appears with the price transformed into 1.100.928,00€ absurd thing !!!! as well as false !!!

This screenshoot

https://www.calzolerialarapida.it/help.jpg

Who knows what this problem can depend on? I don't know how to solve it I ask for help thanks
Title: Re: Prices in virtuemart, on google images change !!!!!
Post by: GJC Web Design on May 16, 2020, 00:46:15 AM
view-source:https://www.calzolerialarapida.it/zeppe-donna/zeppe-donna-in-sughero-alte.html

around line 680

  "offers": {
    "@type": "Offer",
    "priceCurrency": "EUR",
    "availability": "OutofStock",
    "price": "110.0928",
    "url": "https://www.calzolerialarapida.it/zeppe-donna/zeppe-donna-in-sughero-alte.html",
    "itemCondition": "NewCondition"
  }

find the code that is producing the structured data and have something like

<?php echo number_format($this->product->prices['salesPrice'],2); ?> so 2 decimal places

Title: Re: Prices in virtuemart, on google images change !!!!!
Post by: michybetti1085 on May 17, 2020, 23:29:56 PM
Thanks a lot, I've been looking for 2 days but I can't find a similar string in the com_virtuemart folder files do you have any idea where I can find it?
Title: Re: Prices in virtuemart, on google images change !!!!!
Post by: GJC Web Design on May 18, 2020, 00:09:32 AM
\components\com_virtuemart\sublayouts\snippets.php or in the over ride version of that file
Title: Re: Prices in virtuemart, on google images change !!!!!
Post by: michybetti1085 on May 18, 2020, 00:18:43 AM
ook thanks in the snippet file this code

<?php } ?>
  "offers": {
    "@type": "Offer",
    "priceCurrency": "<?php echo $currency->_vendorCurrency_code_3; ?>",
    "availability": "<?php echo $stockog; ?>",
    "price": "<?php echo $product->prices['salesPrice']; ?>",
    "url": "<?php  echo $canonicalUrl; ?>",


So I should change this line 131 to

   "price": "<?php echo $product->prices['salesPrice'],2; ?>",
Title: Re: Prices in virtuemart, on google images change !!!!!
Post by: GJC Web Design on May 18, 2020, 14:02:08 PM
I can only say "perhaps" -  suck and see -- test with the https://search.google.com/structured-data/testing-tool