Deprecated: Assigning the return value of new by reference is deprecated in /home/sodoityo/public_html/wp-settings.php on line 512

Deprecated: Assigning the return value of new by reference is deprecated in /home/sodoityo/public_html/wp-settings.php on line 527

Deprecated: Assigning the return value of new by reference is deprecated in /home/sodoityo/public_html/wp-settings.php on line 534

Deprecated: Assigning the return value of new by reference is deprecated in /home/sodoityo/public_html/wp-settings.php on line 570

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/sodoityo/public_html/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/sodoityo/public_html/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el(&$output) in /home/sodoityo/public_html/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el(&$output) in /home/sodoityo/public_html/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/sodoityo/public_html/wp-includes/classes.php on line 1244

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/sodoityo/public_html/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/sodoityo/public_html/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el(&$output) in /home/sodoityo/public_html/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el(&$output) in /home/sodoityo/public_html/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/sodoityo/public_html/wp-includes/classes.php on line 1442

Strict Standards: Redefining already defined constructor for class wpdb in /home/sodoityo/public_html/wp-includes/wp-db.php on line 306

Deprecated: Assigning the return value of new by reference is deprecated in /home/sodoityo/public_html/wp-includes/cache.php on line 103

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /home/sodoityo/public_html/wp-includes/cache.php on line 431

Deprecated: Assigning the return value of new by reference is deprecated in /home/sodoityo/public_html/wp-includes/query.php on line 61

Deprecated: Assigning the return value of new by reference is deprecated in /home/sodoityo/public_html/wp-includes/theme.php on line 1109

Strict Standards: Declaration of Walker_Comment::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/sodoityo/public_html/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/sodoityo/public_html/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::start_el() should be compatible with Walker::start_el(&$output) in /home/sodoityo/public_html/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::end_el() should be compatible with Walker::end_el(&$output) in /home/sodoityo/public_html/wp-includes/comment-template.php on line 1266

Strict Standards: Redefining already defined constructor for class WP_Dependencies in /home/sodoityo/public_html/wp-includes/class.wp-dependencies.php on line 31

Strict Standards: Redefining already defined constructor for class WP_Http in /home/sodoityo/public_html/wp-includes/http.php on line 61
 » osCommerce: STS and Dynamic Meta Tags : SoDoItYourself.com

osCommerce: STS and Dynamic Meta Tags
3 Votes | Average: 3.67 out of 53 Votes | Average: 3.67 out of 53 Votes | Average: 3.67 out of 53 Votes | Average: 3.67 out of 53 Votes | Average: 3.67 out of 5
Loading ... Loading ...


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/sodoityo/public_html/wp-content/plugins/postratings/postratings.php on line 399

Os CommerceOsCommerce is a great free ecommerce software. The plain vanilla release however has a few shortcommings but the ammount of released modifications makes it easy for anybody to modify it as you please. Sky’s the limit!


This article shows you how to use Simple Template System together with the cDynamic Meta Tags modification.

Simple Template System (STS)

OsCommerce vanilla release has no support for easy change of themes. Nobody wants a webshop looking like every other found on the net. STS makes it fairly easy to change the looks of your webshop just by changing a HTML template file.
This article uses v4.5.2 of STS. The latest version can be found here:
http://www.oscommerce.com/community/contributions,1524

Thanks to Chris “Rigadin2″ for his excellent work with this contribution.

cDynamic Meta Tags

There are quite a few mods for changing the osCommerce default meta tags. Dynamic Metatags however uses data from the Category and Product Names and aso the product description to produce meaningfull meta tags. This means less work for management as you don’t have to type in your own Tags and Titles.
This article uses Version 1.6. The latest version can be found here:
http://www.oscommerce.com/community/contributions,2895/

Thanks goes also to Chris LaRocque (azer, Glcustoms, Didier Debbaut and others) for their work with the Dynamic Meta Tags.

STS + cDynamic Meta Tags

The problem is that the Dynamic Meta Tags outputs the data direcly so it never seems to be catured by the STS. This modification enables the output from dynamic meta tags while STS is disabled and disables it when STS is enabled. The variables will instead be pulled from dynamic meta tags into the template.

