Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header Tags SEO


Jack_mcs

Recommended Posts

Hi,

 

is it possible to have in the categories page , only header tags title , without the default site title ?

Yes, uncheck the default title checkbox in Page Control for index.php.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I just installed header tags and working through it. I have a quick question/problem.

I'm getting this

/*** Begin Header Tags SEO ***/ if (isset($HTTP_GET_VARS['manufacturers_id'])) $db_query = tep_db_query("select manufacturers_htc_title_tag as htc_title, manufacturers_htc_description as htc_description from " . TABLE_MANUFACTURERS_INFO .

right below my header. It came up on the Index page (I found my mistake and fixed it)but I'm still getting it in all my categories list. It does not show up when a category has sub categories just the ones that has just products in it. I need help finding the file I should look at to fix this.

Thank you for the help :)

 

Paul

Link to comment
Share on other sites

I went to google and entered site:domain-name and came upon several results. There are a few of them that display the following:

GreatDiscounts4u
Shopping Cart contains. Products: 0. Total: $0.00. Home · Shipping · New Products · Contact Us · Specials · FAQ · Policy · Home » About us. Categories ...
https://www.greatdiscounts4u.com/about_us.php - Cached

Looking at this it is reading the header. So am asking, is it because of the code added to header.php for contribution Header Tags SEO? I did read some of the previous post, like post # 4048, and so I am thinking this might be normal.

 

Just checking.

 

Thanks.

 

Bennett

Link to comment
Share on other sites

I just installed header tags and working through it. I have a quick question/problem.

I'm getting this

right below my header. It came up on the Index page (I found my mistake and fixed it)but I'm still getting it in all my categories list. It does not show up when a category has sub categories just the ones that has just products in it. I need help finding the file I should look at to fix this.

You've made a mistake in the changes to the file. Compare yours with the included one to find it.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I went to google and entered site:domain-name and came upon several results. There are a few of them that display the following:

GreatDiscounts4u
Shopping Cart contains. Products: 0. Total: $0.00. Home · Shipping · New Products · Contact Us · Specials · FAQ · Policy · Home » About us. Categories ...
https://www.greatdiscounts4u.com/about_us.php - Cached

Looking at this it is reading the header. So am asking, is it because of the code added to header.php for contribution Header Tags SEO? I did read some of the previous post, like post # 4048, and so I am thinking this might be normal.

No, it isn't because of Header Tags.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

You've made a mistake in the changes to the file. Compare yours with the included one to find it.

Thank you

But I'm unsure what file I made the mistake in, I looked for the mistake in the ones I thought would have it. But I can't seam to find the file that it would be in. Any one know what the file name and if it is in the catalog/included folder? Thank you

Link to comment
Share on other sites

Thank you

But I'm unsure what file I made the mistake in, I looked for the mistake in the ones I thought would have it. But I can't seam to find the file that it would be in. Any one know what the file name and if it is in the catalog/included folder? Thank you

Look in the archive in the catalog folder. There are only a few.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Look in the archive in the catalog folder. There are only a few.

Thank you

I did find it, it was in the index.php I found the first one and fixed it but did not know there was a 2nd one in there. :blush:

Link to comment
Share on other sites

Thank you

I did find it, it was in the index.php I found the first one and fixed it but did not know there was a 2nd one in there. :blush:

You're welcome. Good job!

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi Jack & any other guru's here,

 

Apologies if this is something simple, however I have searched and just can't seem to get this right.

 

A store i'm working on has the header tags contribution installed, and it generally works great (thanks for all the effort you put into this stuff). One thing I can't work out how to do properly however. Please note i'm a newbie at osCommerce.

 

The title of each category page is showing up as "CATEGORY NAME" (ie all in capitals) and that's it.

 

What I want it to show up as is "Category Name | Some standard common text | Site Name"

 

For example, instead of "RED WIDGETS" I want the categories to say "Red Widgets | Widgets & Gadgets | Widgets Shop" where "| Widgets & Gadgets | Widgets Shop" is common to all category pages and just the first bit changes.

 

So there are two parts to this basically:

1) How do I get the category titles to have the extra text in there?

2) Is it possible to rewrite the category names to lower case IN THE TITLES ONLY? I'm not interested in changing them on the site overall, just how the text is used in the titles.

 

Any help very much appreciated.

 

Matt

Link to comment
Share on other sites

