Jump to content
jcisar

Featured Product Support v1.5.4

Recommended Posts

OK, thanks for that!

I had been meaning to download it for my site for a while now but when I finally get round to it.......its gone!

 

cheers :rolleyes:

OK. Its back. You can find it by clicking on "My Contributions" link to the left under my screenname. :blink:

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Hi Bill,

 

I am using Featured Products, do you know why the prices on my homepage are not showing the special prices that I have set for the products?

 

thanks,

 

Ben

Share this post


Link to post
Share on other sites
Hi Bill,

 

I am using Featured Products, do you know why the prices on my homepage are not showing the special prices that I have set for the products?

 

thanks,

 

Ben

Ben, this should work "out of the box". Have you modified your shop other than the installation of Featured Products? I have it working without any extra modification using my Featured Products version.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

I have modded my shop quite alot and i'm using a template so naturally the code is abit of a mess. However, I just did a comparison between the original featured_products.php file and my current one and I could not see anything that may have caused it not to work.

 

The only differences were on line 60 I had the addition of c.categories_status and the rest of the mod by Bruin_03 that I have added. Perhaps I should remove this and see if it works then?

Share this post


Link to post
Share on other sites

Okay, I'm having an issue with Featured Products. I apologize if this has been addressed elsewhere, but I've spent the entire morning trying to solve this.

 

I installed Featured Products 4.3.4 awhile ago and it worked beautifully. Recently, I added sub-categories to a category listing. I just realized that in place of the Featured Products for Category box, I was receiving an error message. I was able to fix the error message using a post earlier in this thread that changed the code in catalog/includes/functions/general.php and catalog/includes/modules/featured.php. But now I have two Featured Products boxes showing up on the sub-category page. My Index page is fine - Featured Products only shows up once. I've fiddled around with the coding in index.php but every time I fix the box on the sub-category page, I remove it from the Index page.

 

I remember when I first installed this contribution, I had two boxes as well on the Index page and I was able to fix it. I can't for the life of me remember what I did and can't seem to figure it out now.

 

Hopefully someone who is well-versed with this contribution can come to my aid! Thanks so much.

Share this post


Link to post
Share on other sites

Hi,

 

I have copied and edited all related files for the Featured Products contribution and the Admin side works fine.

 

However, when I look at the live site, there is this fatal error that I don't know hot to fix.

 

"Fatal error: Call to a member function on a non-object in /home/norsesal/public_html/store/catalog/includes/header.php on line 51"

 

Any help would be appreciated.

 

Ron

Share this post


Link to post
Share on other sites

hi

 

im still experiencing a problem with Fearured Products. The homepage and category pages do not show the new 'special' price of an item if one has been chosen. Does anyone know why this is? Bill said it should work straight out of the box so im abit confused.

 

What files or specific pieces of code would relate to the display of the new special price? if I knew this then I could look for this when comparing my file to the originals to see whats missing.

 

any ideas?

 

thanks,

 

Ben

Share this post


Link to post
Share on other sites

Hey Bill, a simple silly question... :blush:

 

I'm not using STS at the moment (may never) and just want to replace the "New Products For Month" box with the Featured Products box.

 

I wouldn't get into whether it will work with my other contributions, I know that's impossible to know.

 

What version do I download? Your version 1.5.9 dated 15 July 2007 and I'll be good to go?

 

I told you it was a silly question, well ok stupid question... :-"


- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Share this post


Link to post
Share on other sites
Hey Bill, a simple silly question... :blush:

 

I'm not using STS at the moment (may never) and just want to replace the "New Products For Month" box with the Featured Products box.

 

I wouldn't get into whether it will work with my other contributions, I know that's impossible to know.

 

What version do I download? Your version 1.5.9 dated 15 July 2007 and I'll be good to go?

 

I told you it was a silly question, well ok stupid question... whistling.gif

Hi Jim,

I can't speak for the other contributions above mine. I created the July 15, 2007 version to be used for non-STS users as well as STS users. The title is a little misleading since it brings attention to STS users. I did that since I added distinct installation steps for STS users to assist them to make it work. Non-STS users would simply skip those steps during the installation which is commented to make it all easy to understand.

 

The other contributions that mentioned STS were either outdated or caused more confusion for STS & non-STS users alike.

 

Hope this helps,


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites
Hi Jim,

