David
Forum Replies Created
-
About system message when the products are not found – trying to show screenshots #3:
First Screenshot
Second screenshotAbout sorting
I used the following code (found on the Internet):class iWC_Orderby_Stock_Status { public function __construct() { // Check if WooCommerce is active if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) { add_filter('posts_clauses', array($this, 'order_by_stock_status'), 2000); } } public function order_by_stock_status($posts_clauses) { global $wpdb; // only change query on WooCommerce loops if (is_woocommerce() && (is_shop() || is_product_category() || is_product_tag())) { $posts_clauses['join'] .= " INNER JOIN $wpdb->postmeta istockstatus ON ($wpdb->posts.ID = istockstatus.post_id) "; $posts_clauses['orderby'] = " istockstatus.meta_value ASC, " . $posts_clauses['orderby']; $posts_clauses['where'] = " AND istockstatus.meta_key = '_stock_status' AND istockstatus.meta_value <> '' " . $posts_clauses['where']; } return $posts_clauses; } } new iWC_Orderby_Stock_Status;I do not know what to insert in the place where you showed 🙁
Also added a couple of screenshots – as I said above, in my theme, out-of-stock products go to the end of the list. First page of catalog, its my catalog. Next pages – its Woof catalog in turbo mod.
- This reply was modified 5 years, 9 months ago by David.
I agree, I tested it and this only happens in turbo mode. In my template, products with zero price are transferred to the end of the list, when the turbo mode is turned on, they are not transferred. There is also a question. In the turbo mode, when the filter does not find goods, the system message “No products matching your request was found.” Is not displayed. How can I get it back?