I've just updated to Store 2.0.4 and have come across the following error on a page using the orders tag with "order_status" parameter:

Error Number: 1054

Unknown column 'order_status' in 'where clause'

select * from `exp_store_orders` where `site_id` = '1' and `order_completed_date` > 0 and `order_status` = 'new' and `member_id` = '1' order by `id` asc limit 100 offset 0

Filename: third_party/store/src/Store/Illuminate/CodeIgniterConnection.php

Line Number: 100

My orders tag looks like this:

{exp:store:orders member_id="CURRENT_USER" order_status="new" secure="yes"}

Has the parameter name changed in 2.0.4, or is this a bug? The documentation still shows the parameter as "order_status".


Many thanks for any help.

  • Welcome kitsimons. For the record, Stack Exchange uses markdown so you indent code with 4 spaces (or click the {} button in the toolbar :) Nov 1 '13 at 11:17
  • Lovely, thank you Adrian, that's sorted it. And thanks for the heads up :-)
    – kitsimons
    Nov 1 '13 at 11:30

This looks like a bug in Store and will be fixed in the next version.

In the meantime, if you need a fix you can open third_party/store/src/Store/Module.php and around line 773 look for this:

$this->queryAndOrParam($query, 'order_status', ee()->TMPL->fetch_param('order_status'));

Change it to this:

$this->queryAndOrParam($query, 'order_status_name', ee()->TMPL->fetch_param('order_status'));

That should do it!

  • 1
    Not exactly the same usage, but related: in Store 2.1.0 the orders report suffers from the same error when filtered by status. Temporary fix, edit third_party/store/src/Store/Service/ReportsService.php line 368: $query->where('order_status', $status); to $query->where('order_status_name', $status); line 411: ee()->db->where('order_status', $status); to ee()->db->where('order_status_name', $status);
    – user2596
    Jan 12 '14 at 22:41
  • Hi Toby. This bug is identified and already fixed and will be rolled out very shortly in the 2.2 release. Also, just for the record, in the spirit of StackExchange any problems should be posted as a new question. Answers are reserved only for answering the original question.
    – Ian
    Jan 12 '14 at 23:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.