Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution support] Custom META Tags per ITEM


Randelia

Recommended Posts

  • 3 weeks later...
  • 2 months later...
  • 3 months later...
  • 8 months later...

In case anyone is interested. I uploaded a file to the contribution for a better search. The file will enable searching through Title, Meta Keywords, Description. etc.

 

Very easy to install. Only change one file. Works great on OSC.

 

Hope this helps,

 

Charles

Link to comment
Share on other sites

 

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.

 

 

In the setup instructions that were provided, Randelia may have forgotten to provide the code for the 'product_info' case in his ShowMETA function. Install as instructed per Randelia's "Installation.html".

 

Finally, modify: /includes/functions/general.php

 

REPLACE:

 

  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;

 

WITH:

 

  case 'product_info':
      $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 '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;

 

You can now also revert to the default META, TITLE values when blank.

Edited by ilocanosc
Link to comment
Share on other sites

  • 1 month later...

Well, it works ok for me - except I have nothing pertaining to this mod in my admin panel. In looking at the mod I can't see anything that adds anything to the admin panel at all. Maybe I have an old version, or something. In any case I wrote a 'back office' program that populates the three new fields in the category and products_description tables along with a way to modify them as needed.

 

Someone asked - "How do I run sql?"

It's done with PhPMyAdmin. Click on the sql tab after opening your database, copy/paste randy's sql into the box, click 'go'. Worked fine for me.

 

The result can be seen on my site here -> http://bonnefidesavings.com/catalog/index.php

(note: this is a live site, so don't make an order unless you mean it. *grin*)

Edited by mb01a
Link to comment
Share on other sites

  • 1 year later...

I have this contribution working for some years, in different sites, I want to have it working in combination with SIMPLE TEMPLATE SYSTEM (STS) contribution, but unfortunately I haven't been able to get it working.

Al the info is in the admin, everything seems to be ok, but it doesn't generate metatags!

I can tell, since there is no title tag displayed from the productpage.

It also takes the title tag (if nothing has been configured in one product) from the administration, not the title as configured in catalog/includes/functions/general.php

 

Where do I need to make any changes?? anyone?

Link to comment
Share on other sites

  • 8 months later...

this doesn't show any "page" info...all my product info, etc. pages show "default page title goes here"...

 

isn't it supposed to show the exact page/item meta info??

 

I read you have to change the default tags...but how can I add a default description for each product when there are over 200 products in my store??

same for keywords and page titles...

 

am I missing something here??

Link to comment
Share on other sites

  • 3 months later...

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...