Author Topic: Call for price  (Read 159 times)

dkaneloglou

  • Beginner
  • *
  • Posts: 33
Call for price
« 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?

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2526
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Call for price
« Reply #1 on: February 11, 2020, 20:06:42 pm »
Your question is not quite clear, Change how and why ?

Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10398
  • VirtueMart Version: 3+
Re: Call for price
« Reply #2 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>
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

pinochico

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 128
    • MiniJoomla
  • VirtueMart Version: 3
Re: Call for price
« Reply #3 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>
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3047
  • VirtueMart Version: 3.6.11
Re: Call for price
« Reply #4 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.

Code: [Select]
$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>';
regards
A

Joomla 3.9.15
php 7.2