Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

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

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

Locked

Started by alex_clarke on 27 Mar 2008, 2:55 PM · Views: 4,062

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?

My Contributions: Zen Lightbox | Best Sellers Reloaded

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

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,741
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 -

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

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. :)

My Contributions: Zen Lightbox | Best Sellers Reloaded

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

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
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?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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?

My Contributions: Zen Lightbox | Best Sellers Reloaded

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

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
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:

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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'?

My Contributions: Zen Lightbox | Best Sellers Reloaded

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

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
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.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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.

My Contributions: Zen Lightbox | Best Sellers Reloaded

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

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
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.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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')

My Contributions: Zen Lightbox | Best Sellers Reloaded

5 Apr 2008, 5:20 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
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.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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.)