Jump to content
Sign in to follow this  
crrrum

Several Random Products

Recommended Posts

you will admin it thru the specials admin part, quoting roy above:

"The install file tells you that you can change "Selection of Products on Special".--"

 

and if you want your entire catalog to loop then follow his other instruction here:

But if you want, you can modify the sql line:

$random_products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' order by rand() limit " . MAX_RANDOM_SELECT_SPECIALS);

 

if you lop off everything after rand() so that it looks like rand()" );, that will select everything."

 

If the info box is empty be sure you uploaded the javascript files in the package--that is most likely the cause


"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Share this post


Link to post
Share on other sites
If the info box is empty be sure you uploaded the javascript files in the package--that is most likely the cause

Thanks for your answer - i think I had a conflict with some other js, but it works now.

Share this post


Link to post
Share on other sites

pretty nice contribution...works great:)

1 thing I did like to find out is if we can add a loop so it doesnt stop after a certain number....lets say if I use Specials as per original contribution or without...setting a infinite loop will be a great idea.

 

any suggestions???


Simple Add-ons Please add simple plain tips here for others.

Share this post


Link to post
Share on other sites

I use this contribution as a module instead of a box. I display it at the top of each category to rotate through various products. You can see an example here. I changed the random_products.php file a little bit so that it displays only products from the current category and it's subcategories.

 

Download Version 1.2

 

I hope someone finds this useful!

Share this post


Link to post
Share on other sites
I use this contribution as a module instead of a box. I display it at the top of each category to rotate through various products. You can see an example here. I changed the random_products.php file a little bit so that it displays only products from the current category and it's subcategories.

 

Download Version 1.2

 

I hope someone finds this useful!

I had a quick look at it and could not find install instructions for your version, so I uploaded the random_products.php file and it was empty. The previous version worked as a box. How do we get yours working? I like the idea and would really like to have both the box and module version working independently.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
I had a quick look at it and could not find install instructions for your version, so I uploaded the random_products.php file and it was empty. The previous version worked as a box. How do we get yours working? I like the idea and would really like to have both the box and module version working independently.

 

Since my module is really entirely different than the original contribution, I've uploaded it as a new contribution. You can download it here. I have updated the install files and everything should be easy and ready to go. Enjoy!

Edited by beachkitty85

Share this post


Link to post
Share on other sites
Since my module is really entirely different than the original contribution, I've uploaded it as a new contribution. You can download it here. I have updated the install files and everything should be easy and ready to go. Enjoy!

Thanks Christina, I will give it a go. It is fatastic that you are sharing this with us.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
Since my module is really entirely different than the original contribution, I've uploaded it as a new contribution. You can download it here. I have updated the install files and everything should be easy and ready to go. Enjoy!

Hi Christina

 

I am having problems getting the products to display. I fixed the src="jscripts/ location error, but the problem seems to be in

 

<?php

