Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Place a box in Text_Main


El_Heso

Recommended Posts

The knowledge base covers adding boxes to / removeing boxes from the left and right column.

 

No doubt you can work out from this how to do the above.

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

The knowledge base covers adding boxes to / removeing boxes from the left and right column.

 

No doubt you can work out from this how to do the above.

Hi!

No cant do it i know how to adding boxes to / remove boxes from the left and right column but i cant gt it to work when i want a box in the content area.

Maybe its so easy so i miss how to do it :-)

 

Regards Tony

Link to comment
Share on other sites

Are you looking to add a box into application_top or application bottom or index.php?

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

index.php

 

/Tony

Hi Tony

 

In your catalog/index.php near the bottom find

 

		  <tr>
		<td class="main"><?php echo TEXT_MAIN; ?></td>
	  </tr>

 

Add beneath it

 

		  <tr>
		<td class="main"><?php require(DIR_WS_BOXES . 'reviews.php'); ?></td>
	  </tr>

 

I don't use reviews but it does show the box heading with "There are no reviews" underneath

 

HTH

 

Ian

Link to comment
Share on other sites

Hi Tony

 

In your catalog/index.php near the bottom find

 

<?php
 require('includes/application_top.php');

// the following cPath references come from application_top.php
 $category_depth = 'top';
 if (isset($cPath) && tep_not_null($cPath)) {
   $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
   $cateqories_products = tep_db_fetch_array($categories_products_query);
   if ($cateqories_products['total'] > 0) {
     $category_depth = 'products'; // display products
   } else {
     $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
     $category_parent = tep_db_fetch_array($category_parent_query);
     if ($category_parent['total'] > 0) {
       $category_depth = 'nested'; // navigate through the categories
     } else {
       $category_depth = 'products'; // category has no products, but display the 'no products' message
     }
   }
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- body //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<?php
 if ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
// create column list
   $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
                        'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
                        'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
                        'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
                        'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
                        'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
                        'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
                        'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

   asort($define_list);

   $column_list = array();
   reset($define_list);
   while (list($key, $value) = each($define_list)) {
     if ($value > 0) $column_list[] = $key;
   }

   $select_column_list = '';

   for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
     switch ($column_list[$i]) {
       case 'PRODUCT_LIST_MODEL':
         $select_column_list .= 'p.products_model, ';
         break;
       case 'PRODUCT_LIST_NAME':
         $select_column_list .= 'pd.products_name, ';
         break;
       case 'PRODUCT_LIST_MANUFACTURER':
         $select_column_list .= 'm.manufacturers_name, ';
         break;
       case 'PRODUCT_LIST_QUANTITY':
         $select_column_list .= 'p.products_quantity, ';
         break;
       case 'PRODUCT_LIST_IMAGE':
         $select_column_list .= 'p.products_image, ';
         break;
       case 'PRODUCT_LIST_WEIGHT':
         $select_column_list .= 'p.products_weight, ';
         break;
     }
   }

// p.products_date_added to query for New Product Icon contribution
// show the products of a specified manufacturer
   if (isset($HTTP_GET_VARS['manufacturers_id'])) {
     if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
       $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_date_available, p.products_id, p.manufacturers_id, p.products_price, p.products_model, p.products_tax_class_id, 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_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
     } else {
// We show them all
       $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_date_available, p.products_id, p.manufacturers_id, p.products_price, p.products_model, p.products_tax_class_id, 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_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m 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 = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
     }
   } else {
// show the products in a given categorie
     if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
       $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_date_available, p.products_id, p.manufacturers_id, p.products_price, p.products_model, p.products_tax_class_id, 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_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
     } else {
// We show them all
       $listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_date_available, p.products_id, p.manufacturers_id, p.products_price, p.products_model, p.products_tax_class_id, 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_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
     }
   }

   if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('^[1-8][ad]$', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
     for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
       if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
         $HTTP_GET_VARS['sort'] = $i+1 . 'a';
         $listing_sql .= " order by pd.products_name";
         break;
       }
     }
   } else {
     $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
     $sort_order = substr($HTTP_GET_VARS['sort'], 1);
     switch ($column_list[$sort_col-1]) {
       case 'PRODUCT_LIST_MODEL':
         $listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_NAME':
         $listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
         break;
       case 'PRODUCT_LIST_MANUFACTURER':
         $listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_QUANTITY':
         $listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_IMAGE':
         $listing_sql .= " order by pd.products_name";
         break;
       case 'PRODUCT_LIST_WEIGHT':
         $listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_PRICE':
         $listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
     }
   }

//Visa produktlistan
include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>

<?php
 } else { // default page
 include(DIR_WS_MODULES . FILENAME_FEATURED);

 //include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
 }
?>

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>


<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

/Tony

Link to comment
Share on other sites

Hi Ian!

I dont have that lines in my files maybe it is beacuse i use STS?

any ideas how i can get that to work with more codes?

Here is my index.php:

<?php
 require('includes/application_top.php');

// the following cPath references come from application_top.php
 $category_depth = 'top';
 if (isset($cPath) && tep_not_null($cPath)) {
.
.
.
(ianric) middle chopped out so page doesn't go on for miles

//Visa produktlistan
include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>

<?php
 } else { // default page
 include(DIR_WS_MODULES . FILENAME_FEATURED);

 //include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
 }
?>

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

/Tony

Hi Tony

 

I'm not familiar with STS but the end of your index.php is similar to mine. You have FILENAME_FEATURED where TEXT_MAIN should be. I also have closing table and row info and new table code which I don't see in yours.

 

	  <tr>
	<td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
  </tr>
</table></td>
<?php
 } else { // default page
?>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">


  <tr>
	<td><table border="0" width="100%" cellspacing="10" cellpadding="0">
	  <tr>
		<td class="main"><?php echo tep_customer_greeting(); ?></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo TEXT_MAIN; ?></td>
	  </tr>
<?php
include(DIR_WS_MODULES . FILENAME_RND_PRODUCTS);
?>
	</table></td>
  </tr>

 

You may need to add extra html code to create a new table but I am guessing you could put it here

 

	//Visa produktlistan
include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>
	  <tr>
		<td class="main"><?php require(DIR_WS_BOXES . 'reviews.php'); ?></td>
	  </tr>
<?php
 } else { // default page

 

or here

 

  //include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
 }
?>
	  <tr>
		<td class="main"><?php require(DIR_WS_BOXES . 'reviews.php'); ?></td>
	  </tr>

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

 

Most of my coding is trial and error, mainly error, but I get there. If you get stuck, right click and view source. You may get a better hint where to put the code. I usually right click, view source, save the source on my local machine as an htm file and open it up in Frontpage. I can usually work out the code from there.

 

HTH

 

Ian

Link to comment
Share on other sites

Hi Ian!

I dont have that lines in my files maybe it is beacuse i use STS?

any ideas how i can get that to work with more codes?

Here is my index.php:

 

Go into your includes/STS folder and show your index.php.html (or something similar like sts_template.html). It's not the /index.php you need to change. It's your template :)

 

jon

It's all just ones and zeros....

Link to comment
Share on other sites

Go into your includes/STS folder and show your index.php.html (or something similar like sts_template.html). It's not the /index.php you need to change. It's your template :)

 

jon

Hi Jon!

Do you know how to code in that file? to put the reviews box i have tryed so many times now even in sts_template.html but cant get it to work i placed the flash banner in that file but do you have some qlues how to code for the reviews?

 

/Tony

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...