Prev | Current Page 273 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

Add the following highlighted code to presentation\templates\products_list.tpl:


Price:
{if $obj->mProducts[k].discounted_price != 0}
{$obj->mProducts[k].price}
{$obj->mProducts[k].discounted_price}
{else}
{$obj->mProducts[k].price}
{/if}


{* Generate the list of attribute values *}


{* Parse the list of attributes and attribute values *}
{section name=l loop=$obj->mProducts[k].attributes}
{* Generate a new select tag? *}
{if $smarty.section.l.first ||
$obj->mProducts[k].attributes[l].attribute_name !==
$obj->mProducts[k].attributes[l.index_prev].attribute_name}
{$obj->mProducts[k].attributes[l].attribute_name}:

{/if}
{/section}



{if $smarty.section.k.index % 2 != 0 && !$smarty.section.k.first ||
$smarty.section.k.last}

{/if}
{/section}


{/if}
2.


Pages:
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285