I’ve got the following problem.
On the e-commerce website (made with Prestashop, so it uses Smarty), products sorting doesn’t work. It’s a SELECT field, which is changed dynamically when user selects some option (site reloads). Please look at the following code:
First, Smarty:
{if isset($orderby) AND isset($orderway)}
<!-- Sort products -->
{if isset($smarty.get.id_category) && $smarty.get.id_category}
{assign var='request' value=$link->getPaginationLink('category', $category, false, true)}
{elseif isset($smarty.get.id_manufacturer) && $smarty.get.id_manufacturer}
{assign var='request' value=$link->getPaginationLink('manufacturer', $manufacturer, false, true)}
{elseif isset($smarty.get.id_supplier) && $smarty.get.id_supplier}
{assign var='request' value=$link->getPaginationLink('supplier', $supplier, false, true)}
{else}
{assign var='request' value=$link->getPaginationLink(false, false, false, true)}
{/if}
Then, jQuery:
<script type="text/javascript">
//<![CDATA[
{literal}
$(document).ready(function()
{
$('#selectPrductSort').change(function()
{
var requestSortProducts = '{/literal}{$request}{literal}';
var splitData = $(this).val().split(':');
document.location.href = requestSortProducts + ((requestSortProducts.indexOf('?') < 0) ? '?' : '&') + 'orderby=' + splitData[0] + '&orderway=' + splitData[1];
});
});
//]]>
{/literal}
</script>
And HTML:
<form id="productsSortForm" action="{$request|escape:'htmlall':'UTF-8'}">
<p class="select">
<label for="selectPrductSort">{l s='Sortuj wg'} </label>
<select id="selectPrductSort">
<option value="{$orderbydefault|escape:'htmlall':'UTF-8'}:{$orderwaydefault|escape:'htmlall':'UTF-8'}" {if $orderby eq $orderbydefault}selected="selected"{/if}>{l s='--'}</option>
{if !$PS_CATALOG_MODE}
<option value="price:asc" {if $orderby eq 'price' AND $orderway eq 'asc'}selected="selected"{/if}>{l s='ceny - od najniższej'}</option>
<option value="price:desc" {if $orderby eq 'price' AND $orderway eq 'desc'}selected="selected"{/if}>{l s='ceny - od najwyższej'}</option>
{/if}
<option value="name:asc" {if $orderby eq 'name' AND $orderway eq 'asc'}selected="selected"{/if}>{l s='nazwy produktu - od A do Z'}</option>
<option value="name:desc" {if $orderby eq 'name' AND $orderway eq 'desc'}selected="selected"{/if}>{l s='nazwy produktu - od Z do A'}</option>
{if !$PS_CATALOG_MODE}
<option value="quantity:desc" {if $orderby eq 'quantity' AND $orderway eq 'desc'}selected="selected"{/if}>{l s='dostępności'}</option>
{/if}
</select>
</p>
</form>
Under this link – http://skleppatrioty.pl/category.php?id_category=5 – you can see a working example. It’s a SELECT field, next to the text “Sortuj wg”, in the upper part of the main, right column.
Am I missing something? Thank you for your help.
I checked the live site and the above code looks fine.
I recommend getting rid of the carousel error first.