hello

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #208690

    salehhamed294
    Participant

    – I need to sort all products that shows in woodmart carousel by InStock first for instance if we sort our product by date we need to have in stock products first then out of stock products.
    I did that to default woocommerce product grid by this code but it\’s not working on woodmart product carousel.
    add_filter(\’posts_clauses\’, \’order_by_stock_status\’,9999);
    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() || is_product_taxonomy())) {
    $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;
    }
    – also i need to have \”Show More\” button next to product carousel title, let me explane that we have 4 product carousel in our main page that shows A,B,C,D products categories i need to have a link to show all products in A category next to carousel title somthing like this:
    https://ollo.market/

    #208820

    Artem Temos
    Keymaster

    Hello,

    Thank you so much for purchasing our theme and contacting our support center.

    1. We see that it is the way how your code supposes to work. It is applied for WooCommere loop only and this is indicated in your snippet https://gyazo.com/2fa4d458ab99a8f05593589b7ed64ba7

    2. Sorry, but there is no such option in our theme and WooCommerce by default. It may require additional code customization or extra plugin but we don’t have an instruction for this. It is out of our theme support scope.

    Regards

Tagged: 

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