chrometweaks.org

Is iPage.com hosting offline right now ?

Click Here To View All Answers...


My first question is Is iPage.com hosting offline right now ? Many thanks for any comment. Second question.. Can someone tell me is it possible to put one product of my chice on the first page of the catalog .... and what are the codes I have to play with ....

Thanks in advance..

Comments (78)

Yep, but you might want to make sure and wait for someone else to confirm it as I am unsure. Better yet, why don't you contact the iPage guys because they can help better...

Comment #1

Ok, I have yet to try this, but here it goes..

1: add new file called featured_product.php to catalog/includes/boxes.

<?php.

/*.

 $Id: featured_product.php,v 1.0 2004/01/28 13:06:58 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 http://www.oscommerce.com.

 Copyright (c) 2003 osCommerce.

 Released under the GNU General Public License.

*/.

?>.

<! feature_product //>.

<tr>.

 <td class="main" width="250" align="center">.

<?php.

 $info_box_contents = array();.

 $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));.

 new contentBoxHeading($info_box_contents);.

 $feature_products_query = tep_db_query("select p.products_id, pd.products_name, p.products_image, p.products_tax_class_id as products_price from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_CATEGORIES" c, "TABLE_PRODUCTS_TO_CATEGORIES" p2c left join "TABLE_SPECIALS" s on p.products_id = s.products_id where products_status = '1' and p.products_id = pd.products_id and pd.language_id = '"$languages_id"' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id where p.products_id = '21'" );.

// the number at the end of this query is the product id number, change that to change the feature product.

 $info_box_contents = array();.

 while ($feature = tep_db_fetch_array($feature_products_query)) {.

   $feature['products_name'] = tep_get_products_name($feature['products_id']);.

   $info_box_contents[] = array('align' => 'center',.

                                'params' => 'class="smallText" valign="top"',.

                                'text' => '<a href="'tep_href_link(FILENAME_PRODUCT_INFO, 'products_id='$feature['products_id'])'">'tep_image(DIR_WS_IMAGES$feature['products_image'], $feature['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)'</a><br><a href="'tep_href_link(FILENAME_PRODUCT_INFO, 'products_id='$feature['products_id'])'">'$feature['products_name']'</a><br>'$currencies->display_price($feature['products_price'], tep_get_tax_rate($feature['products_tax_class_id'])));.

 }.

 new contentBox($info_box_contents);.

?>.

<! featured_product_eof //>.

 </td>.

</tr>.

2: add code to catalog/includes/languages/english/index.php.

Define('TABLE_HEADING_FEATURED_PRODUCT', '&nbsp; Featured For %s');.

3: add to catalog/index.php (in a table of your choice in the place of your choice.).

<?php require (DIR_WS_BOXES'featured_product.php'); ?>.

Like I said, I haven't even had a chance to try this yet, but I wanted to post this so anybody else working on this could see what i'm doing..

Designed for MS2..

Comment #2

Hi, I tried the code and I am getting the following error :.

And I made sure that there is a Product with an ID 40. Did I miss some thing out ......

U can see the error on this page :.

Http://mosaicartkeepsakes.com/catalog/inde...0e8a704ea77b21a.

Error.

1064 - You have an error in your SQL syntax near 'where p.products_id = '40'' at line 1.

Select p.products_id, pd.products_name, p.products_image, p.products_tax_class_id as products_price from products p, products_description pd, categories c, products_to_categories p2c left join specials s on p.products_id = s.products_id where products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id where p.products_id = '40'..

Comment #3

Sorry about that, I thought I had posted the updated chunk of code..

File: featured_product.php.

<?php.

/*.

 $Id: featured_product.php,v 1.0 2004/01/28 13:06:58 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 http://www.oscommerce.com.

 Copyright (c) 2003 osCommerce.

 Released under the GNU General Public License.

*/.

?>.

<! feature_product //>.

<tr>.

 <td width="250" align="right">.

<?php.

 $info_box_contents = array();.

 $info_box_contents[] = array('text' => '<b>'sprintf(TABLE_HEADING_FEATURED_PRODUCT, strftime('%B'))'</b>');.

 new searchBox($info_box_contents);.

 $feature_products_query = tep_db_query("select p.products_id, pd.products_name, p.products_image, p.products_tax_class_id as products_price from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_CATEGORIES" c, "TABLE_PRODUCTS_TO_CATEGORIES" p2c left join "TABLE_SPECIALS" s on p.products_id = s.products_id where products_status = '1' and p.products_id = pd.products_id and pd.language_id = '"$languages_id"' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p.products_id = 33 ");.

 // the number at the end of this query is the product id number, change that to change the feature product.

 $rows = 0;.

 $info_box_contents = array();.

 while ($feature = tep_db_fetch_array($feature_products_query)) {.

   $feature['products_name'] = tep_get_products_name($feature['products_id']);.

   $info_box_contents[$rows] = array('align' => 'center',.

                                'params' => 'class="smallText" valign="top"',.

                                'text' => '<a href="'tep_href_link(FILENAME_PRODUCT_INFO, 'products_id='$feature['products_id'])'">'tep_image(DIR_WS_IMAGES$feature['products_image'], $feature['products_name'], 150, 150)'</a><br><a href="'tep_href_link(FILENAME_PRODUCT_INFO, 'products_id='$feature['products_id'])'">'$feature['products_name']'</a><br>'$currencies->display_price($feature['products_price'], tep_get_tax_rate($feature['products_tax_class_id'])));.

 }.

 new searchBox($info_box_contents);.

?>.

<! featured_product_eof //>.

 </td>.

</tr>.

Keep in mind that the other changes are still needed and this should work for MS2, still unsure about MS1...

Comment #4

It seems to be working really nice ... however, the only thing I did was change.

To.

I had to do this in two places .... let me know if it was supposed to be that way or no ....

Comment #5

Oh, don't worry about that. I setup a custom box-class, to give it a different look. changing it to "contentbox" is a good choice..

I'm thinking about adding a description to that box also..

Hi ho hi ho off to code I go.....

Comment #6

Gr8 and you read my mind .... thats exactly I was wondering, what I need to do add content to that box..

Comment #7

Can someone tell me is it possible to put one product of my chice on the first page of the catalog .... and what are the codes I have to play with ....

Thanks in advance..

Comment #8

I assume you are talking about something like a featured product....

I've been thinking about puting something like that together but never sat down and figured it out..

If anybody knows please post it, otherwise that is what i'm working on...

Comment #9


This question was taken from a support group/message board and re-posted here so others can learn from it.