1054 Unknown column 'o.order_created' in 'where clause' when generating report

  • Posts: 46
  • Thank you received: 1
  • Hikashop Business
7 months 1 week ago #361052

-- HikaShop version -- : 5.0.4
-- Joomla version -- : 4.4.2
-- PHP version -- : 8.0.30
-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : 1054 Unknown column 'o.order_created' in 'where clause'

Call stack
# Function Location
1 () JROOT/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:141
2 Joomla\Database\Mysqli\MysqliStatement->__construct() JROOT/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:1089
3 Joomla\Database\Mysqli\MysqliDriver->prepareStatement() JROOT/libraries/vendor/joomla/database/src/DatabaseDriver.php:1900
4 Joomla\Database\DatabaseDriver->setQuery() JROOT/administrator/components/com_hikashop/classes/widget.php:1232
5 hikashopWidgetClass->data() JROOT/administrator/components/com_hikashop/views/dashboard/view.html.php:52
6 dashboardViewDashboard->widget() JROOT/administrator/components/com_hikashop/views/dashboard/view.html.php:17
7 dashboardViewDashboard->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:936
8 hikashop_getLayout() JROOT/administrator/components/com_hikashop/views/report/view.html.php:419
9 reportViewReport->form() JROOT/administrator/components/com_hikashop/views/report/view.html.php:28
10 reportViewReport->display() JROOT/libraries/src/MVC/Controller/BaseController.php:660
11 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:2582
12 hikashopController->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:2300
13 hikashopController->edit() JROOT/libraries/src/MVC/Controller/BaseController.php:693
14 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_hikashop/helpers/helper.php:2560
15 hikashopController->execute() JROOT/administrator/components/com_hikashop/hikashop.php:73
16 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
17 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
18 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
19 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:143
20 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:186
21 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
22 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:61
23 require_once() JROOT/administrator/index.php:32

Hi,

I'm trying to generate a table based report that includes the 'total customers' option, see here for details: scribehow.com/shared/Generate_a_Customer...DKl9nPTMSeTaLdlj5yuA

When report is saved I get a page stating

An error has occurred.
1054 Unknown column 'o.order_created' in 'where clause'

Doing this with debug turned on gives me:

Call stack
# Function Location
1 () JROOT/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:141
2 Joomla\Database\Mysqli\MysqliStatement->__construct() JROOT/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:1089
3 Joomla\Database\Mysqli\MysqliDriver->prepareStatement() JROOT/libraries/vendor/joomla/database/src/DatabaseDriver.php:1900
4 Joomla\Database\DatabaseDriver->setQuery() JROOT/administrator/components/com_hikashop/classes/widget.php:1232
5 hikashopWidgetClass->data() JROOT/administrator/components/com_hikashop/views/dashboard/view.html.php:52
6 dashboardViewDashboard->widget() JROOT/administrator/components/com_hikashop/views/dashboard/view.html.php:17
7 dashboardViewDashboard->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:936
8 hikashop_getLayout() JROOT/administrator/components/com_hikashop/views/report/view.html.php:419
9 reportViewReport->form() JROOT/administrator/components/com_hikashop/views/report/view.html.php:28
10 reportViewReport->display() JROOT/libraries/src/MVC/Controller/BaseController.php:660
11 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:2582
12 hikashopController->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:2300
13 hikashopController->edit() JROOT/libraries/src/MVC/Controller/BaseController.php:693
14 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_hikashop/helpers/helper.php:2560
15 hikashopController->execute() JROOT/administrator/components/com_hikashop/hikashop.php:73
16 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
17 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
18 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
19 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:143
20 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:186
21 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
22 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:61
23 require_once() JROOT/administrator/index.php:32

Do you have any ideas how I can resolve this?

Thanks in advance.

KH

Please Log in or Create an account to join the conversation.

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
7 months 1 week ago #361061

Hi,

Change the line:

$query='SELECT COUNT(name) FROM '.hikashop_table('users',false).' as u LEFT JOIN '.hikashop_table('user').' as a ON u.id=a.user_cms_id '.$filters;
to:
$query='SELECT COUNT(name) FROM '.hikashop_table('users',false).' as u LEFT JOIN '.hikashop_table('user').' as a ON u.id=a.user_cms_id LEFT JOIN '.hikashop_table('order').' AS o ON a.user_id=o.order_user_id '.$filters;
in the file /administrator/components/com_hikashop/classes/widget.php and it should fix the problem.
We'll include the change for the next version of HikaShop.

The following user(s) said Thank You: vividfish

Please Log in or Create an account to join the conversation.

  • Posts: 46
  • Thank you received: 1
  • Hikashop Business
7 months 1 week ago #361063

Thanks Nicolas,

All working now.

KH

The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum