Jump to content

Default "Sort By" Product Dropdown


Recommended Posts

I am just wondering if the Default "Sort By" Product Dropdown is working properly.

 

I am using Version 1.4.4.0

 

Anyways the dropdown selection

 

price:lowest

price:highest

product name: A to Z

product name: Z to A

In-stock first

 

Does not seem to Fire the Javascript when viewing the products on the product list page...However it does seem to work on the list produced when searching. It is able to sort the searched product list and the manufactures product list but not main product list.

 

In both cases it shows the Javascript is present as well as the Select Options.

 

It looks like the only difference is the URL that is being query'd, Is it a problem with Friendly URLS or BUG or something.

 

This Code DOES NOT WORK (Nothing Sorts)

 



<!-- Sort products -->

<script type="text/javascript">
//<![CDATA[

$(document).ready(function()
{
$('#selectPrductSort').change(function()
{
	var requestSortProducts = 'http://www.totsandteapots.com/shop/45-my-blankee';
	var splitData = $(this).val().split(':');
	document.location.href = requestSortProducts + ((requestSortProducts.indexOf('?') < 0) ? '?' : '&') + 'orderby=' + splitData[0] + '&orderway=' + splitData[1];
});
});
//]]>

</script>

<form id="productsSortForm" action="http://www.totsandteapots.com/shop/45-my-blankee">
<p class="select">

	<select id="selectPrductSort">
		<option value="position:asc" selected="selected">--</option>
						<option value="price:asc" >Price: lowest first</option>
			<option value="price:desc" >Price: highest first</option>
					<option value="name:asc" >Product Name: A to Z</option>
		<option value="name:desc" >Product Name: Z to A</option>

						<option value="quantity:desc" >In-stock first</option>
				</select>
	<label for="selectPrductSort">Sort by</label>
</p>
</form>
<!-- /Sort products -->

 

This Code IS WORKING (Sorting Fine)

 


<!-- Sort products -->

<script type="text/javascript">
//<![CDATA[

$(document).ready(function()
{
$('#selectPrductSort').change(function()
{
	var requestSortProducts = 'http://www.totsandteapots.com/shop/search?search_query=my+blankee&submit_search=Search';
	var splitData = $(this).val().split(':');
	document.location.href = requestSortProducts + ((requestSortProducts.indexOf('?') < 0) ? '?' : '&') + 'orderby=' + splitData[0] + '&orderway=' + splitData[1];
});
});
//]]>

</script>

<form id="productsSortForm" action="http://www.totsandteapots.com/shop/search?search_query=my+blankee&submit_search=Search">
<p class="select">
	<select id="selectPrductSort">

		<option value="position:asc" selected="selected">--</option>
						<option value="price:asc" >Price: lowest first</option>
			<option value="price:desc" >Price: highest first</option>
					<option value="name:asc" >Product Name: A to Z</option>
		<option value="name:desc" >Product Name: Z to A</option>
						<option value="quantity:desc" >In-stock first</option>

				</select>
	<label for="selectPrductSort">Sort by</label>
</p>
</form>
<!-- /Sort products -->

Link to comment
Share on other sites

  • 3 months later...
  • 3 months later...
  • 1 month later...

I found the same problem, but there is one difference - "sort by price" is working everywhere, "sort by name" is not working only in product-list.

 

I have solved my problem. There was my fault. For sorting files in the category view answer the file /classes/category.php.

In the beginning of the project, i has edited the line 575, adding there "sort by id". After deleting this condition, sorting is working as it must.

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

×
×
  • Create New...