Advertisement
Guest User

code

a guest
Dec 16th, 2013
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. {if isset($orderby) AND isset($orderway)}
  2.  
  3. {* On 1.5 the var request is setted on the front controller. The next lines assure the retrocompatibility with some modules *}
  4. {if !isset($request)}
  5. <!-- Sort products -->
  6. {if isset($smarty.get.id_category) && $smarty.get.id_category}
  7. {assign var='request' value=$link->getPaginationLink('category', $category, false, true)}
  8. {elseif isset($smarty.get.id_manufacturer) && $smarty.get.id_manufacturer}
  9. {assign var='request' value=$link->getPaginationLink('manufacturer', $manufacturer, false, true)}
  10. {elseif isset($smarty.get.id_supplier) && $smarty.get.id_supplier}
  11. {assign var='request' value=$link->getPaginationLink('supplier', $supplier, false, true)}
  12. {else}
  13. {assign var='request' value=$link->getPaginationLink(false, false, false, true)}
  14. {/if}
  15. {/if}
  16. <script type="text/javascript">
  17. //<![CDATA[
  18. $(document).ready(function()
  19. {
  20. $('#selectProductSort').change(function()
  21. {
  22. var requestSortProducts = '{$request}';
  23. var splitData = $(this).val().split(':');
  24. document.location.href = requestSortProducts + ((requestSortProducts.indexOf('?') < 0) ? '?' : '&') + 'orderby=' + splitData[0] + '&orderway=' + splitData[1];
  25. });
  26. });
  27. //]]>
  28. </script>
  29. <div class="product_sort">
  30. <form id="productsSortForm" action="{$request|escape:'htmlall':'UTF-8'}">
  31. <label for="selectProductSort">{l s='Sort by'}</label>
  32. <select id="selectProductSort" class="selectProductSort">
  33. <option value="{$orderbydefault|escape:'htmlall':'UTF-8'}:{$orderwaydefault|escape:'htmlall':'UTF-8'}" {if $orderby eq $orderbydefault}selected="selected"{/if}>{l s='--'}</option>
  34. {if !$PS_CATALOG_MODE}
  35. <option value="price:asc" {if $orderby eq 'price' AND $orderway eq 'asc'}selected="selected"{/if}>{l s='Price: lowest first'}</option>
  36. <option value="price:desc" {if $orderby eq 'price' AND $orderway eq 'desc'}selected="selected"{/if}>{l s='Price: highest first'}</option>
  37. {/if}
  38. <option value="name:asc" {if $orderby eq 'name' AND $orderway eq 'asc'}selected="selected"{/if}>{l s='Product Name: A to Z'}</option>
  39. <option value="name:desc" {if $orderby eq 'name' AND $orderway eq 'desc'}selected="selected"{/if}>{l s='Product Name: Z to A'}</option>
  40. {if !$PS_CATALOG_MODE}
  41. <option value="quantity:desc" {if $orderby eq 'quantity' AND $orderway eq 'desc'}selected="selected"{/if}>{l s='In-stock first'}</option>
  42. {/if}
  43. </select>
  44. </form>
  45. <ul class="product_view">
  46. <li id="product_view_grid"></li>
  47. <li id="product_view_list" class="current"></li>
  48. </ul>
  49. </div>
  50. <!-- /Sort products -->
  51. {/if}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement