Recent Topics

Product filter by date "Newest First" does not work



  • There's an issue with specific category filter
    "Newest First" does not work

    Here are steps to follow:

    • Shop by category
    • Click Sort By
    • Choose Newest First
    • Choose Oldest First

    You can notice that products results are not filtered by date and follows default query

    I tried to enable debug this is the query for Oldest first :
    select distinct `product_flat`.* from `product_flat` inner join `product_flat` as `variants` on `product_flat`.`id` = COALESCE(variants.parent_id, variants.id) left join `product_categories` on `product_categories`.`product_id` = `product_flat`.`product_id` left join `product_attribute_values` on `product_attribute_values`.`product_id` = `variants`.`product_id` where `product_flat`.`channel` = 'default' and `product_flat`.`locale` = 'en' and `product_flat`.`url_key` is not null and `product_categories`.`category_id` = '7' and `product_flat`.`status` = 1 and `product_flat`.`visible_individually` = 1 group by `product_flat`.`id` limit 9 offset 0

    This is the query for Newest first :
    select distinct `product_flat`.* from `product_flat` inner join `product_flat` as `variants` on `product_flat`.`id` = COALESCE(variants.parent_id, variants.id) left join `product_categories` on `product_categories`.`product_id` = `product_flat`.`product_id` left join `product_attribute_values` on `product_attribute_values`.`product_id` = `variants`.`product_id` where `product_flat`.`channel` = 'default' and `product_flat`.`locale` = 'en' and `product_flat`.`url_key` is not null and `product_categories`.`category_id` = '7' and `product_flat`.`status` = 1 and `product_flat`.`visible_individually` = 1 group by `product_flat`.`id` limit 9 offset 0

    the query are the same, and does not add order by created_at



  • @kukocrunch
    may I know your bagisto version on which you are getting this issue?



  • @Vaishali-Agarwal hello! my bagisto version : v1.2.0



  • @Vaishali-Agarwal

    The version I use is 1.2.0
    f7678dbd-ff82-45a2-bfe4-26f3da3d36b3-image.png
    I tried also using bagisto demo page
    Sort By Newest First doesn't work.



  • @kukocrunch
    Thanks for the update!
    We will fix this and update you here soon with the commit id.

    Thanks


Log in to reply