Jump to content

aiuto modifica codice ordinamento prodotti


PEPPE83

Recommended Posts

Ciao a tutti, sto provando a far funzionare un modulo che ha un proprio file di ordinamento prodotti, solo che me li ordina alfabeticamente dalla "A alla Z" come impostato di default nel sito, a me interesserebbe che me li ordinasse dal "meno caro".

Questo è il codice del file di ordinamento del modulo, mi spiegate che modifiche fare e magari anche il perchè? Da solo proprio non ci riesco, grazie!

 

{if isset($orderby) AND isset($orderway)}
<!-- Sort products -->
<form id="productsSortForm" action="{$request|escape:'htmlall':'UTF-8'}">
<p class="select">
 <select id="selectPrductSort" onchange="document.location.href = $(this).val();">
  <option value="{$link->addSortDetails($requestPage, $orderbydefault, $orderwaydefault)|escape:'htmlall':'UTF-8'}" {if $orderby eq $orderbydefault}selected="selected"{/if}>{l s='--'}</option>
  {if !$PS_CATALOG_MODE}
  <option value="{$link->addSortDetails($requestPage, 'price', 'asc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'price' AND $orderway eq 'asc'}selected="selected"{/if}>{l s='Price: lowest first'}</option>
  <option value="{$link->addSortDetails($requestPage, 'price', 'desc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'price' AND $orderway eq 'desc'}selected="selected"{/if}>{l s='Price: highest first'}</option>
  {/if}
  <option value="{$link->addSortDetails($requestPage, 'name', 'asc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'name' AND $orderway eq 'asc'}selected="selected"{/if}>{l s='Product Name: A to Z'}</option>
  <option value="{$link->addSortDetails($requestPage, 'name', 'desc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'name' AND $orderway eq 'desc'}selected="selected"{/if}>{l s='Product Name: Z to A'}</option>
  {if !$PS_CATALOG_MODE}
  <option value="{$link->addSortDetails($requestPage, 'quantity', 'desc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'quantity' AND $orderway eq 'desc'}selected="selected"{/if}>{l s='In-stock first'}</option>
  {/if}
 </select>
 <label for="selectPrductSort">{l s='Sort by'}</label>
</p>
</form>
<!-- /Sort products -->
{/if}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...