Merge pull request woocommerce/woocommerce-blocks#105 from woocommerce/fix/101
Add order DESC attribute when ordering by newest first
This commit is contained in:
commit
89794358e6
|
@ -1195,6 +1195,9 @@ registerBlockType('woocommerce/products', {
|
|||
} else if ('price_asc' === orderby) {
|
||||
shortcode_atts.set('orderby', 'price');
|
||||
shortcode_atts.set('order', 'ASC');
|
||||
} else if ('date' === orderby) {
|
||||
shortcode_atts.set('orderby', 'date');
|
||||
shortcode_atts.set('order', 'DESC');
|
||||
} else {
|
||||
shortcode_atts.set('orderby', orderby);
|
||||
}
|
||||
|
|
|
@ -834,6 +834,9 @@ registerBlockType( 'woocommerce/products', {
|
|||
} else if ( 'price_asc' === orderby ) {
|
||||
shortcode_atts.set( 'orderby', 'price' );
|
||||
shortcode_atts.set( 'order', 'ASC' )
|
||||
} else if ( 'date' === orderby ) {
|
||||
shortcode_atts.set( 'orderby', 'date' );
|
||||
shortcode_atts.set( 'order', 'DESC' )
|
||||
} else {
|
||||
shortcode_atts.set( 'orderby', orderby );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue