Supreme, Send Enquiry – Sidebar
This topic contains 13 replies, has 3 voices, and was last updated by Kiran 6 years, 11 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
December 11, 2017 at 9:19 pm #409119
Hi guys, I’ve been trying to implement this within the sidebar but haven’t had luck. The link from the Supreme detail header has been removed and we are trying to relocate to the side bar. However, part of the code isn’t being accepted – and the link isn’t conditional and remains visible even if there is not email address input for the listing.
I have tried several options, including hard-coding the geodirectory-compatibility.php but I’m stuck. This is the code I’m using:
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 }
I have followed this post: https://wpgeodirectory.com/support/topic/send-enquiry-form/
I have tried to use it within a text widget that has been edited to accept php and also within a php widget. Please see the attached results. Adding an opening php code doesn’t have any effect also. Thank you.
December 12, 2017 at 12:26 am #409158Hello!
As you saw, in the posts you referenced, this is based on the existing link functionality within the theme. A developer should be able to get your customization implemented with the filter so it can be used again outside the theme https://wpgeodirectory.com/support/topic/listing-detail-author-link/#post-361147
We are currently working hard on GeoDirectory V2 which will make some of the most common requests easier regardless of what theme is being used.
December 12, 2017 at 12:31 am #409159I am trying to do exactly that – use a link with the existing functionality of the theme. The link you referenced is to change the function of the “Send Enquiry” link, which is not what I am looking for.
I simply want to add the “Send Enquiry” link into the sidebar instead of it being in the Supreme header.
December 12, 2017 at 12:50 am #409167Hello!
If you removed the link, then you cannot recall the functionality with the snippet.
If you did restore the theme functionality then the snippet could be used to duplicate the link, not move it.
December 12, 2017 at 12:55 am #409169But that’s the problem. I have attached the image of the way the snippet is displaying when used in a php widget in my original post. The link and the pop-up form is just fine, but the conditions are being lost – meaning it should/should not display based on the listing email field being populated. The link for the “Send Enquiry” option is being displayed on listings with an without an email. Even if there is not action when an email is not present, it could be confusing, so I’m trying to figure out why half of the code is being lost.
The functionality isn’t removed, it’s hidden in the header with CSS. Couldn’t I hide the supreme header link and rename this div so that it’s visible? It seems that the contact link can be set up more than once on a page so it should be a problem.
December 12, 2017 at 3:55 pm #409218Hello!
You can post the code you are using here and we can take a look at it.
December 12, 2017 at 4:30 pm #409227I have posted it on my very first attempt with this thread. Please reread the first post. Thank you.
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 }
December 12, 2017 at 6:47 pm #409257Hello!
Just to confirm again, this is a site with Supreme?
Please send over the site URL and WP Admin so we can take a look.
December 12, 2017 at 7:59 pm #409271This reply has been marked as private.December 13, 2017 at 4:14 am #409305Hi Joy,
You have used incorrect logic in code. You have missing opening & closing PHP tags.
I have updated snippet code in your widget:<?php global $post; if ( ! empty( $post ) && ! empty( $post->geodir_email ) ) { ?> <a href="javascript:void(1);" class="b_send_inquiry2" onclick="jQuery('.b_send_inquiry').click();">Send Enquiry</a> <?php } ?>
Thanks,
KiranDecember 13, 2017 at 5:33 pm #409396Thank you so much Kiran! I really appreciate that.
Is there a way that I can have the actual php widget to respond to the same “if” statements used in this code? I have styled the widget to look good with the theme, the only problem I have now is that if there is no email address – the link does not show up, but there is a blank stylized button that will still appear. Any ideas?
December 14, 2017 at 5:48 am #409489Hi Joy,
The logic i used will not display link if there is blank value for email field.
See attachments.
1) With email
2) Without emailLet us know.
Thanks,
KiranDecember 14, 2017 at 7:02 am #409500Thank you. I actually meant if I could apply the logic to a widget. On the site I am working on I styled the “Send Enquiry” link so that there was a background because I added it to the sidebar with css. So when the link isn’t visible, the background would still show. It looked strange.
But no worries, the client decided to use a default email address for listings without an email contact, so the link shows all the time anyway. Thank you again.
December 14, 2017 at 7:13 am #409502Thanks for letting us know 🙂
Kiran
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket