Ejemplo n.º 1
0
        include 'catalog_view_' . $this->getView() . '.tpl.php';
    }
    ?>



<?php 
} elseif (!$action) {
    ?>
<div>Список пуст</div><?php 
}
?>
</form>
</div>
<?php 
if ($text = BaseComponent::getText("/catalog/{$id}")) {
    ?>
<div class="blk2">
<?php 
    echo $text;
    ?>
</div>
<?php 
} else {
    echo $this->getText("/catalog/{$id}");
}
/*form  class="common search" action="/catalog/?act=searchGoods" method="POST">

<input name="search" class="field" value="<?=isset($_GET['search'])?htmlspecialchars(trim(urldecode($_GET['search']))):''?>">
<button type="submit" class="button">Найти</button>
</form*/
Ejemplo n.º 2
0
 function actSubscribe()
 {
     global $ST, $post;
     if ($post->isMail('mail')) {
         $type = array("news");
         if ($t = $post->get('type')) {
             $type = preg_split('/[,\\s]/', $t);
         }
         //Добавим в подписку
         $rs = $ST->select("SELECT * FROM sc_subscribe WHERE mail='" . SQL::slashes($post->get('mail')) . "'");
         if (!$rs->next()) {
             $ST->insert('sc_subscribe', array('mail' => $post->get('mail'), 'type' => implode(' ', $type)));
         } else {
             $t = array();
             if (trim($rs->get('type'))) {
                 $t = explode(' ', trim($rs->get('type')));
             }
             if ($t == array_unique(array_merge($t, $type))) {
                 echo printJSON(array('msg' => 'Уже подписаны'));
                 exit;
             }
             $t = array_unique(array_merge($t, $type));
             $ST->update('sc_subscribe', array('type' => implode(' ', $t)), "mail='" . SQL::slashes($post->get('mail')) . "'");
         }
         echo printJSON(array('msg' => BaseComponent::getText('subscribe_confirm')));
         exit;
     } else {
         echo printJSON(array('err' => 'Введите адрес корректно!'));
         exit;
     }
 }
Ejemplo n.º 3
0
 function actGetDescrByZone()
 {
     global $get;
     echo BaseComponent::getText('delivery_zone_' . $get->get('id'));
 }
Ejemplo n.º 4
0
    if (empty($is_order)) {
        ?>
<!--	<a class="refresh" href="/catalog/">Продолжить покупки</a>-->
<!--	<a class="refresh" href="javascript:shop.refresh()">Пересчитать</a>-->
<a class="clear" href="javascript:shop.clear()" ><span>Очистить корзину</span></a>
<?php 
    }
    ?>
&nbsp;</td>
	<td>Итого:</td>
	<td colspan="2"><strong class="total_price"><span id="basket_total_summ"><?php 
    echo price($price);
    ?>
</strong>
	<?php 
    echo BaseComponent::getText('total_info');
    ?>
	</td>
	<td></td><?php 
    if (empty($is_order)) {
        ?>
<td></td><?php 
    }
    ?>
</tr>

</tfoot>
</table>

<?php 
} else {
Ejemplo n.º 5
0
 function checkDelivery($args)
 {
     $error = array();
     if (!Cfg::get('SHOP_DELIVERY_ENABLED')) {
         return $error;
     }
     if ($args->exists('date')) {
         //Если передаём дату доставки
         if (!trim($args->get('date'))) {
             $error['time'] = 'Введите дату';
         } elseif (!preg_match('|\\d{2}\\.\\d{2}\\.\\d{4}|', $args->get('date'))) {
             $error['time'] = 'Введите дату корректно [dd.mm.yyyy]';
         }
     }
     if ($this->cfg('SHOP_CHECK_DELIVERY_TIME') && time() > strtotime($args->get('date') . ' ' . $args->get('time') . ':00:00')) {
         $error['time'] = BaseComponent::getText('delivery_time_error_notice');
         $error['time'] .= '<small style="color:#aaa">Текущее время ' . date('H:i:s') . '</small>';
     }
     if (!trim($args->get('address'))) {
         $error['address'] = 'Введите адрес доставки';
     }
     return $error;
 }