PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Problema con boton pop up

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Creé un botón para que se abriera una ventana emergente mostrando los filtros de"WOOF Filter" con el shortcode [woof autosubmit=0 dynamic_recount="1"] y que solo se mostrara en las paginas donde se muestra la tienda y categorías de los productos en el tema storefront. El problema que tengo es que cada vez que le doy clic en mi botón refresca la pagina, he probado desactivando el plugin WOOF Filter y mi código si funciona (es decir no refresca la pagina y muestra el contenido dentro del popup), por lo cual el problema esta en WOOF Filter. Lo que quisiera saber es que si hay alguna funcionalidad por parte de WOOF Filter que ocaciona refrescar la pagina cuando presiono el botón.

En el archivo functions.php de mi tema tengo el siguiente código

add_action( 'wp', 'woofilterhook' );
function woofilterhook() {
    if (is_shop() || is_product_category()) {
        wp_register_script('js_filtro', get_stylesheet_directory_uri(). '/script_filtro.js', array(), null , true );
        wp_enqueue_script('js_filtro');
    add_filter( 'storefront_handheld_footer_bar_links', 'jk_add_home_link3' );
    function jk_add_home_link3( $links ) {
        $new_links = array(
            'filtros' => array(
                'priority' => 9,
                'callback' => 'jk_home_link_2',
            ),
        );
        $links = array_merge( $new_links, $links );
        return $links;
    }
    function jk_home_link_2() {
        echo '<a href="#" id="myBtn"></a>
                <div id="myModal" class="modal">
                <!-- Modal content -->
                    <div class="modal-content">
                        <span class="stftitle">Filtros</span>
                        <span class="close">&times;</span>'
                        . do_shortcode('[woof autosubmit=0 dynamic_recount="1"]') .
                    '</div>
            </div>';
}
    }
    }

 

En mi archivo javascript tengo lo siguiente:
var modal=document.getElementById("myModal"),btn=document.getElementById("myBtn"),span=document.getElementsByClassName("close")[0];btn.onclick=function(){modal.style.display="block"},span.onclick=function(){modal.style.display="none"},window.onclick=function(n){n.target==modal&&(modal.style.display="none")};
Comento que la extensión"Slideout shortcode" propia de WOOF Filter la he instalado pero no se como agregar a un boton especifico de mi tema para que lo accione y abra los filtros con el shortcode. He intentado lo siguiente en functions.php de mi tema y tampoco funciona (muestra el boton pero nunca abre los filtros):
add_action( 'wp', 'woofilterhook' );
function woofilterhook() {
    if (is_shop() || is_product_category()) {
        add_filter( 'storefront_handheld_footer_bar_links', 'jk_add_home_link3' );
    function jk_add_home_link3( $links ) {
        $new_links = array(
            'filtros' => array(
                'priority' => 9,
                'callback' => 'jk_home_link_2',
            ),
        );
        $links = array_merge( $new_links, $links );
        return $links;
    }
    function jk_home_link_2() {
            echo '<a href="#">'.do_shortcode('[woof_slideout image_h=50 image_w=50 location=right speed=100 action=click offset=100px onloadslideout=false ][/woof_slideout]') .'</a>';
}
    }
    }

Hello

Your  page  link - https://c2n.me/4aAQDUa.png

Please renew your suppot

Tiene un bloque de ips por geolocalización. Ya se deshabilito y se puede acceder.

Saludos

Hello

Give me a link where you use this button.

The shortcode cannot affect your JS

https://c2n.me/4aDGZKE.png - this code doesn't make any sense.  Slideout  - this is a wrapper, you can insert any shortcode or content - https://c2n.me/4aDHgnK.png It is also very strange to insert another fixed container into the popup

 

 

Entiendo.

Esta es la captura y la URL del botón donde deseo que al darle clic se abra el Woof Slideout

https://ibb.co/Twdpn8P

 

 

Hello

Try  to  add this  code  in  your  click action

n.preventDefault();

Funciono, muchas gracias.

 

Saludos

Hello

Welcome;)