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!
Product visibility problem
12 posts from 4 voices-
Posted 3 months ago #
-
Is there anyone can answer me?
Thanks.Posted 3 months ago # -
Kriesi uses the default woocommerce query to display the products. It can be found in wp-content\themes\replete\includes\helper-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...
Posted 3 months ago # -
I hope Kriesi can resolve this problem.
Thanks!Posted 3 months ago # -
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['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 );
Posted 3 months ago # -
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!
EricPosted 3 months ago # -
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,
KriesiPosted 3 months ago # -
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!Posted 3 months ago # -
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
Posted 3 months ago # -
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
Posted 3 months ago # -
Just to be clear: In your theme files you have opened: wp-content\themes\replete\includes\helper-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.
Posted 3 months ago # -
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,
KriesiPosted 2 months ago #
Topic Closed
This topic has been closed to new replies.














