Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #20106

    Hello Support team.

    I have a problem with products visibility when I active “Hide out of stock items from catalog” in Woocommerce>>>Inventory.

    Please check my website to clearly understand the problem at http://bcgadgets.com.

    It seem the product which is hidden still reserve a space on a pages. So some page appear 1 item, some appear 2 or 4 items. NOTE: I have set 12 items on a single pages and it works properly if I un-check the “Hide out of stock items from catalog” box.

    Thank you!

    #106314

    Is there anyone can answer me?

    Thanks.

    #106315

    Kriesi uses the default woocommerce query to display the products. It can be found in wp-contentthemesrepleteincludeshelper-template-dynamic.php:

    $avia_config['new_query'] = array(
    'post_type' => 'product',
    'post_status' => 'publish',
    'ignore_sticky_posts' => 1,
    "paged" => $page_nr,
    'posts_per_page' => $shop_item_count,
    'orderby' => $orderBY,
    'order' => $order,
    'meta_query' => array(
    array(
    'key' => '_visibility',
    'value' => array('catalog', 'visible'),
    'compare' => 'IN'
    )
    )
    );

    Actually it should return the same number of items unless you reach the last page. I’ll tag this thread for Kriesi because I see no reason why this doesn’t work…

    #106316

    I hope Kriesi can resolve this problem.

    Thanks!

    #106317

    Tricky one. Found the issue and will include it in the next update. if you want a fix right now you can replace the code that dude postet above in with this one:


    global $woocommerce;
    $meta_query = array();
    $meta_query[] = $woocommerce->query->visibility_meta_query();
    $meta_query[] = $woocommerce->query->stock_status_meta_query();

    $avia_config = array(
    'post_type' => 'product',
    'post_status' => 'publish',
    'ignore_sticky_posts' => 1,
    "paged" => $page_nr,
    'posts_per_page' => $shop_item_count,
    'orderby' => $orderBY,
    'order' => $order,
    'meta_query' => $meta_query
    );

    #106318

    Hi.Kriesi.

    The code doesn’t resolve the problem. I found the solution that I will move Out of stock item to Trash. However, it is inconvenience for web master. I hope you can work to resolve the problem which can help your theme better in next version. If you still want to work on it, I am happy to test the result for you.

    All best!

    Eric

    #106319

    Hi!

    thats weird. I was able to reproduce your problem in the first place and using that code fixed it for me. Cant really imagine why this shouldnt work…

    Best regards,

    Kriesi

    #106320

    Hi Kriesi,

    I would like to add the Tool-tip to the shipping method which will explain each of my shipping method when customer move mouse on the text at Shopping Cart and Check out page.

    Here is the tooltip code that I would like http://www.menucool.com/tooltip/css-tooltip. However, I don’t know where to apply it. Can you please show me how to apply it?

    Thank you!

    #106321

    Hi trungct902,

    Integrating that is a bit beyond what we can do via support. You would need to look into a freelance developer to implement something like that.

    Is the code from Kriesi above still not fixing the issue? The fix was actually added into the most recent update scheduled for release as it was a bug fix that should fix the same thing from happening for all users.

    Regards,

    Devin

    #106322

    Hi Devin.

    The code doesn’t fix the bug. I hope you guys can work out to fix it in next update. I can assist develop team by testing the result if you want.

    Regards,

    Trung

    #106323

    Just to be clear: In your theme files you have opened: wp-contentthemesrepleteincludeshelper-template-dynamic.php

    And you’ve replaced this block of code:

    $avia_config['new_query'] = array(
    'post_type' => 'product',
    'post_status' => 'publish',
    'ignore_sticky_posts' => 1,
    "paged" => $page_nr,
    'posts_per_page' => $shop_item_count,
    'orderby' => $orderBY,
    'order' => $order,
    'meta_query' => array(
    array(
    'key' => '_visibility',
    'value' => array('catalog', 'visible'),
    'compare' => 'IN'
    )
    )
    );

    With this block of code:

    $meta_query = array();
    $meta_query[] = $woocommerce->query->visibility_meta_query();
    $meta_query[] = $woocommerce->query->stock_status_meta_query();

    $avia_config['new_query'] = array(
    'post_type' => 'product',
    'post_status' => 'publish',
    'ignore_sticky_posts' => 1,
    "paged" => $page_nr,
    'posts_per_page' => $shop_item_count,
    'orderby' => $orderBY,
    'order' => $order,
    'meta_query' => $meta_query
    );

    This would be the files located on your server and not locally on your computer.

    #106324

    Hey!

    Since there was no additional feedback til now can we consider this solved? If you encounter any issues after the next update let us know :)

    Regards,

    Kriesi

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

The topic ‘Product visibility problem’ is closed to new replies.