Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Several Random Products


Guest

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"

Link to comment
Share on other sites

  • 2 months later...

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.
Link to comment
Share on other sites

  • 5 months later...

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!

Link to comment
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.

Link to comment
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
Link to comment
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.

Link to comment
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);

}

Link to comment
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!

Link to comment
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.

Link to comment
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.

Link to comment
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:

Link to comment
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.

Link to comment
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!

Link to comment
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?

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

  • 2 weeks later...

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);

Link to comment
Share on other sites

  • 2 months later...

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

Link to comment
Share on other sites

  • 5 months later...
  • 5 months later...

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...