Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

bug in product_listing.php


jhdesign

Recommended Posts

Posted

I'm no SQL expert but when viewing product_listing on my site the products are ordered like this: (I gave each product name a number and this is how it showed up).

 

10

1

11

12

....

20

2

21

22..

 

This is wrong it should be 1,2,3,4...10,11..20,21...etc

 

Wondering if there is a solution for this?

 

Any help is greatly appreciated!

Posted

Ordering should be

 

1

10

11

12

.

.

.

2

20

21

22

 

This is expected because product names are strings, not numbers. (For an example, create some files on your harddrive called 1.txt, 2.txt, 11.txt, 21.txt, etc. and order them by name. You should get a similar ordering because filenames are also considered strings and are ordered thus.)

 

However, if you're really getting

 

10

1

11

12

.

.

.

20

2

21

22

 

I would find this rather unusual.

Contributions

 

Discount Coupon Codes

Donations

Posted
Ordering should be

 

1

10

11

12

.

.

.

2

20

21

22

 

This is expected because product names are strings, not numbers. (For an example, create some files on your harddrive called 1.txt, 2.txt, 11.txt, 21.txt, etc. and order them by name. You should get a similar ordering because filenames are also considered strings and are ordered thus.)

 

However, if you're really getting

 

10

1

11

12

.

.

.

20

2

21

22

 

I would find this rather unusual.

 

Thanks for this, didnt realize that. But how does OSC sort out the product on this page? (product listing).

 

Jacob

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...