Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Help please.

 

I am using STS with headertags bundle and it worked perfectly. Thanks to the authors and contributors. Now I have installed All Products and am having errors. I am not sure how these contributions interact or conflict.

 

Specific errors:

 

Fatal Error: Call to undefined function: clean_html_comments()

in(shortened url)/www/STS/catalog/includes/header_tags.php on line 208 (for product_info.php)

 

and

 

Fatal Error: Call to undefined function: clean_html_comments()

in(shortened url)/www/STS/catalog/includes/header_tags.php on line 273 (for specials.php)

 

This is the code for 2 calls to clean_html_comments in header_tags.php (emphasis added for easy finding)

 

in Product_info section:

// PRODUCT_INFO.PHP

case ( strstr($_SERVER['PHP_SELF'],FILENAME_PRODUCT_INFO) or strstr($PHP_SELF,FILENAME_PRODUCT_INFO) ):

// $the_product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_keywords_tag, pd.products_head_desc_tag, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . $HTTP_GET_VARS['products_id'] . "'");

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

$the_product_info = tep_db_fetch_array($the_product_info_query);

 

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

if (HTTA_CAT_PRODUCT_DEFAULT_ON=='1') {

$tags_array['desc']= HEAD_DESC_TAG_PRODUCT_INFO;

}

if (HTDA_PRODUCT_INFO_ON=='1' || empty($tags_array['desc'])) {

$tags_array['desc'].= HEAD_DESC_TAG_ALL;

}

} else {

$tags_array['desc']= $the_product_info['products_head_desc_tag'];

if (HTTA_CAT_PRODUCT_DEFAULT_ON=='1') {

$tags_array['desc'] .= ' ' . HEAD_DESC_TAG_PRODUCT_INFO;

}

if ( HTDA_PRODUCT_INFO_ON=='1' ) {

$tags_array['desc'] .= ' ' . HEAD_DESC_TAG_ALL;

}

}

 

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

if (HTTA_CAT_PRODUCT_DEFAULT_ON=='1') {

$tags_array['keywords']= HEAD_KEY_TAG_PRODUCT_INFO;

}

if ( HTKA_PRODUCT_INFO_ON=='1' || empty($tags_array['keywords'])) {

$tags_array['keywords'].= HEAD_KEY_TAG_ALL;

}

} else {

$tags_array['keywords']= $the_product_info['products_head_keywords_tag'];

if (HTTA_CAT_PRODUCT_DEFAULT_ON=='1') {

$tags_array['keywords'] .= ' ' . HEAD_KEY_TAG_PRODUCT_INFO;

}

if ( HTKA_PRODUCT_INFO_ON=='1' ) {

$tags_array['keywords'] .= ' ' . HEAD_KEY_TAG_ALL;

}

}

 

if (empty($the_product_info['products_head_title_tag'])) { //if not HTC title in product

if (HTTA_CAT_PRODUCT_DEFAULT_ON=='1') { //if HTCA checked

$tags_array['title']= HEAD_TITLE_TAG_PRODUCT_INFO; //show title for this section

}

if ( HTTA_PRODUCT_INFO_ON=='1' || empty($tags_array['title'])) { //if default switch on or no entry

$tags_array['title'].= HEAD_TITLE_TAG_ALL; //include the default text

}

} else {

$tags_array['title']= clean_html_comments($the_product_info['products_head_title_tag']);

if (HTTA_CAT_PRODUCT_DEFAULT_ON=='1') {

$tags_array['title'] .= ' ' . HEAD_TITLE_TAG_PRODUCT_INFO;

}

if ( HTTA_PRODUCT_INFO_ON=='1' ) {

$tags_array['title'] .= ' ' . HEAD_TITLE_TAG_ALL;

}

}

 

break;

 

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

 

and in Specials section:

if ( HEAD_KEY_TAG_SPECIALS=='' ) {

// Build a list of ALL specials product names to put in keywords

$new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC ");

$row = 0;

$the_specials='';

while ($new_values = tep_db_fetch_array($new)) {

$the_specials .= clean_html_comments($new_values['products_name']) . ', ';

}

if ( HTKA_SPECIALS_ON=='1' ) {

$tags_array['keywords']= $the_specials . ' ' . HEAD_KEY_TAG_ALL;

} else {

$tags_array['keywords']= $the_specials;

}

} else {

$tags_array['keywords']= HEAD_KEY_TAG_SPECIALS . ' ' . HEAD_KEY_TAG_ALL;

}

 

