function template_pricecore_product_hook($obj, $category, $rout) { if ($rout == 'START') { $dis = null; // 404 if (!PHPShopSecurity::true_num($category)) { return $obj->setError404(); } // Выборка данных $PHPShopOrm = new PHPShopOrm($GLOBALS['SysValue']['base']['products']); $PHPShopOrm->debug = $obj->debug; $data = $PHPShopOrm->select(array('*'), array('category' => '=' . $category, 'enabled' => "='1'", 'parent_enabled' => "='0'"), array('order' => 'num'), array('limit' => 500)); if (!empty($obj->category_name)) { $dis = $obj->tr(false, $obj->category_name); } if ($obj->PHPShopSystem->getSerilizeParam('admoption.user_price_activate') == 1 and empty($_SESSION['UsersId'])) { $user_price_activate = true; } // Добавляем в дизайн ячейки с товарами if (is_array($data)) { foreach ($data as $row) { $name = '<a href="' . $obj->seourl($row) . '" class="list-group-item">' . $row['name']; if (empty($row['sklad']) and empty($user_price_activate)) { $cart = PHPShopText::a('javascript:AddToCart(' . $row['id'] . ')', PHPShopText::img('images/shop/basket_put.gif', false, 'absMiddle'), $obj->lang('product_sale')); } else { $cart = PHPShopText::a('../users/notice.html?productId=' . $row['id'], PHPShopText::img('images/shop/date.gif', false, 'absMiddle'), $obj->lang('product_notice')); } if (empty($user_price_activate)) { $price = $obj->price($row) . ' ' . $obj->currency(); } else { $price = PHPShopText::a('../users/register.html', PHPShopText::img('images/shop/icon_user.gif', false, 'absMiddle'), $obj->lang('user_register_title')); } $dis .= $name . '<b class="pull-right">' . $price . '</b></a>'; } } $block = $dis . '</div>'; $obj->add($block, true); return true; } }