Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.

    #1182311

    Hey 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,
    Mike

    #1182360

    Hello Mike,
    Thank you for your
    Absolutelly, yes! It is what I need!

    So here is my product grid:

    Here is the link I need to atach to “Pasūtit” link/button:
    Pasūtīt
    Actually it is not even link it is how you see anchor element I need to add.

    #1182562

    Hi,
    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,
    Mike

    #1182995

    Hi, 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/r02sie

    #1183037

    Hi,
    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,
    Mike

    #1183060

    Just 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!

    #1183343

    Hi Max Miko,

    We’re glad to hear that :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Custom link for "Show Details" link’ is closed to new replies.