Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Importante por favor ayuda!!!

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Spanish
View previous topic :: View next topic  
Author Message
banense
Smarty n00b


Joined: 30 Jan 2012
Posts: 1

PostPosted: Mon Jan 30, 2012 3:24 pm    Post subject: Importante por favor ayuda!!! Reply with quote

Hola chicos,
Llevo par de días tratando de buscar una solución para mostrar una lista con los proveedores de mi tienda. Tengo un archivo que me los muestra todos pero yo quiero escoger los ID de los proveedores que tengo en la tienda y luego mostrarlos.
Después de varios intentos fallidos he logrado hacer lo que quería pero de una forma poco profesional que es este código que os dejo aquí:
_____________________________________
<ul class="products-list">
{assign var='suppliers' value=Supplier::getSuppliers()}
{foreach from=$suppliers item=supplier name=supplier_list}
{if $supplier.id_supplier eq "2" or $supplier.id_supplier eq "3" or $supplier.id_supplier eq "4" or $supplier.id_supplier eq "5" or $supplier.id_supplier eq "9"}
<li class="{if $smarty.foreach.supplier_list.last}last{elseif $smarty.foreach.supplier_list.first}first{else}item{/if}"><a href="{$link->getsupplierLink($supplier.id_supplier, $supplier.link_rewrite)}" title=""><img src="{$img_sup_dir}{$supplier.id_supplier|escape:'htmlall':'UTF-8'}.jpg" alt="{$supplier.name|escape:'htmlall':'UTF-8'}" /></a></li>
{/if}
{/foreach}
</ul>
______________________________________
Así los muestro y aparecen pero me gustaría pedir ayuda a ver si alguien me puede decir como organizarlo de otra forma porque quiero mostrar 70 proveedores y meter todo ese código dentro del IF no se no lo veo..
Por fa si alguien sabe como mejorarlo o una idea mejor le agradecería que me ayudase
Saludos
Banense
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Spanish All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP