• Resolved debrecenibalazs

    (@debrecenibalazs)


    Hi Guys,

    First things first I am in love with the plugin,
    Another problem occured when I am trying to exclude one specific page from the BBloomer’s Stock forst snippet.

    The snippet I am using the following:

    if ( is_page( 499 ) ) {
    return;
    }

    add_filter( ‘woocommerce_get_catalog_ordering_args’, ‘bbloomer_first_sort_by_stock_amount’, 9999 );

    function bbloomer_first_sort_by_stock_amount( $args ) {
    $args[‘orderby’] = ‘meta_value’;
    $args[‘order’] = ‘ASC’;
    $args[‘meta_key’] = ‘_stock_status’;
    return $args;

    }

    The purpose of this tiny snippet is to sort the in-stock products first and exclude the main page( ID:499) from the code itself.

    Maybe I am doing something wrong, but i would apreciate a little help 🙂

    Tkae care and have a node weekend!

    The page I need help with: [log in to see the link]

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

The topic ‘Exclude PHP snippet on a specific page’ is closed to new replies.