Unknown column 'categpos' in 'order clause'<br /><br /><pre>SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`,
pl.`meta_keywords`, pl.`meta_title`, pl.`name`, pl.`available_now`, pl.`available_later`, image_shop.`id_image` id_image, il.`legend`, m.`name` AS manufacturer_name,
(DATEDIFF(product_shop.`date_add`,
DATE_SUB(
"2024-03-19 00:00:00",
INTERVAL 20 DAY
)
) > 0) as new,
product_attribute_shop.minimal_quantity AS product_attribute_minimal_quantity, IFNULL(product_attribute_shop.id_product_attribute,0) id_product_attribute
FROM `ps_product` p
INNER JOIN ps_product_shop product_shop
ON (product_shop.id_product = p.id_product AND product_shop.id_shop = 5)
LEFT JOIN `ps_product_lang` `pl` ON
p.`id_product` = pl.`id_product`
AND pl.`id_lang` = 1 AND pl.id_shop = 5
LEFT JOIN `ps_image_shop` `image_shop` ON image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop=5
LEFT JOIN `ps_image_lang` `il` ON image_shop.`id_image` = il.`id_image` AND il.`id_lang` = 1
LEFT JOIN `ps_manufacturer` `m` ON m.`id_manufacturer` = p.`id_manufacturer`
LEFT JOIN `ps_product_attribute_shop` `product_attribute_shop` ON p.`id_product` = product_attribute_shop.`id_product` AND product_attribute_shop.`default_on` = 1 AND product_attribute_shop.id_shop=5
LEFT JOIN ps_stock_available stock
ON (stock.id_product = `p`.id_product AND stock.id_product_attribute = 0 AND stock.id_shop = 5 AND stock.id_shop_group = 0 )
WHERE (product_shop.`active` = 1) AND (product_shop.`visibility` IN ("both", "catalog")) AND (product_shop.`date_add` > "2024-02-28") AND (EXISTS(SELECT 1 FROM `ps_category_product` cp
JOIN `ps_category_group` cg ON (cp.id_category = cg.id_category AND cg.`id_group` =1)
WHERE cp.`id_product` = p.`id_product`))
ORDER BY `categpos` asc
LIMIT 1000</pre>
at line 769 in file classes/db/Db.php
764. if ($webservice_call && $errno) {
765. $dbg = debug_backtrace();
766. WebserviceRequest::getInstance()->setError(500, '[SQL Error] ' . $this->getMsgError() . '. From ' . (isset($dbg[3]['class']) ? $dbg[3]['class'] : '') . '->' . $dbg[3]['function'] . '() Query was : ' . $sql, 97);
767. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
768. if ($sql) {
769. throw new PrestaShopDatabaseException($this->getMsgError() . '<br /><br /><pre>' . $sql . '</pre>');
770. }
771.
772. throw new PrestaShopDatabaseException($this->getMsgError());
773. }
774. }
380. $this->result = $this->_query($sql);
381. }
382. }
383.
384. if (_PS_DEBUG_SQL_) {
385. $this->displayError($sql);
386. }
387.
388. return $this->result;
389. }
390.
Argument [0] SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, pl.`available_now`, pl.`available_later`, image_shop.`id_image` id_image, il.`legend`, m.`name` AS manufacturer_name, (DATEDIFF(product_shop.`date_add`, DATE_SUB( "2024-03-19 00:00:00", INTERVAL 20 DAY ) ) > 0) as new, product_attribute_shop.minimal_quantity AS product_attribute_minimal_quantity, IFNULL(product_attribute_shop.id_product_attribute,0) id_product_attribute FROM `ps_product` p INNER JOIN ps_product_shop product_shop ON (product_shop.id_product = p.id_product AND product_shop.id_shop = 5) LEFT JOIN `ps_product_lang` `pl` ON p.`id_product` = pl.`id_product` AND pl.`id_lang` = 1 AND pl.id_shop = 5 LEFT JOIN `ps_image_shop` `image_shop` ON image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop=5 LEFT JOIN `ps_image_lang` `il` ON image_shop.`id_image` = il.`id_image` AND il.`id_lang` = 1 LEFT JOIN `ps_manufacturer` `m` ON m.`id_manufacturer` = p.`id_manufacturer` LEFT JOIN `ps_product_attribute_shop` `product_attribute_shop` ON p.`id_product` = product_attribute_shop.`id_product` AND product_attribute_shop.`default_on` = 1 AND product_attribute_shop.id_shop=5 LEFT JOIN ps_stock_available stock ON (stock.id_product = `p`.id_product AND stock.id_product_attribute = 0 AND stock.id_shop = 5 AND stock.id_shop_group = 0 ) WHERE (product_shop.`active` = 1) AND (product_shop.`visibility` IN ("both", "catalog")) AND (product_shop.`date_add` > "2024-02-28") AND (EXISTS(SELECT 1 FROM `ps_category_product` cp JOIN `ps_category_group` cg ON (cp.id_category = cg.id_category AND cg.`id_group` =1) WHERE cp.`id_product` = p.`id_product`)) ORDER BY `categpos` asc LIMIT 1000
608. }
609.
610. return $this->execute($sql, $use_cache);
611. }
612.
613. $this->result = $this->query($sql);
614.
615. if (!$this->result) {
616. $result = false;
617. } else {
618. if (!$array) {
Argument [0] SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, pl.`available_now`, pl.`available_later`, image_shop.`id_image` id_image, il.`legend`, m.`name` AS manufacturer_name, (DATEDIFF(product_shop.`date_add`, DATE_SUB( "2024-03-19 00:00:00", INTERVAL 20 DAY ) ) > 0) as new, product_attribute_shop.minimal_quantity AS product_attribute_minimal_quantity, IFNULL(product_attribute_shop.id_product_attribute,0) id_product_attribute FROM `ps_product` p INNER JOIN ps_product_shop product_shop ON (product_shop.id_product = p.id_product AND product_shop.id_shop = 5) LEFT JOIN `ps_product_lang` `pl` ON p.`id_product` = pl.`id_product` AND pl.`id_lang` = 1 AND pl.id_shop = 5 LEFT JOIN `ps_image_shop` `image_shop` ON image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop=5 LEFT JOIN `ps_image_lang` `il` ON image_shop.`id_image` = il.`id_image` AND il.`id_lang` = 1 LEFT JOIN `ps_manufacturer` `m` ON m.`id_manufacturer` = p.`id_manufacturer` LEFT JOIN `ps_product_attribute_shop` `product_attribute_shop` ON p.`id_product` = product_attribute_shop.`id_product` AND product_attribute_shop.`default_on` = 1 AND product_attribute_shop.id_shop=5 LEFT JOIN ps_stock_available stock ON (stock.id_product = `p`.id_product AND stock.id_product_attribute = 0 AND stock.id_shop = 5 AND stock.id_shop_group = 0 ) WHERE (product_shop.`active` = 1) AND (product_shop.`visibility` IN ("both", "catalog")) AND (product_shop.`date_add` > "2024-02-28") AND (EXISTS(SELECT 1 FROM `ps_category_product` cp JOIN `ps_category_group` cg ON (cp.id_category = cg.id_category AND cg.`id_group` =1) WHERE cp.`id_product` = p.`id_product`)) ORDER BY `categpos` asc LIMIT 1000
3074. $sql->select('product_attribute_shop.minimal_quantity AS product_attribute_minimal_quantity, IFNULL(product_attribute_shop.id_product_attribute,0) id_product_attribute');
3075. $sql->leftJoin('product_attribute_shop', 'product_attribute_shop', 'p.`id_product` = product_attribute_shop.`id_product` AND product_attribute_shop.`default_on` = 1 AND product_attribute_shop.id_shop=' . (int) $context->shop->id);
3076. }
3077. $sql->join(Product::sqlStock('p', 0));
3078.
3079. $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
3080.
3081. if (!$result) {
3082. return false;
3083. }
3084.
Argument [0] SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, pl.`available_now`, pl.`available_later`, image_shop.`id_image` id_image, il.`legend`, m.`name` AS manufacturer_name, (DATEDIFF(product_shop.`date_add`, DATE_SUB( "2024-03-19 00:00:00", INTERVAL 20 DAY ) ) > 0) as new, product_attribute_shop.minimal_quantity AS product_attribute_minimal_quantity, IFNULL(product_attribute_shop.id_product_attribute,0) id_product_attribute FROM `ps_product` p INNER JOIN ps_product_shop product_shop ON (product_shop.id_product = p.id_product AND product_shop.id_shop = 5) LEFT JOIN `ps_product_lang` `pl` ON p.`id_product` = pl.`id_product` AND pl.`id_lang` = 1 AND pl.id_shop = 5 LEFT JOIN `ps_image_shop` `image_shop` ON image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop=5 LEFT JOIN `ps_image_lang` `il` ON image_shop.`id_image` = il.`id_image` AND il.`id_lang` = 1 LEFT JOIN `ps_manufacturer` `m` ON m.`id_manufacturer` = p.`id_manufacturer` LEFT JOIN `ps_product_attribute_shop` `product_attribute_shop` ON p.`id_product` = product_attribute_shop.`id_product` AND product_attribute_shop.`default_on` = 1 AND product_attribute_shop.id_shop=5 LEFT JOIN ps_stock_available stock ON (stock.id_product = `p`.id_product AND stock.id_product_attribute = 0 AND stock.id_shop = 5 AND stock.id_shop_group = 0 ) WHERE (product_shop.`active` = 1) AND (product_shop.`visibility` IN ("both", "catalog")) AND (product_shop.`date_add` > "2024-02-28") AND (EXISTS(SELECT 1 FROM `ps_category_product` cp JOIN `ps_category_group` cg ON (cp.id_category = cg.id_category AND cg.`id_group` =1) WHERE cp.`id_product` = p.`id_product`)) ORDER BY `categpos` asc LIMIT 1000
73. $context->getIdLang(),
74. $query->getPage(),
75. $query->getResultsPerPage(),
76. $type !== 'products',
77. $query->getSortOrder()->toLegacyOrderBy(),
78. $query->getSortOrder()->toLegacyOrderWay()
79. );
80. }
81.
82. /**
83. * {@inheritdoc}
Argument [0] 1 Argument [1] 1 Argument [2] 1000 Argument [3] Argument [4] categpos Argument [5] asc
84. */
85. public function runQuery(
86. ProductSearchContext $context,
87. ProductSearchQuery $query
88. ) {
89. if (!$products = $this->getProductsOrCount($context, $query, 'products')) {
90. $products = [];
91. }
92. $count = $this->getProductsOrCount($context, $query, 'count');
93.
94. $result = new ProductSearchResult();
Argument [0] PrestaShop\PrestaShop\Core\Product\Search\ProductSearchContext Object ( [idShop:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchContext:private] => 5 [idLang:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchContext:private] => 1 [idCurrency:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchContext:private] => 1 [idCustomer:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchContext:private] => ) Argument [1] PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery Object ( [queryType:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => new-products [idCategory:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => [idManufacturer:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => [idSupplier:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => [searchString:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => [searchTag:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => [encodedFacets:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => [resultsPerPage:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => 1000 [page:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => 1 [sortOrder:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => PrestaShop\PrestaShop\Core\Product\Search\SortOrder Object ( [entity:PrestaShop\PrestaShop\Core\Product\Search\SortOrder:private] => product [field:PrestaShop\PrestaShop\Core\Product\Search\SortOrder:private] => categpos [direction:PrestaShop\PrestaShop\Core\Product\Search\SortOrder:private] => asc [label:PrestaShop\PrestaShop\Core\Product\Search\SortOrder:private] => ) ) Argument [2] products
129. // We're ready to run the actual query!
130.
131. /** @var ProductSearchResult $result */
132. $result = $provider->runQuery(
133. $context,
134. $query
135. );
136.
137. if (Configuration::get('PS_CATALOG_MODE') && !Configuration::get('PS_CATALOG_MODE_WITH_PRICES')) {
138. $this->disablePriceControls($result);
139. }
Argument [0] PrestaShop\PrestaShop\Core\Product\Search\ProductSearchContext Object ( [idShop:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchContext:private] => 5 [idLang:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchContext:private] => 1 [idCurrency:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchContext:private] => 1 [idCustomer:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchContext:private] => ) Argument [1] PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery Object ( [queryType:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => new-products [idCategory:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => [idManufacturer:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => [idSupplier:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => [searchString:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => [searchTag:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => [encodedFacets:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => [resultsPerPage:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => 1000 [page:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => 1 [sortOrder:PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery:private] => PrestaShop\PrestaShop\Core\Product\Search\SortOrder Object ( [entity:PrestaShop\PrestaShop\Core\Product\Search\SortOrder:private] => product [field:PrestaShop\PrestaShop\Core\Product\Search\SortOrder:private] => categpos [direction:PrestaShop\PrestaShop\Core\Product\Search\SortOrder:private] => asc [label:PrestaShop\PrestaShop\Core\Product\Search\SortOrder:private] => ) )
584. header('Content-Type: application/json');
585. $this->ajaxRender(json_encode($this->getAjaxProductSearchVariables()));
586.
587. return;
588. } else {
589. $variables = $this->getProductSearchVariables();
590. $this->context->smarty->assign([
591. 'listing' => $variables,
592. ]);
593. $this->setTemplate($template, $params, $locale);
594. }
16. * version: 7.0.2
17. */
18. protected function doProductSearch($template, $params = array(), $locale = null)
19. {
20. if (!Tools::getIsset('page_cache_dynamics_mods')) {
21. return parent::doProductSearch($template, $params, $locale);
22. }
23. }
24.
25. /**
26. * This method is the heart of the search provider delegation
Argument [0] catalog/listing/new-products Argument [1] Array ( [entity] => new-products ) Argument [2]
36. */
37. public function initContent()
38. {
39. parent::initContent();
40.
41. $this->doProductSearch('catalog/listing/new-products', ['entity' => 'new-products']);
42. }
43.
44. protected function getProductSearchQuery()
45. {
46. $query = new ProductSearchQuery();
Argument [0] catalog/listing/new-products Argument [1] Array ( [entity] => new-products )
301. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
302. $this->initHeader();
303. }
304.
305. if ($this->viewAccess()) {
306. $this->initContent();
307. } else {
308. $this->errors[] = $this->trans('Access denied.', [], 'Admin.Notifications.Error');
309. }
310.
311. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) {
513. if (isset($params_hook_action_dispatcher)) {
514. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
515. }
516.
517. // Running controller
518. $controller->run();
519.
520. // Execute hook dispatcher after
521. if (isset($params_hook_action_dispatcher)) {
522. Hook::exec('actionDispatcherAfter', $params_hook_action_dispatcher);
523. }
23. * @copyright Since 2007 PrestaShop SA and Contributors
24. * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
25. */
26.
27. require dirname(__FILE__).'/config/config.inc.php';
28. Dispatcher::getInstance()->dispatch();