Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * - - 2 votes

KissMT Dynamic SEO Meta & Canonical Header Tags


  • You cannot reply to this topic
587 replies to this topic

#561 kvadre

  • Community Member
  • 43 posts
  • Real Name:jesper emborg

Posted 04 September 2011, 07:54

Hi

Sorry if this has been posted before, but i'm not good friends with the new search function on the forum.

My problem is that in the title and descrioption I get an space when I use a specieal danish caracter, so instead of looking like "får" it comes out "få r"

Any idea how to fix this?

Kind regards
Jesper

#562 hughesca

  • Community Member
  • 133 posts
  • Real Name:Chris Hughes

Posted 11 September 2011, 14:57

Hey there!

For security purposes I had removed the real names from the product reviews and replaced them with "Verified Member". I noticed Kiss MT was pulling the customer name and including it in the header tags.

I made the following modification replacing the customer name with a max of 80 characters of the actual reviews text.

In includes/modules/kiss_meta_tags/modules/product_reviews_info.php, around line 66:

Replace:

$this->parse( KissMT::init()->entities( sprintf( KISSMT_PRODUCT_REVIEWS_INFO_TEXT, $product_results['customers_name'] ), $decode = true ) . '[-separator-]' . KissMT::init()->entities( $leading_values, $product_results['reviews_text'], $decode = true ) );

With:

$this->parse( KissMT::init()->entities( $leading_values, $product_results['reviews_text'], $decode = true ) . '[-separator-]' . KissMT::init()->entities( sprintf( '%.80s', $product_results['reviews_text'] ), $decode = true ));

I'm curious if this will cause any issues? If not, I hope it will help others looking to do the same thing.

Peace,
Chris

#563 hughesca

  • Community Member
  • 133 posts
  • Real Name:Chris Hughes

Posted 11 September 2011, 15:16

Oops, I posted the wrong modification. :P

Here is the correct replacement code:

$this->parse( KissMT::init()->entities( sprintf( KISSMT_PRODUCT_REVIEWS_INFO_TEXT, 'Verified Member' ), $decode = true ) . '[-separator-]' .
	 KissMT::init()->entities( $leading_values, $product_results['reviews_text'], $decode = true ) . '[-separator-]' .
	 KissMT::init()->entities( sprintf( '%.80s', $product_results['reviews_text'] ), $decode = true ));


#564 RMD27

  • Community Member
  • 259 posts
  • Real Name:Ricardo
  • Gender:Male

Posted 22 September 2011, 12:58

Number of characters displayed in H1 tags on category and manufacturer pages.

Although the meta title gives out the full title, the title on the page itself seems to be cut short.

Can you tell me where I can change the number of characters shown in the H1 tags, I have tried the init file but i do not see anything

To give an example of what I mean

On a manufacturers page in h1 I have the following

Quote

Yokohama - Ελαστικά/Elastika - S


The Meta title of this page reads


Quote

Yokohama - Ελαστικά Elastika - S & C Shop - ελαστικα Elastika ελαστικά

"S & C Shop" are the fill terms I have entered in the language file

I am looking for the text in the h1 tags in the category and manufactuer pages to read

Quote

Yokohama - Ελαστικά Elastika - S & C Shop

in this example.

ie the h1 text heading to stop at the fill terms set in the language file

I hope this makes sense, if not please let me know!

Edited by RMD27, 22 September 2011, 13:01.


#565 RMD27

  • Community Member
  • 259 posts
  • Real Name:Ricardo
  • Gender:Male

Posted 23 September 2011, 09:40

View PostRMD27, on 22 September 2011, 12:58, said:

Number of characters displayed in H1 tags on category and manufacturer pages.

Although the meta title gives out the full title, the title on the page itself seems to be cut short.

Can you tell me where I can change the number of characters shown in the H1 tags, I have tried the init file but i do not see anything

To give an example of what I mean

On a manufacturers page in h1 I have the following



The Meta title of this page reads




"S & C Shop" are the fill terms I have entered in the language file

I am looking for the text in the h1 tags in the category and manufactuer pages to read



in this example.

ie the h1 text heading to stop at the fill terms set in the language file

I hope this makes sense, if not please let me know!

Just to clarify, I have changed the KISS_MT_PAGE_TITLE_LENGTH in the init file to 200 characters but it does not seem to have any effect. The title still gets cut off short

