if ($images !== null && count($images) > 0) {
        $img = CHtml::image('/images/goods/xs_' . $images[0]->image);
    } else {
        $img = CHtml::image('/images/xs_empty.jpg');
    }
    echo CHtml::link($img, $this->createUrl('good/view', array('id' => $good->id)));
    ?>
    </div>
    <div class="good_desc">
        <?php 
    echo CHtml::link($good->name, $this->createUrl('good/view', array('id' => $good->id)));
    $good->ShowRating();
    echo '<div class="fix">';
    $main_features = $good->GetMainAttributes();
    foreach ($main_features as $main_feature) {
        echo $main_feature->attr->GetValue($main_feature->value);
        if (end($main_features) != $main_feature) {
            echo ', ';
        }
    }
    if ($good->price !== null && $good->price != 0) {
        echo '</div><div class="sm-price">Цена: ' . CAlexHelper::GetMoneyFormat($good->price) . ' руб.</div>';
    } else {
        echo '</div><div><b>Нет в продаже</b></div>';
    }
    ?>
    </div>
</div>
<?php 
    $this->endCache();
}
 /**
  * get items count in shopping card
  */
 public function actionGetCartQuantity()
 {
     $count = Yii::app()->shoppingCart->getItemsCount();
     $cost = CAlexHelper::GetMoneyFormat(Yii::app()->shoppingCart->getCost());
     echo $count . ',' . $cost;
 }
    <td width="60%">Наименование товара</td>
    <td>Цена</td>
    <td>Кол-во</td>
    <td>Сумма</td>
    <td>Удалить</td>
</tr>
</thead>
<tbody>
<?php 
$positions = Yii::app()->shoppingCart->getPositions();
foreach ($positions as $position) {
    echo '<tr>';
    echo '<td class="good-name">' . $position->GetGoodImage('xs') . CHtml::link($position->name, $this->createUrl('good/view', array('id' => $position->id))) . '</td>';
    echo '<td><span id="one-price-' . $position->id . '">' . CAlexHelper::GetMoneyFormat($position->getPrice()) . '</span> руб.</td>';
    echo '<td>' . CHtml::textField('good-quantity-' . $position->id, $position->getQuantity(), array('onkeyup' => 'SetNewQuantity(' . $position->id . ')', 'maxlength' => '10', 'size' => '3')) . '</td>';
    echo '<td><span id="sum-price-' . $position->id . '">' . CAlexHelper::GetMoneyFormat($position->getSumPrice()) . '</span> руб.</td>';
    echo '<td class="remove-good">' . CHtml::link('<img src="/images/delete.png" alt="" />', '', array('onclick' => 'DeleteItem(' . $position->id . ')')) . '</td>';
    echo '</tr>';
}
?>
</tbody>
<tfoot>
<td colspan=5>
    <div class="cart-sum">Итого: <span><?php 
$cost = (string) Yii::app()->shoppingCart->getCost();
echo CAlexHelper::GetMoneyFormat($cost);
?>
 руб.</span></div>
</td>
</tfoot>
Beispiel #4
0
        ?>
</span>
				<span class="b-prices__currency">руб.</span>
                <?php 
    }
    ?>
			</div>
		</div>
		<div class="b-rating__with_text">
        <?php 
    $this->endCache();
}
?>
		<?php 
$good->ShowRating();
echo '<span>&nbsp;&nbsp; ' . $good->marksCount . ' ' . CAlexHelper::GetFormatWord('оценка', $good->marksCount) . '</span>';
?>

		</div>
		<div class="b-rating__with_text">
			<?php 
if (!Yii::app()->user->isGuest) {
    $this->widget('CStarRating', array('name' => 'user-input-rating', 'minRating' => '1', 'maxRating' => '5', 'value' => $good->GetUserRating(), 'starWidth' => '15', 'ratingStepSize' => '1', 'titles' => CHtml::listData(RatingDesc::model()->cache(3600)->findAll(), 'id', 'desc'), 'allowEmpty' => false, 'callback' => 'function(value) {SetRating(value, ' . $good->id . ');}', 'cssFile' => '/css/rating/jquery.rating.css'));
    echo '<span>&nbsp;&nbsp;оцените модель</span>';
}
?>
		</div>
		<ul>
			<li><?php 
if (Yii::app()->shoppingCart->contains($good->id)) {
    echo 'Этот товар уже есть в вашей корзине <br>';
 public function SavePictures($good_id, $pic)
 {
     if (empty($pic)) {
         return;
     }
     if (is_array($pic)) {
         foreach ($pic as $picture) {
             CAlexHelper::SaveImages($picture, $good_id);
         }
     } else {
         CAlexHelper::SaveImages(array($pic), $good_id);
     }
 }