Ejemplo n.º 1
0
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;
    }
}
Ejemplo n.º 2
0
// Мобильная корзина
if (!empty($_SESSION['cart'])) {
    $PHPShopCart = new PHPShopCart();
    $GLOBALS['SysValue']['other']['cart_active_num'] = $PHPShopCart->getNum();
    $GLOBALS['SysValue']['other']['cart_active'] = 'active';
}
// Личный кабинет
if (!empty($_SESSION['UsersId'])) {
    $GLOBALS['SysValue']['other']['user_link'] = 'href="/users/"';
    $GLOBALS['SysValue']['other']['user_active'] = 'active';
} else {
    $GLOBALS['SysValue']['other']['user_link'] = 'href="#"  data-toggle="modal"';
}
// Цветовые темы CSS
if (isset($_COOKIE['bootstrap_theme'])) {
    if (PHPShopSecurity::true_skin($_COOKIE['bootstrap_theme'])) {
        $GLOBALS['SysValue']['other']['bootstrap_theme'] = $_COOKIE['bootstrap_theme'];
    } else {
        $GLOBALS['SysValue']['other']['bootstrap_theme'] = 'bootstrap';
    }
} elseif (empty($GLOBALS['SysValue']['other']['bootstrap_theme'])) {
    $GLOBALS['SysValue']['other']['bootstrap_theme'] = 'bootstrap';
}
$sign = 1423218824;
if (!empty($GLOBALS['RegTo']['SupportExpires']) and $GLOBALS['RegTo']['SupportExpires'] < $sign) {
    echo '<div class="alert alert-danger alert-dismissible text-center" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <span class="glyphicon glyphicon-exclamation-sign"></span> <strong>Внимание!</strong> Для использования этого шаблона требуется продлить <a href="http://phpshop.ru/order/?from=' . $_SERVER['SERVER_NAME'] . '&action=pay_new_template" target="_blank" class="alert-link">техническую поддержку</a>.</div>';
}
// Меню брендов
$PHPShopBrandsElement = new PHPShopBrandsElement();