#566 christos

  • Community Member
  • 9 posts
  • Real Name:Christos
  • Gender:Male
  • Location:Australia

Posted 16 October 2011, 14:19

Having a slight problem with the google breadcrumb.

My question is shouldn't the below have another </li>?

function trail($separator = ' - ') {
$trail_string = '';

for (
$i=0, $n=sizeof($this->_trail); $i<$n; $i++) {
if (isset(
$this->_trail[$i]['link']) && tep_not_null($this->_trail[$i]['link'])) {
$trail_string .= '<li><a href="' . $this->_trail[$i]['link'] . '" class="headerNavigation">' . $this->_trail[$i]['title'] . '</a>';
} else {
$trail_string .= '<li>' . $this->_trail[$i]['title'];
}

if ((
$i+1) < $n) $trail_string .= $separator;
$trail_string .= '</li>';
}

return
$trail_string;
}
}

?>


This is two opens but only one close....... Displays as a list - below each other rather than beside each other. Is this correct?

If it should please let me know where to place it.
Thanks for your time.

#567 RMD27

  • Community Member
  • 259 posts
  • Real Name:Ricardo
  • Gender:Male

Posted 18 October 2011, 14:00

View Postburt, on 28 December 2010, 23:12, said:

Try;

$ucfirst_words[] = ucfirst( strtolower( $it->current() ) );

to;

$ucfirst_words[] = it->current();

Similar for;

$file_title = ucfirst( strtolower( str_replace( '_', ' ', $short_filename ) ) ); 

May have an effect elsewhere - have no idea why it is being changed to lowercase, then having the first letter capitalised. Rob?
Hello Burt

Blast from the past on this thread I know, but if you could take the time to let me know which file this is in it would be appreciated[img]http://forums.oscommerce.com//public/style_emoticons/default/smile.png[/img]

#568 Trentide

  • Community Member
  • 471 posts
  • Real Name:Jason Maier
  • Gender:Male

Posted 21 October 2011, 20:15

Hi, I have a general question for you regarding this awesome add-on. It seems Google has a problem with many of my title tags and meta descriptions. Will this contribution fix these? I will elaborate.

1) I have missing title tags in the form of:

http://www.subcitizen.com/ames-bros-3d-monkey-t-shirt-heather-ash-pi-442.html.

All of them have a "pi" towards the end of the url. When I click on them they show a blank page with a question mark in the corner.

2) Also, I have duplicate title tags in the form of:

http://www.subcitizen.com/ames-bros-robot-kong-shirt-kelly-green-pr-461.html
http://www.subcitizen.com/ames-bros-robot-kong-shirt-kelly-green-p-461.html
http://www.subcitizen.com/ames-bros-robot-kong-shirt-kelly-green-pi-461.html

This is the most common but could also include review pages

3) Lastly, I have duplicate meta descriptions of the same sort. Many with pr and p towards the end of the url.

Thanks so much for your help.

Jason

#569 snowbird

  • Community Member
  • 83 posts
  • Real Name:Snowbird
  • Gender:Male
  • Location:Istanbul

Posted 31 October 2011, 15:27

I have a question regarding canonical link feature. Sorry if this issue is already discussed here.

Thanks a million that this contrib also produce canonical links for products, but in order to keep google position in particular product should we use non-SEO product URL as canonical like

<link rel="canonical" href="http://www.example.com/products_info.php?products_id=xxx" />

instead of

<link rel="canonical" href="http://www.example.com/my-perfect-product-p-xxx.html" />

I'm asking this because when we change the product name canonical link is also changing (see below), so does google thinks this is a new URL to crawl?

<link rel="canonical" href="http://www.example.com/my-perfect-product-is-now-much-cheeper-p-xxx.html" />

But if we use non-SEO product URL it will be the same as always.
What you think?

Edited by snowbird, 31 October 2011, 15:28.

---------------------------------------------
Regards,

Snowbird

#570 Trentide

  • Community Member
  • 471 posts
  • Real Name:Jason Maier
  • Gender:Male

Posted 15 November 2011, 19:32

Hi. Thanks for this cool contribution! I installed the two minute test and had a problem with the way my site was displaying my products afterwards. All the columns went missing along with the "other product suggestions" module. Is this how it's supposed to work? Thanks so much!

