Send Enquiry Follow-up

This topic contains 3 replies, has 2 voices, and was last updated by  Giri 6 years, 9 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #387595

    Tim Sanford
    Full Member
    Post count: 157

    Hi, sorry this took me a bit of time to get to, got sidetracked.

    Reference thread https://wpgeodirectory.com/support/topic/send-enquiry-form/
    in response to Giri’s comment on inserted “if” wrapped code

    I’m having a difficult time identifying where to insert that code so that it works 🙁
    I have attached a screen

    #387682

    Giri
    Expired Member
    Post count: 3155

    Hi Tim, Thats a link wrapper with if check. If you are not seeing that link then it means you have not filled the Email field.

    As for your question, you need to place the code where you want to display the link.

    Let me know if I misunderstood your question.

    Thanks

    #388175

    Tim Sanford
    Full Member
    Post count: 157

    I know what it is, I’m just a bit rusty, not completely useless 🙁

    I tried placing it various lines, however I couldn’t arrive at the desired end result.

    I’m updating the file manually with each attempt through Godaddy’s cpanel file manager.

    here is an example listing http://perfectpaddles.com/places/united-states/california/marina-del-rey/feature/paddle-method/

    The listing has an email associated to it, which is determinable by a working “send enquiry” on the right

    I’ve updated the code and added a second version of the same link – non-conditional with dummy text as reference. The latter seems to work as desired, however the conditional one is not being displayed.

    I’ve attached a new screen

    #388431

    Giri
    Expired Member
    Post count: 3155

    Hi Tim, I guess I understand your problem

    In your old thread you mentioned like this.

    I’d like the 2nd link to be conditionally visible like the default in the event that the listing doesn’t have an email assigned to it.

    Thats why i given this code.

    
    
    global $post;
    if (!isset($post->geodir_email) || empty($post->geodir_email)) {
    	?>
    	<a href="javascript:void(1);" class="b_send_inquiry2" onclick="jQuery( '.b_send_inquiry' ).click();">Send Enquiry</a>
    	<?php
    }

    Which means that link would display only when the Email field not filled. If you want to do the exact opposite (when email filled)

    you need to replace this line

    if (!isset($post->geodir_email) || empty($post->geodir_email)) {

    with

    if (isset($post->geodir_email) && !empty($post->geodir_email)) {

    Hope that helps.

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket