Jump to content
Sign in to follow this  
surfalot

[Contribution] Open Featured Sets Support

Recommended Posts

I am using the latest XAMPP on my system. It's running php 5.1. with apache and mysql and oscommerce-2.2ms2-051113.

If you could paste the error using the

code

section, I or someone more knowledged in php might be able to help you better.

 

This is probably a dumb question, so please excuse me, but are you just doing the "upgrade" in the contrib file or are you merging all the files in the "catalog" file with winmerge or something?

 

 

Hi Larry,

 

I appreciate the quick response!

 

I don't have winmerge (although i could try it i s'pose!)

I've tried both a fresh install of oscommerce and installing both wolfen and the open featured sets (not at the same time obviously lol) but each time i try, i get an error 1054 - - blah blah blah

 

Unfortunately i can't post the code as i've got that fed up with it, i've decided to do a fresh install again (still got my original catalog and backup on a flash drive so i can go back to it if need be)

 

As you've probably gathered, i'm rather new to this, (html no problem, but php and sql are a headache to me)

 

I'll install the open sets feature again on a fresh database, and post the errors i get - if that would help?

 

Appreciate your help! - i've been working towards getting an online site for the last few months (previous attempt was with evolve 4.1 - load of rubbish in my opinion, but i didn't spend the ?600 - it was my boss!! hehe)

 

Thanks in advance :)

Share this post


Link to post
Share on other sites
I've tried both a fresh install of oscommerce and installing both wolfen and the open featured sets (not at the same time obviously lol) but each time i try, i get an error 1054 - - blah blah blah

 

you don't need the fresh install to fix this. This issue is being addressed starting in post #43 above. If you can follow the instructions in the bug link in that post, it should fix you up. the page with the errent SQL is /catalog/includes/modules/featured_sets.php

 

I will be posting a newer version of Open Featured Sets with corrected SQL queries that should work for both MySQL 4 & 5. (when I can get a chance)

Edited by surfalot

Share this post


Link to post
Share on other sites

Ok Larry,

 

This is what i've done:

 

