Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Header Tags Controller for Admin MS 2.2


Farrukh

Recommended Posts

  • Replies 4.6k
  • Created
  • Last Reply

Top Posters In This Topic

I can't seem to find this code anywhere, and I am using ms2. Maybe I am blind, if it is there could someone post the line # on a default install. Thanks

 

Find the following (approx line 377)



  } elseif ($HTTP_GET_VARS['action'] == 'new_product') {

   if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {

     $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, 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.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 . "'");

     $product = tep_db_fetch_array($product_query);

Link to comment
Share on other sites

I can't seem to find this code anywhere, and I am using ms2.  Maybe I am blind, if it is there could someone post the line # on a default install.  Thanks

 

Find the following (approx line 377)



  } elseif ($HTTP_GET_VARS['action'] == 'new_product') {

   if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {

     $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, 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.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 . "'");

     $product = tep_db_fetch_array($product_query);

 

This line is not present in MS2

 

} elseif ($HTTP_GET_VARS['action'] == 'new_product') {

 

 

Instead find this below code:

 

Its around 434 line:

 

<?php

 if ($action == 'new_product') {

   $parameters = array('products_name' => '',

                      'products_description' => '',

                      'products_url' => '',

                      'products_id' => '',

                      'products_quantity' => '',

                      'products_model' => '',

                      'products_image' => '',

                      'products_mediumimage' => '',

                      'products_largeimage' => '',

                      'products_price' => '',

                      'products_weight' => '',

                      'products_date_added' => '',

                      'products_last_modified' => '',

                      'products_date_available' => '',

                      'products_status' => '',

                          'products_tax_class_id' => '',

                      'manufacturers_id' => '');



   $pInfo = new objectInfo($parameters);



   if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {

$product_query = tep_db_query("select pd.products_name, pd.products_description,  pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, 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.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 . "'");

     $product = tep_db_fetch_array($product_query);

 

[/code]

Link to comment
Share on other sites

Farrukh,

I have the same problem. I don't understand your answer in the above post. Could you please post the exact code to look for and the exact code to replace it with. Plus, see below, there are two sections that are not in MS2 code.

 

In the readme file are the following two instructions:

 

Find the following (approx line 377)

} elseif ($HTTP_GET_VARS['action'] == 'new_product') {

if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {

$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, 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.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 . "'");

$product = tep_db_fetch_array($product_query);

 

AND

 

Find the following (approx line 573)

$pInfo = new objectInfo($product);

} elseif ($HTTP_POST_VARS) {

$pInfo = new objectInfo($HTTP_POST_VARS);

$products_name = $HTTP_POST_VARS['products_name'];

$products_description = $HTTP_POST_VARS['products_description'];

$products_url = $HTTP_POST_VARS['products_url'];

} else {

$pInfo = new objectInfo(array());

}

 

 

I have a clean install of 2.2 MS2 and can not find this code in the categories.php file.

Has this changed and the readme is not updated? What code am I really looking for, and do I replace it with the code in the readme file?

 

Any help is appreciated as the readme file does not seem to be correct.

Boom... Big butta boom.

Link to comment
Share on other sites

Another fix (syntax error):

 

readme says:

Find the following (approx line 279)

$sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]),

'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]),

'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]),

Add the following to the end

'products_head_title_tag' => tep_db_prepare_input($HTTP_POST_VARS['products_head_title_tag'][$language_id]),

==========================

 

Well the last ";" in the original code does need to be changed to a "," but the last line of the new code needs to end with "));"

 

Here is the complete code:

$sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]), 

                                   'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]), 

                                   'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]), 

                                   'products_head_title_tag' => tep_db_prepare_input($HTTP_POST_VARS['products_head_title_tag'][$language_id]));

Boom... Big butta boom.

Link to comment
Share on other sites

I get the following error while looking at the reviews of a product, and then clicking on a the link. Ex, http://www.healthyharvest.com/product_revi...31&reviews_id=1

 

Error:

Fatal error: Call to undefined function: tep_get_header_tag_products_desc() in /home/healthyh/public_html/includes/header_tags.php on line 169

 

Code from line 169:

 

        $the_desc= tep_get_header_tag_products_desc((int)$HTTP_GET_VARS['reviews_id']) . ' ' . HEAD_DESC_TAG_ALL;

 

Suggestions ??

Link to comment
Share on other sites

  • 3 weeks later...

Just curious about this one. How does one go about making the Admin page for creating a new products show the label text for meta tags fields in a second language?

 

I have tried adding the following to the admin/includes/languages/french/categories.php :

 

define('TEXT_PRODUCTS_PAGE_TITLE', 'Products Page Title:');

define('TEXT_PRODUCTS_HEADER_DESCRIPTION', 'French Product Descriptions:');

define('TEXT_PRODUCTS_KEYWORDS', 'French Product Keywords:');

 

but I still just get the field boxes with the flags and no text for the french description and meta tag boxes.

 

I have seen on webmakerscorner site on the demo admin of the shopcontroller mod that it is possible , I just seem to be missing something

 

tia

Link to comment
Share on other sites

I have attempted to install the admin portion of the header tag controller, and get the following error:

 

