Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

entering a new products description


Guest

Recommended Posts

Posted

2 quick questions that must have been answered at some point but I can't find them.

 

1. When I enter a new products description into the text box, the preview and final output don't show any carriage returns. I have to manually place html break code to get the output I want. Is it possible to change some code somewhere so that it will recognize carriage returns?

 

2. On the main page in the "New products for month" box, I would like get these products to rotate from ALL the products that we're placed that month. I'm sure I've seen the answer to this one at some point. The problem I'm having is that the box will only show the most recent items placed.

 

I've got pretty good HTML and CGI skills but with PHP I'm a newbie.

Any help would be great.

By the way this software is awesome!

Posted

1. Look at HTML WYSIWYG Editor for Product Desc, MS1 2.2 contribution.

 

2. In /catalog/includes/modules/new_products.php change

 

 new contentBoxHeading($info_box_contents);

 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_date_added desc 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_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 }

 

to

 

 new contentBoxHeading($info_box_contents);

list($usec, $sec) = explode(' ', microtime());
 srand( (float) $sec + ((float) $usec * 100000) );
 $random_sort = rand();

 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 rand($random_sort) desc 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 rand() desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 }

while (!succeed) {try()};

 

GMT -6:00

Posted

Thanks for the reply. I tried the code and I still get the same 9 items popping up (its set to 9) on the home page even though there we're hundreds put in this month.HMMMM!

 

Any thoughts?

Archived

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

×
×
  • Create New...