How to compress data in customer information page for PrestaShop v1.6+

blog_post_img_compress

The “problem” occurs when a customer makes repeated purchases and orders start to pile up in the customer information page. The list can grow very large and altough we would all like to be facing with this problem it can be fixed easily 🙂

This problem was identified by haylau, a user on PrestaShop forum, who reported to have a customer with 80+ orders and finds it hard to manage the customer page with all that information.

Before:

before

After:

after

PrestaShop’s back office is built with bootstrap framework so to contract the data we can use bootstrap collapse.js plugin. It can collapse panels by default and on click a nice transition will open/close them.

We will make it so the panels are collapsed by default and when we click on the panel heading (customer name, orders, carts etc) it will expand.

First we need to create an override of the template file used by PrestaShop to display the customer list page which is found here: /root/admin/themes/default/template/controllers/customers/helpers/view/view.tpl.

Creating an override instead of editing the file itself is useful because when we update PrestaShop the core files might be overwritten if new changes are detected and we will lose our customizations. If you want to learn more about overrides read the docs. If we want we can delete the override files and PrestaShop will revert back to default so it’s totally safe.

To create the override copy the file mentioned above to: /root/override/controllers/admin/templates/customers/helpers/view/view.tpl.

I have prepared the file for you to download (works for PrestaShop v1.6+): view.tpl

The lines I’ve changed to the original file are:

  • 34, 50 – customer name
  • 182, 186 – orders
  • 273, 277 – carts
  • 311, 314 – purchased products
  • 342, 345 – viewed products
  • 369, 372 – private note
  • 394, 398 – messages
  • 425, 429 – vouchers
  • 474, 477 – last emails
  • 504, 507 – last connections
  • 535, 544 – groups
  • 578, 581 – referrers
  • 611, 615 – addresses

If you have any questions or suggestions for improving this functionality please leave a comment and I’ll get back to you.

  • Brilliant. Very useful.

  • The real problem is connected carts. Once that grows to an obtainable number, it is almost impossible to pull up the customer record or create an order for them. There needs to be a cart object flush for each associated client id.

Subscribe!