1054 - Unknown column 'c.categories_status' in 'field list'

 

select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified, c.categories_status from categories c, categories_description cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id = '1' order by c.sort_order, cd.categories_name

 

There was no mention of adding fields for the admin portion. I have added all required by Linda's part.

 

Any help would be great.

Link to comment
Share on other sites

Ok, here's what I did.

 

I used the readme.txt to manually update the admincategories.php. It appears to be working fine.

 

But, I did notice one of the changes asks to change code that has already been replaced.

 

"Header Tag Controller Admin MS 2.2.TXT"

Find the following (approx line 603) 



     $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_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'] . "'");

     $product = tep_db_fetch_array($product_query);

     

     

Replace with the following      





     $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_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'] . "'");

     $product = tep_db_fetch_array($product_query);

 

The only place that code exists in the categories.php is already replaced with the following instruction from "Header Tag Controller Admin MS 2.2.TXT"

 

 

Find the following (approx line 743)





<?php

 } elseif ($action == 'new_product_preview') {

   if (tep_not_null($HTTP_POST_VARS)) {

     $pInfo = new objectInfo($HTTP_POST_VARS);

     $products_name = $HTTP_POST_VARS['products_name'];

     $products_description = $HTTP_POST_VARS['products_description'];

     $products_url = $HTTP_POST_VARS['products_url'];

  } else {

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

     $product = tep_db_fetch_array($product_query);

   }



    

Replace with the following     

    



<?php

 } elseif ($action == 'new_product_preview') {

   if (tep_not_null($HTTP_POST_VARS)) {

     $pInfo = new objectInfo($HTTP_POST_VARS);

     $products_name = $HTTP_POST_VARS['products_name'];

     $products_description = $HTTP_POST_VARS['products_description'];

     $products_head_title_tag = $HTTP_POST_VARS['products_head_title_tag'];

     $products_head_desc_tag = $HTTP_POST_VARS['products_head_desc_tag'];

     $products_head_keywords_tag = $HTTP_POST_VARS['products_head_keywords_tag'];

     $products_url = $HTTP_POST_VARS['products_url'];

   } else {

     $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . $HTTP_GET_VARS['pID'] . "'");

     $product = tep_db_fetch_array($product_query);                              

 

I dunno, maybe I hacked it and turned it into a timebomb.

Link to comment
Share on other sites

I have attempted to install the admin portion of the header tag controller, and get the following error:

 

1054 - Unknown column 'c.categories_status' in 'field list'

 

select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified, c.categories_status from categories c, categories_description cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id = '1' order by c.sort_order, cd.categories_name

 

There was no mention of adding fields for the admin portion. I have added all required by Linda's part.

 

Any help would be great.

 

category status was removed some time ago from oscommerce this error is because it is not present in the database remove all references to category status ie: 'c.categories_status'

Link to comment
Share on other sites

Does any one can put a working contrib for download? I'm little confused couse I tried to edit these files with no results :( As I seen on forum there are some fixes and I tried to put them but right now it's complete disaster :( I had to go back to old categories.php couse it was really broken. PLEASE update this instal :/

Thanks A LOT in advance

Piotr

Link to comment
Share on other sites

Fatal error: Cannot 'redeclare tep_get_products_head_title_tag() (previously declared in /home/www/web10/html/admin/includes/functions/general.php:515) in /home/www/web10/html/admin/includes/functions/general.php on line 539

 

This is the error I currently have :( I've checked categories.php from admin section several times and there is something like 'redeclare tep_get_products_head_title_tag' Any ideas?

Link to comment
Share on other sites

I have the same problem as previous poster - I've installed the Header Tags controller and the admin part, but cannot find this function in admin.

maybe I've done somthing wrong in the installation?

 

If somebody could tell me what to expect in the admin, this would be a great help.

 

thanks

Link to comment
Share on other sites

When you add a Products, you will see Three (3) Blank Boxes.

 

First one will be " Products Page Title: "

 

Second will be " Page Header Description: "

 

Third will be " Product Keywords: "

 

These are the places where you have to enter the details

Link to comment
Share on other sites

I'm getting the following error:

 

1054 - Unknown column 'products_head_title_tag' in 'field list'



select pd.products_name, pd.products_description, products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, 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.manufacturers_id from products p, products_description pd where p.products_id = '30' and p.products_id = pd.products_id and pd.language_id = '4'

what can I do about it?

Link to comment
Share on other sites

I'm getting the following error:

 

1054 - Unknown column 'products_head_title_tag' in 'field list'



select pd.products_name, pd.products_description, products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, 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.manufacturers_id from products p, products_description pd where p.products_id = '30' and p.products_id = pd.products_id and pd.language_id = '4'

what can I do about it?

 

It seems for the above SQK Query that 'products_head_title_tag' is missing 'pd.' in front of it.

 

Run this SQL Command.

 

ALTER TABLE products_description ADD products_head_title_tag VARCHAR(80) NULL;

ALTER TABLE products_description ADD products_head_desc_tag LONGTEXT NULL;

ALTER TABLE products_description ADD products_head_keywords_tag LONGTEXT  NULL;

Link to comment
Share on other sites

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