Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Whats new box on left column


Guest

Recommended Posts

Posted

I am trying to get this store ready to roll out and for some reason the whats new box on the left side column shows no graphic. I track it down to a whats new. php file and it runs a random function to pull stuff from the database. Does anyone know what could be the problem or how can test to see if the function is returning any results?

 

Thanks

Rida

Posted

tried that, changed the date for today and still nothing shows up. any ideas..

Posted

Are the products enabled and Admin > Configuration > Maximum values the Selection of Random New Products setting is greater than 0

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Posted

Yes maximum is set to 10, and the product is enabled and I have it set to 1 in inventory.

 

any other ideas why nothing shows. just a missing image place holder. Also looking at the properties it shows no image file when I click on the place holder and look at the path its suppose to show.

 

Are the products enabled and Admin > Configuration > Maximum values the Selection of Random New Products setting is greater than 0

Posted

The products *does* have an image file and the catalog/images folder is set to 777 permissions correct?

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Posted

yes the catalog/images is set to 777 and the rest of the product images show up when you browse through the products. Just the whats new box shows nothing. Its almost as if the function is not working or returning anything, I wish I could test the function.

I am not sure how.

thanks

 

The products *does* have an image file and the catalog/images folder is set to 777 permissions correct?

Posted

Edit the catalog/includes/functions/general.php file, find the tep_random_select() function definition and after the

    $num_rows = tep_db_num_rows($random_query);

line add

print_r($num_rows);

and see how many rows the query is returning.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Posted

ok thanks for the info, thats a good troubleshooting technique. well it prints a 0 so no records are being returned.

 

whats my next step?

Thanks in advance

Edit the catalog/includes/functions/general.php file, find the tep_random_select() function definition and after the

 ? ?$num_rows = tep_db_num_rows($random_query);

line add

print_r($num_rows);

and see how many rows the query is returning.

Posted

After

  function tep_random_select($query) {
   $random_product = '';

insert

print_r($query);

 

That should print out the entire query statement. If it looks correct to you syntax wise, paste that statement into a SQL window in PHPMyAdmin and see if you can determine what is preventing records from being selected.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Posted

hee I learn fast, already did that, checking the query in phpadmin now.

 

I will let you know.. in a few...

 

After

 ?function tep_random_select($query) {
? ?$random_product = '';

insert

print_r($query);

 

That should print out the entire query statement. If it looks correct to you syntax wise, paste that statement into a SQL window in PHPMyAdmin and see if you can determine what is preventing records from being selected.

Posted

something strange, in the query, all the fields that are checked have a p in the front. example p.product_id. and that field in the products table does not have this. I am going to try to change the query up to make it return something.

 

am I on the right track?

Posted

here is the query. I don't understand the m after manufacturer:

 

SELECT

p.products_id, p.products_name, p.products_image, p.manufacturers_id, m.manufacturers_name from products p, manufacturers m where p.products_status='1' and p.manufacturers_id = m.manufacturers_id order by p.products_date_added desc limit 100;

 

 

what do you think?

 

something strange, in the query, all the fields that are checked have a p in the front. example p.product_id. and that field in the products table does not have this. I am going to try to change the query up to make it return something.

 

am I on the right track?

Posted

ok, I think its a query problem. I was able to play with it and get it to work on the phpadmin page. I will research the original query and change it if necessary.

Thanks for pointing me in the right direction. I feel as if I can solve it now. Thanks

 

rida...

 

 

here is the query. I don't understand the m after manufacturer:

 

SELECT

p.products_id, p.products_name, p.products_image, p.manufacturers_id, m.manufacturers_name from products p, manufacturers m where p.products_status='1' and p.manufacturers_id = m.manufacturers_id order by p.products_date_added desc limit 100;

what do you think?

Posted

Ok,

Here was the problem. I turned manufacturers and this whats new query had some manufacturer dependancies so once I changed the query up to not have the manufacturer dependancies then it worked like a champ. Now on to the next problem. Thanks.... for all your help.

 

Rida...

 

ok, I think its a query problem. I was able to play with it and get it to work on the phpadmin page. I will research the original query and change it if necessary.

Thanks for pointing me in the right direction. I feel as if I can solve it now. Thanks

 

rida...

Posted

Glad to hear that you were able to resolve the problem. :)

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Archived

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

×
×
  • Create New...