if ( HEAD_TITLE_TAG_SPECIALS!='' ) {

if ( HTTA_SPECIALS_ON=='1' ) {

$tags_array['title']= HEAD_TITLE_TAG_SPECIALS . ' ' . HEAD_TITLE_TAG_ALL;

} else {

$tags_array['title']= HEAD_TITLE_TAG_SPECIALS;

}

} else {

$tags_array['title']= HEAD_TITLE_TAG_ALL;

}

 

break;

 

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

 

the file clean_html_comments.php is properly located in catalog>includes>funtions as follows:

<?php

// /catalog/includes/functions/clean_html_comments.php

// WebMakers.com Added: Header Tags Generator v2.0

// WebMakers.com Added: FREE-CALL FOR PRICE-COMING SOON ETC. v3.0

//

// BE CAREFUL NOT to use this function where it will effect currencies.php or the listings for product name

// This is used for cosmetic purposes for what the visitor sees and not for what the php code sees. The php code needs to see the HTML comment tags.

//

// Removes the <!--//* and *//--> from Product Names

 

////

// Clean out HTML comments code

function clean_html_comments($clean_html) {

global $its_cleaned;

 

if ( strpos($clean_html,'<!--//*')>1 ) {

$the_end1= strpos($clean_html,'<!--//*')-1;

$the_start2= strpos($clean_html,'*//-->')+7;

 

$its_cleaned= substr($clean_html,0,$the_end1);

$its_cleaned.= substr($clean_html,$the_start2);

} else {

$its_cleaned= $clean_html;

}

return $its_cleaned;

}

 

?>

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

This error can be recreated by going to My Site and either click on "All Clearance Products link" or any product. (site critique also welcome)

 

Is the solution as simple as commenting out the call because it affects a request for product name?

 

If someone that knows how these codes interact, and is willing to take a look at them for me, could help, I would appreciate any and all help that you could provide. I am not asking for hand holding, I have just exhausted all possibilities that my knowledge and coding abilities allow.

 

Thank you in advance,

Scott

Posted

My guess is that you didn't include the STS code in the all products file (or wherever it is required). If you are talking about All Products with Images, you can check that support thread since I think getting it to work with STS came up there. If not, or if the answer isn't there, try asking in the STS support thread since that is what the problem is related to.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted
Help please.

 

I am using STS with headertags bundle and it worked perfectly. Thanks to the authors and contributors. Now I have installed All Products and am having errors. I am not sure how these contributions interact or conflict.

 

Specific errors:

 

Fatal Error: Call to undefined function: clean_html_comments()

in(shortened url)/www/STS/catalog/includes/header_tags.php on line 208 (for product_info.php)

 

and

 

Fatal Error: Call to undefined function: clean_html_comments()

in(shortened url)/www/STS/catalog/includes/header_tags.php on line 273 (for specials.php)

 

Thank you in advance,

Scott

I'll take a stab at this. Be sure you have the following line of code at the beginning of your includes/header_tags.php file:

 

require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

 

If that does not work or causes previoulsy declared error messages, use this instead:

 

 require_onece(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Posted
I'll take a stab at this. Be sure you have the following line of code at the beginning of your includes/header_tags.php file:

 

require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

 

If that does not work or causes previoulsy declared error messages, use this instead:

 

 require_onece(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

 

You two guys are GREAT! :thumbsup:

 

Spent the day rereading these two threads, and got some more ideas. Thanks Jack.

 

[Contribution] All Products v3.0 MS 2.2 with Images

[Contribution Update] All Prods v2.4

 

After I used the 'require_once' tag all seems as it should be. Thanks Bill.

 

Funny thing is that the 'require' tag had to be in the includes/header_tags.php file previously because meta tags were being created prior to the allprods instillation. I must have removed it somehow.

 

Again, thanks to both of you for your patience and guidance, couldn't have done it without ya!

 

Scott

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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