if (isset($current_category_id) && ($current_category_id > 0)) {

$random_products_query = tep_db_query("select distinct p.products_id, p.products_price, p.products_tax_class_id, p.products_image, p.products_model, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by rand() limit " . MAX_RANDOM_SELECT_SPECIALS);

} else {

$random_products_query = tep_db_query("select distinct p.products_id, p.products_price, p.products_tax_class_id, p.products_image, p.products_model, pd.products_name from " . TABLE_PRODUCTS . " p, " . 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 rand() limit " . MAX_RANDOM_SELECT_SPECIALS);

}


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
Hi Christina

 

I am having problems getting the products to display. I fixed the src="jscripts/ location error, but the problem seems to be in

 

<?php

if (isset($current_category_id) && ($current_category_id > 0)) {

$random_products_query = tep_db_query("select distinct p.products_id, p.products_price, p.products_tax_class_id, p.products_image, p.products_model, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by rand() limit " . MAX_RANDOM_SELECT_SPECIALS);

} else {

$random_products_query = tep_db_query("select distinct p.products_id, p.products_price, p.products_tax_class_id, p.products_image, p.products_model, pd.products_name from " . TABLE_PRODUCTS . " p, " . 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 rand() limit " . MAX_RANDOM_SELECT_SPECIALS);

}

 

I'm gonna be totally honest with you - I know absolutely nothing about PHP or JavaScript. I just peiced this together from a few things and it seemed to work great for me. I hope someone is able to help you. Sorry!

Share this post


Link to post
Share on other sites
I'm gonna be totally honest with you - I know absolutely nothing about PHP or JavaScript. I just peiced this together from a few things and it seemed to work great for me. I hope someone is able to help you. Sorry!

No need to be sorry. You did a great job.

I will try it in an unmodified store tomorrow.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
I'm gonna be totally honest with you - I know absolutely nothing about PHP or JavaScript. I just peiced this together from a few things and it seemed to work great for me. I hope someone is able to help you. Sorry!

Hi Christina

 

You did the same as me with your latest version (Category Slideshow v1.0_1_2.zip)

 

You need to either change the js directory to jscripts or in category_slideshow.php change the jscrits directory to js.

 

I tried on a fresh osc and could not get it to work. It turns out the problem is in category_slideshow.php where it says

 

$random_products_script .= "'" . LARGE_IMAGE_WIDTH . "',";

$random_products_script .= "'" . LARGE_IMAGE_HEIGHT . "',";

 

I changed the large to small and it worked, so maybe there is another contrib or something that needs to be done also.

 

I also found that it interferes with the several random products v1.1 contrib which I really like. So I guess it is a choice of one or the other.

 

Anyway, good job Christina.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
Hi Christina

 

You did the same as me with your latest version (Category Slideshow v1.0_1_2.zip)

 

You need to either change the js directory to jscripts or in category_slideshow.php change the jscrits directory to js.

 

I tried on a fresh osc and could not get it to work. It turns out the problem is in category_slideshow.php where it says

 

$random_products_script .= "'" . LARGE_IMAGE_WIDTH . "',";

$random_products_script .= "'" . LARGE_IMAGE_HEIGHT . "',";

 

I changed the large to small and it worked, so maybe there is another contrib or something that needs to be done also.

 

I also found that it interferes with the several random products v1.1 contrib which I really like. So I guess it is a choice of one or the other.

 

Anyway, good job Christina.

 

I just uploaded ANOTHER package, lol. I fixed the issues you brought up, so it should work now. :blush:

Share this post


Link to post
Share on other sites
I just uploaded ANOTHER package, lol. I fixed the issues you brought up, so it should work now. :blush:

Sorry, I knew of one other error in category_slide_show.php.

 

Line 67

 

$info_box_contents[] = array('text' => BOX_HEADING_RANDOM_PRODUCTS);

 

should be

 

$info_box_contents[] = array('text' => BOX_HEADING_CATEGORY_SLIDESHOW);

 

The thing with the

$random_products_script .= "'" . LARGE_IMAGE_WIDTH . "',";

$random_products_script .= "'" . LARGE_IMAGE_HEIGHT . "',";

 

is that "something" needs to be specified as LARGE_IMAGE and I was wondering what contrib you used to get the LARGE_IMAGE to work.

 

I use a fairly old contrib that I am planning to change. It is called Big Image and it inserted an sql query called products_bimage

 

The problem with specifying SMALL_IMAGE is that only a thumbnail appears.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
Sorry, I knew of one other error in category_slide_show.php.

 

Line 67

 

$info_box_contents[] = array('text' => BOX_HEADING_RANDOM_PRODUCTS);

 

should be

 

$info_box_contents[] = array('text' => BOX_HEADING_CATEGORY_SLIDESHOW);

 

The thing with the

$random_products_script .= "'" . LARGE_IMAGE_WIDTH . "',";

$random_products_script .= "'" . LARGE_IMAGE_HEIGHT . "',";

 

is that "something" needs to be specified as LARGE_IMAGE and I was wondering what contrib you used to get the LARGE_IMAGE to work.

 

I use a fairly old contrib that I am planning to change. It is called Big Image and it inserted an sql query called products_bimage

 

The problem with specifying SMALL_IMAGE is that only a thumbnail appears.

 

I use UltraPics for my images and it's awesome. You can have a popup image, primary image, about 6 large images and 6 small images. That could be a little off because its all from memory. So is that the last error that you know of? I'm getting ready to go out of town, so I'll post the final package (well, hopefully it's the final one) when I get back on Monday. Thanks for the heads up!

Share this post


Link to post
Share on other sites
I use UltraPics for my images and it's awesome. You can have a popup image, primary image, about 6 large images and 6 small images. That could be a little off because its all from memory. So is that the last error that you know of? I'm getting ready to go out of town, so I'll post the final package (well, hopefully it's the final one) when I get back on Monday. Thanks for the heads up!

OK, will check ultrapics.

 

Leave file at large image and perhaps suggest that ultrapics be installed?


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
OK, will check ultrapics.

 

Leave file at large image and perhaps suggest that ultrapics be installed?

I meant to add that I do not know of any more errors.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

Hello,

 

I also installed this nice contri.But I have a question.

 

My product pics will shown up with the product text underneath it.

But the product text is to big.Is it possible to make it smaller and make it the same as the product _info in the other boxes.

 

Regards

Nico

Share this post


Link to post
Share on other sites

Very nice and easy contribution! :thumbsup:

 

QUESTION:

Is it possible to show just the latest Products usually seen on the front page???

Share this post


Link to post
Share on other sites

got it...

 

if you want to show your latest products just replace on top of "random_products.php" the following lines:

 

  if (isset($current_category_id) && ($current_category_id > 0)) {
$random_products_query = tep_db_query("select distinct p.products_id, p.products_price, p.products_tax_class_id, p.products_image, p.products_model, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by rand() limit "  . MAX_RANDOM_SELECT_SPECIALS);
 } else {
$random_products_query = tep_db_query("select distinct p.products_id, p.products_price, p.products_tax_class_id, p.products_image, p.products_model, pd.products_name from " . TABLE_PRODUCTS . " p, " . 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 rand() limit "  . MAX_RANDOM_SELECT_SPECIALS);
 }

 

with

 

$random_products_query = tep_db_query("select distinct p.products_id, p.products_price, p.products_tax_class_id, p.products_image, p.products_model, pd.products_name from " . TABLE_PRODUCTS . " p, " . 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 products_date_added desc limit "  . MAX_RANDOM_SELECT_SPECIALS);

Share this post


Link to post
Share on other sites

Hello People,

 

I have a problem with this contribution, please help me out:

 

Problem:

Random box is empty, no products are showing, even if i put the products on special prices. If i put special prices another box will appear on the index, but no products are filling up the random box.

 

What did i do:

1. Put the require code in colum left under the information box.

2. Put the define in english.php

3. Uploaded the js file with the 3 files with a FTP program to catalog.

 

This close!

 

Please help

Thanks

Share this post


Link to post
Share on other sites

Hello,

I've installed it. It workds perfectly with firefox but not with IE7. I can see only the prices but no images inside the box on IE7.

Could you help

Thanks

Share this post


Link to post
Share on other sites

The scriptaculous.js that this contribution uses conflicts with moo tools, light box, shadow box etc. Has anyone got a work around for it?


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×