Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

products order in the front-end is not showing in descending order ( the latest to the oldest) of the createdAt date only in production. #16217

Open
Manasmd opened this issue May 6, 2024 · 1 comment
Labels
Potential Bug Potential bugs or bugfixes, that needs to be reproduced. Shop ShopBundle related issues and PRs.

Comments

@Manasmd
Copy link

Manasmd commented May 6, 2024

I am trying to sort orders by createdAt date and it is very weird that this configuration is not only working for the production environment but it seems to work for local and preprod. I am also using this filter plugin for the front-end and I am not sure if this is clashing with the configuration comin from the YAML file. Regardless, I think if local and preprod is working fine with the AsdoriaSyliusFacetFilterPlugin, it should work fine in production too.
https://github.com/asdoria/AsdoriaSyliusFacetFilterPlugin

Here's what I have tried in production so far.

  1. Added this configuration in sylius_shop_product.yaml config > packages > sylius_shop_product.yaml:
sylius_grid:
    grids:
        sylius_shop_product:
            filters:
                facets_filters:
                    type: facets_filters
                    label: true
                    options:
                        owner: taxon
            sorting: //this was recently added so as to set the default order to be in desc of the createdAt date
                createdAt: desc      

After adding the "sorting: createdAt: desc" the default order on the E-shop catalogue page seems to be working only for local and preprod environments but not for production.

  1. I also ran the following commands to make sure the cache is properly cleared:
php bin/console cache:clear

 php bin/console doctrine:cache:clear-metadata 
 php bin/console doctrine:cache:clear-query  
 php bin/console doctrine:cache:clear-result
 

overall, What I am trying to achieve is to display the production in descending order of the createdAt date.

@GSadee
Copy link
Member

GSadee commented May 17, 2024

Hi @Manasmd!

I don't know if I've understood correctly, so I'd like to be sure. Does it work incorrectly for you also in the base Sylius, or only with the plugin installed?

If this problem does not occur in the base Sylius, I would refer you to the plugin creators.

We are not able to reproduce it, checking on our demo, which is on the production environment.

@GSadee GSadee added Potential Bug Potential bugs or bugfixes, that needs to be reproduced. Shop ShopBundle related issues and PRs. labels May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Potential Bug Potential bugs or bugfixes, that needs to be reproduced. Shop ShopBundle related issues and PRs.
Projects
None yet
Development

No branches or pull requests

2 participants