Sign in to follow this  
Followers 0
Randelia

[contribution support] Custom META Tags per ITEM

87 posts in this topic

I just installed this and it works pretty good, except, in the scrrenshots it shows where you can add keywords along with the product information, but when I add a new product I don't see a place to do that at all...what am I missing...?

 

Wow, I found it, awesome! Never mind! :D

Share this post


Link to post
Share on other sites
Wow, I found it, awesome! Never mind! :D

 

Uh...wait...now the title tag is missing? The meta title tag is there, but the regular one is gone :huh: Anyone know how to correct this?

Share this post


Link to post
Share on other sites
Uh...wait...now the title tag is missing? The meta title tag is there, but the regular one is gone :huh: Anyone know how to correct this?

 

I have been adding my tag values in the database.

 

Lisa

Share this post


Link to post
Share on other sites
I have been adding my tag values in the database.

 

Lisa

 

 

I've done that too, and it seems to work ok, but the real problem occurs when the H1 tag doesn't show...do you know of a way to fix this?

Share this post


Link to post
Share on other sites
I've done that too, and it seems to work ok, but the real problem occurs when the H1 tag doesn't show...do you know of a way to fix this?

 

Not sure. I haven't had time to add the fix to my cart yet because of the power outages in my area but if I figure it out I will let you know.

 

Lisa

Share this post


Link to post
Share on other sites
Not sure. I haven't had time to add the fix to my cart yet because of the power outages in my area but if I figure it out I will let you know.

 

Lisa

 

Anyone know how to get the h1 tags to show while using this...?

Share this post


Link to post
Share on other sites

I have installed the contribution on a clean site and it went well.

However the tags only work for the categories and not the products. THe products always show the default tags.

Any ideas what this might be?

Share this post


Link to post
Share on other sites
I have installed the contribution on a clean site and it went well.

However the tags only work for the categories and not the products. THe products always show the default tags.

Any ideas what this might be?

OK the patch from Kam Rcing does not work on my site. Everything works of I disable Search Engine friendly URL's but if they are enabled this doesnt work even with Kams patch.

 

Any other ideas?

Share this post


Link to post
Share on other sites

How do I remove the category name from the Title on my product pages?

 

Even after I specify the title tag for a product page, it makes the title tag using this format: {product category name} {Specified Title}

 

How do I remove the category name?

 

Thanks,

Adam

Share this post


Link to post
Share on other sites
OK the patch from Kam Rcing does not work on my site. Everything works of I disable Search Engine friendly URL's but if they are enabled this doesnt work even with Kams patch.

 

Any other ideas?

 

 

I am having this problem also. I have checked all the way through the install and I can't see anything which I have done incorrectly.

 

The default tags are displayed where they should be

The category tags are displayed when you view the categories, but when you go to the product pages, they revert to the default tags instead of the individual item ones.

 

I am running SEO-G, but it makes no difference if I have it enabled or disabled, the product tags do not work.

 

Anybody have any tips please?

Share this post


Link to post
Share on other sites

Sorry I can't edit my last post so have had to add a new one.

 

This is the content from includes/functions/general.php that relates to this contribution :

 

//Default META TAGS: Change these to what you want.

//These will be the default throughout the entire store

$Description="<my description>";

$Keywords="<my keywords>";

$Pagetitle="<my default title>";

$Reviewheader="Product Review: ";

 

switch($strPAGE){

case 'product_info':

case 'product_review':

$product_info_query = tep_db_query("select products_keywords, products_metadescription, products_pagetitle from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $id . "' and language_id = '" . (int)$languages_id . "'");

$product_info = tep_db_fetch_array($product_info_query);

if (tep_not_null($product_info['products_keywords'])){$Keywords=$product_info['products_keywords'];}

if (tep_not_null($product_info['products_metadescription'])){$Description=$product_info['products_metadescription'];}

if (tep_not_null($product_info['products_pagetitle'])){$Pagetitle=$product_info['products_pagetitle'];}

break;

 

case 'categories':

if(strrpos($id,'_')!=false){ $id=substr($id,strrpos($id,'_')+1);}

$categories_query = tep_db_query("select categories_keywords, categories_metadescription, categories_pagetitle from " . TABLE_CATEGORIES . " where categories_id = '" . $id . "'");

$categories = tep_db_fetch_array($categories_query);

if (tep_not_null($categories['categories_keywords'])){$Keywords=$categories['categories_keywords'];}

if (tep_not_null($categories['categories_metadescription'])){$Description=$categories['categories_metadescription'];}

if (tep_not_null($categories['categories_pagetitle'])){$Pagetitle=$categories['categories_pagetitle'];}

break;

}

 

if($strPAGE=='product_review') { // Add 'Product Review:' to TITLE

$Pagetitle= $Reviewheader . $Pagetitle;

}

 

return ("<META NAME=\"Description\" CONTENT=\"" . $Description . "\">\n" .

"<META NAME=\"Keywords\" CONTENT=\"" . $Keywords . "\">\n" .

"<TITLE>" . $Pagetitle . "</TITLE>\n");

}

