Zen Cart Logo
Forums / General Questions / Product Listing Sort Error (sort by price ... doesn't)

Product Listing Sort Error (sort by price ... doesn't)

Locked

Views: 4,061

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
27 Mar 2008, 2:55 PM
#1
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Product Listing Sort Error (sort by price ... doesn't)

I've just noticed an error on my site when I sort product listings (i.e. sort by price).

When clicking on the 'Price' column header the product listing data is sorted, but it's not correct. The listing appears to be random with products not display as price ascending/descending.

You can visit my website (adult toys retailer) by clicking on the Link in my signature.

Has anyone else experienced a similar issue?

27 Mar 2008, 6:51 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,616
Plugin Contributions:
0

Re: Product Listing Sort Error (sort by price ... doesn't)

Check you Admin> Tools> Store Manager and run the Update ALL Products Price Sorter -

27 Mar 2008, 11:22 PM
#3
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Product Listing Sort Error (sort by price ... doesn't)

Hi Kim,

Thanks for the advice... it worked great.

Is there any reason why my price sort order went 'out of sync'?

Also, I've noticed that the advanced search feature doesn't correctly filter out prices. For example, if I search for all items between £0.00 and £4.99 I'm displayed all the items below £5.00, but also one or two above £5.00 (i.e. £5.50).

Could these two issues be related?

Thanks again for the help. :)

28 Mar 2008, 7:22 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Product Listing Sort Error (sort by price ... doesn't)

Alex Clarke:

I've noticed that the advanced search feature doesn't correctly filter out prices. For example, if I search for all items between £0.00 and £4.99 I'm displayed all the items below £5.00, but also one or two above £5.00 (i.e. £5.50).Is this related to having tax-included-in-prices by any chance?

28 Mar 2008, 9:53 AM
#5
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Product Listing Sort Error (sort by price ... doesn't)

Hi DrByte,

You're correct. It was related to having tax-included-in-prices.

I set Display Prices with Tax to false in my admin and the correct products were then displayed.

I would still like to show my products inclusive of tax and also have the advanced search function take into account the tax on each product.

Is there a way to work around this?

28 Mar 2008, 9:54 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Product Listing Sort Error (sort by price ... doesn't)

Alex Clarke:

Is there a way to work around this?
Naturally.
Just rewrite the tax calculation logic :blush:

28 Mar 2008, 10:39 AM
#7
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Product Listing Sort Error (sort by price ... doesn't)

No nice admin switches!?!?! :(

Would I be correct in thinking that rewritting this code would be a big job?

Also, going back to my original post, do you know why my price sort order went 'out of sync'?

28 Mar 2008, 10:42 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Product Listing Sort Error (sort by price ... doesn't)

Alex Clarke:

Would I be correct in thinking that rewritting this code would be a big job?Yes, it's quite involved.
Alex Clarke:

Also, going back to my original post, do you know why my price sort order went 'out of sync'?
That usually happens when you use external means to update database content, such as importing or manipulating product data. When you do that, the automated calculations that update the pricing details don't fire, leaving you with unexpected results.

28 Mar 2008, 11:27 AM
#9
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Product Listing Sort Error (sort by price ... doesn't)

DrByte:

That usually happens when you use external means to update database content, such as importing or manipulating product data. When you do that, the automated calculations that update the pricing details don't fire, leaving you with unexpected results.

That makes sense, as I have a couple of scripts that update my product information (prices, special price, etc).

Now, please correct me if I am wrong, but it should be ok to setup an automated task on my server to access the following URL admin/store_manager.php?action=update_all_products_price_sorter, which would correct the price sort order.

28 Mar 2008, 1:14 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Product Listing Sort Error (sort by price ... doesn't)

Or, whenever you do an update via one of your scripts, simply call zen_update_products_price_sorter($products_id) after you apply your update. Repeat for each product you're updating.

5 Apr 2008, 1:44 PM
#11
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Product Listing Sort Error (sort by price ... doesn't)

Is it possible to us an array with this?

For example...

zen_update_products_price_sorter('product1', 'product2', 'product3')
5 Apr 2008, 5:20 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Product Listing Sort Error (sort by price ... doesn't)

No.
And, technically, what you posted was not an array either.

Nevertheless, you could always adapt the actual function to work as you desire.

17 Mar 2009, 11:02 PM
#13
alake avatar

alake

New Zenner

Join Date:
Mar 2009
Location:
Jyväskylä, Finland
Posts:
6
Plugin Contributions:
0

Re: Product Listing Sort Error (sort by price ... doesn't)

I've been trying to find the zen_update_products_price_sorter, but so far without success. I'd like to call it from within my external product loading script, if possible. (Yes, I'm a Zen Cart newbie.)