Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Index Page problem


Guest

Recommended Posts

Posted

Now the index page is show the new product list,

but I don't want it.

 

I want to show the special product list that I think be more attractive for discount product.

 

 

How to do it?!

 

Thanks~

Posted

Toni,

 

In /catalog/index.php, around line 326

 

<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->

 

In /catalog/includes/column_right.php . line 35 to 39

 

  if (isset($HTTP_GET_VARS['products_id'])) {
   if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) include(DIR_WS_BOXES . 'tell_a_friend.php');
 } else {
   include(DIR_WS_BOXES . 'specials.php');
 }

 

As a 'test' try replacing this line in /catalog/index.php (lines 315/317 for me)

 

<?php
   include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>

 

with .................................

 

<?php
   //include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
   include(DIR_WS_BOXES . 'specials.php');
?>

 

Peter

Posted
Try This contribution, it's what I used.

 

OK~ Thanks!

 

Let me try it!

 

:lol:

Posted
Toni,

 

In /catalog/index.php, around line 326

 

<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->

 

In /catalog/includes/column_right.php . line 35 to 39

 

 ?if (isset($HTTP_GET_VARS['products_id'])) {
? ?if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) include(DIR_WS_BOXES . 'tell_a_friend.php');
?} else {
? ?include(DIR_WS_BOXES . 'specials.php');
?}

 

As a 'test' try replacing this line in /catalog/index.php (lines 315/317 for me)

 

<?php
? ?include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>

 

with .................................

 

<?php
? ?//include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
? ?include(DIR_WS_BOXES . 'specials.php');
?>

 

Peter

I tried it.

But it does not sucess.

Posted
Toni,

 

Can you tell us what files you have changed, and the lines you changed.

 

Peter

Hi Peterr

 

I was changed this code:

 

As a 'test' try replacing this line in /catalog/index.php (lines 315/317 for me)

 

 

CODE 

 

<?php

  include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);

?>

 

 

 

with .................................

 

 

CODE 

 

<?php

  //include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);

  include(DIR_WS_BOXES . 'specials.php');

?>

 

 

 

Peter

Posted
Toni,

 

What is being displayed, upcoming products or specials ??

 

Peter

It is show upcoming~

Posted

Toni,

 

If it is showing upcoming products, then you haven't commented out the line like this:

 

//include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);

 

..... unless you have some contributions or other code that does the above include ??

 

Peter

Posted
Toni,

 

If it is showing upcoming products, then you haven't commented out the line like this:

 

//include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);

 

..... unless you have some contributions or other code that does the above include ??

 

Peter

OH..Sorry..

I see ...

 

But it only show 1 product in the bottom.

 

~.~

Posted

Toni,

 

But it only show 1 product in the bottom.

 

Upcoming products are by date, so that is why there is only one, because there is only one of your products with a "date available" after today. :)

 

Peter

Posted
Toni,

 

But it only show 1 product in the bottom.

 

Upcoming products are by date, so that is why there is only one, because there is only one of your products with a "date available" after today. :)

 

Peter

But I want to show the special product (discount) to replace the new products,

not upcoming product.

 

^^

Posted

Toni,

 

Comment out the upcoming products, and then add a line to display the specials like this

 

//include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
  include(DIR_WS_BOXES . 'specials.php');

 

Peter

Posted
Toni,

 

Comment out the upcoming products, and then add a line to display the specials like this

 

//include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
? include(DIR_WS_BOXES . 'specials.php');

 

Peter

Yes, I know that.

 

But may be my question is making you with some mistakes...

 

 

I just want to show the Special Product and don't want to show the New Product (in a month) in index page.

 

 

The upcoming product list that I needed.

Posted

Hi,

 

Comment out the upcoming products, and then add a line to display the specials like this:

 

//include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
  include(DIR_WS_BOXES . 'specials.php');

 

Peter

Yes, I know that.

 

Yes, we are finally getting somewhere, I see from your website that you have commented out the line, the upcoming products is not showing now, which is what you wanted. :D

 

I just want to show the Special Product and don't want to show the New Product (in a month) in index page.

 

The upcoming product list that I needed.

 

1. Your first statement says you don't want the new products

 

2. Your second statement says you want the upcoming product list.

 

My understanding is that:

 

New_products == Upcoming_products

 

I'm sure they are the SAME thing, so please state whether you want it or not.

 

It is clear that you DO want specials though. :)

 

Peter

Posted

For Specials on index instead of New Products try this:

Copy this and save in catalog/includes/modules/ as default_specials.php

<?php
/*
 $Id: default_specials.php,v 2.0 2003/06/13

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- default_specials //-->

 <tr>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
<?php
$info_box_contents = array();
 $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
 new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));

  if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
    $new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIAL_PRODUCTS);
  } else {
    $new = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price, s.specials_new_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 where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and s.status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
  }


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

<!-- default_specials_eof //-->

Backup...Backup...Backup

Complete the following:

 

1). In filenames.php in the catalog/includes directory find line 37 approx

 

define('FILENAME_DEFAULT', 'index.php');

 

and add after

 

define('FILENAME_DEFAULT_SPECIALS', 'default_specials.php');

 

 

2). In index.php in the catalog directory find line 130 and line 300 approx,

Change the two instances of

 

FILENAME_NEW_PRODUCTS

 

and replace with

 

FILENAME_DEFAULT_SPECIALS

 

 

3). In index.php in the catalog/includes/languages/english directory find line 23 approx

 

define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');

define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

 

and add after:

 

define('TABLE_HEADING_DEFAULT_SPECIALS', 'Specials For %s');

 

REPEAT THE LAST STEP FOR index.php IN ANY OTHER LANGUAGES YOU MAY HAVE INSTALLED.

Posted

i modified new products in a similar way to the code above but i want it to be randomised specials aswell. i could not figure out how to get this to work. Do you know how to do this?

 

any help will be greatly appreciated :D

always here to offer some useless advice....

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...