// -Randelia Custom_META_Tags_Per_Item.

 

 

Here is a category address (which the meta tags work correctly on) :

http://toptiara.com/index_cpath-21.html

 

Here is a product address (which the tags will not work on) :

http://toptiara.com/product_info_cpath-21_...cts_id-133.html

 

 

Looking at the code, it should be picking up the 'product_info' part of the address and parsing the relevant keywords, description and title, but it is not doing so. I don't know enough PHP to debug it. Anybody able to identify what might need to be changed to remedy it please?

1 person likes this

Share this post


Link to post
Share on other sites
Sorry I can't edit my last post so have had to add a new one.

 

This is the content from includes/functions/general.php that relates to this contribution :

 

//Default META TAGS: Change these to what you want.

//These will be the default throughout the entire store

$Description="<my description>";

$Keywords="<my keywords>";

$Pagetitle="<my default title>";

$Reviewheader="Product Review: ";

 

switch($strPAGE){

case 'product_info':

case 'product_review':

$product_info_query = tep_db_query("select products_keywords, products_metadescription, products_pagetitle from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $id . "' and language_id = '" . (int)$languages_id . "'");

$product_info = tep_db_fetch_array($product_info_query);

if (tep_not_null($product_info['products_keywords'])){$Keywords=$product_info['products_keywords'];}

if (tep_not_null($product_info['products_metadescription'])){$Description=$product_info['products_metadescription'];}

if (tep_not_null($product_info['products_pagetitle'])){$Pagetitle=$product_info['products_pagetitle'];}

break;

 

case 'categories':

if(strrpos($id,'_')!=false){ $id=substr($id,strrpos($id,'_')+1);}

$categories_query = tep_db_query("select categories_keywords, categories_metadescription, categories_pagetitle from " . TABLE_CATEGORIES . " where categories_id = '" . $id . "'");

$categories = tep_db_fetch_array($categories_query);

if (tep_not_null($categories['categories_keywords'])){$Keywords=$categories['categories_keywords'];}

if (tep_not_null($categories['categories_metadescription'])){$Description=$categories['categories_metadescription'];}

if (tep_not_null($categories['categories_pagetitle'])){$Pagetitle=$categories['categories_pagetitle'];}

break;

}

 

if($strPAGE=='product_review') { // Add 'Product Review:' to TITLE

$Pagetitle= $Reviewheader . $Pagetitle;

}

 

return ("<META NAME=\"Description\" CONTENT=\"" . $Description . "\">\n" .

"<META NAME=\"Keywords\" CONTENT=\"" . $Keywords . "\">\n" .

"<TITLE>" . $Pagetitle . "</TITLE>\n");

}

// -Randelia Custom_META_Tags_Per_Item.

Here is a category address (which the meta tags work correctly on) :

http://toptiara.com/index_cpath-21.html

 

Here is a product address (which the tags will not work on) :

http://toptiara.com/product_info_cpath-21_...cts_id-133.html

Looking at the code, it should be picking up the 'product_info' part of the address and parsing the relevant keywords, description and title, but it is not doing so. I don't know enough PHP to debug it. Anybody able to identify what might need to be changed to remedy it please?

 

Seems there is limited to no support for this contribution any more looking at the thread history.

 

I switched to the header tags controller contribution. Removing this one was pretty easy (albeit a little long due to code changes) and install of the other was pretty easy too. The best bit is that the other one works :)

Share this post


Link to post
Share on other sites

I have installed this and whether I manually change the admin/catagories or upload the file provided I get the following error:

 

Parse error: syntax error, unexpected '}' in /home/supreme/public_html/admin/categories.php on line 1122

 

Any Ideas?

Share this post


Link to post
Share on other sites

Hi,

 

I really like this contribution - and whilst setting it up everything was going well... until I discovered I only get the defaults on the product info pages. The category pages are right, and the metadata for the products is going into the database - just something isn't letting it display on the products_info page like it should.

 

Anyone else had this problem/got any ideas?

 

I've used pretty much the files that came with the pack, so don't think I've typo-ed anything!

 

Thanks,

lisa x

Share this post


Link to post
Share on other sites

This is a definitely a hack, but it worked for me. On product_info.php replace the <?php echo ShowMETA('product_info', $products_id, $languages_id); ?> part with the following...

 

<?php // Randelia Custom_META_Tags_Per_Item. Includes TITLE!

// echo ShowMETA('product_info', $products_id, $languages_id);

 

