Jump to content

Sort by problem


NewbieSVK

Recommended Posts

Hello

 

I read a lot of articles about problem with sort by (I tried to reinstall module, set permission etc.), but my problem still persists.

Sort by works, when the blocklayered is inactive, result is: ?orderby=name&orderway=asc or desc

But, when the blocklayered is active (filter works), sort by doesn´t work, result is #/

 

In console, the is no problem.

Can anyone helps me?

 

Thank you a lot.

Sorry for my English

Link to comment
Share on other sites

Hi NewbieSVK,

 

Go in your backoffice under Modules/Layered navigation block configuration and verify that your selections in the "Filters templates" for "Categories used for this template" matches what you have selected for your product catalog for "Default category" under Associations...

 

Hope that help...

 

Cheers

Link to comment
Share on other sites

  • 2 months later...

this is link after call sort:

/modules/blocklayered/blocklayered-ajax.php?id_category_layered=3&layered_price_slider=16_63&orderby=price&orderway=desctrue&_=1419257004425

 

as you can see parameter orderway has desctrue insted desc

 

To fix the problem go to blocklayered.js

\themes\modules\blocklayered\blocklayered.js
and in theme:
\themes\motoserwis\js\modules\blocklayered\blocklayered.js

 

and change this line (461):

data += '&orderby='+splitData[0]+'&orderway='+splitData[1];

 

to 

 

data += '&orderby='+splitData[0]+'&orderway='+splitData[1]+'&asd=';

  • Like 8
  • Thanks 1
Link to comment
Share on other sites

this is link after call sort:

/modules/blocklayered/blocklayered-ajax.php?id_category_layered=3&layered_price_slider=16_63&orderby=price&orderway=desctrue&_=1419257004425

 

as you can see parameter orderway has desctrue insted desc

 

To fix the problem go to blocklayered.js

\themes\modules\blocklayered\blocklayered.js
and in theme:
\themes\motoserwis\js\modules\blocklayered\blocklayered.js

 

and change this line (461):

data += '&orderby='+splitData[0]+'&orderway='+splitData[1];

 

to 

 

data += '&orderby='+splitData[0]+'&orderway='+splitData[1]+'&asd=';

 

GREAT!!!!!!!! :-) very very GREAT! 

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
 

Hey, I just ran into that problem too, I deleted the params_plus in the data ajax call :
 

$.ajax({
            type: 'GET',
            url: baseDir + 'modules/rs_blocklayered/rs_blocklayered-ajax.php',
            data: data+n,
            dataType: 'json',
            cache: false,

I guess it's just another solution.
Did someone made a pull request here https://github.com/PrestaShop/blocklayered ?

 

this modification, where the did you do?

Edited by fernandodelgado (see edit history)
Link to comment
Share on other sites

Thanks for the answer, but it does not work, I need to sort by weight. I made the changes in the theme/product-sort.tpl adding;
 
			<option value="weight:asc" {if $orderby eq 'weight' AND $orderway eq 'asc'}selected="selected"{/if}>{l s='Carat weight: lowest first'}</option>
			<option value="weight:desc" {if $orderby eq 'weight' AND $orderway eq 'desc'}selected="selected"{/if}>{l s='Carat weight: highest first'}</option>

And in doing the following change classes/controller/FrontController.php;

$order_by_values = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position', 5 => 'manufacturer_name', 6 => 'quantity', 7 => 'reference');
for
 
$order_by_values = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position', 5 => 'manufacturer_name', 6 => 'quantity', 7 => 'reference', 8 => 'weight');
 

It works well and sort by weight correctly when the blocklayered module is not enabled, but with activated module, the option to sort by weight not work, and these changes described in this thread has not helped me. Do you have any idea what should I change?

Link to comment
Share on other sites

×
×
  • Create New...