ashadweb Posted June 25, 2014 Share Posted June 25, 2014 How can I change the feature values as I want currently it orders alphabetically. example front end:http://gyazo.com/c8226b780c641070a93727043b49d120 I want to change as it is in the admin how I added example admin:http://gyazo.com/9b6511a9ea72ee87e45aba559650d5fd Link to comment Share on other sites More sharing options...
PascalVG Posted July 6, 2014 Share Posted July 6, 2014 Hmm, I expected when adding something like ORDER BY fv.id_feature_value would do the trick, but 'somewhere' after getting the data it 'mixes it up' and reorders according to alphabetical order... :-( No Idea yet... Witt try later. coming week on holiday, so please be patient... pascal Link to comment Share on other sites More sharing options...
Florent Posted May 8, 2015 Share Posted May 8, 2015 Hello,I know this is an old post, but I wondered if you found a solution.Indeed, I tried to add ORDER BY information on Blocklayered.php without success. I also think there is something to do elsewhere.Thanks,Florent 1 Link to comment Share on other sites More sharing options...
tumil Posted July 28, 2016 Share Posted July 28, 2016 Well, i think I'll refresh this one... Stil no solution? 1 Link to comment Share on other sites More sharing options...
Sharak Posted November 10, 2017 Share Posted November 10, 2017 Can't find any proper solution. Even if you make proper changes in sql query, all features' values are generated still in default order. Only workaround I've come up with is to add some number combination to each value and remove this part in .tpl file. Example: Feature: SIZE Values (in order presta is using): L M S XL XXL What we want is: S M L XL XXL So you need to change vaules to: 01_S 02_M 03_L 04_XL 05_XXL To avoid this in url just fill URL field without this added part. Now in /themes/your_theme/modules/blocklayered/blocklayered.tpl find (around line 100 in 1.6.1.17): <label for="layered_{$filter.type_lite}_{$id_value}"{if !$value.nbr} class="disabled"{else}{if isset($filter.is_color_group) && $filter.is_color_group} name="layered_{$filter.type_lite}_{$id_value}" class="layered_color" data-rel="{$id_value}_{$filter.id_key}"{/if}{/if}> {if !$value.nbr} {$value.name|escape:'html':'UTF-8'}{if $layered_show_qties}<span> ({$value.nbr})</span>{/if} {else} <a href="{$value.link}"{if $value.rel|trim != ''} data-rel="{$value.rel}"{/if}>{$value.name|escape:'html':'UTF-8'}{if $layered_show_qties}<span> ({$value.nbr})</span>{/if}</a> {/if} </label> and change both {$value.name|escape:'html':'UTF-8'} to {$value.name|escape:'html':'UTF-8'|regex_replace:"/^[0-9][0-9]_/":""} or {$value.name|escape:'html':'UTF-8'|regex_replace:"/^\d\d_/":""} This will remove all double digits followed by _ from the beginning of each label. You can choose whatever you want to add to values names. Just make sure your regex is correct. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now