Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Linda's Header Tag Controller


Rob Petterson

Recommended Posts

I seem to be having trouble setting up the configuration on this contrib (even after reading all the comments within the code).

 

This is part of the code:

/ DEFINITIONS FOR /includes/languages/english/header_tags.php



// Define your email address to appear on all pages

define('HEAD_REPLY_TAG_ALL','[email protected]');



// For all pages not defined or left blank, and for products not defined

// These are included unless you set the toggle switch in each section below to OFF ( '0' )

// The HEAD_TITLE_TAG_ALL is included BEFORE the specific one for the page

// The HEAD_DESC_TAG_ALL is included AFTER the specific one for the page

// The HEAD_KEY_TAG_ALL is included BEFORE the specific one for the page

define('HEAD_TITLE_TAG_ALL_OFF','0');

define('HEAD_DESC_TAG_ALL_OFF','0');

define('HEAD_KEY_TAG_ALL_OFF','0');



// DEFINE TAGS FOR INDIVIDUAL PAGES



// default.php

define('HTTA_DEFAULT_OFF','0'); // Include HEAD_TITLE_TAG_ALL in Title

define('HTKA_DEFAULT_OFF','0'); // Include HEAD_KEY_TAG_ALL in Keywords

define('HTDA_DEFAULT_OFF','0'); // Include HEAD_DESC_TAG_ALL in Description

define('HEAD_TITLE_TAG_DEFAULT', '');

define('HEAD_DESC_TAG_DEFAULT','Fasion jewellery, valetines, christmas, jewellery uk');

define('HEAD_KEY_TAG_DEFAULT','Fasion jewellery');



// product_info.php - if left blank in products_description table these values will be used

define('HTTA_PRODUCT_INFO_ON','1');

define('HTKA_PRODUCT_INFO_ON','1');

define('HTDA_PRODUCT_INFO_ON','1');

define('HEAD_TITLE_TAG_PRODUCT_INFO','');

define('HEAD_DESC_TAG_PRODUCT_INFO','');

define('HEAD_KEY_TAG_PRODUCT_INFO','');

 

What do I have to change to get the meta tag to read with the product title and desription, so that when looking at the HTNKL code on the fly you see something like this:

 

<meta name="description" content="Sterling Silver Pink Sapphire Scatter Ring, 59.95. This classy and elegant sterling silver ring from the Concepts collection is set with a scatter of pink sapphires. Comes complete with luxurious complimentary gift packaging.">

 

 

Any pointers?

 

Cheers,

 

Rob

Sometimes I think I understand everything, then I regain consciousness

Link to comment
Share on other sites

You need to enter the values of title, description, keyword for each of the product through admin control panel:

 

Admin -> Catalog -> Aategories/Products (choose the product to define value)

 

define('HEAD_TITLE_TAG_PRODUCT_INFO','');

define('HEAD_DESC_TAG_PRODUCT_INFO','');

define('HEAD_KEY_TAG_PRODUCT_INFO','');

 

You can define the default values in the above lines which are used if you do not define values for the products seperately through admin control panel.

 

Hope this helps you.

Link to comment
Share on other sites

Thanks Kavita for the reply. I didn't realize that I have to populate three additional fields in the products_description table. DFor some reason I thought that the info for the tags would be dynamically collected from other fields from within that or other tables.

So it makes sense now. All I've gotta do is just cut and paste the relevant data into those 3 fields - I'm going to do it this way rather than via the admin coz I've got a lot of products to edit.

 

Do you want to concatenate the product header title and product header description for the meta tag description?

 

Yes, that would be good to do. How would you do that?

 

 

Rob

Sometimes I think I understand everything, then I regain consciousness

Link to comment
Share on other sites

Replace the following lines in /catalog/includes/header_tags.php:

 

if (empty($the_product_info['products_head_desc_tag'])) {

$the_desc= HEAD_DESC_TAG_ALL;

} else {

if ( HTDA_PRODUCT_INFO_ON=='1' ) {

$the_desc= $the_product_info['products_head_desc_tag'] . ' ' . HEAD_DESC_TAG_ALL;

} else {

$the_desc= $the_product_info['products_head_desc_tag'];

}

}

 

with:

if (empty($the_product_info['products_head_desc_tag'])) {

$the_desc= $the_product_info['products_name'] . ' ' . $the_product_info['products_description'];

} else {

if ( HTDA_PRODUCT_INFO_ON=='1' ) {

$the_desc= $the_product_info['products_head_desc_tag'] . ' ' . HEAD_DESC_TAG_ALL;

} else {

$the_desc= $the_product_info['products_head_desc_tag'];

}

}

 

The above code will automatically cancatenate product name and description and put it meta tag description for each product.

 

Hope this work!

 

Make a backup of your file before modifications.

 

Kavita

Link to comment
Share on other sites

  • 3 weeks later...

I've some problems with my site. I've integrated the Linda's contribution and it seems to work but with some errors. I've tried some modifications but can't put it work fine. Please look in www.neuronios.com (portuguese language), click in any category link (i.e. fotografia digital), and in any sub-category. Choose a product an see what happens!!! There are something wrong an I don?t know what it is! Please if someone could help, I appreciate that.

Sorry the bad english.

 

Thanks all.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...