The title of each category page is showing up as "CATEGORY NAME" (ie all in capitals) and that's it.

 

What I want it to show up as is "Category Name | Some standard common text | Site Name"

 

For example, instead of "RED WIDGETS" I want the categories to say "Red Widgets | Widgets & Gadgets | Widgets Shop" where "| Widgets & Gadgets | Widgets Shop" is common to all category pages and just the first bit changes.

 

So there are two parts to this basically:

1) How do I get the category titles to have the extra text in there?

2) Is it possible to rewrite the category names to lower case IN THE TITLES ONLY? I'm not interested in changing them on the site overall, just how the text is used in the titles.

There isn't anything in the Header Tags code to cause the title to be all capitals. That is either due to how the titles are entered in admin or something in your code is doing it (that is common with some templates). Check the title in admin by going to the category edit page. If it is capitalized there, just change it. Otherwise, it is the code in your shop and you will have to figure out how to change it.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

There isn't anything in the Header Tags code to cause the title to be all capitals. That is either due to how the titles are entered in admin or something in your code is doing it (that is common with some templates). Check the title in admin by going to the category edit page. If it is capitalized there, just change it. Otherwise, it is the code in your shop and you will have to figure out how to change it.

 

Hi Jack,

 

Thanks for your advice so far.

 

What I was hoping existed was a way to "force title case for page title" despite how they are entered, but perhaps not.

 

Leaving that aside, do you have any advice on the other bit - how to get more than the category name showing as the title (as per my example)?

 

Thanks

Matt

Link to comment
Share on other sites

What I was hoping existed was a way to "force title case for page title" despite how they are entered, but perhaps not.

 

Leaving that aside, do you have any advice on the other bit - how to get more than the category name showing as the title (as per my example)?

Oh, I misunderstood. You can edit the header tags array in includes/header_tags.php and use the strtoupper php function to change the case.

 

You can change the title in the categories edit page. Or, if the test will be the same for all pages, set the default title to that extra text and check the default category for index.php in page control. Or, if the extra text is to appear on the home page too, add it as the root text for index.php in page control and check the root box.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi jack

 

i was wondering if implementing the top parent id ( top parent category ) can be easily added

 

this is for the product_info.php page neway

Edited by xp02ed
Link to comment
Share on other sites

Hi jack

 

i was wondering if implementing the top parent id ( top parent category ) can be easily added

 

this is for the product_info.php page neway

I don't understand your question (implementing the top parent id and neway) but if you are wanting to add the main parent category to the title and tags, instead of the immediate category, you would need to alter the code in includes/header_tags.php and includes/functions/header_tags.php to load in the category you want. It is not part of the code but can be done.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Be sure the includes/header_tags.php file has the correct permissions on it. If it does, open that file and look at the entry for information pages. It should have many more lines than one of the other pages. If not, then there is a problem writing to that file.

 

Jack, sorry for coming up with this problem again, but I double-checked the permissions on the file /catalog/includes/header_tags.php.

The file is writeable for oscommerce.

 

I also deleted all case-blocks in the middle of /catalog/includes/header_tags.php and let the file being re-written by selecting the "add all missing pages"-Function in the admin.

After that the /catalog/includes/header_tags.php was re-written, but the code for the information.php-case is not longer than the one of the other pages.

In the database, a pseudo page ("information.php?info_id=9") is set up correctly, but the results wont show up in the frontend.

 

Do you have an advice for me please, what to check next in order to get my pseudo pages working correctly ?

 

Any help very much appreciated.

Andreas

 

PS: osC is on version RC2.2a and PHP 5.2.14.

Link to comment
Share on other sites

Jack, sorry for coming up with this problem again, but I double-checked the permissions on the file /catalog/includes/header_tags.php.

The file is writeable for oscommerce.

 

I also deleted all case-blocks in the middle of /catalog/includes/header_tags.php and let the file being re-written by selecting the "add all missing pages"-Function in the admin.

After that the /catalog/includes/header_tags.php was re-written, but the code for the information.php-case is not longer than the one of the other pages.

In the database, a pseudo page ("information.php?info_id=9") is set up correctly, but the results wont show up in the frontend.

 

Do you have an advice for me please, what to check next in order to get my pseudo pages working correctly ?

 

Any help very much appreciated.

Andreas

 

PS: osC is on version RC2.2a and PHP 5.2.14.