Jason

#571 Trentide

  • Community Member
  • 471 posts
  • Real Name:Jason Maier
  • Gender:Male

Posted 16 November 2011, 02:29

Sorry. I should have made myself more clear.

Here's an example of what I'm talking about:

Before Kiss: http://www.subcitizen.com/images/before%20Kiss.png

After Kiss: http://www.subcitizen.com/images/After%20Kiss.png

Also, will this contribution fix canonical problems dealing with:

http://www.yoursite.com
http://yoursite.com
http://www.yoursite/index.com

Thanks so much!!

Jason

#572 RMD27

  • Community Member
  • 259 posts
  • Real Name:Ricardo
  • Gender:Male

Posted 17 November 2011, 08:36

View Postsnowbird, on 31 October 2011, 15:27, said:

I have a question regarding canonical link feature. Sorry if this issue is already discussed here.

Thanks a million that this contrib also produce canonical links for products, but in order to keep google position in particular product should we use non-SEO product URL as canonical like

<link rel="canonical" href="http://www.example.com/products_info.php?products_id=xxx" />

instead of

<link rel="canonical" href="http://www.example.com/my-perfect-product-p-xxx.html" />

I'm asking this because when we change the product name canonical link is also changing (see below), so does google thinks this is a new URL to crawl?

<link rel="canonical" href="http://www.example.com/my-perfect-product-is-now-much-cheeper-p-xxx.html" />

But if we use non-SEO product URL it will be the same as always.
What you think?
I wouldn't worry about it. I do not believe it will hurt your ranking as the old address diverts to the new address

#573 RMD27

  • Community Member
  • 259 posts
  • Real Name:Ricardo
  • Gender:Male

Posted 17 November 2011, 08:39

View PostTrentide, on 16 November 2011, 02:29, said:

Sorry. I should have made myself more clear.

Here's an example of what I'm talking about:

Before Kiss: http://www.subcitize...fore%20Kiss.png

After Kiss: http://www.subcitize...fter%20Kiss.png

Also, will this contribution fix canonical problems dealing with:

http://www.yoursite.com
http://yoursite.com
http://www.yoursite/index.com

Thanks so much!!

Jason
The before and after shots should not have anything to do with KissMT, it is possible that another contribution is conflicting with KissMT maybe... but KissMT has nothing to do with the left column

About the index address, I believe KissMT will make all links to the index pages the same ie either the top or middle address that you gave

#574 Trentide

  • Community Member
  • 471 posts
  • Real Name:Jason Maier
  • Gender:Male

Posted 17 November 2011, 18:03

View PostRMD27, on 17 November 2011, 08:39, said:

The before and after shots should not have anything to do with KissMT, it is possible that another contribution is conflicting with KissMT maybe... but KissMT has nothing to do with the left column

I do have Header Tags SEO installed. Could that conflict be causing the pages to format weirdly?

Regarding the index address: Could you choose which one you prefer; www vs non www?

Thanks RMD27!

#575 RMD27

  • Community Member
  • 259 posts
  • Real Name:Ricardo
  • Gender:Male

Posted 18 November 2011, 09:40

i think you choose if your site is www or non www when you instal osc, if I remember correctly

about having header tags seo and kissmt installed. i would not be surprised if it caused some sort of conflict as they are both trying to write meta tags, whether it would effect the left column i dont know.

imho kissmt is too unobtrusive to cause the problems you are having with regards to layout

question - if you have headers tags seo installed why would you bother with kissmt?

#576 kwarming

  • Community Member
  • 4 posts
  • Real Name:Kim

Posted 19 December 2011, 12:04

Hi,
here is a list with the danish stopwords, if it haven't already been posted?[img]http://forums.oscommerce.com//public/style_emoticons/default/blush.png[/img]
remember to rename it to dansih_stopwords.ini

Attached Files



#577 kwarming

  • Community Member
  • 4 posts
  • Real Name:Kim

Posted 19 December 2011, 12:21

and the german stopwords....

Attached Files



#578 dlsmyth

  • Community Member
  • 4 posts
  • Real Name:Dennis Smith
  • Gender:Male
  • Location:Colorado, USA

Posted 27 December 2011, 15:49

