• Resolved Sirion89

    (@sirion89)


    The new Wc 4.0 is using that nice customizer to let us choose the number of items per row and the numbers of rows, that’s great!

    What is much less great is that we have no more filter to modify those value on the run w/o sacrificing the customizer since you have this:

    
    // The following settings should be hidden if the theme is declaring the values.
        if ( has_filter( 'loop_shop_columns' ) ) {
        return;
    }
    

    And this:

    	
    // Only add this setting if something else isn't managing the number of products per page.
    if ( ! has_filter( 'loop_shop_per_page' ) ) {
        $wp_customize->add_setting(
            'woocommerce_catalog_rows',
            array(
                'default'              => 4,
                'type'                 => 'option',
                'capability'           => 'manage_woocommerce',
                'sanitize_callback'    => 'absint',
                'sanitize_js_callback' => 'absint',
            )
        );
    }
    

    Which means that the legacy filters kill your new feature.

    Why didn’t you just left another apply_filter at the end of these two function:
    -wc_get_default_products_per_row
    -wc_get_default_product_rows_per_page

    So that somebody can modify them on the run?

    I need those since my customer wants 4 columns when viewing category products and 5 columns when viewing category subcategories.

    Please, add one new hook back
    Cheers

    • This topic was modified 4 years, 7 months ago by Sirion89.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Missing filter for layout cols and rows’ is closed to new replies.