If you delete the entries in that file, the pseudo code won't get recreated. You need to delete the pseudo page entry in page control and add it again. If the page is getting added in page control, then the problem has to be with the permissions on the includes/header_tags.php file. Try this. Create a copy of your index.php file and name it whatever you want. Upload it to the root of your shop and then go to page control so that the new page is added to the list. Then look at includes/header_tags.php and see if the new page is listed. If not, the file is not being updated, which is a permissions problem.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

If you delete the entries in that file, the pseudo code won't get recreated. You need to delete the pseudo page entry in page control and add it again. If the page is getting added in page control, then the problem has to be with the permissions on the includes/header_tags.php file. Try this.

 

That was the solution, thanks !

First I deleted all pseudo pages and the root page of information.php in the admin page control.

Next, I added the root page again, by adding missing pages.

Next, I added one pseudo page.

To this point of time, the database had no entries for these two pages.

Next I added the data in the page control and it works !

 

Thanks for your help !

Link to comment
Share on other sites

Jack, one additional question:

 

I have the problem, that the info, that I entered for the root page index.php

also appears, when a category is being watched.

Then, both information, the one entered for the category AND the info for the index.php appears.

 

Is it possible to enter separate information for the index.php (the root page of the shop) only,

without affecting all category pages as well ?

 

Thanks in advance

Link to comment
Share on other sites

I have the problem, that the info, that I entered for the root page index.php

also appears, when a category is being watched.

Then, both information, the one entered for the category AND the info for the index.php appears.

 

Is it possible to enter separate information for the index.php (the root page of the shop) only,

without affecting all category pages as well ?

Uncheck the root box in page control.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

******** NOTE: STS USERS ONLY - Skip to step 1A. *********

******** NOTE: BTS USERS ONLY - Skip to step 1B. *********

Your shop is an STS shop if there is an includes/sts_templates/ directory.

Your shop is a BTS shop if there is a templates directory in the root directory.

 

 

hi i have got to this part of the install and mine does not have either of the above, does this mean it has been deleated? or have i got a later version since your post?

 

also same question regarding version

mine is as below.

 

// define the project version

define('PROJECT_VERSION', 'osCommerce Online Merchant v2.2 RC2a');

 

many thanks

andy

Link to comment
Share on other sites

******** NOTE: STS USERS ONLY - Skip to step 1A. *********

******** NOTE: BTS USERS ONLY - Skip to step 1B. *********

Your shop is an STS shop if there is an includes/sts_templates/ directory.

Your shop is a BTS shop if there is a templates directory in the root directory.

 

 

hi i have got to this part of the install and mine does not have either of the above, does this mean it has been deleated? or have i got a later version since your post?

It says if you use STS or BTS to skip. You say you don't have either. So you shouldn't skip to the indicated step.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hello

I'm new to this and i have some problems installing HT add-on.

First of all, i have RC2.2 with a free template from TemplateMonster.

I tried to follow the steps in the Install_Catalog but i'm stuck at step 3 2nd instruction. I cant find any code containing "HEADING_TITLE" so i cant go forward. I attach the index.php here so you can see the problem. If anyone can help me i would be very gratefull.

Thank you.

 

 

 

<?php
/*
 $Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 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">
<html <?php echo HTML_PARAMS; ?>>
<head>
<?php
/*** Begin Header Tags SEO ***/
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?>
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
 <title><?php echo TITLE; ?></title>
<?php
}
/*** End Header Tags SEO ***/
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<style type="text/css">
<!--
body {
background-color: #FFF;
}
-->
</style></head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td valign="top" class="col_left">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </td>
<!-- body_text //-->
<?php
 if ($category_depth == 'nested') {
   $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
   $category = tep_db_fetch_array($category_query);
?>
   <td width="100%" class="col_center">


<?php tep_draw_heading_top();?>

<?php new contentBoxHeading_ProdNew($info_box_contents);?>

<?php tep_draw_heading_top_3();?>


				<table cellpadding="0" cellspacing="0" border="0"><tr><td height="6"></td></tr></table>
				<table border="0" cellspacing="0" cellpadding="0" align="center" class="box_width_cont product">
					<tr>
<?php
if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
  $category_links = array_reverse($cPath_array);
  for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
	$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
	$categories = tep_db_fetch_array($categories_query);
	if ($categories['total'] < 1) {
	  // do nothing, go through the loop
	} else {
	  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
	  break; // we've found the deepest category the customer is in
	}
  }
} else {
  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
}

