• Resolved webdocdisain

    (@webdocdisain)


    add_filter(‘woocommerce_get_catalog_ordering_args’, ‘am_woocommerce_catalog_orderby’);
    function am_woocommerce_catalog_orderby( $args ) {
    $args[‘meta_key’] = ‘_price’;
    $args[‘orderby’] = ‘meta_value_num’;
    $args[‘order’] = ‘desc’;
    return $args;
    }

    Using this doesnt work on my current query. Is there any way to sort post current query.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter webdocdisain

    (@webdocdisain)

    add_action( ‘elementor/query/My_Price_Sort’, function( $query ) {
    $query->set( ‘orderby’, ‘meta_value_num’ );
    $query->set( ‘order’, ‘DESC’ );
    $query->set( ‘meta_key’, ‘_price’ );
    } );

    made it work

    Plugin Author dudaster

    (@dudaster)

    Great work!

    Plugin Author dudaster

    (@dudaster)

    Let’s close this one.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Ele custom skin post(woocommerce) loop sort by price function doesnt work’ is closed to new replies.