Ошибка в коде модуля, помогите исправить, после обновления

Дорогие форумчане,
помогите исправить ошибку.
Обновили кс-карт до последней версии.
Есть ошибка в стороннем модуле, я так понял, что он конфликтует с модулем Баннеры в категориях от AB.
Конфликт только на странице категории, вот ошибка:

и сам код с файла:

<?php

use Tygh\Registry;

if (!defined('BOOTSTRAP')) { die('Access denied'); }

$_REQUEST['category_id'] = empty($_REQUEST['category_id']) ? 0 : $_REQUEST['category_id'];

if ($mode == 'view') {
	$products = Tygh::$app['view']->getTemplateVars('products');
	foreach ($products as &$product) {
		fn_gather_reward_points_data($product, $auth);
	}
	Tygh::$app['view']->assign('products', $products);
/*
	$params = Array (
	    'sl' => 'ru',
	    'dispatch' => 'categories.view',
	    'category_id' => $_REQUEST['category_id'],
	    'items_per_page' => '1',
	    'sort_by' => 'price',
	    'sort_order' => 'desc',
	    'cid' => $_REQUEST['category_id'],
	    'extend' => Array
	        (
	            '0' => 'categories',
	            '1' => 'description',
	        ),
	    'subcats' => 'Y',
	);

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

    if(isset($products) && !empty($products)){
	    foreach ($products as $product) {
	    	$highPrice = $product['price'];
	    }
	} else {
	    $highPrice = 0;
	}

    Tygh::$app['view']->assign('highPrice', $highPrice);

	$params = Array (
	    'sl' => 'ru',
	    'dispatch' => 'categories.view',
	    'category_id' => $_REQUEST['category_id'],
	    'items_per_page' => '1',
	    'sort_by' => 'price',
	    'sort_order' => 'asc',
	    'cid' => $_REQUEST['category_id'],
	    'extend' => Array
	        (
	            '0' => 'categories',
	            '1' => 'description',
	        ),
	    'subcats' => 'Y',
	);

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

    if(isset($products) && !empty($products)){
	    foreach ($products as $product) {
	    	$lowPrice = $product['price'];
	    }
	} else {
	    $lowPrice = 0;
	}

    Tygh::$app['view']->assign('lowPrice', $lowPrice);
*/
}

12 строка, это:
fn_gather_reward_points_data($product, $auth);

Может в нововй кс-карт сменили функцию вывода баллов… кто-знает?

Замените

	$products = Tygh::$app['view']->getTemplateVars('products');
	foreach ($products as &$product) {
		fn_gather_reward_points_data($product, $auth);
	}
	Tygh::$app['view']->assign('products', $products);

на

if (Registry::get('addons.reward_points.status') == 'A') {
	$products = Tygh::$app['view']->getTemplateVars('products');
	foreach ($products as &$product) {
		fn_gather_reward_points_data($product, $auth);
	}
	Tygh::$app['view']->assign('products', $products);
}

Так как данная функция находится в модуле Бонусные баллы то без него этот кусок кода работать не будет

1 лайк

Спасибо большое вам! Все работает!
Как мне вас отблагодарить?