$number_of_categories = tep_db_num_rows($categories_query);
$rows = 0;
while ($categories = tep_db_fetch_array($categories_query)) {

  $rows++;
  $cPath_new = tep_get_path($categories['categories_id']);

$p_pic_sub = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a>';

$p_name_sub = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'] . '</a>';

  $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
  echo '               

	<td width="' . $width . '">'.tep_draw_prod_top().'
			<table cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td class="vam" style="height:43px "><span>'.$p_name_sub.'</span></td>
				</tr>
			</table>'.tep_draw_prod_pic_top().''.$p_pic_sub.''.tep_draw_prod_pic_bottom().'
	'.tep_draw_prod_bottom().'</td>
  ' . "\n";
			  if ($col!=(MAX_DISPLAY_CATEGORIES_PER_ROW-1)){
			  echo '
					<td class="bg_line_y">'.tep_draw_separator('spacer.gif', '32', '1').'</td>					
					';
			  }
			 else{	

  if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
	echo '              
</tr><tr><td colspan="'.(MAX_DISPLAY_CATEGORIES_PER_ROW + MAX_DISPLAY_CATEGORIES_PER_ROW -1).'">'.tep_draw_separator('spacer.gif', '1', '10').'</td></tr>' . "\n";
	echo '              <tr>' . "\n";
  }
}
if ($col==MAX_DISPLAY_CATEGORIES_PER_ROW-1){
$col=0;
}else{
$col++;
}
}	

// needed for the new products module shown below
$new_products_category_id = $current_category_id;
?>					

			</table>

<?php tep_draw_heading_bottom_3();?>

<?php tep_draw_heading_bottom();  ?>

<?php /*  tep_draw_separate();  */ ?>  <!--  /////////  -->

<?php tep_draw_heading_top();  ?>

<?php new contentBoxHeading_WHATS_NEW($info_box_contents, true, false);?>

<?php tep_draw_heading_top_3();?>			

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

<?php tep_draw_heading_bottom_3();?>

<?php tep_draw_heading_bottom();?>		

</td>
<?php
 } elseif ($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;
     }
   }

// 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_id, p.manufacturers_id, p.products_price, 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_id, p.manufacturers_id, p.products_price, 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_id, p.manufacturers_id, p.products_price, 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_id, p.manufacturers_id, p.products_price, 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;
     }
   }
?>
   <td width="100%" class="col_center">

<?php tep_draw_heading_top();?>		





<?php
// optional Product List Filter
/*      if (PRODUCT_LIST_FILTER > 0) {
     if (isset($HTTP_GET_VARS['manufacturers_id'])) {
       $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
     } else {
       $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
     }
     $filterlist_query = tep_db_query($filterlist_sql);
     if (tep_db_num_rows($filterlist_query) > 1) {
       echo '            <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' ';
       if (isset($HTTP_GET_VARS['manufacturers_id'])) {
         echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
         $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
       } else {
         echo tep_draw_hidden_field('cPath', $cPath);
         $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
       }
       echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
       while ($filterlist = tep_db_fetch_array($filterlist_query)) {
         $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
       }
       echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
       echo tep_hide_session_id() . '</form></td>' . "\n";
     }
   }
 */
// Get the right image for the top-right
   $image = DIR_WS_IMAGES . 'table_background_list.gif';
   if (isset($HTTP_GET_VARS['manufacturers_id'])) {
     $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
     $image = tep_db_fetch_array($image);
     $image = $image['manufacturers_image'];
   } elseif ($current_category_id) {
     $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
     $image = tep_db_fetch_array($image);
     $image = $image['categories_image'];
   }
?>
     <?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?>

<?php tep_draw_heading_bottom_3();?>

<?php tep_draw_heading_bottom();?>		

  </td>
<?php
 } else { // default page
?>
   <td width="100%" class="col_center">



<?php /*  require(DIR_WS_BOXES . 'panel_top.php');  */ ?>

<?php tep_draw_heading_top();?>

<?php /*  new contentBoxHeading_ProdNew($info_box_contents);  */  ?>

<?php tep_draw_heading_top_3();?>


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


<?php tep_draw_heading_bottom_3();?>

<?php tep_draw_heading_bottom();?>		

	</td>
<?php
 }
?>
<!-- body_text_eof //-->
   <td class="col_right">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </td>
 </tr>
</table>
<!-- body_eof //-->

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...