Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PI Call for Price Button


ce7

Recommended Posts

Hi,
I have phoenix 1075, at the product information page, i am trying to replace the buy button with call for price button if the price is 0,
version #1,

const MODULE_CONTENT_PI_MOBILE_BUTTON_TEXT = '<br>' . 
'<a  href="tel:' . STORE_MOBILE 
. '" class="btn-success btn-block btn-lg btn-pi-product btn-mobile" >
<span class="fas fa-phone-square"></span>  
Mob: ' . STORE_MOBILE . ' </a>';
echo tep_draw_button(MODULE_CONTENT_PI_MOBILE_BUTTON_TEXT);


and when you point at the button, will show the mobile number, and when click on the button, it will have pop up screen, this popup action is what I want as click on the button, you can make a call... however the button will not have the right template size even put btn-block btn-lg
image.png.c85b1ce1cc563eff0445397f35ca7f8d.png 
image.png.1e949b4f20516948b07d406a038e0f94.png

version #2

    

echo
     '<a href="Mob:'. STORE_MOBILE . '">' .
     tep_draw_button(IMAGE_BUTTON_MOBILE,
                           'fas fa-phone-square', 
                           'Mob:'. STORE_MOBILE .'',  // $link
                           NULL,
                           NULL,
                           'btn-success btn-block btn-lg btn-pi-product btn-mobile',
                           ) . PHP_EOL
     . '</a>'
     ;

with this version #2, when you point at the button, it will show up the mobile number, and when you click on it, it will not do anything, no popup screen that allow you to make a call, but the template size does show up btn-block btn-lg style
image.png.7189526126073103e764a0a4728d36d9.png


version #3

     echo
     '<a href="Mob:'. STORE_MOBILE . '">' .
     tep_draw_button(IMAGE_BUTTON_MOBILE,
                           'fas fa-phone-square', // $icon = null,
                           NULL,  // $link
                           NULL,
                           NULL,
                           'btn-success btn-block btn-lg btn-pi-product btn-mobile',
                           ) . PHP_EOL
     . '</a>'
     ;
	


with this version #3, when you point at the button, it will show up the mobile number, the template show up btn-block btn-lg style, which is what I want, but when you click on the button, instead of make a call, it add the product to the shopping cart.

So my question is:
How can I modify the code that will show up
#1 the right template design ( btn-block btn-lg),
#2 when you point at the button, show up the mobile # details
#3 when you click on the button will show popup screen and you can make a call

 

any help or suggestion is appreciated, thanks!

 

 

 

Link to comment
Share on other sites

after google and read through different posts, i found only <a href tel: > will work,
so with $link, i
change
'Mob:'. STORE_MOBILE,
to
'tel:' . STORE_MOBILE,
then it does have the popup screen that choose call apps

hope this will help for people who also interesting in making button to have call function...

Link to comment
Share on other sites

Whilst I would not use this on my store it does seem like a good idea which others may use. Why not package the whole thing up as a hook or something and release it as an addon so others can use it.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

On 8/13/2020 at 4:02 PM, 14steve14 said:

Whilst I would not use this on my store it does seem like a good idea which others may use. Why not package the whole thing up as a hook or something and release it as an addon so others can use it.

@14steve14 Hi Steve,

I don't quite understand the design of Phoenix yet, so don't know how to make it as hooks, all I tried so far is mixed the addons I had been installed, and try to modify the code with other addons so that it show up what I want. So what I tried to do here is borrowed the ideas of Email for Quote & JcM Call for price, but instead of email, put call button when price is 0. And also with your help from other post about the button style btn-block btn-lg  😊 (thanks again!)


I would also love to learn about how to make a new addon and share with others for sure....
Spend a lot of time read the forums posts, stackoverflow.com posts, and other related google search results, I did time by time post on my own posts if I found solution myself so that others don't waste time like i did 😂.... (all my posts if i did not post my own solution, a lot of time means I am still struggling with it 😭 but I appreciated a lot the helps from forums general support as I know experts here help us with their own time and ask for no charge, really appreciate to each one who ever helped!)

Link to comment
Share on other sites

Just a small comment. I prefer a value of -1 for "Call For Price", which leaves zero for the possibility of Free products. Some store owners might have a promotion where there's a giveaway when another (range of) product(s) is purchased. I have one client that does exactly that and showing a Free product encourages further purchases (sometimes). I does however, mean that shop owners need to pay attention that they enter a price when adding a new product! ;)

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...