New Landing How can we help? Themeforest Theme Support Neighborhood WooCommerce integration category help please

Viewing 3 posts - 1 through 3 (of 3 total)
  • #46971
    cdsouza
    Member
    Post count: 44

    Hi,

    I’m trying to have a wholesale page (additionally to the regular SHOP page) where users would have to login to view the items.

    So far, I have installed the plugin wc-password-protect which allowed me to protect the category “wholesale” but not hide the items completely until a password is used.

    1. I’m trying to see if there is a way to use a PAGE called Wholesale at the menu level that will only call on products using the category “wholesale”. This way I can password protect the page easily.

    2. Can I hide items from a category from the WooCommerce STORE page so they only appear in the WHOLESALE page I’m trying to create?

    Any help is much appreciated. I feel like my eyeballs are bleeding from reading so many forums for help…

    #46979
    cdsouza
    Member
    Post count: 44

    Hi,

    So, I’ve accomplished the first page by using swift page building and using mini products to show the wholesale category.

    Can you please help with item 2? I want to hide the wholesale category from the SHOP page. I tried using the following codeI found online, but its not working:

    add_action( ‘pre_get_posts’, ‘custom_pre_get_posts_query’ );

    function custom_pre_get_posts_query( $q ) {

    if ( ! $q->is_main_query() ) return;
    if ( ! $q->is_post_type_archive() ) return;

    if ( ! is_admin() && is_shop() ) {

    $q->set( ‘tax_query’, array(array(
    ‘taxonomy’ => ‘product_cat’,
    ‘field’ => ‘slug’,
    ‘terms’ => array( ‘knives’ ), // Don’t display products in the knives category on the shop page
    ‘operator’ => ‘NOT IN’
    )));

    }

    remove_action( ‘pre_get_posts’, ‘custom_pre_get_posts_query’ );

    }

    #47834
    Melanie – SUPPORT
    Member
    Post count: 11032

    Hey, you can use our products swift page builder element for that, you can set categories in our products element.

    Cheers!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register