تغییر نحوه نمایش دسته بندی ها در اسکریپت سبد خرید

hanijafari

تازه وارد
با سلام.

نحوه نمایش دسته بندیهای فروشگاه در اسکریپت سبدخرید به صورت درختی هست و اونم با تیبل طراحی شده.

من قصد دارم اونو به صورت منوی بازشونده با <ul> و  <li> تغییرش بدم.

خیلی روش وقت گذاشتم ، تا جایی رسیدم اما تا یک دسته بندی جدید اضافه میکنم توش تداخل ایجاد میشه و یکی از دسته ها وارد حلقه اجراییش میشه.

مغزم دیگه هنگ کرده.

کداشو میزارم اینجا هر کدوم از دوستان میتونه درست یا تکمیلش کنه لطفا اینکارو انجام بده ، چون خودم دیگه خیلی خسته شدم.

هزینه هم داشت بگید تقدیم میشه.

 کد اصلی اسکریپت :

{* front-end homepage*}{$smarty.const.STRING_GREETINGS}<br><table cellpadding="0" cellspacing="0" width="100%" class="main-row" height="22"> <!-- MSTableType="layout" --> <tr> <td valign="middle" height="22">:: دسته بندی محصولات</td> </tr></table><table width=100% border=0 cellpadding=5>{section name=i loop=$root_categories}{if $smarty.section.i.index is div by 2}<tr style="border: 1px solid #008000">{/if}<td width=1% align=center> {if $root_categories[3] ne ""}<a href="index.php?categoryID={$root_categories[0]}"><img border=0 src="products_pictures/{$root_categories[3]}" alt="{$root_categories[1]}">{/if}</td><td> <a href="index.php?categoryID={$root_categories[0]}" class=cat>{$root_categories[1]}</a> <b>[{$root_categories[2]}]</b>:<br> {* show sub categories *} {assign var="tmp" value=0} {section name=j loop=$root_categories_subs} {if $root_categories_subs[j][3] == $root_categories[0]} {if $tmp == 1}| {else} {assign var="tmp" value=1} {/if} <a href="index.php?categoryID={$root_categories_subs[j][0]}" class=standard>{$root_categories_subs[j][1]}</a> {/if} {/section}</td></td>{if ($smarty.section.i.index+1) is div by 2}</tr>{/if}{/section}</table>{* now show special offers *}<p><center><table cellpadding="0" cellspacing="0" width="100%" class="main-row" height="22"> <!-- MSTableType="layout" --> <tr> <td valign="middle" height="22">:: پیشنهاد ویژه</td> </tr></table><br><table border=0 cellspacing=1 cellpadding=5>{section name=i loop=$special_offers}{if $smarty.section.i.index is div by 2}<tr>{/if}<td valign=top> <table border=0 width=100% bgcolor=#{$smarty.const.CONF_MIDDLE_COLOR} cellpadding=0 cellspacing=1> <tr><td> <table border=0 bgcolor=white width=100%> <tr> <td align="center"><a href="index.php?productID={$special_offers[0]}"><img src="products_pictures/{$special_offers[2]}" border=0></a></td> </tr> <tr> <td align=center style="background-color: #EAF4FF"><a href="index.php?productID={$special_offers[0]}">{$special_offers[1]}</a></td> </tr> <tr> <td align=center style="background-color: #FFF2F2"><font color="red"><b>{$special_offers[3]}</b></font></td> </tr> </table> </td></tr> </table></td>{if ($smarty.section.i.index+1) is div by 2}</tr>{/if}{/section}</table></center> منم تا اینجا تغییر دادمش و یک سری قسمتها رو حذف کردم و الان توی تبدیل تیبل به <ul> به مشکل بر خوردم.

کدهای تغییر داده شده من :

<ul id="cm-nav"><li><a href="index.php">{$smarty.const.LINK_TO_HOMEPAGE}</a></li><li><a href="#" class="arrow">محصولات</a>{section name=i loop=$root_categories}{if $smarty.section.i.index is div by 2}{/if} <ul class="arrow-pad"><li>{if $root_categories[3] ne ""}<a href="index.php?categoryID={$root_categories[0]}" class="arrow"><img border=0 src="products_pictures/{$root_categories[3]}" alt="{$root_categories[1]}">{/if} <a href="index.php?categoryID={$root_categories[0]}" class="arrow">{$root_categories[1]}</a><ul><li> {* show sub categories *} {assign var="tmp" value=0} {section name=j loop=$root_categories_subs} {if $root_categories_subs[j][3] == $root_categories[0]} {if $tmp == 1}</li> <li> {else} {assign var="tmp" value=1} {/if} <a href="index.php?categoryID={$root_categories_subs[j][0]}">{$root_categories_subs[j][1]}</a> {/if} {/section} </li></ul></li>{if ($smarty.section.i.index+1) is div by 2}</ul>{/if}</ul>{/section}قسمتهای حذف شده رو نیاز نداشتم حذف کردم.

با تشکر

 
آخرین ویرایش توسط مدیر:
بالا