-
AuthorPosts
-
February 5, 2020 at 4:24 pm #1181810
I have product grid and each product have one button “Show details”, I renamed this to “Order”. When you click you go to the Product Details Page.
But now we decided with client that we want to run specific CF7 pop-up form after pressing this link. But I don’t know where I can add my custom link to run this specific pop-up.Also I was unable to find such thread here at forum, so may be you can help me, how can I change this link
Thank you.
February 7, 2020 at 2:05 pm #1182311Hey MAKSIMS,
Sorry for the late reply, do you mean that all of the buttons will trigger the same CF7 pop-up?
If it is the button I’m thinking of there is not a built-in way to change the link of the button, but we may be able to add a function to do this. Please link to your page with the button and include the link to the pop-up so we can investigate.Best regards,
MikeFebruary 7, 2020 at 5:50 pm #1182360February 8, 2020 at 12:05 pm #1182562Hi,
Thanks for the link to your page, this script will replace the link and add the popup class in every “show_details_button” on your site to your popup, I tried to be very specific with the classes so it should not affect other buttons.
Try adding this code to the end of your functions.php file in Appearance > Editor:function custom_button_script(){ ?> <script> (function($){ $(document).ready(function(){ $(".product .avia_cart_buttons a.button.show_details_button").attr("href", "#").addClass('spu-open-6686'); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_button_script');
You will note that the button’s design will change a little because of your css for that button class, I assume that is ok?
Best regards,
MikeFebruary 10, 2020 at 11:24 am #1182995Hi, Mike!
Thank you for the code. Pitty, bet I am not very experienced in php/js, so WP don’t like something. I guess there is something with <?php ?> combination.
Please see screenshot: https://prnt.sc/r02sieFebruary 10, 2020 at 1:36 pm #1183037Hi,
I don’t see an error in the code itself, so it could be elsewhere in the file. Sometimes WordPress gives this message about editing the functions.php via FTP, this is the WordPress sandbox feature after a change is made WP tests to make sure your site isn’t white screened if it can’t determine the state, it cancels the save to avoid accidental breakage.
If your not comfortable editing in FTP then we can assist, Please include an admin login & FTP access in the Private Content area.Best regards,
MikeFebruary 10, 2020 at 2:24 pm #1183060Just wow, Mike!
I’ve done the things via FTP as you recommended and all works nice! Even style new button has I like :) And thank you a lot for the code you wrote. Best support!
February 11, 2020 at 6:09 am #1183343Hi Max Miko,
We’re glad to hear that :)
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Custom link for "Show Details" link’ is closed to new replies.