VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: idor on February 04, 2020, 13:34:18 PM

Title: Call for price
Post by: idor on February 04, 2020, 13:34:18 PM
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?
Title: Re: Call for price
Post by: Jörgen on February 11, 2020, 20:06:42 PM
Your question is not quite clear, Change how and why ?

Jörgen @ Kreativ Fotografi
Title: Re: Call for price
Post by: PRO on February 11, 2020, 20:53:57 PM
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>
Title: Re: Call for price
Post by: pinochico on February 11, 2020, 22:36:09 PM
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>
Title: Re: Call for price
Post by: AH on February 12, 2020, 09:47:09 AM
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>';