$product_info_query = tep_db_query("select products_keywords, products_metadescription, products_pagetitle from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

$product_info = tep_db_fetch_array($product_info_query);

 

echo '<title>' . $product_info['products_pagetitle']. '</title>';

echo '<meta name="description" content="' . $product_info['products_metadescription']. '">';

echo '<meta name="keywords" content="' . $product_info['products_keywords']. '">';

?>

 

Perhaps someone can more elegantly put this in the showMETA function like the rest of the mod, but I couldn't get it to work.

Notice that products_id = '" . (int)$HTTP_GET_VARS['products_id'] differs from the mod's syntax which calls the $id variable.

 

Hope this helps.

Share this post


Link to post
Share on other sites

Hi,

 

I love the mod!

 

I have it all working with the exception of the actual individual product page. I can't seem to figure out why the title is not displaying the title that I put for the individual product rather than the category.

 

Your help is appreciated.

 

Not sure how to cancel this reply but I figured it out I did not have echo ShowMETA('product_info', $products_id, $languages_id); ?>

Edited by fan4chevy

Share this post


Link to post
Share on other sites

Hi,

This is a great contribution.

I have just installed it and it works great.

My shop uses MVS - Multi Vendor Shipping, so I had to merge the two modifications in the places where they overlapped in /admin/categories.php

 

There were two queries that needed to be merged, these are the two, in order as they appear in the instructions.

 

	  $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, pd.products_keywords, pd.products_metadescription, pd.products_pagetitle, p.products_id, p.products_quantity, p.products_model, p.vendors_prod_id, p.products_image, p.products_price, p.vendors_product_price, p.products_weight, p.vendors_prod_comments, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.vendors_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

Above is the first one you will encounter, this code is the merged query, use this instead.

Below is the second one you will encounter. This code is the merged query, use this instead.

  
  $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, pd.products_keywords, pd.products_metadescription, pd.products_pagetitle, p.products_quantity, p.products_model, p.vendors_prod_id, p.products_image, p.products_price, p.vendors_product_price, p.products_weight, p.vendors_prod_comments, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id, p.vendors_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");

 

I have updated the contribution with the modified /admin/categories.php to merge it with the MVS hack.

I think these two queries were all that was needed (along with some common sense as far as arranging things goes) but I have included the complete merged file as it works on my site in the contrib.

I hope it helps someone and I'm not liable if it breaks your site! You may not need to, but it may be advisable to test on a non-production site first!

If anything, maybe just use it as a guide as you merge your files as you have them on your particular shop.

Share this post


Link to post
Share on other sites

i just want to thank you from the bottom of my heart...it works like a charm...with SEO urls and others too...really good

Share this post


Link to post
Share on other sites

Great Contribution, Easy and quick to install.

Question though, does anyone know how to alter the code so it would be possible to have the multilingual feature for the categories as well as the products? I get stuck trying to edit...

Share this post


Link to post
Share on other sites

I wanted to thank Bigfish,

I was having the same problem with the product info only showing the default and your code made it work. Although the default doesn't work now, it still shows what I enter in the database for the tags.

 

This had me totally stumped and I installed it successfully on my companies website and worked perfectly, but i'm now doing a site for someone and it wouldn't work on product info (only the defaults) I ran up and down the code and even turned off search engine safe urls' on both sites. Although this new one I'm working on had someone else install OSC and did some weird stuff to it but I still couldn't figure out the problem. Wonder if it's a register globals problem? I know my work has them turned on but not sure what this new sites host has.

 

I usually steel php code and can modify to an extent but am still learning a lot.

 

Again, Thanks Bigfish. I'd rather have the database inputs for the meta tags working rather then the defaults.

Share this post


Link to post
Share on other sites

Bigfish,

 

Thank you very much for your contribution to solving the issue!

Share this post


Link to post
Share on other sites
Hello.

 

I'm using your meta tags contribution, and needed a little help.

 

I have an admin section which I'm using this in, and there's a little problem. ( PMed you o this, but checked with my client & it's ok for me to post too apparently.)

 

I can edit the meta tags for existing products, but when I try and edit the tags for existing categories, I can't find the update/save button. It's completely vanished.

 

Any ideas??

 

I just installed the contribution and works like a charm but have this same problem... anybody knows how to solve it? Thanks!

Share this post


Link to post
Share on other sites
Bigfish,

 

Thank you very much for your contribution to solving the issue!

Bigfish

 

You give credit to your ''nick'' :D

 

thanks from me also, works like a charme now.

You made my life easyer and my shop better.

Share this post


Link to post
Share on other sites

Hello I am new and in the process of learning...

ur contribution sounds great..i need some help

 

Its written in instalation step

Pretty Easy Install: Run a SQL script, easy copy-paste modifications on 5 files, 1 detailed copy-paste file: If you have a modified the original admin/categories.php this install method is for you.

 

now can u tell me how and from where to run the SQL script...

 

secondly

 

if i am sing teh about method...i just need to modify the files or do i have to upload teh files also

 

 

regards

aly

Share this post


Link to post
Share on other sites

Hello all,

 

Firstly appreciate much for this great contribution :)

 

I following exactly the installation instructions. After setting some testing Tag contents, what can be seen is only the following on the webpage:

default page title goes here...

 

The Version I installed:

1. osCommerce 2.2 MS2 RC2a

2. Custom META Tags per Item v1.0 for Oscommerce 2.2 MS2

 

Please kindly advise if I missed out some setting steps? thank you very much.

 

Best regards,

allright

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0