Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Featured Product Support v1.5.4


jcisar

Recommended Posts

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

 

Thank you for the reply Bill Kellum.

 

I tried that already, but the position of the featured products keeps on changing on the main page when I hit refresh and also when new customer logged in.

 

I tried messing with the sql, deleting here and there and adding some stuff hoping for miracles, since I only have a little knowledge at all with sql.

 

I hope someone can shed some idea on how to make sure that the product position won't change on the main page.

 

Many thanks in advance.

Edited by canselori
Link to comment
Share on other sites

I just installed this (1.5.9 w/ STS 4.5.3 - thanks Bill!) and everything seems to be working properly, however, my admin page (catalog/featured items) is all jacked up. There's no style to it like the rest of admin. Did I miss something? :rolleyes:

 

 

Stacy

Edited by ugh
Link to comment
Share on other sites

I just installed this (1.5.9 w/ STS 4.5.3 - thanks Bill!) and everything seems to be working properly, however, my admin page (catalog/featured items) is all jacked up. There's no style to it like the rest of admin. Did I miss something? :rolleyes:

 

 

Stacy

 

Stacy,

Did you do Step 5 of the Installation Text?

 

'<a href="' . tep_href_link(FILENAME_FEATURED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_FEATURED_PRODUCTS . '</a><br>' .

Edited by bkellum

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

I added the Featured Product to my site just now. Everything looks great except for one thing.

 

On my main/home page I have the link "Featured Products" in a row at the top of the table that displays the actual products. It apparantly is also supposed to dispaly two images in the infobox directory, which I do not have.

 

How can I get rid of the row that all of this is displayed in? Im not sure which file that is.

 

Thanks.

Link to comment
Share on other sites

Stacy,

Did you do Step 5 of the Installation Text?

 

'<a href="' . tep_href_link(FILENAME_FEATURED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_FEATURED_PRODUCTS . '</a><br>' .

 

 

Yep, I did.....

Link to comment
Share on other sites

I added the Featured Product to my site just now. Everything looks great except for one thing.

 

On my main/home page I have the link "Featured Products" in a row at the top of the table that displays the actual products. It apparantly is also supposed to dispaly two images in the infobox directory, which I do not have.

 

How can I get rid of the row that all of this is displayed in? Im not sure which file that is.

 

Thanks.

 

Found it in /includes/classes/boxes.php

Link to comment
Share on other sites

  • 2 weeks later...
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

 

I've the same kind of problem:

Fatal error: Call to a member function on a non-object in /homepages/2/******/htdocs/OSC/catalog/includes/functions/html_output.php on line 78

 

Any idea?

Link to comment
Share on other sites

I've the same kind of problem:

Fatal error: Call to a member function on a non-object in /homepages/2/******/htdocs/OSC/catalog/includes/functions/html_output.php on line 78

 

Any idea?

Do you have any other contributions installed?

Also, did you have the following in includes/application_top.php:

 

// auto expire special products
 require(DIR_WS_FUNCTIONS . 'specials.php');
 tep_expire_specials();
// auto expire featured products
 require(DIR_WS_FUNCTIONS . 'featured.php');
 tep_expire_featured();

// calculate category path

I displayed the code before and after the Featured Products code to show how it should look.

Edited by bkellum

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

Do you have any other contributions installed?

Also, did you have the following in includes/application_top.php:

 

...

 

I made some modifications but i don't remember the contributions I tried :P

I've copied the "modified files" of the folder and it's working fine... Strange... (the application_top.php code was ok)

 

Thanks!

Link to comment
Share on other sites

Thank you for the reply Bill Kellum.

 

I tried that already, but the position of the featured products keeps on changing on the main page when I hit refresh and also when new customer logged in.

 

I tried messing with the sql, deleting here and there and adding some stuff hoping for miracles, since I only have a little knowledge at all with sql.

 

I hope someone can shed some idea on how to make sure that the product position won't change on the main page.

 

Many thanks in advance.

 

I was wondering if anyone can give suggestion on how to make sure that the product position doesnt change. I am posting products on the featured products and wished that the product position doesnt change each time when new customer logged in.

 

Any idea how to do it.

Link to comment
Share on other sites

Hi! Love this! No probs installing..

 

BUT i am used to have 3 New_Products in a row on the main page - now i only get 1 Featured :/

 

How do i get 2 more?

 

Thanks!

Michael, sounds like you may have set something up wrong. Have you added the products that you want to be featured? Can you give a link? Edited by bkellum

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

Michael, sounds like you may have set something up wrong. Have you added the products that you want to be featured? Can you give a link?

Hi. Yes i have addet several products in the admin, and they all show on the "featured_products.php" - but on my index site, there is only one product at the time that is showen,

 

I run this on a Live Shop, so i cant give you a link because i have turned the feature off again :)

 

Hope you can see my problem anyway

Link to comment
Share on other sites

  • 3 weeks later...
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

 

Has anyone found a solution to this? I have the same problem, except I am stuck on 2 products. No matter how many I add, the index page displays 2. In the admin, I have it set to 4.

 

Anyone know why this is happenning?

Link to comment
Share on other sites

I installed FP v4.3.4 and everything is great on the admin side but when I go to the main page I get this error msg:

 

Warning: main(includes/functions/featured.php) [function.main]: failed to open stream: No such file or directory in /home/includes/application_top.php on line 895

 

Warning: main(includes/functions/featured.php) [function.main]: failed to open stream: No such file or directory in /home/includes/application_top.php on line 895

 

Warning: main(includes/functions/featured.php) [function.main]: failed to open stream: No such file or directory in /home/includes/application_top.php on line 895

 

Fatal error: main() [function.require]: Failed opening required 'includes/functions/featured.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/includes/application_top.php on line 895

 

Can anyone help me figure out what I screwed up here?

Jada

 

The codes of the many, outweigh the codes of the few. Live long and Prosper.

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

 

I did the above and works great - however I only need to add the product description. I do not need the BUY NOW or product price showing (product price can show on the product info page, but not needed to show as a Featured Product on the home page).

 

Could anyone advise what code needs to be revised/removed? Much appreciation and thanks in advance!!!

Link to comment
Share on other sites

Hi,

 

I have added the code (found somewhere here in topic) to get description and BUY NOW, but i would like to have the 'BUY NO' button on a seperate line (<BR>), in the bottom instead of now in front of prices.

 

products.gif

 

'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>' . 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('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> <s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . 

 

Does anybody got a solotion for this ?

 

Regards

jarzom

Link to comment
Share on other sites

  • 2 weeks later...

(note: I've added this to another forum as well, but this one seems more alive - so here comes...)

 

Hi,

I'm using Oscommerce with MS2 and have been trying to install the Featured Products add-on.

However, there are certain parts of the instructions that lead to files that simply don't exist in my directory structure.

Having otherwise completed the installation - the system is not working. From the admin side I cannot access and edit the Featured Products list (in the catalog box). The home page of my website shows a blank where the box should be for the featured products. Can someone help me?

 

Here's the instructions I was unable to follow:

Step 3:

Add the following lines to /catalog/admin/includes/filenames.php: -- this file does not exist in this directory

 

define('FILENAME_FEATURED', 'featured.php');

define('FILENAME_FEATURED_PRODUCTS', 'featured_products.php');

 

Step 4:

Add the following line to /catalog/admin/includes/database_tables.php: -- this file does not exist in this directory

 

Step 5:

Edit the file /catalog/admin/includes/boxes/catalog.php - this file does not exist in any of my directories

 

 

Step 6:

Edit the file /catalog/admin/includes/languages/english.php:

Find: define('BOX_CATALOG_PRODUCTS_EXPECTED', 'Products Expected'); --- this line does not exist in this file on my system

Link to comment
Share on other sites

Hi,

I've got the above problem fixed now. For some strange reason the directory structure on my installation was a bit different and the admin folder was somewhere else - but now that I've found it everything is ok!

 

Here's the instructions I was unable to follow:

Step 3:

Add the following lines to /catalog/admin/includes/filenames.php: -- this file does not exist in this directory

 

define('FILENAME_FEATURED', 'featured.php');

define('FILENAME_FEATURED_PRODUCTS', 'featured_products.php');

 

Step 4:

Add the following line to /catalog/admin/includes/database_tables.php: -- this file does not exist in this directory

 

Step 5:

Edit the file /catalog/admin/includes/boxes/catalog.php - this file does not exist in any of my directories

Step 6:

Edit the file /catalog/admin/includes/languages/english.php:

Find: define('BOX_CATALOG_PRODUCTS_EXPECTED', 'Products Expected'); --- this line does not exist in this file on my system

Link to comment
Share on other sites

Hey guys,

Got a question about this mod/database. I am having problems installing this and would like to go back to the way my shop was before I started messing with this mod. I have installed the SQL file and would like to uninstall the SQL file. I am new to SQL and not sure how to remove the "configuration_group"

columns ? I did a drop to remove the table "featured" that worked fine. I just need to know how to remove where it says :

 

INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) values ('39','Featured', 'Featured Products Display', '339', '1'

);

 

INSERT into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added) values ('Display Featured Products', 'FEATURED_PRODUCTS_DISPLAY', 'true', 'Set to true or false in order to display featured.', '39', '1', now(), now()

);

 

INSERT into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added) values ('Maximum Display of Featured', 'MAX_DISPLAY_FEATURED_PRODUCTS', '6', 'This is the maximum amount of items to display on the front page.', '39', '2', now(), now()

);

 

I am getting a 1054 - Unknown column 'products_length' in 'field list' when I try to add or edit products.

 

Thanks Tim

How to secure your site. A must read

Link to comment
Share on other sites

I have the problem with contribution, for some reason it displays only one product not 10 as selected in admin panel.

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Link to comment
Share on other sites

I have the problem with contribution, for some reason it displays only one product not 10 as selected in admin panel.

This contribution comes with two "box" options; one for the left or right column (an infobox with only one product in it) and a box that replaces the "New Products for [Month]" box in the main content window on the front page. The latter allows the amount to be set in the admin on how many products to display as featured.

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

Hey guys im looking to only show the product picture (not the price or name) and i am fairly new at this, i assume i need to modify the code below but i cant seem to do it, can anyone help a girl out

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 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['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'] . '' . $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
}
?>
<!-- featured_products_eof //-->

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