Sql Ошибка При Поиске Продуктов

Добрый день,

почему-то при попытке воспользоваться поиском появляется следующая ошибка:

SERVICE

UNAVAILABLE

Sorry, service is temporarily unavailable.


Сайт – duhpoleta.ru

В чем может быть дело?

В таблице cscart_product_descriptions по какой-то причине отстутствует колонка search_words. Добавьте ее вручную в phpMyAdmin

<!--

Tygh\Exceptions\AException

Message
Unknown column ‘descr1.search_words’ in ‘where clause’ (1054)SELECT MIN(IF(shared_prices.product_id IS NOT NULL, shared_prices.price, cscart_product_prices.price)) as min, MAX(IF(shared_prices.product_id IS NOT NULL, shared_prices.price, cscart_product_prices.price)) as max FROM cscart_product_prices LEFT JOIN cscart_products as products ON products.product_id = cscart_product_prices.product_id LEFT JOIN cscart_product_prices as prices_2 ON cscart_product_prices.product_id = prices_2.product_id AND cscart_product_prices.price > prices_2.price AND prices_2.lower_limit = 1 AND prices_2.usergroup_id IN (0, 0, 1) LEFT JOIN cscart_ult_product_prices AS shared_prices ON shared_prices.product_id = products.product_id AND shared_prices.lower_limit = 1 AND shared_prices.usergroup_id IN (0, 0, 1) AND shared_prices.company_id = 1 INNER JOIN cscart_products_categories as products_categories ON products_categories.product_id = products.product_id INNER JOIN cscart_categories ON cscart_categories.category_id = products_categories.category_id AND (cscart_categories.usergroup_ids = ‘’ OR FIND_IN_SET(0, cscart_categories.usergroup_ids) OR FIND_IN_SET(1, cscart_categories.usergroup_ids)) AND cscart_categories.status IN (‘A’, ‘H’) WHERE products.status IN (‘A’) AND (((descr1.search_words LIKE ‘%test%’) OR (descr1.meta_keywords LIKE ‘%test%’ OR descr1.meta_description LIKE ‘%test%’))) AND cscart_categories.company_id = 1 AND (products.usergroup_ids = ‘’ OR FIND_IN_SET(0, products.usergroup_ids) OR FIND_IN_SET(1, products.usergroup_ids)) AND products.status IN (‘A’) AND cscart_product_prices.lower_limit = 1 AND cscart_product_prices.usergroup_id IN (0, 0, 1) AND prices_2.price IS NULL

Error at
app/Tygh/Database.php, line: 714

Backtrace
File:app/Tygh/Database.php
Line:359
Function:error

File:app/Tygh/Database.php
Line:188
Function:query

File:app/functions/fn.database.php
Line:54
Function:getRow

File:app/functions/fn.catalog.php
Line:10095
Function:db_get_row

File:app/functions/fn.catalog.php
Line:9562
Function:fn_get_current_filters

File:app/Tygh/BlockManager/Block.php
Line:796
Function:fn_get_filters_products_count

File:app/Tygh/BlockManager/RenderManager.php
Line:655
Function:getItems

File:app/Tygh/BlockManager/RenderManager.php
Line:537
Function:getValue

File:app/Tygh/BlockManager/RenderManager.php
Line:400
Function:renderBlockContent

File:app/Tygh/BlockManager/RenderManager.php
Line:335
Function:renderBlock

File:app/Tygh/BlockManager/RenderManager.php
Line:293
Function:renderBlocks

File:app/Tygh/BlockManager/RenderManager.php
Line:230
Function:_renderGrid

File:app/Tygh/BlockManager/RenderManager.php
Line:181
Function:_renderGrids

File:app/Tygh/BlockManager/RenderManager.php
Line:146
Function:_renderContainer

File:app/functions/smarty_plugins/function.render_location.php
Line:48
Function:render

