Jump to content

Want to Add 3 Random Image Products to Column


Guest sunshine

Recommended Posts

Guest sunshine

Hi Everyone,

Need help please. The template has 3 columns; left for nav, language, etc. The middle is the main content. Now, for the right being the 3rd column, I would like to have 3 or 4 boxes that will provide random images of items that come from a particular category(department) identified in the nav bar. The customer, if interested in seeing this can click the pic and will be taken straight to the product. Just like the 'Random Product' we now show on the main page but for specific categories. I'm taking a wild guess and saying I would be just do a 'save as' for the boxes/random_prods but config wise I don't know.

Link to comment
Share on other sites

Guest sunshine

I tried just adding 3 random products to the right column. Every product that came up was the same. I'd like the products to be different in each box.

Link to comment
Share on other sites

Guest sunshine

Hi Sir William :w00t: ,

Here's my 'code' and it wasn't very creative as you can see

<div class="colRight">

  {SHOPPING_CART}

  {RANDOM_PROD}

  {RANDOM_PROD}

  {RANDOM_PROD}

	</div>

:wacko: I simply input 'Random Prod' 3 times. The action above is due to having gone blank without my vitamins in narly a week. I went through the English Language folder to see if I could find anything specific related to the nav categories, as the intended idea was to do a 'save as' on the random product tpl and adjust it for the nav (departments).

Link to comment
Share on other sites

Ok, I can't test this (I don't have enough products in my store to be effective), but it *should* work just fine.

In your template, do this:

<div class="colRight">

 {SHOPPING_CART}

 {RANDOM_PROD}

 {RANDOM_PROD2}

 {RANDOM_PROD3}

</div>


Then in /index.php, add a call for RANDOM_PROD2 & 3 as such:


	include("includes/boxes/randomProd.inc.php");

	$body->assign("RANDOM_PROD",$box_content);

	

	include("includes/boxes/randomProd.inc.php");

	$body->assign("RANDOM_PROD2",$box_content);

	

	include("includes/boxes/randomProd.inc.php");

	$body->assign("RANDOM_PROD3",$box_content);

What that should do is call the randomProd.inc.php file for each requested random product. It will choose a different product each time it's called. Now there is the chance that two instances will choose the same product, but it is reasonably unlikely. If you'd like a guaratee of three different random products, I'd have to rewrite some stuff....which I'm not willing to jump into as a freebie. :w00t:

Link to comment
Share on other sites

Guest sunshine

Thank you Sir William,

I'm going to try that in a little while and post back with results.

I do have a mod request for you :w00t: Need to get a sample and I'll email you today with the info then you can give me price.

Link to comment
Share on other sites

A very good and simple solution. By tweaking a few other files, you can display a group of randoms in the center column! Sounds like grounds for a new free tutorial in the minor mods section :(

@ Sir William, what'd really be cool would be to have a row of three, and a script that says when and if the three all displayed the same image simultaneously, a large JACKPOT sign will flash :)

Link to comment
Share on other sites

Guest sunshine

I slept like a baby last night, all night :)

@ :( Didn't ya already know about Marks flash fetish :)

@Markscarts Good idea for tutorials. Maybe you can add in how to move the shopping cart to the top header area where search is now. This way we can get rid of the third row altogether and being that the left nav isn't good for the little search' 'bots.

Link to comment
Share on other sites

  • 2 months later...

Ok, I can't test this (I don't have enough products in my store to be effective), but it *should* work just fine.

In your template, do this:

<div class="colRight">

 {SHOPPING_CART}

 {RANDOM_PROD}

 {RANDOM_PROD2}

 {RANDOM_PROD3}

</div>


Then in /index.php, add a call for RANDOM_PROD2 & 3 as such:


	include("includes/boxes/randomProd.inc.php");

	$body->assign("RANDOM_PROD",$box_content);

	

	include("includes/boxes/randomProd.inc.php");

	$body->assign("RANDOM_PROD2",$box_content);

	

	include("includes/boxes/randomProd.inc.php");

	$body->assign("RANDOM_PROD3",$box_content);

What that should do is call the randomProd.inc.php file for each requested random product. It will choose a different product each time it's called. Now there is the chance that two instances will choose the same product, but it is reasonably unlikely. If you'd like a guaratee of three different random products, I'd have to rewrite some stuff....which I'm not willing to jump into as a freebie. :errm:

Hi Sir

I want 3 random products too. Can't understand which files to be modified, please write the file names tobe modified :dizzy: I am using CC v 3.0.6 with killer skin

Regards

Yunus

Link to comment
Share on other sites

  • 2 weeks later...
Guest ardwyn

A big thank you once again Sir William and also to you Mark for the directions of the files. (I'm thinking of writing a script that says "Thank You Sir William" to make it easier for me.

I modded this on my site and also took the words "Featured Product" out and it does the job very well.

If You'd like to take a look Here.

Link to comment
Share on other sites

Very, very cool, ardwyn.

I took that principle yesterday, and came up with this design showing three randoms.

The top pic would look best if your main product pix are at least 300 px wide. Some of these sample item pics are very small and get stretched with this design, but you can get the idea I hope:

http://allservico.com/skinTest/

Link to comment
Share on other sites

Heads up in 800x600 mark the site doesn't fit when it comes to most of the pages with that design... and on the homepage the latest products are all in 1 column...

Looks great but think would only work in a 2 column design...

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
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...