installed new fresh oscommerce ms2- 05113 with default catalog (dvd's and a couple of pc components)

 

installed the open feature sets (by dragging and replacing the relevent files in each area)

 

Ran the newinstall query through phpadmin

 

Loaded the webpage up - get this error on the front (index page):

 

1054 - Unknown column 'p.products_id' in 'on clause'

 

select p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description, pd.products_short, p.products_image, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, m.manufacturer_featured_until, mi.manufacturers_id, mi.languages_id, mi.manufacturers_url from products p, products_description pd, manufacturers m, manufacturers_info mi left join specials s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '1' and m.manufacturer_featured = '1' order by rand() DESC limit 3

 

If i navigate away from the front page to Hardware, this is what i get:

 

1054 - Unknown column 'p.products_id' in 'on clause'

 

SELECT distinct p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, pd.products_description, pd.products_short, s.status as specstat, s.specials_new_products_price, p.products_price from products p left join specials s on p.products_id = s.products_id, products_to_categories p2c, categories c left join products_description pd on p.products_id = pd.products_id and pd.language_id = '1' where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and (p2c.categories_id = '1' OR p2c.categories_id = '4' OR p2c.categories_id = '5' OR p2c.categories_id = '6' OR p2c.categories_id = '7' OR p2c.categories_id = '8' OR p2c.categories_id = '9' OR p2c.categories_id = '16' OR p2c.categories_id = '17') and p.products_status = '1' and p.products_featured = '1' order by rand() DESC limit 6

 

[TEP STOP]

 

(with the default oscommerce images such as cdrom drives, graphics cards... etc above the error message)

 

If i do a search by manufacturer "canon" for instance:

 

Let's See What We Have Here

 

 

There are no products to list in this category.

 

 

1054 - Unknown column 'p.products_id' in 'on clause'

 

select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from categories c, categories_description cd, products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where c.categories_featured = '1' and cd.language_id = '1' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' order by rand() DESC limit 6

 

[TEP STOP]

 

 

Any ideas?

 

I'll post the relevent coding if you need it

I use dreamweaver 8 to edit the code /Frontpage if needed.

 

Many thanks!

Share this post


Link to post
Share on other sites
you don't need the fresh install to fix this. This issue is being addressed starting in post #43 above. If you can follow the instructions in the bug link in that post, it should fix you up. the page with the errent SQL is /catalog/includes/modules/featured_sets.php

 

I will be posting a newer version of Open Featured Sets with corrected SQL queries that should work for both MySQL 4 & 5. (when I can get a chance)

 

 

Hi Todd,

 

I followed the changes in the coding to featured_sets.php as in post 44 but i'm still getting the error.

 

So, i'll try your changes to see if that makes any difference (my thoughts being that perhaps the changes in post 44 were more to my problem - no offence!)

 

All new to me - brilliant piece of coding, just hope i can get it working hehe!

 

Posting my findings in a few mins (if you're still around)

 

Many thanks

Troy

Share this post


Link to post
Share on other sites
Hi Todd,

 

I followed the changes in the coding to featured_sets.php as in post 44 but i'm still getting the error.

 

So, i'll try your changes to see if that makes any difference (my thoughts being that perhaps the changes in post 44 were more to my problem - no offence!)

 

All new to me - brilliant piece of coding, just hope i can get it working hehe!

 

Posting my findings in a few mins (if you're still around)

 

Many thanks

Troy

 

 

Right....

 

Tried your first change to the code - got the same 1054 error.

 

When i changed the code to your secnd suggestion i get this:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' manufacturers_info mi on p.manufacturers_id = mi.manufacturers_id where p.produ' at line 1

 

select p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description, pd.products_short, p.products_image, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, m.manufacturer_featured_until, mi.manufacturers_id, mi.languages_id, mi.manufacturers_url from products p, products_description pd left join specials s on pd.products_id = s.products_id left join manufacturers m, manufacturers_info mi on p.manufacturers_id = mi.manufacturers_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '1' and m.manufacturer_featured = '1' order by rand() DESC limit 3

 

[TEP STOP]

 

Looking through the posts to see if there's any further info

 

Much appreciated!

 

By the way, this 1064 error code is appearing on the index page - unlike the post in # 46

 

If i navigate to any of the categories or select a manufacturer i get the original (?) code error:

 

1054 - Unknown column 'p.products_id' in 'on clause'

 

SELECT distinct p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, pd.products_description, pd.products_short, s.status as specstat, s.specials_new_products_price, p.products_price from products p left join specials s on p.products_id = s.products_id, products_to_categories p2c, categories c left join products_description pd on p.products_id = pd.products_id and pd.language_id = '1' where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and (p2c.categories_id = '1' OR p2c.categories_id = '4' OR p2c.categories_id = '5' OR p2c.categories_id = '6' OR p2c.categories_id = '7' OR p2c.categories_id = '8' OR p2c.categories_id = '9' OR p2c.categories_id = '16' OR p2c.categories_id = '17') and p.products_status = '1' and p.products_featured = '1' order by rand() DESC limit 6

 

[TEP STOP]

 

 

Confused now!!

Edited by Troyski

Share this post


Link to post
Share on other sites
Tried your first change to the code - got the same 1054 error.

What I meant was that the issue is being addressed STARTing with that post. :D

 

If you read the next post, you'll find that my suggestions didn't work for Seagoofy either :blush:

 

go to the bug report I linked on that post and follow the suggestions that put parenthesis in the correct place for the SQL.

Edited by surfalot

Share this post


Link to post
Share on other sites
Confused now!!

If I'm looking at the code right, it doesn't seem that you have applied the changes correctly. Make double sure your in *root*\includes\modules\featured_sets.php (There is more than one featured_sets.php file.) Here is the code to change.

 

Find

// do product features

 if ( (OPEN_FEATURED_LIMIT_PRODUCTS_FEATURES=='true') && !empty($current_category_id) ) { /// We are in category depth 
$featured_products_query_raw = "SELECT distinct p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, pd.products_description, pd.products_short, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and (".$categories_query_addition.") and p.products_status = '1' and p.products_featured = '1' order by " . FEATURED_PRODUCTS_SORT_ORDER . " " . FEATURED_PRODUCTS_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_PRODUCTS; 
 } else if ( (OPEN_FEATURED_LIMIT_PRODUCTS_FEATURES=='true') && tep_not_null($product_info['products_id']) ) { // products info page
$featured_products_query_raw = "SELECT distinct p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, pd.products_description, pd.products_short, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = '" . (int)$featured_product_category_id . "' and p.products_status = '1' and p.products_featured = '1' order by " . FEATURED_PRODUCTS_SORT_ORDER . " " . FEATURED_PRODUCTS_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_PRODUCTS; 
 } else { // default
$featured_products_query_raw = "SELECT p.products_id, pd.products_name, pd.products_description, pd.products_short, 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_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' where p.products_status = '1' and p.products_featured = '1' order by " . FEATURED_PRODUCTS_SORT_ORDER . " " . FEATURED_PRODUCTS_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_PRODUCTS; 
 }

And replace it with

// do product features

 if ( (OPEN_FEATURED_LIMIT_PRODUCTS_FEATURES=='true') && !empty($current_category_id) ) { /// We are in category depth 
$featured_products_query_raw = "SELECT distinct p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, pd.products_description, pd.products_short, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c )left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and (".$categories_query_addition.") and p.products_status = '1' and p.products_featured = '1' order by " . FEATURED_PRODUCTS_SORT_ORDER . " " . FEATURED_PRODUCTS_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_PRODUCTS; 
 } else if ( (OPEN_FEATURED_LIMIT_PRODUCTS_FEATURES=='true') && tep_not_null($product_info['products_id']) ) { // products info page
$featured_products_query_raw = "SELECT distinct p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, pd.products_description, pd.products_short, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c )left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = '" . (int)$featured_product_category_id . "' and p.products_status = '1' and p.products_featured = '1' order by " . FEATURED_PRODUCTS_SORT_ORDER . " " . FEATURED_PRODUCTS_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_PRODUCTS; 
 } else { // default
$featured_products_query_raw = "SELECT p.products_id, pd.products_name, pd.products_description, pd.products_short, 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_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' where p.products_status = '1' and p.products_featured = '1' order by " . FEATURED_PRODUCTS_SORT_ORDER . " " . FEATURED_PRODUCTS_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_PRODUCTS; 
 }

Then find

if ((!isset($featured_manufacturer_products_id)) || ($featured_manufacturer_products_id == '0')) {
$featured_manufacturer_products_query_raw = "select p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description, pd.products_short, p.products_image, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, m.manufacturer_featured_until, mi.manufacturers_id, mi.languages_id, mi.manufacturers_url from " .
  TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'  and m.manufacturer_featured = '1' order by " . FEATURED_MANUFACTURER_SORT_ORDER . " " . FEATURED_MANUFACTURER_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_MANUFACTURER;

 

And replace it with

if ((!isset($featured_manufacturer_products_id)) || ($featured_manufacturer_products_id == '0')) {
$featured_manufacturer_products_query_raw = "select p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description, pd.products_short, p.products_image, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, m.manufacturer_featured_until, mi.manufacturers_id, mi.languages_id, mi.manufacturers_url from( " .
  TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi )left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'  and m.manufacturer_featured = '1' order by " . FEATURED_MANUFACTURER_SORT_ORDER . " " . FEATURED_MANUFACTURER_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_MANUFACTURER;

Then find

//if ((!isset($featured_categories_id)) || ($featured_categories_id == '0')) {

if ( (OPEN_FEATURED_LIMIT_CATEGORIES_FEATURES=='true') && !empty($current_category_id) ) { /// We are in category depth 
  $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES .
	" p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.categories_featured = '1' and cd.language_id = '" . (int)$languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and (".$categories_query_addition.") and pd.language_id = '" . (int)$languages_id . "' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES;
} else if ( (OPEN_FEATURED_LIMIT_CATEGORIES_FEATURES=='true') && tep_not_null($product_info['products_id']) ) { // products info page
  $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES .
	" p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.categories_featured = '1' and cd.language_id = '" . (int)$languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and p2c.categories_id = '" . (int)$featured_product_category_id . "' and pd.language_id = '" . (int)$languages_id . "' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES;
} else { // default
  $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES .
	" p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.categories_featured = '1' and cd.language_id = '" . (int)$languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES;
}

And replace it with

//if ((!isset($featured_categories_id)) || ($featured_categories_id == '0')) {

if ( (OPEN_FEATURED_LIMIT_CATEGORIES_FEATURES=='true') && !empty($current_category_id) ) { /// We are in category depth 
  $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from(( " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p )left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES .
	" p2c )left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.categories_featured = '1' and cd.language_id = '" . (int)$languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and (".$categories_query_addition.") and pd.language_id = '" . (int)$languages_id . "' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES;
} else if ( (OPEN_FEATURED_LIMIT_CATEGORIES_FEATURES=='true') && tep_not_null($product_info['products_id']) ) { // products info page
  $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from(( " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p )left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES .
	" p2c )left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.categories_featured = '1' and cd.language_id = '" . (int)$languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and p2c.categories_id = '" . (int)$featured_product_category_id . "' and pd.language_id = '" . (int)$languages_id . "' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES;
} else { // default
  $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from(( " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p )left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES .
	" p2c )left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.categories_featured = '1' and cd.language_id = '" . (int)$languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES;
}

I am mostly sure that's all the code to change. Should be as easy as copy and paste! (Though it's sorta like the blind leading the blind with me :blink:) I hope this helps...

Share this post


Link to post
Share on other sites
If I'm looking at the code right, it doesn't seem that you have applied the changes correctly. Make double sure your in *root*\includes\modules\featured_sets.php (There is more than one featured_sets.php file.) Here is the code to change.

 

Find

// do product features

 if ( (OPEN_FEATURED_LIMIT_PRODUCTS_FEATURES=='true') && !empty($current_category_id) ) { /// We are in category depth 
$featured_products_query_raw = "SELECT distinct p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, pd.products_description, pd.products_short, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and (".$categories_query_addition.") and p.products_status = '1' and p.products_featured = '1' order by " . FEATURED_PRODUCTS_SORT_ORDER . " " . FEATURED_PRODUCTS_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_PRODUCTS; 
 } else if ( (OPEN_FEATURED_LIMIT_PRODUCTS_FEATURES=='true') && tep_not_null($product_info['products_id']) ) { // products info page
$featured_products_query_raw = "SELECT distinct p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, pd.products_description, pd.products_short, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = '" . (int)$featured_product_category_id . "' and p.products_status = '1' and p.products_featured = '1' order by " . FEATURED_PRODUCTS_SORT_ORDER . " " . FEATURED_PRODUCTS_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_PRODUCTS; 
 } else { // default
$featured_products_query_raw = "SELECT p.products_id, pd.products_name, pd.products_description, pd.products_short, 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_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' where p.products_status = '1' and p.products_featured = '1' order by " . FEATURED_PRODUCTS_SORT_ORDER . " " . FEATURED_PRODUCTS_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_PRODUCTS; 
 }

And replace it with

// do product features

 if ( (OPEN_FEATURED_LIMIT_PRODUCTS_FEATURES=='true') && !empty($current_category_id) ) { /// We are in category depth 
$featured_products_query_raw = "SELECT distinct p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, pd.products_description, pd.products_short, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c )left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and (".$categories_query_addition.") and p.products_status = '1' and p.products_featured = '1' order by " . FEATURED_PRODUCTS_SORT_ORDER . " " . FEATURED_PRODUCTS_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_PRODUCTS; 
 } else if ( (OPEN_FEATURED_LIMIT_PRODUCTS_FEATURES=='true') && tep_not_null($product_info['products_id']) ) { // products info page
$featured_products_query_raw = "SELECT distinct p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, pd.products_description, pd.products_short, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c )left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = '" . (int)$featured_product_category_id . "' and p.products_status = '1' and p.products_featured = '1' order by " . FEATURED_PRODUCTS_SORT_ORDER . " " . FEATURED_PRODUCTS_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_PRODUCTS; 
 } else { // default
$featured_products_query_raw = "SELECT p.products_id, pd.products_name, pd.products_description, pd.products_short, 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_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' where p.products_status = '1' and p.products_featured = '1' order by " . FEATURED_PRODUCTS_SORT_ORDER . " " . FEATURED_PRODUCTS_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_PRODUCTS; 
 }

Then find

if ((!isset($featured_manufacturer_products_id)) || ($featured_manufacturer_products_id == '0')) {
$featured_manufacturer_products_query_raw = "select p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description, pd.products_short, p.products_image, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, m.manufacturer_featured_until, mi.manufacturers_id, mi.languages_id, mi.manufacturers_url from " .
  TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'  and m.manufacturer_featured = '1' order by " . FEATURED_MANUFACTURER_SORT_ORDER . " " . FEATURED_MANUFACTURER_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_MANUFACTURER;

 

And replace it with

if ((!isset($featured_manufacturer_products_id)) || ($featured_manufacturer_products_id == '0')) {
$featured_manufacturer_products_query_raw = "select p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description, pd.products_short, p.products_image, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, m.manufacturer_featured_until, mi.manufacturers_id, mi.languages_id, mi.manufacturers_url from( " .
  TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi )left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'  and m.manufacturer_featured = '1' order by " . FEATURED_MANUFACTURER_SORT_ORDER . " " . FEATURED_MANUFACTURER_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_MANUFACTURER;

Then find

//if ((!isset($featured_categories_id)) || ($featured_categories_id == '0')) {

if ( (OPEN_FEATURED_LIMIT_CATEGORIES_FEATURES=='true') && !empty($current_category_id) ) { /// We are in category depth 
  $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES .
	" p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.categories_featured = '1' and cd.language_id = '" . (int)$languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and (".$categories_query_addition.") and pd.language_id = '" . (int)$languages_id . "' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES;
} else if ( (OPEN_FEATURED_LIMIT_CATEGORIES_FEATURES=='true') && tep_not_null($product_info['products_id']) ) { // products info page
  $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES .
	" p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.categories_featured = '1' and cd.language_id = '" . (int)$languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and p2c.categories_id = '" . (int)$featured_product_category_id . "' and pd.language_id = '" . (int)$languages_id . "' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES;
} else { // default
  $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES .
	" p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.categories_featured = '1' and cd.language_id = '" . (int)$languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES;
}

And replace it with

//if ((!isset($featured_categories_id)) || ($featured_categories_id == '0')) {

if ( (OPEN_FEATURED_LIMIT_CATEGORIES_FEATURES=='true') && !empty($current_category_id) ) { /// We are in category depth 
  $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from(( " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p )left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES .
	" p2c )left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.categories_featured = '1' and cd.language_id = '" . (int)$languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and (".$categories_query_addition.") and pd.language_id = '" . (int)$languages_id . "' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES;
} else if ( (OPEN_FEATURED_LIMIT_CATEGORIES_FEATURES=='true') && tep_not_null($product_info['products_id']) ) { // products info page
  $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from(( " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p )left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES .
	" p2c )left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.categories_featured = '1' and cd.language_id = '" . (int)$languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and p2c.categories_id = '" . (int)$featured_product_category_id . "' and pd.language_id = '" . (int)$languages_id . "' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES;
} else { // default
  $featured_categories_query_raw = "select c.categories_id, c.categories_image, c.parent_id, c.categories_featured_until, cd.categories_name, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, pd.products_description, pd.products_short, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from(( " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p )left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES .
	" p2c )left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.categories_featured = '1' and cd.language_id = '" . (int)$languages_id . "' and c.categories_id = cd.categories_id and c.categories_id = p2c.categories_id and cd.categories_id = p2c.categories_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' order by " . FEATURED_CATEGORIES_SORT_ORDER . " " . FEATURED_CATEGORIES_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_CATEGORIES;
}

I am mostly sure that's all the code to change. Should be as easy as copy and paste! (Though it's sorta like the blind leading the blind with me :blink:) I hope this helps...

:D

 

OMG OMG OMG!!!

 

You are both STARS!!!!! :) :) :)

 

Thank you Sooooooooo much!!!!

 

I'd have been sat there for weeks and weeks on this guys!

 

/ jumping up and down for joy

 

Now i can get adding my catalog!!!

 

So appreciated!!!

 

Brilliant contribution - many thanks to all involved!!:):) :)

Share this post


Link to post
Share on other sites

hy

 

i have problem with editing and adding products or categories. every time i add (edit) products or categories they become featured sets active. i want manually activate featured sets not automatic.

 

Mike

Share this post


Link to post
Share on other sites
i have problem with editing and adding products or categories. every time i add (edit) products or categories they become featured sets active. i want manually activate featured sets not automatic.

Hey Mike25,

 

That should not happen for editing a product. check to make sure you have line 492-499 of the package file /catalog/admin/categories.php added to your production file. Also check to make sure you added the "p.products_featured, p.products_featured_until," to the SQL on line 451 of the same file in the package.

 

For the new product, it was intended to have the new product start as not featured. Here is your fix...

 

find in /catalog/admin/categories.php (around line 493 of the package file):

 

		if (!isset($pInfo->products_featured)) $pInfo->products_featured = '0';

 

replace with:

 

	if (empty($pInfo->products_featured)) $pInfo->products_featured = '0';

Share this post


Link to post
Share on other sites

Is it possible to make the text flow around the image and buy now buttons on the featured products (the ones on the front page) - Can this be turned on or off in this contrib' via Admin?

 

I installed the wolfen contrib' on a store last week, then found this contrib' this week!!! I've installed it on a test site, and I am very impressed by all of additional features on top of Wolfen. There's so many features I can't believe there isn't a way to set this in the Admin.

 

I've got round it in the Wolfen contrib' by merging the two table cells used in each product box, adding a div tag and a css style to the images etc.

 

Thanks.

Share this post


Link to post
Share on other sites

Sorry for the delay, been on a business trip.

 

There is not a way to do that in the admin. although the code is a bid cleaner the Wolfens, the current version still ridiculously redundant in the code base. I have a newer version which may still be a couple months out which is oop with all the redundant code consolidated and will make seemingly small changes like this actually easy to do globally.

 

What we would need to do is determine which style & format you want to make that way and make the same change you did with Wolfens.

Share this post


Link to post
Share on other sites

how about removing the name and price so that only the image displays? please dont ask me why, i just like to things a little different. please just tell me what to remove. thank you for your time and god bless!

 

<?php

/*

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

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

$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_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and 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);

}

?>

<!-- featured_products_eof //-->

Edited by RMStuning

Share this post


Link to post
Share on other sites
also, how do i change the format to have the items display in 6 per row instead of 3?

that's in the admin configuration options

Share this post


Link to post
Share on other sites
how about removing the name and price so that only the image displays? please dont ask me why, i just like to things a little different. please just tell me what to remove. thank you for your time and god bless!

If you want to change the format of "Display featured products", set layout 4, set style 4 that would be lines 209-210 of /catalog/includes/modules/featured_gbox_products.php

Share this post


Link to post
Share on other sites
What we would need to do is determine which style & format you want to make that way and make the same change you did with Wolfens.

 

I've made the changes in OFS - only for one style and layout, but it should give you the idea:

 

Change to featured_sbox_products.php:

 

  if ((FEATURED_SET == '3') && ((FEATURED_SET_STYLE == '2') || (FEATURED_SET_STYLE == '5'))) {

 if (FEATURED_SET_STYLE == '5') {
   $info_box_contents = array();
   $info_box_contents[] = array('text' => OPEN_FEATURED_BOX_HEADING);

   new infoBoxHeading($info_box_contents,true,true);
 }

 $info_box_contents = array();
 $info_box_contents[] = array('text' => '<table border="0" width="100%" cellspacing="2" cellpadding="2"><tr><td width="50%" align="center" valign="top" class="featuredProducts"><div class="featurefloat"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_array[$i]['id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . $featured_products_array[$i]['image'], $featured_products_array[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br>' . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . '<br>' . OPEN_FEATURED_TABLE_HEADING_PRICE . $products_price . '' . $buy_now_link . '<br><strong><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_array[$i]['id'], 'NONSSL') . '">' . $featured_products_array[$i]['name'] . '</a></strong></div><div class="featuretext">');
 $info_box_contents[0]['text'] .=  $current_description;
 $info_box_contents[0]['text'] .= '  <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_array[$i]['id'], 'NONSSL') . '"><font color="#FF0000">' . TEXT_MORE_INFO . '</font></a> </div></td></tr></table>';
 new infoBox($info_box_contents);
 }

 

And the addtional styles for stylesheet.css:

 

.featurefloat {
float: left;
padding-right: 5px;
padding-bottom: 5px;
font-family: Verdana, Arial, sans-serif;
font-size: 10px;
border:thin;
border-color:#0000FF;
}

.featuretext {
 font-family: Verdana, Arial, sans-serif;
 font-size: 12px;
 text-align:left;
}

 

To be honest, now that I've made the change I think I prefer the over-under style! :P

 

Thanks a lot for this contribution.

 

JamesB

Share this post


Link to post
Share on other sites

Hi once again Todd :D

 

I have integrated the New Product Icon contrib into my site, so that when a customer reaches the product pages the new icon is present on recently added items. I would like to have the same icon display on the featured products that I have on my default index page.

 

I have looked through your contribs files but have not been able to find an appropriate place to stick this code:

 

 // added for New Product Icon contribution
		//  2592000 = 30 days in the unix timestamp format
		   if ( ($today_time - strtotime($listing['products_date_added'])) < 2592000) {
			  $listing['products_name'] .= ' ' . tep_image_button('icon_newarrival.gif', TEXT_ICON_NEW_PRODUCT);
		   }
		// end addition

 

It is inserted after the PRODUCT_LIST_NAME case in product info.php. Where would I insert it in featured sets.php?

 

TIA,

Sheri :blush:

Share this post


Link to post
Share on other sites

First you will have to tell me what your settings are for the items listing on your home page.

 

+Product Features, Category Features, or Maufacturer w/products features?

+Choose a featured products set layout

+Choose a featured products set style

+Choose a box grouping method

 

Unfortunately there is a lot of different places that change COULD be made depending on your configuration.. This will help narrow it down.

Share this post


Link to post
Share on other sites
First you will have to tell me what your settings are for the items listing on your home page.

 

+Product Features, Category Features, or Maufacturer w/products features?

+Choose a featured products set layout

+Choose a featured products set style

+Choose a box grouping method

 

Unfortunately there is a lot of different places that change COULD be made depending on your configuration.. This will help narrow it down.

 

Hi Todd,

 

Thanks for your help B)

 

I have only products featured on my store front...nothing else, anywhere else (I know what a waste of a great contrib! :blink: )

Set layout is #4: image, price over under

Set style is #1: plain

Boxgroup: gbox

 

Thanks again,

Sheri

(mush for brains right about now)

Share this post


Link to post
Share on other sites

i need help. i have checked every page over i cannot tell you how many times but i am obviously missing something. The contribution works great except for one thing. Every time i try to edit anything through admin, and i mean anything. From changing settings, adding features, adding new products, editing old products, changing config settings from true to false, absolutely anything, i get this error message.

 

 

Warning: Cannot modify header information - headers already sent by (output started at /home/*****/public_html/admin/includes/languages/english.php:609) in /home/*****/public_html/admin/includes/functions/general.php on line 17

 

i know that it is probably not the fault of this contribution but rather myself removing something. Can someone help me please?

Share this post


Link to post
Share on other sites

crash3903 absolutely rocks! :thumbsup:

 

i found the answer in another forum. Thank you so much crash! i had extra spaces after the ?> in my english.php file

Share this post


Link to post
Share on other sites
I have only products featured on my store front...nothing else, anywhere else (I know what a waste of a great contrib! :blink: )

Set layout is #4: image, price over under

Set style is #1: plain

Boxgroup: gbox

OK, you want to look for the file /catalog/includes/modules/featured_gbox_products.php

 

about line 186 is the code that needs changing for layout 4 style 1 of the grouped box (gbox). change that block to:

 

	if ((FEATURED_SET == '4') && (FEATURED_SET_STYLE == '1')) {
  $info_box_contents[0]['text'] .= '<table border="0" width="100%" cellspacing="2" cellpadding="2"><tr><td width="' . (SMALL_IMAGE_WIDTH + 25);
  $info_box_contents[0]['text'] .= '" align="center" valign="top" class="featuredProducts"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_array[$i]['id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . $featured_products_array[$i]['image'], $featured_products_array[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br>' . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . '<br><div align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_array[$i]['id'], 'NONSSL') . '">' . $featured_products_array[$i]['name'] . '</a>';
  if ( ($today_time - strtotime( $featured_products_array[$i]['products_date_added'] )) < 2592000) {
	$info_box_contents[0]['text'] .= ' ' . tep_image_button('icon_newarrival.gif', TEXT_ICON_NEW_PRODUCT);
  }
  $info_box_contents[0]['text'] .= '</div>' . OPEN_FEATURED_TABLE_HEADING_PRICE . $products_price . '' . $buy_now_link . '</td></tr></table>';
}

 

Then open /catalog/includes/modules/featured_sets.php

just under where it says "// do product features" there are 3 SELECT statements that start something like this:

 

$featured_products_query_raw = "SELECT distinct p.products_id, pd.products_name

 

Right after it says " p.products_id," add this just after it (no double quotes): " p.products_date_added,"

 

so each of the three lines look like:

 

$featured_products_query_raw = "SELECT distinct p.products_id,  p.products_date_added, pd.products_name

 

NOTE: the third one does not have "distinct" in it and looks like this:

 

$featured_products_query_raw = "SELECT p.products_id,  p.products_date_added, pd.products_name

 

That should do it for you :thumbsup:

Share this post


Link to post
Share on other sites

Hello everyone!

 

Can someone tell me how to fix the font problem displayed on the screenshot? It is a fresh installation, with no changes but the font size is pretty much bigger than it should...

 

bug.jpg

Share this post


Link to post
Share on other sites
That should do it for you :thumbsup:

 

Thank you Todd :D I'll give it a whirl tonight!

 

Sheri

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
Sign in to follow this  

×