Hello,
I would like to change the "call for price" button´s function. If there isn´t a price to a product and the user hits the call for price button, I would like to try to make a call ej. "tel:00000000" in every page that the button appears (product page, category page, carousel etc.)
Is it possible?
Your question is not quite clear, Change how and why ?
Jörgen @ Kreativ Fotografi
sublayouts/prices.php
change
<a class="ask-a-question bold" href="<?php echo $askquestion_url ?>" rel="nofollow" ><?php echo vmText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE') ?></a>
to this below, but change the numbert and text
<a href="tel:+01273123456">Your text here</a>
You must add phone to element for an automatic click-to-call:
https://www.elegantthemes.com/blog/wordpress/call-link-html-phone-number
<a href="tel:123-456-7890">123-456-7890</a>
Do a template override
$phone should be taken from the vendor contact number
You can make the ask for price display a simple click to call div that will call the required number when clicked - mostly only used, of course, on mobile phone displays.
$clicktocall = '<div itemprop="telephone mobile-only"><button class="mobile-click-to-call" " onclick="window.location.href=\'tel:'.$tel.'\'">'.$phone.' - ' vmText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE').'</button></div>';