• Customer

    Techone: Products module always show hidden and Out of Stock items

    Posted by: fernandocoello Nov 24, 2017 at 10:41 (7 year ago)
    I'm Having a problem with the module because show hidden and Out of stock items. I had the same issue with woocommerce, but was solved.

    Is there any patch or way to solve this?

    Thanks

  • Customer

    Posted by: Kazim Vu, Nov 27, 2017 at 07:35 (7 year ago)

    Hi fernandocoello
    I have checked and found you have set hide exhausted items in the catalog. Please try to add this function into the functions.php file and let me know your results.
    add_action( 'pre_get_posts', 'iconic_hide_out_of_stock_products' );
    function iconic_hide_out_of_stock_products( $q ) {
    if ( ! $q->is_main_query() || is_admin() ) {
    return;
    }
    if ( $outofstock_term = get_term_by( 'name', 'outofstock', 'product_visibility' ) ) {
    $tax_query = (array) $q->get('tax_query');
    $tax_query[] = array(
    'taxonomy' => 'product_visibility',
    'field' => 'term_taxonomy_id',
    'terms' => array( $outofstock_term->term_taxonomy_id ),
    'operator' => 'NOT IN'
    );
    $q->set( 'tax_query', $tax_query );
    }
    remove_action( 'pre_get_posts', 'iconic_hide_out_of_stock_products' );
    }
    If it does not work, please contact to the author of Woo, they will check and update this issue.
    Regards,

INSTALLATION SERVICE

Theme Installation: $49. Pay now

CUSTOMIZED SERVICES

Use our expert service to turn your ideas into reality. Please send an email to kutethemes@gmail.com to provide the more detailed information. Thanks!

WORKING TIME

Our support service works from Monday to Friday.
Mean time (GMT +7):
+ 7:30 - 11:30 AM
+ 1:30 - 5:30 PM
We will try to answer all the questions within 24 hours and solve them as quickly as possible