I can't speak for the other contributions above mine. I created the July 15, 2007 version to be used for non-STS users as well as STS users. The title is a little misleading since it brings attention to STS users. I did that since I added distinct installation steps for STS users to assist them to make it work. Non-STS users would simply skip those steps during the installation which is commented to make it all easy to understand.

 

The other contributions that mentioned STS were either outdated or caused more confusion for STS & non-STS users alike.

 

Hope this helps,

 

Hi Bill,

 

Yes it helps tremendiously :thumbsup:

Thank you for the speedy reply and the help!

Seeing so many version numbers and different fixes/additions can drive a person insane hehe.

Keeping it simple, I like that.

Not to worry about my other contributions, I've been struggling with merging different ones together until I either find the correct match or make them work together, LOL. Sad thing is, my shop still looks pretty stock/vanilla so far, but that's alright for now.

 

Your version it is then... ;)

 

Thanks again!


- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Share this post


Link to post
Share on other sites

hey

 

I have a slight problem with featured products, when I click on a category, instead of featured products showing me the featured products from that category it just shows me featured products from all categories.

 

Does anyone know what might be wrong?

Share this post


Link to post
Share on other sites

Hi all,

 

I'm using Featured Product 1.5.9, but I noticed a little problem. When I click on "New Product", the drop-down list that occurs also contains products that have been deactived. How can I fix it so that only the activated products appears in the list (ie. the ones with status = 1)?

Share this post


Link to post
Share on other sites
Hi all,

 

I'm using Featured Product 1.5.9, but I noticed a little problem. When I click on "New Product", the drop-down list that occurs also contains products that have been deactived. How can I fix it so that only the activated products appears in the list (ie. the ones with status = 1)?

 

John,

Take a look at the Featured Products contribution page as their is two options available for you to choose from that came out after your 1.5.9 version.

 

http://www.oscommerce.com/community/contributions,651


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Hello everyone, please help me this code, I need to also do a query from Specials, It's actually working, but it's taking too long to display them. I tried with a new_products.php and it worked so here it's the new_products.php code with an extra query for specials that works for me

 

