Всем доброго здравия
Подскажите, как вывести название бренда купленных товаров в order.tpl?
Код: Выделить всё
foreach($this->products->get_products(array('id'=>$products_ids,'limit' => count($products_ids))) as $p) {
$products[$p->id] = $p;
$images_ids[] = $p->main_image_id;
}
Код: Выделить всё
$brands = array();
foreach ($this->brands->get_brands(array('product_id'=>$products_ids)) as $b) {
$brands[$b->id] = $b;
}
foreach($products as $product) {
if($brands[$product->brand_id]) {
$product->brand = $brands[$product->brand_id];
}
}
Код: Выделить всё
{if $purchase->product->brand}
<div>{$lang->product_brand_name} <a href="{$lang_link}brands/{$purchase->product->brand->url}">{$purchase->product->brand->name|escape}</a></div>
{/if}
Вернуться в «Вопросы по работе с OkayCMS»
Сейчас этот раздел просматривают: 89 гостей