Jump to content

Отображение свойств товара в корзине


Recommended Posts

api/Cart.php после 55-й строки впишите:

// Свойства
$features = $this->features->get_product_options($products_ids);
foreach($features as &$feature)
{
	$products[$feature->product_id]->features[] = $feature;
}

 

Ну и в шаблоне cart.tpl используйте такой цикл:

{foreach $purchase->product->features as $f}
{$f->name}
{$f->value}
{/foreach}

 

Готово!

Link to post
Share on other sites
  • 7 months later...

Если товаров добавлено в корзину больше одного, то показывает только одно значение. 

Как показать каждое значение с каждого товара?

Ничего подобного, каждому товару набор его же свойств. Делал у себя на сайте все работало, версия симплы 2.2.1 вроде была.

Может Вы что-то не так делаете, а еще Вы не указываете версию симплы.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...