<?php
/*
 $Id: new_products.php,v 1.34 2003/06/09 22:49:58 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- new_products //-->
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));

 new contentBoxHeading($info_box_contents);

 if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
// get rid of the join with specials
$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price from " . TABLE_PRODUCTS . " p where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 } else {
$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit ". MAX_DISPLAY_NEW_PRODUCTS);
 }

 if (($no_of_new_products = tep_db_num_rows($new_products_query)) > 0) {
  while ($_new_products = tep_db_fetch_array($new_products_query)) {
$new_products[] = $_new_products;
$list_of_prdct_ids[] = $_new_products['products_id'];
}

$select_list_of_prdct_ids = "products_id = '".$list_of_prdct_ids[0]."' ";
 if ($no_of_new_products > 1) {
  for ($n = 1; $n < count($list_of_prdct_ids); $n++) {
  $select_list_of_prdct_ids .= "or products_id = '".$list_of_prdct_ids[$n]."' "; 
  }
}

// an extra query is now used for all the specials
$specials_query = tep_db_query("select products_id, specials_new_products_price from specials where (".$select_list_of_prdct_ids.") and status = '1' ");
while ($specials_array = tep_db_fetch_array($specials_query)) {
$new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'specials_new_products_price' => $specials_array['specials_new_products_price']);
}

// replace products_price with the specials_new_products_price
if(!empty($new_s_prices)) {
for ($x = 0; $x < $no_of_new_products; $x++) {
	for ($i = 0; $i < count($new_s_prices); $i++) {
		if( $new_products[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) {
		$new_products[$x]['products_price'] = $new_s_prices[$i]['specials_new_products_price'];
		}
	   }
   }
} // // end if(!empty($new_s_prices)

 $row = 0;
 $col = 0;

 $info_box_contents = array();

//  while ($new_products = tep_db_fetch_array($new_products_query)) {
for ($x = 0; $x < $no_of_new_products; $x++) {
$new_products[$x]['products_name'] = tep_get_products_name($new_products[$x]['products_id']);

$info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="33%" valign="top"',
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products[$x]['products_image'], $new_products[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products[$x]['products_id']) . '">' . $new_products[$x]['products_name'] . '</a><br>' . $currencies->display_price($new_products[$x]['products_price'], tep_get_tax_rate($new_products[$x]['products_tax_class_id'])));

$col ++;
if ($col > 2) {
  $col = 0;
  $row ++;
}
  } // end for ($x = 0; $x < $no_of_new_products; $x++)
} //  end if (($no_of_new_products = tep_db_num_rows($new_products_query)) > 0)
new contentBox($info_box_contents);
?>
<!-- new_products_eof //-->

 

What I need is to have that same extra query in new_products.php I need to adapt to /includes/modules/featured.php

 

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License

 Featured Products V1.1
 Displays a list of featured products, selected from admin
 For use as an Infobox instead of the "New Products" Infobox  
*/
?>
<!-- featured_products //-->
<?php
if(FEATURED_PRODUCTS_DISPLAY == 'true')
{
 $featured_products_category_id = $new_products_category_id;
 $cat_name_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $featured_products_category_id . "' limit 1");
 $cat_name_fetch = tep_db_fetch_array($cat_name_query);
 $cat_name = $cat_name_fetch['categories_name'];
 $info_box_contents = array();

 if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) {
$info_box_contents[] = array('align' => 'left', 'text' => '<a class="headerNavigation" href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . TABLE_HEADING_FEATURED_PRODUCTS . '</a>');

 list($usec, $sec) = explode(' ', microtime());
 srand( (float) $sec + ((float) $usec * 100000) );
 $mtm= rand();

$featured_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
 } else {
$info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name));
$subcategories_array = array();
tep_get_subcategories($subcategories_array, $featured_products_category_id);
$featured_products_category_id_list = tep_array_values_to_string($subcategories_array);
if ($featured_products_category_id_list == '') {
  $featured_products_category_id_list .= $featured_products_category_id;
} else {
  $featured_products_category_id_list .= ',' . $featured_products_category_id;
}
$featured_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) left join " . TABLE_FEATURED . " f on p.products_id = f.products_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
}

 $row = 0;
 $col = 0; 
 $num = 0;
 while ($featured_products = tep_db_fetch_array($featured_products_query)) {
$num ++; if ($num == 1) { new contentBoxHeading($info_box_contents); }
$featured_products['products_name'] = tep_get_products_name($featured_products['products_id']);
if($featured_products['specstat']) {
  $info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="33%" valign="top"',
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br><s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . 
									   $currencies->display_price($featured_products['specials_new_products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</span>');
} else {
  $info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="33%" valign="top"',
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])));
}	
$col ++;
if ($col > 2) {
  $col = 0;
  $row ++;
}
 }
 if($num) {

  new contentBox($info_box_contents);
 }
} else // If it's disabled, then include the original New Products box
{
// include (DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); // disable for dont show if desactive the feature module
include (DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); 
}
if ($num == 0)
{
include (DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); 
}
?>
<!-- featured_products_eof //-->

Share this post


Link to post
Share on other sites

Hi,

 

I have 27 products in 'featured products' and on my home page (index.php) I have 9 products rotating display at the same time. Now I wont to set one product that should be always displaying on my home page. - must be always visible. It is possible to do that? ...and how?

 

thanks for your any help ;)

Share this post


Link to post
Share on other sites

Hi there, I installed the module and it shows up fine on my site in the left column; however, I would like the featured products to show up in the big area on the main page where the NEW PRODUCTS listing are. Can somone please tell me what to do to make this happen?

Share this post


Link to post
Share on other sites
Hi there, I installed the module and it shows up fine on my site in the left column; however, I would like the featured products to show up in the big area on the main page where the NEW PRODUCTS listing are. Can somone please tell me what to do to make this happen?

 

It appears you did not make the edits needed on the index.php page.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

Gday - looked around for an answer to this but it seems 'unique'

 

I have a new install of Os - have installed CCGV(trad) & Paypal IPN which were working ok (just one small glitch)

 

Just tried to install Featured Products (latest version) and getting the following error:

 

MAX_DISPLAY_FEATURED_PRODUCTS' at line 1

 

select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, s.specials_new_products_price, specials_new_products_price, p.products_date_added from products p left join products_description pd on p.products_id = pd.products_id and pd.language_id = '1' left join specials s on p.products_id = s.products_id left join featured f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand() DESC limit MAX_DISPLAY_FEATURED_PRODUCTS

 

