For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Monday, September 21, 2015

Product color drop down is not sort order in magento admin panel

Problem:

In Magento admin Manage product section drop down is not in sort order.

Product color drop down is not sort order in magento admin panel


Go into backend magento admin ----> catalog ----> Manage Products --- under product colour when you click on a colour a dropdown will appear ---- then this will give you a list of colours
For some reason the colours are not in alphabetical order
See the image

drop down is not in sort order



Solution:

just open the file "app/design/adminhtml/default/default/template/catalog/product.phtml"
and paste below code. Please note that I am still working on this issue and updating the script so please wait. till than you can use the script

<script>
var $j = jQuery.noConflict();
function SortBox(x, y) {
    if (x.innerHTML == 'NA') {
        return 1;
    }
    else if (y.innerHTML == 'NA') {
        return -1;
    }
    return (x.innerHTML > y.innerHTML) ? 1 : -1;
}

function dook(){
 $j('select').each(function( index ) {
     $j(this).find('option').sort(SortBox).appendTo($(this));
});
}
var myVar = setInterval(function(){ dook() }, 5000);
</script>

Share:

0 comments:

Post a Comment

Unable to resolve <website url> Try checking the for validity Google Pagespeed Insights

Unable to resolve <website url> Try checking the for validity Google Pagespeed Insights   You have a website and want to test it'...

Ads Inside Post

Powered by Blogger.

Arsip