Example #1
0
 //
 //
 //extra parameters
 $extra = psGetExtra($productID);
 $extracount = count($extra);
 if ($extra) {
     $pre_extra = array();
     $pre_extra[$productID] = $extra;
     $a['color'] = psGetColor($productID, $pre_extra);
     global $type_set;
     //14 Тип товара
     $typeID = $extra['14']['variantID'];
     $a['type'] = array_search($typeID, $type_set);
 }
 //related items
 $related = psGetRelated($productID);
 if (!empty($related)) {
     $sort_related = psGetSortRelated($related);
     if (!empty($sort_related)) {
         $smarty->assign('sort_related', $sort_related);
     }
 }
 //
 //            $reviews = new RVS();
 //
 //            $data = $reviews->lst($productID);
 //            $smarty->assign('reviews', $data);
 //            $lst = $reviews->lst($productID, $sort_review);
 /*            if (isset($_POST['sort'])) {
                             switch (key($_POST['sort'])) {
                                 case 'reviews':
Example #2
0
File: podbor.php Project: gblok/rsc
<?php

if (isset($_POST['brandID'])) {
    $brandID = $_POST['brandID'];
    $products = getProductByBrand($brandID);
    $response['products'] = $products;
}
if (isset($_POST['relatedID'])) {
    $relatedID = $_POST['relatedID'];
    $related = psGetRelated($relatedID);
    if (!empty($related)) {
        $sort_related = psGetSortRelated($related);
        sort($sort_related);
    }
    $response['related'] = $sort_related;
}
if (isset($_POST['2cart'])) {
    $productID = $_POST['2cart'];
    if (!empty($productID)) {
        if (empty($qty)) {
            $qty = 1;
        }
        for ($i = 0; $i < $qty; $i++) {
            cartAddToCart($productID, array());
        }
        $cart = cartGetCartContent();
        if (!empty($cart['cart_content'])) {
            $qty = 0;
            foreach ($cart['cart_content'] as $k => $v) {
                $qty += $v['quantity'];
            }