Hello all, this is a wonderful contribution, i've installed it on a highly customized templete and it works without a hitch. I was wondering if there is a way to suppress it from pulling the model number into the meta tags?

Thanks for any help..

www.jewelryallstars.com

Dennis

#579 dlsmyth

  • Community Member
  • 4 posts
  • Real Name:Dennis Smith
  • Gender:Male
  • Location:Colorado, USA

Posted 28 December 2011, 15:43

I found the solution to my own problem. If any one is interested in my solution. In the file:

catalog/includes/modules/kiss_meta_tags/modules/product_info.php

in this part:

public function __construct() {
$this->products_query = "SELECT p.products_model, pd.products_name, pd.products_description, m.manufacturers_name FROM " . TABLE_PRODUCTS . " p INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON pd.products_id = p.products_id AND pd.language_id = :languages_id LEFT JOIN " . TABLE_MANUFACTURERS . " m ON m.manufacturers_id = p.manufacturers_id WHERE p.products_id = :products_id";

I removed the highlighted text and it no longer pulls the model number into the meta data.

Dennis

#580 ganoo42o

  • Community Member
  • 1 posts
  • Real Name:Andrew

Posted 30 December 2011, 00:54

I am trying to get this to work with my site and I am having problems finding <title><?php echo TITLE; ?></title> in any of the files that is said to change. This is my first attempt at installing an add on. Someone else had started this add on for me so I looked for the code it was to be replaced with and I can't find that either in any of the file it says to change. I also was looking at the other file I would need to change for the optional extras categories-manufactures and was only able to find require('includes/application_top.php')and require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);in the index.php file and nothing else I need to change. Here is my index.php file, please help and sorry if this already addressed.




<?php
/*
$Id$

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

Copyright © 2010 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 . "'");
$categories_products = tep_db_fetch_array($categories_products_query);
if ($categories_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);

require(DIR_WS_INCLUDES . 'template_top.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);
?>
<h1><?php echo $category['categories_name']; ?></h1>

<div class="contentContainer">
<div class="contentText">
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<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)) {
if(SMALL_IMAGE_DEFAULT=='true') {
$cat_img = ((file_exists(DIR_WS_IMAGES . $categories['categories_image'])) && ($categories['categories_image']!='')) ? DIR_WS_IMAGES . $categories['categories_image'] : DIR_WS_IMAGES . 'noImage.jpg';
} else {
$cat_img = DIR_WS_IMAGES . $categories['categories_image'];
}
$rows++;
$cPath_new = tep_get_path($categories['categories_id']);
$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image($cat_img, $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories['categories_name'] . '</a></td>' . "\n";
if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
echo ' </tr>' . "\n";
echo ' <tr>' . "\n";
}
}

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

<br />

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

</div>
</div>

<?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'])) || (!preg_match('/^[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;
}
}

$catname = HEADING_TITLE;
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
$image = tep_db_query("select manufacturers_image, manufacturers_name as catname from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
$image = tep_db_fetch_array($image);
$catname = $image['catname'];
} elseif ($current_category_id) {
$image = tep_db_query("select c.categories_image, cd.categories_name as catname from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
$image = tep_db_fetch_array($image);
$catname = $image['catname'];
}
?>

<h1><?php echo $catname; ?></h1>

<div class="contentContainer">

<?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 '<div>' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . '<p align="right">' . 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() . '</p></form></div>' . "\n";
}
}

include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>

</div>
<?php
} else { // default page

if(isset($HTTP_GET_VARS['page_id']) && $HTTP_GET_VARS['page_id']!='') {
$article_id = (int)$HTTP_GET_VARS['page_id'];
?>
<div class="contentContainer">
<div class="contentText">
<?if($article_id>0){?>
<h1><?php echo tep_get_articles_name($article_id); ?></h1>
<?php echo tep_get_articles_description($article_id); ?>
<?}else{?>
<h1>Page Not Found</h1>
<?}?>

</div>
</div>
<?php } else { ?>
<h1><?php echo HEADING_TITLE; ?></h1>

<div class="contentContainer">
<div class="contentText">

<?php echo tep_get_articles_description(1); ?>
</div>

<?php

#include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);
include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>
</div>
<?php
}

}

require(DIR_WS_INCLUDES . 'template_bottom.php');
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>