Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Display Order


daxcastro

Recommended Posts

WOW! Thanks. Just what I was looking for.......

 

BUUUUUT....

 

I went through all the edits and modified all the files and in their own catagories they sort like I want.....

 

 

BUUUUUT....

 

the "What's New" Start page is uneffected by the sort order.

 

I need to sort that area as well.

 

Any more wisdom from your fountain of knowledge.

 

Thanks again for pointing me in the right direction.

 

Dax

Link to comment
Share on other sites

We have the same problem in our store and once i get more accustomed with that I'm going to write a mod to fix it.

 

One thing you can try is setting the dates of the items entered further back in time to the ones you want to display on that front page.

Link to comment
Share on other sites

@dax, i wanted to do somethign a little different from you and that was to choose if i wanted to display or not to display items on the new products page.

 

i added a new field to the products table, a 1 digit char field where i put N for no if i didnt want it displayed.

 

if you open this file \catalog\includes\modules\new_products.php

 

on line 21 is the following line

 

if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

 

 

at the end of the two "$new_products_query = " statements I added my field and select contrainst (and p.products_dspInFront <> 'N' ) before the Order By bit.

 

"....and p.products_dspInFront <> 'N' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);"

 

My guess is that you can insert your own sort field instead and use a new ORDER BY command to disaply the records as you wish.

 

hope that helps.

Link to comment
Share on other sites

I think I found it, but now what......

 

Okay.. I found the contribution for sorting products and installed it fine like I said.

 

Now for the products_new.php page.... This is the part where is lists and sorts the products...

------------------------------------------------

 

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id,p.products_sort_order, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";

--------------------------------------------------

 

If I edit this line.....

----------------------

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id,p.products_sort_order, m.manufacturers_name from " .

 

and

 

order by p.products_date_added DESC, pd.products_name

----------------------

 

to look at the sort column that is in the same products table

-----------------------

order by p.products_sort_order DESC";

------------------------

 

then you would think it would sort by my sort order right?

 

Well.. it doesn't

 

Anyone have any grains of wisdom?

 

Thanks

Dax

Link to comment
Share on other sites

Okay.. so maybe I am clueless here..

 

I mean I thought that products_new was the page that was appearing in the center of the index page and calling the items in that center box.

 

I guess I was wrong. because, products_new.php

 

and

 

the default homepage are different.

 

So infact.. it does work the way I modified it.

 

NOWWWWW... to find the code for the images on the index page....

 

Sorry if I seem link I am ranting.

 

Dax

Link to comment
Share on other sites

I FOUND IT!!!!

 

 

was looking for products_new.php when I should have been looking for new_products.php

 

Changed them both and now it works like a charm.

 

Hope that helps the next person and keeps them from pulling their hair out too!!!

 

Changed line

 

if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_sort_order asc limit " . MAX_DISPLAY_NEW_PRODUCTS);

} else {

$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_sory_order asc limit " . MAX_DISPLAY_NEW_PRODUCTS);

Link to comment
Share on other sites

Probably...but since I am not a php person, I am sure I just misunderstood. I am really more of a graphic designer you can stumle through code than an actual person who can program or write php. LOL.

 

Thanks for your help nontheless.

 

Dax

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...