Instructions

1.First of all install the two mentioned mods above.

2.Backup your files. Files that are going to be modified are:

  • catalog\includes\meta_tags.php
  • catalog\includes\modules\sts_inc\sts_user_code.php
  • Your current template.
    The standard is catalog\includes\sts_templates\test\sts_template.html

3. Open file catalog\includes\meta_tags.php

Find:

# Keywords
tep_not_null(HEAD_KEY_TAG_ALL)
  ? $key.='-'. STORE_KEYWORD
  : NULL;

$metakeywords=strtolower(meta_create_meta_keywords($key));
}
After Add:

// Mod STS + cDynamic Meta Tags
// Check if STS is enabled or in test mode
    if ((MODULE_STS_DEFAULT_STATUS == 'true') || (($_GET['sts_debug'] == MODULE_STS_DEBUG_CODE)))
	  { }

else {
Find:
#####################################   OUTPUT THE DATA    ##########################################
echo '  <title>'.$metatitle.'</title>' . "n";
echo '  <META NAME="Description" Content="' .$metadescription. '">' . "n";
echo '  <META NAME="Keywords" Content="' . $metakeywords . '">' . "n";
#####################################################################################################
After Add:

    }

// END STS + cDynamic Meta Tags Mod

4. Open catalog\includes\modules\sts_inc\sts_user_code.php

Somewhere in the file, prefably on the top after the comments

Add:
# Mod STS + cDynamic Meta Tags
 $sts->template['stsMetaTitle']='  <title>'.$metatitle.'</title>' . "n";
 $sts->template['stsMetaDescription']='  <META NAME="Description" Content="' .$metadescription. '">' . "n";
 $sts->template['stsMetaKeywords']='  <META NAME="Keywords" Content="' . $metakeywords . '">' . "n";
# End Mod STS + cDynamic Meta Tags

5.Open your current template.
The standard is catalog\includes\sts_templates\test\sts_template.html

Find:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html $htmlparams>
<head>
After Add:


 $stsMetaTitle
 $stsMetaDescription
 $stsMetaKeywords

6. All Done! Save and close all files.

Add 'osCommerce: STS and Dynamic Meta Tags' to Del.icio.us Add 'osCommerce: STS and Dynamic Meta Tags' to digg Add 'osCommerce: STS and Dynamic Meta Tags' to FURL Add 'osCommerce: STS and Dynamic Meta Tags' to blinklist Add 'osCommerce: STS and Dynamic Meta Tags' to My-Tuts Add 'osCommerce: STS and Dynamic Meta Tags' to reddit Add 'osCommerce: STS and Dynamic Meta Tags' to Feed Me Links! Add 'osCommerce: STS and Dynamic Meta Tags' to Technorati Add 'osCommerce: STS and Dynamic Meta Tags' to Socializer 

