private function getOfferInfo(Product $model) { $res = ''; $res .= CHtml::tag('url', [], $model->getUrl(true)); $res .= CHtml::tag('price', [], $model->price); $res .= CHtml::tag('currencyId', [], 'RUR'); $res .= CHtml::tag('categoryId', [], $model->category_id); // tag market_category $imageCount = 0; if ($model->image) { $res .= CHtml::tag('picture', [], $model->getImageUrl()); $imageCount++; } foreach ($model->getImages() as $image) { if ($imageCount > 10) { break; } $res .= CHtml::tag('picture', [], $image->getImageUrl()); $imageCount++; } // tag store // tag pickup // tag delivery // tag local_delivery_cost // tag typePrefix $res .= CHtml::tag('vendor', [], $model->producer->name); // tag vendorCode $res .= CHtml::tag('model', [], htmlspecialchars(strip_tags($model->name))); $res .= CHtml::tag('description', [], htmlspecialchars(strip_tags($model->description))); // tag sales_notes // tag manufacturer_warranty // tag seller_warranty // tag country_of_origin // tag downloadable // tag adult // tag age // tag barcode // tag cpa // tag rec // tag expiry // tag weight // tag dimensions // tag param return $res; }
/** * @param Product $product * @param int $width * @param int $height * @param bool|true $crop * @return mixed */ public static function product(Product $product, $width = 0, $height = 0, $crop = true) { return $product->getImageUrl($width, $height, $crop, static::getDefaultImage()); }