<xsl:apply-templates select="document(concat('udata://catalog/getSmartCatalog//', page/@id, '///5/', document('utype://catalog-object')//field[@name='price']/@name ,'/', $sort_direction,'/'))/udata" />
<xsl:template match="/result[@method = 'category'][count(/result/parents/page) > 0]">
<xsl:choose>
<xsl:when test="$sort_field = 'Price'">
<xsl:apply-templates select="document(concat('udata://catalog/getSmartCatalog//', page/@id, '///5/', document('utype://catalog-object')//field[@name='price']/@name ,'/', $sort_direction,'/'))/udata" />
</xsl:when>
<xsl:when test="$sort_field = 'Name'">
<xsl:apply-templates select="document(concat('udata://catalog/getSmartCatalog//', page/@id, '///5/', document('utype://catalog-object')//field[@name='title']/@name ,'/', $sort_direction,'/'))/udata" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="document(concat('udata://catalog/getSmartCatalog//', page/@id, '///5/'))/udata" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Для начала, обратите внимание что там, где сортировка работает корректно, есть перезагрузка страницы.
А затем, посмотрите js код, который делает это без перезагрузки http://ruki24.ru/templates/demodizzy/js/__common.js
P.S. Логотип огонь )
jQuery('a', '.catalog .change .sort').click(function() {
var reactive = jQuery(this).hasClass('reactive');
...
jQuery('a', '.catalog .change .sort').click(function() {
var reactive = jQuery(this).hasClass('reactive');
if(jQuery('.content .numpages').get(0)) {
if(jQuery(this).hasClass('sort-price')) {
jQuery.cookie('sort_field', 'Price', {path: '/'});
} else if( jQuery(this).hasClass('sort-name') ) {
jQuery.cookie('sort_field', 'Name', {path: '/'});
} else if( jQuery(this).hasClass('sort-stock') ) {
jQuery.cookie('sort_field', 'Stock', {path: '/'});
}
if(reactive) {
jQuery.cookie('sort_direction', '0', {path: '/'});
} else {
jQuery.cookie('sort_direction', '1', {path: '/'});
}
location.reload(true);
} else {
....................
}
location.reload(true);
});