[TEP STOP]

 

I have noticed that I have no file or option in Admin to put in the value for number of featured items to display - any help anybody?

Where do i look...

 

THANKS IN ADVANCE!

Share this post


Link to post
Share on other sites
Hi

 

Open file

 

catalog/includes/modules/featured.php

 

1- find:

 

$featured_products['products_name'] = tep_get_products_name($featured_products['products_id']);

 

ADD after:

 

	$sql = 'SELECT `products_description` FROM `products_description` WHERE products_id ='.$featured_products['products_id'].' && language_id='.(int)$languages_id;
$description_query = tep_db_query($sql);
$description = mysql_fetch_array($description_query, MYSQL_ASSOC);		
$description['products_description'] = substr($description['products_description'], 0, 80);
$desc_len = strlen($description['products_description']);
$description['products_description'][$desc_len-1] = '.';
$description['products_description'][$desc_len-2] = '.';
$description['products_description'][$desc_len-3] = '.';
$description['products_description'] = ereg_replace("(Array)", "", $description['products_description']);

80 is the number of character of the short description, you can change it

2- In the same file FIND:

 

. '</a><br><s>' .

 

REPLACE with:

 

. '</a><br>' . strip_tags($description['products_description']) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']). '">' . DESCR_READ_MORE . '</a><br>  <a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products['products_id']) . '">' . tep_image_button('cart_buy.gif', IMAGE_BUTTON_BUY_NOW) . '</a> <s>' .

3- In the same file FIND:

 

. '</a><br>' .

 

REPLACE with:

 

. '</a><br>' . strip_tags($description['products_description']) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']). '">' . DESCR_READ_MORE . '</a><br>  <a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products['products_id']) . '">' . tep_image_button('cart_buy.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ' .

4- open file:

 

catalog/includes/languages/english.php

 

and ADD this:

 

//Short description in products modules Start
define('DESCR_READ_MORE', '<FONT color=blue>more info+.</FONT>'); // ... read more.
//Short description in products modules End

 

This add a short description, button buy now and a "more info+" link to product description

nicko107

 

Nicko - don't think you spend time on the boards any more and your PM inbox is full - so if you get this - thanks very much for this. I needed to do this for a client of mine so was delighted to find your post. It worked perfectly - thanks very much. Saved me several hours of work!

 

thanks again

 

Jason

Share this post


Link to post
Share on other sites

I have installed 4.3 and everything seems to work just fine. I decided not to use the small infoBox and am just using the main box on the index page.

 

My problem is that the cols and rows dont work properly. I have my max featured prods set to six. If I add 3 featured prods the box only shows two prods, if I add 6 featured prods the box only shows 5 prods. So essentially I am having to add 4 featured prods to display 3 and 7 featured prods to show 6.

 

Also, say I have 6 featured products added. The box will display all 6 items on refresh but only five at a time, ie. it sees all the featured products in the select but will only display 5 per page refresh.

 

Anyone got any ideas? TIA


Matt Mika

Installed Contributions: Multi-Stores, QTPro, CCGV(trad), Batch Print, EasyPopulate, Simple Manual Order Entry, Encrypting Credit Card Via Mcrypt, UPSXML, Down for Maintenance, On The Fly GD Thumbs, SPPC, SPPC Hide, and various personal tweaks

Share this post


Link to post
Share on other sites

So I just got done installing the "Product Columns" Contribution and it seems to work how it's supposed to BUT I think it either A) Interferes with the "Featured Products" Contribution that I installed or B) I'm an idiot and changed/deleted something I wasn't supposed to.

 

Does anyone know if one contribution such as this would get in the way of that?

 

Thanks,

-Kevin

Share this post


Link to post
Share on other sites

I only have almost zero knowledge on PHP and SQL. I've searched through the forums and couldn't find the solution to my problem.

 

Question

 

1. Is there anyway not to randomize the featured product displayed on the main page?

 

It would be a great help. Thank you in advance!

Edited by canselori

Share this post


Link to post
Share on other sites
I only have almost zero knowledge on PHP and SQL. I've searched through the forums and couldn't find the solution to my problem.

 

Question

 

1. Is there anyway not to randomize the featured product displayed on the main page?

 

It would be a great help. Thank you in advance!

 

Absolutely! Just configure which products you want to display in that box in the admin.


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

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

×