Jump to content

Filter by carrier in prestashop orders view


udubniewski

Recommended Posts

Im using prestashop 1.6.1.4.

I want to add a column of "Carrier" at the orders view and a selection box in the top to filter by the selected carrier.

The closest answer i found whas this one: Edit Prestashop current orders view

It works fine to show a carrier column but:

1) It shows a text box in the top to filter (its not bad but will be better a selection box).

2) If you write something in that box and you press search, it throws the following error:

 

Bad SQL query Unknown column 'carrier' in 'where clause'

 

I asume that the code adds a WHERE 'carrier' like %***% which is wrong becouse "carrier " is an alias from a joint.

The problem is that i dont know how to modify the code to solve it, i dived into prestashop documentation but culdnt find the solution.

Link to comment
Share on other sites

I think you can add your code in a module instead of adding to core controllers.

Try to implement your logic in this free  module :https://www.prestashop.com/forums/topic/502335-free-module-prestashop-product-orders-list/

 

Thank you!

Honestly im not expert in prestashop so i was looking for something simplier. Maybe a little twist of the solution provided in the link i posted to make the filter work fine.

If not so simple, could you provide the service of doing this? Do you want to tell me the cost by PM ??

Edited by udubniewski (see edit history)
Link to comment
Share on other sites

  • 2 years later...
On 21/04/2016 at 3:36 PM, udubniewski said:

Im using prestashop 1.6.1.4.

I want to add a column of "Carrier" at the orders view and a selection box in the top to filter by the selected carrier.

The closest answer i found whas this one: Edit Prestashop current orders view

It works fine to show a carrier column but:

1) It shows a text box in the top to filter (its not bad but will be better a selection box).

2) If you write something in that box and you press search, it throws the following error:

 

 

Bad SQL query Unknown column 'carrier' in 'where clause'

 

 

I asume that the code adds a WHERE 'carrier' like %***% which is wrong becouse "carrier " is an alias from a joint.

The problem is that i dont know how to modify the code to solve it, i dived into prestashop documentation but culdnt find the solution.

 

 

it  throws this  exception because carrier is an alias .  and  you can't perform a where clause to an alias  you need to add this to the filter 

'havingFilter' => true,
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...