smarty как получить алиас категории?

KK
На сайте с 25.07.2006
Offline
138
853

Есть интернет-магазин на smarty. На странице товара внизу есть список рекомендуемых товаров - пример. Но в этом списке товар можно только заказать, а возможность перейти на страницу рекомендуемого товара не предусмотрели почему-то... сайт старенький. Так вот подскажите пожалуйста, как получить алиас категории рекомендуемого товара?

На странице самой категории ссылка получается вот так:

<a href="{{$smarty.get.path}}{{$smarty.get.ic_alias}}/{{$item.i_id}}" style="color:#000; font-weight:bold; text-decoration:underline; ">смотреть полное описание</a>

А на странице с товаром рекомендуемые товары выводятся таким кодом:

{{if count($item.recommended_items) > 0}}

<p><div style="border-top:1px solid #FFF;"></div></p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- <td width="161"></td>
<td width="220"><span style="font-size:0.8em; font-weight:bold; color:#000;margin-left:0px;">Рекомендуемые товары</span></td>
<td width="307"></td>-->
<td align="center"><span style="font-size:0.8em; font-weight:bold; color:#000; margin-left:0px;">Рекомендуемые товары</span></td>
</tr>
</table>
<br>
<span class="s_black"><span class="s1_black"></span></span>
{{foreach from=$item.recommended_items item=ri name="fRI"}}
<table class="format" width="750" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="140" valign="top"><img src="{{if is_file($ri.small_image_dir)}}{{$ri.small_image_url}}{{else}}i/no_image.gif{{/if}}" alt="" width="150" height="113" class="bordered_image"></td>
<td width="225" valign="top"><center><b style="color: #000 ">{{$ri.ii_title}}</b></center><br>
<div style="color:#000; font-size:0.7em;text-align: justify;">{{if !empty($ri.ii_short_description)}}{{$ri.ii_short_description}}{{else}}нет описания{{/if}}</div></td>
<td width="293" valign="top"><table class="data" width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" class="none"><span class="rtoptable"><span class="r1table"></span></span></td>
</tr>
<tr class="bg">
<th><center>цена</center></th>
<th nowrap>кол-во:</th>
<th>заказать</th>
</tr>
<form action="{{$smarty.const.URLROOT}}cart/" method="POST">
<input type="hidden" name="i_id" value="{{$ri.i_id}}">
{{if checkOptions($ri.i_options, ITEM_OPT_INSTOCK)}}
<tr>
<td>{{math equation="x * y" x=$ri.i_price1 y=$current_currency.c_rate format="%.2f"}}&nbsp;{{$current_currency.c_title}}</td>
<td><center><input name="count" type="text" class="order" id="count_field_recommended_{{$ri.i_id}}" value="1"></center></td>
<td align="center">

<input type="image" src="i/order.gif" alt="" width="14" height="14" id="order_button_recommended_{{$ri.i_id}}" title="добавить в корзину" onclick="addToCart({{$ri.i_id}}, document.getElementById('count_field_recommended_{{$ri.i_id}}').value, this.id); return false;">
<span id="order_button_recommended_{{$ri.i_id}}_title" style="display:none">добавлено</span>
<img id="order_button_recommended_{{$ri.i_id}}_clock" style="display:none" src="i/sand_glass.gif">
</td>
</tr>
{{else}}
<tr class="{{cycle values=",bg"}}">
<td colspan="3" align="center">
<a href="#" class="ab" id="message_instock_recommended_{{$ri.i_id}}" onclick="message_instock({{$ri.i_id}}, this.id); return false;">Нет в наличии. Оставить заявку.</a>
<img id="message_instock_recommended_{{$ri.i_id}}_clock" style="display:none" src="i/sand_glass.gif">
<span id="message_instock_recommended_{{$ri.i_id}}_title" style="display:none">отправлено</span>
</td>
</tr>

{{/if}}

Вот как тут реализовать ссылку на рекомендуемый товар? Делал так вот:

<a href="{{$smarty.get.path}}{{$smarty.get.ic_alias}}/{{$ri.i_id}}" style="color:#000; font-weight:bold; text-decoration:underline; ">{{$ri.ii_title}}</a>

id рекомендуемого товара выдается правильно, а категорию конечно выдает не ту. что вместо {{$smarty.get.ic_alias}} нужно поставить так и не придумал. подскажите пожааалуста =)

KK
На сайте с 25.07.2006
Offline
138
#1

никто smarty не знает?

S
На сайте с 23.05.2004
Offline
315
#2

А при чем тут смарти ? Копайте свой пхп скрипт на предмет получения алиаса. Смарти лишь отображает данные в указанной ячейке массива.

Это просто подпись.

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий