Advertisement:

Author Topic: How To Make Phone Call Button work with Osclass Wizard + Telephone Plugin  (Read 1792 times)

bhatav

  • Newbie
  • *
  • Posts: 12
Hello Everyone  :D
Newbie here hava a question

I'had install my osclass with Osclass Wizard and added a free telephone plugin on osclass market.

but i had been confused when solving my problem,

i want to Make the "Contact Seller" Button on Osclass Wizards can integrate with Telephone plugin and do automatic phone call (with href="tel"000) while clicking the button on mobile,

but, i had tried with href and it not worked and i just got like +62572829293829290202 and it's not the correct number on the listing.

here is my plugin code to call the phone number on the listing
Code: [Select]
<?php if(function_exists('osc_telephone_number')){ osc_telephone_number();} ?>here is the code by default
Code: [Select]
<ul class="contact_button">
          <li>
            <?php if( !osc_item_is_expired () ) { ?>
            <?php if( !( ( osc_logged_user_id() == osc_item_user_id() ) && osc_logged_user_id() != ) ) { ?>
            <?php     if(osc_reg_user_can_contact() && osc_is_web_user_logged_in() || !osc_reg_user_can_contact() ) { ?>
            <a href="#contact">
            <?php _e('Contact seller'OSCLASSWIZARDS_THEME_FOLDER); ?>
            </a>
            <?php     ?>
            <?php     ?>
            <?php ?>
          </li>
And change it like this
Code: [Select]
<ul class="contact_button">
          <li>
            <?php if( !osc_item_is_expired () ) { ?>
            <?php if( !( ( osc_logged_user_id() == osc_item_user_id() ) && osc_logged_user_id() != ) ) { ?>
            <?php     if(osc_reg_user_can_contact() && osc_is_web_user_logged_in() || !osc_reg_user_can_contact() ) { ?>
            <a href="tel:'osc_telephone_number'">
            <?php _e('Contact seller'OSCLASSWIZARDS_THEME_FOLDER); ?>
            </a>
            <?php     ?>
            <?php     ?>
            <?php ?>
          </li>

But Not Worked, and change it like this

Code: [Select]
<ul class="contact_button">
          <li>
            <?php if( !osc_item_is_expired () ) { ?>
            <?php if( !( ( osc_logged_user_id() == osc_item_user_id() ) && osc_logged_user_id() != ) ) { ?>
            <?php     if(osc_reg_user_can_contact() && osc_is_web_user_logged_in() || !osc_reg_user_can_contact() ) { ?>
            <a href="tel:<?php if(function_exists('osc_telephone_number')){ osc_telephone_number();} ?>">
            <?php _e('Contact seller'OSCLASSWIZARDS_THEME_FOLDER); ?>
            </a>
            <?php     ?>
            <?php     ?>
            <?php ?>
          </li>
And it was be worse, the button crashed and not worked too

Please, Anyone help me  :-[


Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: How To Make Phone Call Button work with Osclass Wizard + Telephone Plugin
« Reply #1 on: December 26, 2016, 06:38:57 pm »
Code: [Select]
<a href="tel:<?php if(function_exists('osc_telephone_number')){ osc_telephone_number();} ?>">

just typing the function dont display it, except there is an echo in it, if not, you have to make an echo...
Code: [Select]
<a href="tel:<?php if(function_exists('osc_telephone_number')){ echo osc_telephone_number(); } ?>">

but to check if the function exist make no sense, when you display the button anyway... this should be work for you
Code: [Select]
<?php if (function_exists('osc_telephone_number') && !empty(osc_telephone_number())) { ?>
<a href="tel:<?php echo osc_telephone_number(); ?>">
    <?php _e('Contact seller'OSCLASSWIZARDS_THEME_FOLDER); ?>
</a>
<?php ?>
« Last Edit: December 26, 2016, 06:44:05 pm by Liath »

bhatav

  • Newbie
  • *
  • Posts: 12
Re: How To Make Phone Call Button work with Osclass Wizard + Telephone Plugin
« Reply #2 on: December 26, 2016, 08:40:35 pm »
Code: [Select]
<a href="tel:<?php if(function_exists('osc_telephone_number')){ osc_telephone_number();} ?>">

just typing the function dont display it, except there is an echo in it, if not, you have to make an echo...
Code: [Select]
<a href="tel:<?php if(function_exists('osc_telephone_number')){ echo osc_telephone_number(); } ?>">

but to check if the function exist make no sense, when you display the button anyway... this should be work for you
Code: [Select]
<?php if (function_exists('osc_telephone_number') && !empty(osc_telephone_number())) { ?>
<a href="tel:<?php echo osc_telephone_number(); ?>">
    <?php _e('Contact seller'OSCLASSWIZARDS_THEME_FOLDER); ?>
</a>
<?php ?>

i've changed the code with your code, but it not worked

and then, i changed to be like this, and not worked too with the code you gave,
any suggestion? :(
Code: [Select]
<ul class="contact_button">
         
           
            <a href="#contact">
            <?php _e('Contact seller'OSCLASSWIZARDS_THEME_FOLDER); ?>
            </a>
           
          </ul>
          <ul class="contact_button">
<a href="<?php echo osc_item_send_friend_url(); ?>" rel="nofollow">
            <?php _e('Share'OSCLASSWIZARDS_THEME_FOLDER); ?>
            </a></li>
          <?php if(function_exists('watchlist')) {?>
          <li>
            <?php watchlist(); ?>
          </ul>
          <?php ?>
          <ul class="contact_button">
<a class="see_all" href="<?php echo osc_user_public_profile_urlosc_item_user_id() ); ?>">
            <?php _e('Semua Iklan Pekerja'OSCLASSWIZARDS_THEME_FOLDER); ?>
            </a>
        </ul>

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: How To Make Phone Call Button work with Osclass Wizard + Telephone Plugin
« Reply #3 on: December 26, 2016, 08:45:38 pm »
what did not work, any error messages? activate the debugging and show the content of debug.log please


Activate debugging in OSClass

bhatav

  • Newbie
  • *
  • Posts: 12
Re: How To Make Phone Call Button work with Osclass Wizard + Telephone Plugin
« Reply #4 on: December 26, 2016, 09:04:12 pm »
what did not work, any error messages? activate the debugging and show the content of debug.log please


Activate debugging in OSClass

There is no error occured, but it was been like screenshot that i attached
and the call function not worked too :(

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: How To Make Phone Call Button work with Osclass Wizard + Telephone Plugin
« Reply #5 on: December 26, 2016, 09:15:31 pm »
can you give me a link to an example page? it seems there is a wrong html syntax

bhatav

  • Newbie
  • *
  • Posts: 12
Re: How To Make Phone Call Button work with Osclass Wizard + Telephone Plugin
« Reply #6 on: December 26, 2016, 09:31:50 pm »
can you give me a link to an example page? it seems there is a wrong html syntax

i want to but i can't PM you

could u give me a pm first?

Thank you very much

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: How To Make Phone Call Button work with Osclass Wizard + Telephone Plugin
« Reply #7 on: December 26, 2016, 09:52:54 pm »
no, pm system is disabled for all user


Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: How To Make Phone Call Button work with Osclass Wizard + Telephone Plugin
« Reply #9 on: December 26, 2016, 10:41:18 pm »
please add the modified code there, so i can see the wrong html structure

bhatav

  • Newbie
  • *
  • Posts: 12
Re: How To Make Phone Call Button work with Osclass Wizard + Telephone Plugin
« Reply #10 on: December 27, 2016, 06:57:03 pm »
please add the modified code there, so i can see the wrong html structure

im sorry for late responding, and it is my freetime after worked on my time zone.

i've added your codes,

and this code that have been added on my website rightnow
Code: [Select]
<?php if (function_exists('osc_telephone_number') && !empty(osc_telephone_number())) { ?>
<a href="tel:<?php echo osc_telephone_number(); ?>">
    <?php _e('Contact seller'OSCLASSWIZARDS_THEME_FOLDER); ?>
</a>
<?php ?>
and here is my website now

https://gawean.co.id/list/teknisi/servis-handphone/test_i6

the button was disappear and just the phone number text and still can't clicked

I had been added another button code above, and still struggling to it :D

Code: [Select]
<ul>
<form>
<!empty $osas = "<?php if(function_exists('osc_telephone_number')){ osc_telephone_number();} ?></>"</>
<input type="button" value="Hubungi Pekerja" onclick="href="tel:/<?php echo ("$osas"); ?>/"" />
</form>
</ul>

what is wrong in my html structure?
Thank you very much for your help btw :)



« Last Edit: December 27, 2016, 07:02:51 pm by bhatav »

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: How To Make Phone Call Button work with Osclass Wizard + Telephone Plugin
« Reply #11 on: December 27, 2016, 07:27:33 pm »
there is a wrong syntax in the onclick attribute

Code: [Select]
<input type="button" value="Hubungi Pekerja" onclick="href=" tel:="" ""="">
there you should look at first


Whats this?
Code: [Select]
<ul>
<form>
<!empty $osas = "<?php if(function_exists('osc_telephone_number')){ osc_telephone_number();} ?></>"</>
<input type="button" value="Hubungi Pekerja" onclick="href="tel:/<?php echo ("$osas"); ?>/"" />
</form>
</ul>
please use always right syntax for php or html, you cannot mix them...




Code: [Select]
<?php if (function_exists('osc_telephone_number')) { ?>
<input type="button" value="Hubungi Pekerja" href="tel:<?php echo osc_telephone_number(); ?>/"" />
<?php ?>
this should be all what you need
« Last Edit: December 27, 2016, 07:35:49 pm by Liath »

bhatav

  • Newbie
  • *
  • Posts: 12
Re: How To Make Phone Call Button work with Osclass Wizard + Telephone Plugin
« Reply #12 on: December 27, 2016, 08:11:25 pm »
there is a wrong syntax in the onclick attribute

Code: [Select]
<input type="button" value="Hubungi Pekerja" onclick="href=" tel:="" ""="">
there you should look at first


Whats this?
Code: [Select]
<ul>
<form>
<!empty $osas = "<?php if(function_exists('osc_telephone_number')){ osc_telephone_number();} ?></>"</>
<input type="button" value="Hubungi Pekerja" onclick="href="tel:/<?php echo ("$osas"); ?>/"" />
</form>
</ul>
please use always right syntax for php or html, you cannot mix them...




Code: [Select]
<?php if (function_exists('osc_telephone_number')) { ?>
<input type="button" value="Hubungi Pekerja" href="tel:<?php echo osc_telephone_number(); ?>/"" />
<?php ?>
this should be all what you need


I had been changed this code
Quote
<ul class="contact_button">
            <a href="#contact">
            <?php _e('Contact seller', OSCLASSWIZARDS_THEME_FOLDER); ?>
            </a>
          </ul>

into this
Code: [Select]
<?php if (function_exists('osc_telephone_number')) { ?>
<input type="button" value="Hubungi Pekerja" href="tel:<?php echo osc_telephone_number(); ?>/"" />
<?php ?>

but still not changed and the apperance crashed idk

Quote
Whats this?
Code: [Select]
<ul>
<form>
<!empty $osas = "<?php if(function_exists('osc_telephone_number')){ osc_telephone_number();} ?></>"</>
<input type="button" value="Hubungi Pekerja" onclick="href="tel:/<?php echo ("$osas"); ?>/"" />
</form>
</ul>
please use always right syntax for php or html, you cannot mix them...

Just my trail&error :p

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: How To Make Phone Call Button work with Osclass Wizard + Telephone Plugin
« Reply #13 on: December 27, 2016, 08:48:17 pm »
<input type="button" value="Hubungi Pekerja" href="tel:<?php echo osc_telephone_number(); ?>/"" />


you're missing the basics of html ;)


Code: [Select]
<input type="button" value="Hubungi Pekerja" href="tel:<?php echo osc_telephone_number(); ?>" />

all time you open an attribute in html, e.g. href you have to close it href="here your content" dont use doublequotes in another way inside of html tags
« Last Edit: December 27, 2016, 08:51:44 pm by Liath »

bhatav

  • Newbie
  • *
  • Posts: 12
Re: How To Make Phone Call Button work with Osclass Wizard + Telephone Plugin
« Reply #14 on: December 27, 2016, 09:00:00 pm »
<input type="button" value="Hubungi Pekerja" href="tel:<?php echo osc_telephone_number(); ?>/"" />


you're missing the basics of html ;)


Code: [Select]
<input type="button" value="Hubungi Pekerja" href="tel:<?php echo osc_telephone_number(); ?>" />

all time you open an attribute in html, e.g. href you have to close it href="here your content" dont use doublequotes in another way inside of html tags

Thanks for your help Liath, i've changed the code into your code,
but it's still like this, idk :(
https://gawean.co.id/list/teknisi/servis-handphone/test_i6