SimplCommerce icon indicating copy to clipboard operation
SimplCommerce copied to clipboard

ProductWidget with Discount & BestSelling option not list right products

Open nqtuyen opened this issue 4 years ago • 2 comments

Using ProductWidget was not as expected. pls give me advise.

Fixed for Discount option: if (model.Setting.OrderBy == ProductWidgetOrderBy.Discount) { query = query.Where(x => x.Price < x.OldPrice).OrderByDescending(x => x.CreatedOn); }

nqtuyen avatar Jan 22 '21 06:01 nqtuyen

x.OldPrice could be null so I think you should do

query.Where(x => x.OldPrice.HasValue && x.Price < x.OldPrice.Value).

tavershimafx avatar Feb 26 '21 16:02 tavershimafx

Thank you. I will try it.

Vào 23:35, Th 6, 26 thg 2, 2021 Tavershima [email protected] đã viết:

x.OldPrice could be null so I think you should do

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/simplcommerce/SimplCommerce/issues/972#issuecomment-786755119, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRDE56MAQ5VGCEUSK2PRZ3TA7EU3ANCNFSM4WOAU2QQ .

nqtuyen avatar Feb 27 '21 12:02 nqtuyen