skip to Main Content

I’m displaying a woocommerce notice with a popup shortcode inside. When you try to click it, it works but redirects the URL to ‘ /void(0 ‘. How to amend this code to prevent this from happening. Thanks

 $message = __( 'Please Sign Up or Login', 'my-plugin ' ) . do_shortcode('[arm_form popup="true"]');

 wc_add_notice( $message );

2

Answers


  1. Chosen as BEST ANSWER

    I'm using a plugin called AR Member , I had to change the following:

    wp-content/plugins/armember/core/classes/class.arm_member_forms.php Line: 1699

    Before:

    $popup_content .= '<a href="javascript:void(0)" id="' . $popupLinkID . '" 
    class="' . $popupLinkClass . ' arm_form_popup_ahref" ' . $popupLinkAttr . '>' 
    . $link_title . '</a>';
    

    After:

    $popup_content .= '<a href="#" id="' . $popupLinkID . '" class="' . 
    $popupLinkClass . ' arm_form_popup_ahref" ' . $popupLinkAttr . '>' . 
    $link_title . '</a>';
    

    The downside is that when the plugin updates I will have to update it again, maybe someone could advise if this can be pulled into theme functions in some way?

    Thanks to @Basharmal for a pointer in the right direction :-)


  2. Please change the plugin code .
    Go to

    popup-anything-on-click/includes/shortcode/popupaoc-popup-shortcode.php 
    

    find the code line no 79 to 84 prnt.sc/q882pq
    just replace the code

    “javascript:void(0);”
    

    to

    “#” 
    

    this way

    prnt.sc/q883t9 Note:-In
    

    the future if plugin will update your code will lose

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search