Woocommerce i Bootstrap 4: Solucionar problema de desquadrament a woocommeca finalitzar comanda

/**
 * Don't enqueue Bootstrap on WC Products archive
 */
function dequeue_bootstrap(){

  if ( is_page( 'finalitza-la-compra' )) {


    // dequeue Bootstrap CSS
    function dequeue_bootstrap_css(){
      wp_dequeue_style( 'toolset_bootstrap_styles' );
      wp_dequeue_style( 'toolset_bootstrap_4' );
    }
    add_action( 'wp_print_styles', 'dequeue_bootstrap_css' );

    // dequeue Bootstrap JS 
    function dequeue_bootstrap_js(){
      wp_dequeue_script( 'toolset_bootstrap' );
      wp_dequeue_script( 'toolset_bootstrap_4' );
    }
    add_action( 'wp_print_scripts', 'dequeue_bootstrap_js' );    

  }

}
add_action( 'wp_enqueue_scripts', 'dequeue_bootstrap', 100 );

Vist a toolset: https://toolset.com/errata/bootstrap-4-columns-classes-col-1-and-col-2-conflicts-with-woocommerce/

You can follow this thread on WooCommerce GitHub page for a stable solution:

https://github.com/woocommerce/woocommerce/issues/15793

As a workaround, for now, you can de-queue Bootstrap on the checkout page using a custom code snippet like this one.

Of course, you’d have to change its condition to is_page( 'checkout' );.

Bootstrap

https://bootstrapious.com/p/bootstrap-tips-and-tricks https://github.com/woocommerce/woocommerce/wiki/Customizing-image-sizes-in-3.3

Bootstrap: Mantener el estado del después de actualizar

$(document).ready(function () {
    //If shown.bs.collapse add the unique id to local storage
    $(".collapse").on("shown.bs.collapse", function () {
        localStorage.setItem("coll_" + this.id, true);
    });
    //If hidden.bs.collaspe remove the unique id from local storage
    $(".collapse").on("hidden.bs.collapse", function () {
        localStorage.removeItem("coll_" + this.id);
    });
    //If the key exists and is set to true, show the collapsed, otherwise hide
    $(".collapse").each(function () {
        if (localStorage.getItem("coll_" + this.id) == "true") {
            $(this).collapse("show");
        }
        else {
            $(this).collapse("hide");
        }
    });
});

Visto en https://stackoverflow.com/questions/56216250/button-toggle-bootstrap-keep-state-after-refresh

Toolset: Búsquedas personalizadas con checkboxes y relación AND

add_filter( 'wpv_filter_query', 'wpv_atributs_serveis_negocis_wp', 99, 3 );
function wpv_atributs_serveis_negocis_wp( $query_args, $view_settings, $view_id ) {
    if ($view_id == 3900 && isset($_GET['wpv-wpcf-altres-serveis-del-negoci'])) {
         
        $my_args = array('relation' => 'AND');
        foreach($_GET['wpv-wpcf-altres-serveis-del-negoci'] as $offre){
            $my_args[] = array(
                'key'     => 'wpcf-altres-serveis-del-negoci',
                'value'   => $offre,
                'compare' => 'LIKE',
            );
        }
        $query_args['meta_query'][] = $my_args;
        foreach($query_args['meta_query'] as $k=>$v){
            if(isset($v['key']) && $v['key'] == 'wpcf-altres-serveis-del-negoci'){
                unset($query_args['meta_query'][$k]);
            }
        }
    }
    return $query_args;
}

Nota: wpv-wpcf-altres-serveis-del-negoci es el parámetro URL y wpcf-altres-serveis-del-negoci es el nombre del campo personalizado.

Visto en https://toolset.com/forums/topic/how-to-filter-by-more-than-one-checkbox/#post-631805

Toolset: personalizar filtro de distancia

Q1) style distance filter
You can use CSS codes to style the distance filter field, for example:

input.js-toolset-maps-distance-value{
  /* here add your custom CSS codes*/
}

Q2) translate the distance filter
You can change the placeholder text «Show results within… » and «Use my location» text manually by setup the shortcode attributes «inputs_placeholder» and «visitor_location_button_text», for example:

[wpv-control-distance inputs_placeholder="MY OWN Show results within %%DISTANCE%% of %%CENTER%%" visitor_location_button_text="MY OWN Use my location" ...]

Q4) Where can i delete the input fielt of km and mi?
There isn’t such a built-in feature within Toolset maps plugin, but you can hide it with some CSS codes, for example:

select.js-toolset-maps-distance-unit{
display:none;
}

Visto en https://toolset.com/forums/topic/style-map-distance-filter/

Scroll al inicio

We are using cookies on our website

Please confirm, if you accept our tracking cookies. You can also decline the tracking, so you can continue to visit our website without any data sent to third party services.