• Resolved adamsusskind

    (@adamsusskind)


    Hello!

    Wonderful plugin! Works very well where the official Layered Nav widgets fail.

    Right now, I am using jameskoster’s WooCommerce Product Archive Customizer. This plugin changes the layout of the Product Archive. It allows me to pick how many products appear in one row. I have selected 3 per row. Once I make a selection from the AJAX widgit, the products per row value changes back to the default 4, but the size of my products ends up forcing each row into two rows, because not all 4 fit on the same row.

    You can see the issue here: http://kjkstyle.com/shop/

    Once you make a selection for the AJAX widget on the left, you’ll see the error.

    Any idea what I can do to fix this?

    Thank you, thank you!

    https://wordpress.org/plugins/woocommerce-ajax-filters/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Dmytro Holovnia

    (@dholovnia)

    Hi adamsusskind,

    As I see my plugin just don’t see changes done by the WooCommerce Product Archive Customizer plugin. You can try to add this to your functions.php file:

    add_filter( 'loop_shop_columns', 'th2342ds_func_loop_shop_columns', 1 );
    function th2342ds_func_loop_shop_columns(){
        return 3;
    }

    Regards,
    Dima

    Thread Starter adamsusskind

    (@adamsusskind)

    Thank you, Dima!

    I see what you were going for with that, but it doesn’t seem to have worked.

    Any other ideas?

    Best,
    Adam

    Plugin Author Dmytro Holovnia

    (@dholovnia)

    Hi Adam,

    I did a mistake there.
    Remove prev version of the code and add this:

    if ( ! function_exists( 'nbf085e4gotrfhw_loop_columns' ) ) {
        function nbf085e4gotrfhw_loop_columns( $cols = '' ) {
            return 3;
        }
    }
    add_filter('loop_shop_columns', 'nbf085e4gotrfhw_loop_columns', 999);

    999 – means we are last in the queue and as a result our changes would be final while in prev code we was first and this is not very good solution in our case =)

    Regards,
    Dima

    Thread Starter adamsusskind

    (@adamsusskind)

    My hero! Thank you so much for providing such excellent support. That worked. 🙂 🙂 🙂

    If you get a chance, is the “nbf085e4gotrfhw” simple for namespace purposes?

    You can mark this as resolved. Thank you!

    Plugin Author Dmytro Holovnia

    (@dholovnia)

    Adam,

    You can name that function any way you want but to minimize the chance of name duplication and issue better to add some dummy symbols or use classes ofc.

    Using class it would be something like this:

    class BeRocket_Loop_Columns {
        public static function columns( $cols = '' ) {
            return 3;
        }
    }
    add_filter('loop_shop_columns', array( 'BeRocket_Loop_Columns', 'columns' ), 999);

    here you can use real namespaces. But for 1 function I’d prefer dummy name =)

    Regards,
    Dima

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Plugin Incompatible with Product Archive Customizer’ is closed to new replies.