File:var/cache/templates/responsive/46dca0eea788a6d7a69d9d3864242917c30be389.tygh.index.tpl.php
Line:126
Function:smarty_function_render_location

File:app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php
Line:188
Function:content_56b0a3a4b1d288_69348222

File:app/Tygh/SmartyEngine/Core.php
Line:70
Function:fetch

File:app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php
Line:394
Function:fetch

File:app/Tygh/SmartyEngine/Core.php
Line:54
Function:display

File:app/functions/fn.control.php
Line:611
Function:display

File:index.php
Line:25
Function:fn_dispatch

–>

В таблице cscart_product_descriptions по какой-то причине отстутствует колонка search_words. Добавьте ее вручную в phpMyAdmin

<!--

Tygh\Exceptions\AException

Message
Unknown column ‘descr1.search_words’ in ‘where clause’ (1054)SELECT MIN(IF(shared_prices.product_id IS NOT NULL, shared_prices.price, cscart_product_prices.price)) as min, MAX(IF(shared_prices.product_id IS NOT NULL, shared_prices.price, cscart_product_prices.price)) as max FROM cscart_product_prices LEFT JOIN cscart_products as products ON products.product_id = cscart_product_prices.product_id LEFT JOIN cscart_product_prices as prices_2 ON cscart_product_prices.product_id = prices_2.product_id AND cscart_product_prices.price > prices_2.price AND prices_2.lower_limit = 1 AND prices_2.usergroup_id IN (0, 0, 1) LEFT JOIN cscart_ult_product_prices AS shared_prices ON shared_prices.product_id = products.product_id AND shared_prices.lower_limit = 1 AND shared_prices.usergroup_id IN (0, 0, 1) AND shared_prices.company_id = 1 INNER JOIN cscart_products_categories as products_categories ON products_categories.product_id = products.product_id INNER JOIN cscart_categories ON cscart_categories.category_id = products_categories.category_id AND (cscart_categories.usergroup_ids = ‘’ OR FIND_IN_SET(0, cscart_categories.usergroup_ids) OR FIND_IN_SET(1, cscart_categories.usergroup_ids)) AND cscart_categories.status IN (‘A’, ‘H’) WHERE products.status IN (‘A’) AND (((descr1.search_words LIKE ‘%test%’) OR (descr1.meta_keywords LIKE ‘%test%’ OR descr1.meta_description LIKE ‘%test%’))) AND cscart_categories.company_id = 1 AND (products.usergroup_ids = ‘’ OR FIND_IN_SET(0, products.usergroup_ids) OR FIND_IN_SET(1, products.usergroup_ids)) AND products.status IN (‘A’) AND cscart_product_prices.lower_limit = 1 AND cscart_product_prices.usergroup_id IN (0, 0, 1) AND prices_2.price IS NULL

Error at
app/Tygh/Database.php, line: 714

Backtrace
File:app/Tygh/Database.php
Line:359
Function:error

File:app/Tygh/Database.php
Line:188
Function:query

File:app/functions/fn.database.php
Line:54
Function:getRow

File:app/functions/fn.catalog.php
Line:10095
Function:db_get_row

File:app/functions/fn.catalog.php
Line:9562
Function:fn_get_current_filters

File:app/Tygh/BlockManager/Block.php
Line:796
Function:fn_get_filters_products_count

File:app/Tygh/BlockManager/RenderManager.php
Line:655
Function:getItems

File:app/Tygh/BlockManager/RenderManager.php
Line:537
Function:getValue

File:app/Tygh/BlockManager/RenderManager.php
Line:400
Function:renderBlockContent

File:app/Tygh/BlockManager/RenderManager.php
Line:335
Function:renderBlock

File:app/Tygh/BlockManager/RenderManager.php
Line:293
Function:renderBlocks

File:app/Tygh/BlockManager/RenderManager.php
Line:230
Function:_renderGrid

File:app/Tygh/BlockManager/RenderManager.php
Line:181
Function:_renderGrids