11 comments to “osCommerce: STS and Dynamic Meta Tags”

  1. Comment by PlugIM.com:

    osCommerce: Installing Dynamic Meta Tags in STS…

    How to install Dynamic Meta Tags in Simple Template System for osCommerce. OsCommerce is a open source based eCommerce platform that is highly customizable.

    A must read if you are into eCommerce….

  2. Comment by eBoxNet:

    just add the code in catalog\includes\modules\sts_inc\sts_user_code.php

    # Mod STS + cDynamic Meta Tags
    $sts->template['stsMetaTitle']=’ ‘.$metatitle.” . “”;
    $sts->template['stsMetaDescription']=’ ‘ . “”;
    $sts->template['stsMetaKeywords']=’ ‘ . “”;
    # End Mod STS + cDynamic Meta Tags

    and then add

    $stsMetaTitle
    $stsMetaDescription
    $stsMetaKeywords

    in your template file. remember to remove the and will be fine

  3. Comment by Simon:

    @David:

    The ‘n’ should be a line break: replace “n” with “\n” and it should work fine.

    I’m having a similar problem with output though. I have tested on a development copy of my client’s site and can get it working properly. I install cDynamic Meta Tags on the production site and get no output at the template stage other than empty HTML tags. This suggests to me that the variables aren’t being passed to the templates somewhere up the line. I have tested the code in sts_user_code.php by putting some static text in the title tag, and confirmed this. It looks like the $meta- variables need to be passed on somewhere. More when I find it.

  4. Comment by Michael:

    Hello.

    I have installed following the above instructions, but i get a “

  5. Comment by Michael:

    Hmm… it was not that :)

    Here it comes again:

    Hello.

    I have installed following the above instructions, but i get a [Opening Tag] (- cant write it, because this blog will disform it) in the top left corner of my site now. Everything else is working fine (also Meta).

    Can some one please help me? I cant find a loose tag anywhere :(

    The tag is somewhere in my catalog\includes\meta_tags.php - i think.

    I really hope you can help! - Michael

  6. Comment by kevin:

    // Mod STS + cDynamic Meta Tags
    // Check if STS is enabled or in test mode
    if ((MODULE_STS_DEFAULT_STATUS == ‘true’) || (($_GET['sts_debug'] == MODULE_STS_DEBUG_CODE)))
    { };

    that works

  7. Comment by Antoine Hoekman:

    I had the same problem with empty variables. The problem is that the above installation procedure is not complete. The meta_tags.php file isn’t called from any code.

    Adding the line below to the beginning of sts_user.php (right after

  8. Comment by Antoine Hoekman:

    addition to above post.

    Meant:

    right after the opening php tag.

    require(DIR_WS_INCLUDES . ‘meta_tags.php’);

    This solved the problem for me.

    Kind regards,

    Antoine

  9. Comment by Antoine Hoekman:

    Another Addition/

    Don’t use require(DIR_WS_INCLUDES . ‘meta_tags.php’); in str_user_code.php … after that index.php and categories don’t work anymore. In stead add the line

    require(DIR_WS_INCLUDES . ‘meta_tags.php’);

    Somewhere in

    product_info.php
    specials.php
    products_new.php

    somewhere after another require.

    Hopefully everything works fine know .. if not let me know.

    Antoine

  10. Comment by Benjamin Baez:

    Very nice article, here are clarifications and augments:

    3. Open file catalog\includes\meta_tags.php
    Find (Pay careful attention since there are many similar declarations, ~line 366):

    # Keywords
    tep_not_null(HEAD_KEY_TAG_ALL)
    ? $key.=’-’. STORE_KEYWORD
    : NULL;

    $metakeywords=strtolower(meta_create_meta_keywords($key));
    }

    After Add:

    // Mod STS + cDynamic Meta Tags
    // Check if STS is enabled or in test mode
    if ((MODULE_STS_DEFAULT_STATUS == ‘true’) || (($_GET['sts_debug'] == MODULE_STS_DEBUG_CODE))) {

    } else {

    Find (Version 1.6.0 had the following error; “n” should be “\n”:
    ##################################### OUTPUT THE DATA ##########################################
    echo ‘ ‘.$metatitle.” . “\n”;
    echo ‘ ‘ . “\n”;
    echo ‘ ‘ . “\n”;
    #####################################################################################################
    After Add:

    }

    // END STS + cDynamic Meta Tags Mod

    window.google_render_ad();
    4. Open catalog\includes\modules\sts_inc\sts_user_code.php
    Somewhere in the file, preferably on the top after the comments
    Add:
    # Mod STS + cDynamic Meta Tags
    # Empty current headertags so we control what goes in, should only be
    $sts->template['headertags'] = ”;
    $sts->template['headertags'] = $sts->template['headertags'] . ”.$metatitle.” .”\n”;
    $sts->template['headertags'] = $sts->template['headertags'] . ” .”\n”;
    $sts->template['headertags'] = $sts->template['headertags'] . ” .”\n”;
    # End Mod STS + cDynamic Meta Tags

    5.Open your current template.
    The standard is catalog\includes\sts_templates\test\sts_template.html
    Find:

    After Add:

  11. Comment by aron yu:

    STORE_DESCRIPT
    STORE_METDEX
    store_keyword

    where do i go set those ?? please email me info@aronatic.com w/ solutions

    thanks