Zen Cart Logo
Forums / Basic Configuration / Featured Product Sidebox - manufacturer

Featured Product Sidebox - manufacturer

Locked

Views: 1,778

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
23 Sep 2007, 6:37 AM
#1
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Featured Product Sidebox - manufacturer

Hey everyone,

I'm just wondering. My client wants the Featured Products Sidebox to show the manufacturer name below the image instead of the product name.

She wants the same thing on the Featured product center module.

Can you guys point me in the right direction?

Thank you in advance.

Adam.

6 Oct 2007, 8:28 PM
#2
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Featured Product Sidebox - manufacturer

Does anyone have any idea for this one?

I only need to replace the product name with the manufacturer name in the Featured Product Sidebox.

Any advice would be really appreciated.

Thanks.

10 Oct 2007, 6:58 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Featured Product Sidebox - manufacturer

You need to customize the featured sidebox select statement to obtain the manufactuer's name and then alter the information that is displayed to use that manufacturer's name vs the product's name ...

Be sure to use the templates and overrides for this ... :smile:

10 Oct 2007, 7:16 PM
#4
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Featured Product Sidebox - manufacturer

Oh, thank you ajeh. to the rescue...

i've been looking for a sidebox that would call the manufacturers name that i could compare it to.

if you know of one could you please let me know?

Thank you.

And of course, i'm overrided to the hilt.http://www.zen-cart.com/forum/images/smilies/smile.gif

12 Oct 2007, 1:23 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Featured Product Sidebox - manufacturer

There are a couple ways to do this ...

You can look up the manufacturer's name with a function after the product is selected for display ... or you can add on to the existing select statement with a LEFT JOIN and get the manufacturer's name at the same time ...

It depends on how tricky you like to get with the SELECT statements ... :smile:

12 Oct 2007, 1:33 AM
#6
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Featured Product Sidebox - manufacturer

Thank you so much for your attention Ajeh.

But I think I'm gonna have to post this on in the "ZenCart developer for hire section" or something.

if i can't find it and copy and edit them. i'm in trouble... (still learning the PHP thing)

Thanks again.

In other words, my SELECT statements are 'not so tricky' ... :)

12 Oct 2007, 4:53 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Featured Product Sidebox - manufacturer

Handy little function for a quick fix is using a built in function:
zen_get_products_manufacturers_name($random_featured_product->fields['products_id'])

12 Oct 2007, 6:53 AM
#8
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Featured Product Sidebox - manufacturer

 
<?php
/**
 * Featured Side Box Template showing Manufacturer's Name
 * original modified by dezinacart.com
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license [URL]http://www.zen-cart.com/license/2_0.txt[/URL] GNU Public License V2.0
 * @version $Id: tpl_featured.php 2982 2006-02-07 07:56:41Z birdbrain $
 */
  $content = "";
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
  $content .= '<a href="' . zen_href_link(zen_get_info_page($random_featured_product->fields["products_id"]), 'products_id=' . $random_featured_product->fields["products_id"]) . '">' . zen_image(DIR_WS_IMAGES . $random_featured_product->fields['products_image'], $random_featured_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . $random_featured_product->fields['products_name'] . '</a><br />' . $featured_box_price;
  $content .= '<div class="centeredContent">' . zen_get_products_manufacturers_name($random_featured_product->fields['products_id']). '</div>';
  $content .= '</div>';
?>
 

Adds manufacturer's name(if there is one entered) to featured sidebox

12 Oct 2007, 8:26 AM
#9
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Featured Product Sidebox - manufacturer

You guys are absolutely incredible.

it worked perfect.

And now I promise I will learn how this particular function got called.

Can't thank you enough Misty and Ajeh.

As always...

12 Oct 2007, 7:21 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Featured Product Sidebox - manufacturer

Glad that this worked for you ... :smile:

NOTE: Peek through the /functions ... you'd be amazed at how many things can be solved utilizing them in your own customizations ...

Sometimes, you can use them as a model for custom functions or help obtain the syntax for adding new data without the need for additional selects on the database ...

The LEFT JOIN would get the extra data at the same time the original data is gathered ...

The functions require an additional lookup or select that in most cases have little affect on things ... but other times, you may want to be more efficient in your code and look to the LEFT JOIN as an alternative solution ...