Product order

Q: I’m trying to order products by the end-of-sale day. I’ve tried different code but with no success.

A: Put below code in your Theme’s functions.php;

    add_filter('jigoshop-request', 'orderjigoshopbysaledatesto');
    function orderjigoshopbysaledatesto($request) {
            $request['orderby'] = 'meta_value';
            $request['meta_key'] = 'sale_price_dates_to';
            $request['order'] = 'DESC'; // longer sales first
            return $request;