Admin First/Last Category Sort bug

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Admin First/Last Category Sort bug

Post by jmestep » Wed Apr 28, 2010 12:35 pm

Mazhar, one of our clients is getting frustrated with this bug

http://bugs.ablecommerce.com/show_bug.cgi?id=8585

Is there a page code fix you could post here for it?
Thanks
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Admin First/Last Category Sort bug

Post by mazhar » Wed Apr 28, 2010 12:50 pm

Here is the complete page of category sorting with fix applied.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Admin First/Last Category Sort bug

Post by jmestep » Thu Apr 29, 2010 7:58 am

Thanks, Mazhar. I tweaked the code in a 703 store, so I'll post the pertinent section here in case someone doesn't want to replace the entire file.

Code: Select all

In Admin/Catalog/SortCategory.aspx -- around line 22
Change
tempVal = sel[tempIndex].value;
	    tempText = sel[tempIndex].text;
	    sel[tempIndex].text = sel[newIndex].text;
	    sel[tempIndex].value = sel[newIndex].value;
	    sel[newIndex].text = tempText;
	    sel[newIndex].value = tempVal;
	    sel.selectedIndex = newIndex

to 

for(;tempIndex>newIndex;tempIndex--)
	    {
	        nextIndex = tempIndex-1; 
	        tempVal = sel[tempIndex].value;
	        tempText = sel[tempIndex].text;
	        sel[tempIndex].text = sel[nextIndex].text;
	        sel[tempIndex].value = sel[nextIndex].value;
	        sel[nextIndex].text = tempText;
	        sel[nextIndex].value = tempVal;
	        sel.selectedIndex = newIndex
	    }
Forgot to post this part

Code: Select all

around line 53
change 

tempVal= sel[tempIndex].value;
	    tempText = sel[tempIndex].text;
	    sel[tempIndex].text = sel[newIndex].text;
	    sel[tempIndex].value = sel[newIndex].value;
	    sel[newIndex].text = tempText;
	    sel[newIndex].value = tempVal;
	    sel.selectedIndex = newIndex   

to

for(;tempIndex<newIndex;tempIndex++)
	    {
	        nextIndex = tempIndex+1;
	        tempVal= sel[tempIndex].value;
	        tempText = sel[tempIndex].text;
	        sel[tempIndex].text = sel[nextIndex].text;
	        sel[tempIndex].value = sel[nextIndex].value;
	        sel[nextIndex].text = tempText;
	        sel[nextIndex].value = tempVal;
	        sel.selectedIndex = newIndex
	    }
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Falala
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 33
Joined: Thu Dec 21, 2006 1:34 pm
Contact:

Re: Admin First/Last Category Sort bug

Post by Falala » Wed Oct 27, 2010 11:48 am

Thanks, this was very helpful.

Post Reply