File:app/Tygh/BlockManager/RenderManager.php
Line:146
Function:_renderContainer

File:app/functions/smarty_plugins/function.render_location.php
Line:48
Function:render

File:var/cache/templates/responsive/46dca0eea788a6d7a69d9d3864242917c30be389.tygh.index.tpl.php
Line:126
Function:smarty_function_render_location

File:app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php
Line:188
Function:content_56b0a3a4b1d288_69348222

File:app/Tygh/SmartyEngine/Core.php
Line:70
Function:fetch

File:app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php
Line:394
Function:fetch

File:app/Tygh/SmartyEngine/Core.php
Line:54
Function:display

File:app/functions/fn.control.php
Line:611
Function:display

File:index.php
Line:25
Function:fn_dispatch

–>


Что-то не пойму, куда конкретно это вставлять, вот, что вижу в phpMyAdmin:

https://yadi.sk/i/3URoISCQoBqFg


Что-то не пойму, куда конкретно это вставлять, вот, что вижу в phpMyAdmin:

https://yadi.sk/i/3URoISCQoBqFg

Да, вы правы. Почему-то таблица cscart_product_descriptions не подключается в запрос

В файле app/controllers/frontend/products.php есть такие строки?

$params = $_REQUEST;
$params['extend'] = array('description');

Да, вы правы. Почему-то таблица cscart_product_descriptions не подключается в запрос

В файле app/controllers/frontend/products.php есть такие строки?

$params = $_REQUEST;
$params['extend'] = array('description');


Нет, такого не найдено.

Для $mode == 'search' должен быть такой код

if ($mode == 'search') {
$params = $_REQUEST;
fn_add_breadcrumb(__('search_results'));

if (!empty($params['search_performed']) || !empty($params['features_hash'])) {

    $params = $_REQUEST;
    $params['extend'] = array('description');

    list($products, $search) = fn_get_products($params, Registry::get('settings.Appearance.products_per_page'));

    fn_gather_additional_products_data($products, array(
        'get_icon' => true,
        'get_detailed' => true,
        'get_additional' => true,
        'get_options'=> true
    ));

    if (!empty($products)) {
        $_SESSION['continue_url'] = Registry::get('config.current_url');
    }

    $selected_layout = fn_get_products_layout($params);

    Tygh::$app['view']->assign('products', $products);
    Tygh::$app['view']->assign('search', $search);
    Tygh::$app['view']->assign('selected_layout', $selected_layout);
}

Для $mode == 'search' должен быть такой код

if ($mode == 'search') {
$params = $_REQUEST;
fn_add_breadcrumb(__('search_results'));

if (!empty($params['search_performed']) || !empty($params['features_hash'])) {

    $params = $_REQUEST;
    $params['extend'] = array('description');

    list($products, $search) = fn_get_products($params, Registry::get('settings.Appearance.products_per_page'));

    fn_gather_additional_products_data($products, array(
        'get_icon' => true,
        'get_detailed' => true,
        'get_additional' => true,
        'get_options'=> true
    ));

    if (!empty($products)) {
        $_SESSION['continue_url'] = Registry::get('config.current_url');
    }

    $selected_layout = fn_get_products_layout($params);

    Tygh::$app['view']->assign('products', $products);
    Tygh::$app['view']->assign('search', $search);
    Tygh::$app['view']->assign('selected_layout', $selected_layout);
}

Сделал так, почистил кеш и все равно поиск не работает

Киньте в личку временный FTP доступ

Киньте в личку временный FTP доступ

Отправил

Готово. У вас отключен поиск по имени продукта. А таблица подключается только, если есть поиск по имени. Странное поведение, конечно. Пришлось немного подправить fn.catalog.php

Готово. У вас отключен поиск по имени продукта. А таблица подключается только, если есть поиск по имени. Странное поведение, конечно. Пришлось немного подправить fn.catalog.php

Благодарю!