Пример #1
0
<?php if(!empty($data['saleProducts'])): ?>
<div class="m-p-products sale js_indexProductSlide">
    <a class="js_indexProductSlideTitle" href="<?php echo SITE; ?>/group?type=sale">Распродажа</a>
    <div class="m-p-products-slider">
    <div class="<?php echo count($data['saleProducts'])>3?"m-p-products-slider-start":"" ?>">
        <?php foreach($data['saleProducts'] as $item): ?>
        <div class="product-wrapper">
          <div class="product-stickers">
            <?php
                echo $item['new']?'<span class="sticker-new"></span>':'';
                echo $item['recommend']?'<span class="sticker-recommend"></span>':'';
            ?>
          </div>
          <div class="product-image">
            <a href="<?php echo SITE ?>/<?php echo isset($item["category_url"])?$item["category_url"]:'catalog' ?>/<?php echo htmlspecialchars($item["product_url"]) ?>">
               <?php echo mgImageProduct($item); ?>
            </a>
          </div>

          <div class="product-name">
            <a href="<?php echo SITE ?>/<?php echo isset($item["category_url"])?$item["category_url"]:'catalog' ?>/<?php echo htmlspecialchars($item["product_url"]) ?>"><?php echo $item["title"] ?></a>
          </div>
          <div class="product-footer">
            <span class="product-price">
              <span class="product-old-price"><?php echo $item["old_price"] ?> <?php echo $data['currency']; ?></span>
              <?php echo priceFormat($item["price"]) ?> <?php echo $data['currency']; ?>
            </span>
            <div class="product-buttons">
              <!--Кнопка, кототорая меняет свое значение с "В корзину" на "Подробнее"-->
              <?php echo $item[$data['actionButton']] ?>
              <?php echo $item['actionCompare'] ?>
Пример #2
0
        echo $item['recommend'] ? '<span class="sticker-recommend"></span>' : '';
        ?>
          </div>
          <div class="product-image">
            <a href="<?php 
        echo SITE;
        ?>
/<?php 
        echo isset($item["category_url"]) ? $item["category_url"] : 'catalog';
        ?>
/<?php 
        echo htmlspecialchars($item["product_url"]);
        ?>
">
               <?php 
        echo mgImageProduct($item);
        ?>
            </a>
          </div>

          <div class="product-name">
            <a href="<?php 
        echo SITE;
        ?>
/<?php 
        echo isset($item["category_url"]) ? $item["category_url"] : 'catalog';
        ?>
/<?php 
        echo htmlspecialchars($item["product_url"]);
        ?>
"><?php 
Пример #3
0
    /**
     * функция фозвращает html код для вывода блока с недавно просмотренными товарами
     * @param type $args
     * @return string
     */
    static function htmlRecentlyProducts($data)
    {
        //viewData($data);
        $block = '';
        foreach ($data["products"] as $item) {
            $block .= '
         <div class="product-wrapper " >
        <div class="mg-recently-viewed">
        <div class="mg-recently-product-wrapper " >
        <div class="mg-recently-product-image">
        <a href="' . $item['url'] . '">';
            $item["image_url"] = $item['img'];
            $block .= mgImageProduct($item) . '</a>
				</div>
        <div class="product-name ">
        <a href="' . $item['url'] . '">' . $item["title"] . '</a>
        </div>';
            //$block .='<span class="product-price">'.$item["price"].' '.$data['currency'].'</span><div ></div>';
            if ($item['count'] == 0) {
                $block .= '<a href="' . $item['url'] . '" class="product-info default-btn">Подробнее</a>';
            } else {
                // $block .= '<a class="addToCart default-btn product-buy" href="'.SITE.'/catalog?inCartProductId='.$item['id'].'" data-item-id="'.$item['id'].'">Купить</a>';
            }
            $block .= '</div>
        </div></div>';
        }
        $html = '<link href="' . SITE . '/' . self::$path . self::$pluginName . '/css/recently.css" rel="stylesheet" type="text/css" />
      <script type="text/javascript" src="' . SCRIPT . 'jquery.bxslider.min.js"></script>
      <script type="text/javascript" src="' . SITE . '/' . self::$path . self::$pluginName . '/js/recently.js"></script>
      <div class="mg-recently-viewed-plugin">
      <h2 class="mg-recently-title">Вы недавно смотрели:</h2>
      <div class="mg-recently-viewed-slider">' . $block . '</div></div>';
        return $html;
    }