I am using WordPress with Woocommerce and want to order the “Woocommerce Product Widget” by the “sales date”. The default order options are “date, price, random, sales”.

Within “class-wc-widget-products.php” line 50 I found

        'orderby' => array(
            'type'  => 'select',
            'std'   => 'date',
            'label' => __( 'Order by', 'woocommerce' ),
            'options' => array(
                'date'   => __( 'Date', 'woocommerce' ),
                'price'  => __( 'Price', 'woocommerce' ),
                'rand'   => __( 'Random', 'woocommerce' ),
                'sales'  => __( 'Sales', 'woocommerce' ),

Here I could add

                'sales_date'  => __( 'Sales_Date', 'woocommerce' ),

which adds the option in the drow-down menu, but how do I connect it with the actual data of the sales dates? I don’t get how this stuff is connected.

Read more here: How can I order the "Woocommerce Products Widget" by the sales date?


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: