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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate customer view cart and order tables to grid #31442

Merged
merged 17 commits into from Mar 9, 2023

Conversation

Hlavtox
Copy link
Contributor

@Hlavtox Hlavtox commented Feb 18, 2023

Questions Answers
Branch? develop
Description? see below
Type? refacto
Category? BO
BC breaks? yes
Deprecations? no
How to test? Check the page and see that it works the same, but limits the amount of shown orders and carts to 10. The main difference will be visible when viewing a customer with many orders and carts (50+).
Fixed ticket? Fixes #25683, Fixes #15444
Related PRs
Sponsor company AGRO-LA

Details

  • Right now, the cart and order listing on customer detail is a simple manually rendered table. When customer has more oders, let's say more than 20, it's incredibly slow because of all the carts loading and computing their data.
  • You can see how it looks with 70 orders - https://user-images.githubusercontent.com/6097524/219952122-995c4f22-26dd-4e5b-acd0-de4124d8e59f.png, and I cropped about a kilometer of bought products. 馃槃
  • So, I changed the implementation of these two tables to grids.
  • This fixes the insanely slow page load time, makes the page readable and allows the use of standard hooks. I followed address grid as an example.
  • For orders, there were originally two grids for valid and invalid orders. I unified orders to a single grid and marked the valid/invalid thing with a green/red badge. I think it simplifies things and looks quite good. PM validated.
  • When this is approved, I can continue with the list of bought products, which can be also pretty long.

Screenshot

localhost_dev_admin-dev_index php_sell_customers_2_view__token=Kzw8BCzesvbRA4l1fN_MoC74wv0Dq5WUYVCa433F5FA customer_order%5BorderBy%5D=id_order customer_order%5BsortOrder%5D=asc

@prestonBot prestonBot added Bug fix Type: Bug fix BC break Type: Introduces a backwards-incompatible break labels Feb 18, 2023
@prestonBot prestonBot added develop Branch Refactoring Type: Refactoring labels Feb 18, 2023
@Hlavtox Hlavtox changed the title WIP - convert customer view cart and order tables to grid Migrate customer view cart and order tables to grid Feb 19, 2023
@Hlavtox Hlavtox marked this pull request as ready for review February 19, 2023 13:45
@Hlavtox Hlavtox requested a review from a team as a code owner February 19, 2023 13:45
@MatShir
Copy link
Contributor

MatShir commented Feb 20, 2023

LGTM 馃憤

@MatShir MatShir added the PM 鉁旓笍 Status: check done, behavior approved label Feb 20, 2023
@MatShir MatShir added this to the 9.0.0 milestone Feb 20, 2023
Copy link
Contributor

@zuk3975 zuk3975 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool

@Hlavtox Hlavtox closed this Mar 3, 2023
@Hlavtox Hlavtox reopened this Mar 3, 2023
@matks matks added the Waiting for QA Status: action required, waiting for test feedback label Mar 4, 2023
@sallemiines sallemiines self-assigned this Mar 8, 2023
@MhiriFaten MhiriFaten assigned MhiriFaten and unassigned sallemiines Mar 9, 2023
Copy link

@MhiriFaten MhiriFaten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 鉁旓笍

@MhiriFaten MhiriFaten added QA 鉁旓笍 Status: check done, code approved and removed Waiting for QA Status: action required, waiting for test feedback labels Mar 9, 2023
@Hlavtox
Copy link
Contributor Author

Hlavtox commented Mar 9, 2023

AAAAAAYY Thank you @MhiriFaten!

@Hlavtox Hlavtox merged commit b809003 into PrestaShop:develop Mar 9, 2023
38 checks passed
@Hlavtox Hlavtox deleted the customer-view-grids branch January 24, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC break Type: Introduces a backwards-incompatible break Bug fix Type: Bug fix develop Branch PM 鉁旓笍 Status: check done, behavior approved QA 鉁旓笍 Status: check done, code approved Refactoring Type: Refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customers Query slow with many orders Reduce client view in Customer Page 1/2
7 participants