Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Error Du Jour.... Fatal error: Call to undefined function tep_draw_prod_top()


15 replies to this topic

#1 sera_archie

  • Community Member
  • 44 posts
  • Real Name:Sera

Posted 02 September 2010, 14:25

OK...I installed a template...I've kicked register globals butt...I've fixed 1054 errors... I've resurrected my admin...I've tried reinstalling files...I've trawled through search results, no one with the exact same...I've tried this popular 'remove the tep' approach...the error stays...I have run out of ideas...48 hours and it's still there

The error reads as follows

Fatal error: Call to undefined function tep_draw_prod_top()
in ***/includes/modules/new_products.php on line 49

If it helps (and yes, I do clutch at straws...I have zero php knowledge)...Yes I have checked the new_products file is there, yes it is the correct file for the template, it isn't to my knowledge the incorrect file. I have checked my application_top file and compared to a fresh app_top file it is not missing anything regarding this file

<?php
/*
  $Id: new_products.php,v 1.34 2003/06/09 22:49:58 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/
?>
<!-- new_products //-->
<?php
  $info_box_contents = array();
  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));

 // new contentBoxHeading($info_box_contents);

  if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
    $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
  } else {
    $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
  }

  $row = 0;
  $col = 0;
  $info_box_contents = array();
  while ($new_products = tep_db_fetch_array($new_products_query)) {
 
  
    $new_products['products_name'] = tep_get_products_name($new_products['products_id']);
	
// ----------	
	$product_query = tep_db_query("select products_description, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$new_products['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
	$product = tep_db_fetch_array($product_query);
	$p_desc = substr($product['products_description'], 0, MAX_DESCR_1);
	$p_id = $product['products_id'];
	
	$p_pic = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
	
	$p_name = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . substr($new_products['products_name'],0,MAX_DESCR_NAME) . '</a>';
	
	$p_price = ''.$currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])).'';
// ----------	
	
    $info_box_contents[$row][$col] = array('align' => 'center',
                                           'params' => ' valign="top"',
                                           'text' => ''.tep_draw_prod_top().'
												<table cellspacing="0" cellpadding="0" border="0" >
													<tr>
														<td width="157" height="52" style=" vertical-align:middle;">
											 			 '.$p_name.'</td>
													</tr>
													<tr>
														<td width="157" height="156" class="pic" align="center">'.$p_pic.'</td>
													</tr>
													<tr>
														<td width="157" height="45">'.$p_desc.'...</td>
													</tr>
													<tr>
														<td width="157" height="44">
															<table cellspacing="0" cellpadding="0" border="0" >
																<tr>
																  <td width="87" height="29"><span>'.$p_price.'</span></td>
																</tr>
																<tr><td height="20">
																	<table cellpadding="0" cellspacing="0" border="0" style=" width:10px;">
																		<tr><td><a href="' . tep_href_link('product_info.php?products_id='.$p_id) . '">'.tep_image_button("button_details.gif").'</a></td>
																		<td><img src="images/spacer.gif" width="5" height="1" alt=""></td>
																		<td><a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.tep_image_button('button_add_to_cart1.gif').'</a><br></td></tr>
																	</table>
																</td></tr>
															</table>
														</td>
													</tr>
												</table>									
			'.tep_draw_prod_bottom());

    $col ++;
    if ($col > 2) {
      $col = 0;
      $row ++;
    }
  }

  new contentBox($info_box_contents);
?>
<!-- new_products_eof //-->

Any help would be great...I just need some direction!!

#2 DunWeb

  • Community Sponsor
  • 9,464 posts
  • Real Name:Chris Dunn
  • Gender:Male
  • Location:Tecumseh, Ontario, Canada N8N 1X8

Posted 02 September 2010, 15:25

Sear,

First of all, congratulations on purchasing one of the many poorly written templates for osCommerce.

Check your directories for the file called prod_top.php and ensure it is there. I would guess the best place to start would be the /includes/boxes/ directory. If it is there, ensure it is intact and conforms to the layout of the other prod_xxx.php files.

It is just a guessing game with purchased templates, the creators of those templates don't care anything about the structure of osCommerce or if/when you try to add a contribution or modify the template. It is the SALE they seek, and then your on your own for support.



Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

:|: Check my About Me page for information about Support Plans, Templates, Custom Add Ons and Professional osCommerce Security Services :|:

#3 burt

  • Community Member
  • 6,765 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEVon/NULL -> get it, hardeharhar.

Posted 02 September 2010, 15:33

View PostDunWeb, on 02 September 2010, 15:25, said:

First of all, congratulations on purchasing one of the many poorly written templates for osCommerce.

+1

function  tep_draw_prod_top()
  {
  return $table = '
		<table cellpadding="0" cellspacing="0" border="0" class="prod_table">
			<tr><td class="prod_td">';
  }

Search Google (it's where I found the above code in less than a minute), as this is a crappy 3rd party template which is not supported at this forum.

Edited by burt, 02 September 2010, 15:34.

Me page.

#4 sera_archie

  • Community Member
  • 44 posts
  • Real Name:Sera

Posted 02 September 2010, 23:33

Burt...I do search google...it's generally the only way I solve my osc errors. Without sufficient php knowledge it's hard to know what to search for, you're limited to the error script and as I said no one had the exact same error...lots of calls to undefined functions where they did this magical 'tep' removal but for me it just removed 'tep' from the error! Must have been a slow connection though...my search results come through in .21 seconds...a whole minute on google seems like an eternity :-"

First of all, congratulations on purchasing one of the many poorly written templates for osCommerce.

:blush: those who can not code, pay. Some of us researched the experience of template users and knew what we were getting ourselves into... refused to pay a dime and find solace in that...just doesn't solve the errors for me :lol:

I'll look at those, Chris. I'm sure it's something exceedingly obvious - thanks again!

#5 sera_archie

  • Community Member
  • 44 posts
  • Real Name:Sera

Posted 03 September 2010, 00:40

Chris...there are no files with the name prod_anything in any of my files for this template or the numerous others I can select from :(

#6 sera_archie

  • Community Member
  • 44 posts
  • Real Name:Sera

Posted 03 September 2010, 01:05

This error displays on my index page - is it possible it is therefore index.php related? The page does display, I can see my logo, navigation, categories etc just not the centre of the page where it should retrieve my 'featured' products - the other pages do function...eg. I have a tab for new products and it retrieves them fine...

#7 FWR Media

  • Community Member
  • 6,462 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 03 September 2010, 09:33

View Postsera_archie, on 03 September 2010, 01:05, said:

This error displays on my index page - is it possible it is therefore index.php related? The page does display, I can see my logo, navigation, categories etc just not the centre of the page where it should retrieve my 'featured' products - the other pages do function...eg. I have a tab for new products and it retrieves them fine...

This sounds like one of the laughable ( not funny really ) Template Monster templates .. most of the horrible procedural code mess can be found in ..

includes/classes/boxes.php ( yes it was originally a class file rolleyes )

Try just adding the following function before the closing ?>

function tep_draw_prod_top() {
}

Edited by FWR Media, 03 September 2010, 09:33.

Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls

KissMT Dynamic SEO Meta & Canonical Header Tags

KissER Error Handling and Debugging

If you found my post useful please click the green + sign to the right

Please only PM me for paid work.


#8 burt

  • Community Member
  • 6,765 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEVon/NULL -> get it, hardeharhar.

Posted 03 September 2010, 09:50

http://www.google.com/search?btnG=1&pws=0&q=%22function+tep_draw_prod_top%22

3 of the 5 results give the code.
1 of the results is this thread.
Me page.

#9 sera_archie

  • Community Member
  • 44 posts
  • Real Name:Sera

Posted 03 September 2010, 13:56

Burt, I think you are misunderstanding me...finding a copy of the code does not help...I don't understand php...I need the explanation part ;)
Oh...and of those 5 (of which 3 I have already seen in my own searching)...one goes to an error page...one is simply code...one is more code with a request for integration and another is in French. So aside from my own post, It kinda doesn't help. Life would be easier if all this ?> { tep meant something but unfortunately I have a better chance of translating the French search result

Thanks for the suggestion Robert! I will see if it gets some results...I was at the point of hitting 'delete' on my database today so commented out the ref to the new products in the index file in an effort to save my sanity. Staring at the error was consuming far too much time.

#10 sera_archie

  • Community Member
  • 44 posts
  • Real Name:Sera

Posted 03 September 2010, 14:18

Ok, so if I add that code to my includes/modules/new_products file I get the following error

Fatal error: Call to undefined function tep_draw_prod_bottom() in ***/includes/modules/new_products.php on line 78

does this mean I'm a step closer...or further away :lol:

#11 burt

  • Community Member
  • 6,765 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEVon/NULL -> get it, hardeharhar.

Posted 03 September 2010, 14:19

You add the function to one of the function files in your website. These are found at /includes/functions/

tep stands for The Exchange Project, which is what osCommerce used to be known as.

Your problem is the fact that you are using a template without knowing enough of osCommerce to be dangerous.
When using a template, seek support from the template vendor.
Me page.

#12 burt

  • Community Member
  • 6,765 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEVon/NULL -> get it, hardeharhar.

Posted 03 September 2010, 14:22

View Postsera_archie, on 03 September 2010, 14:18, said:

Ok, so if I add that code to my includes/modules/new_products file I get the following error

Fatal error: Call to undefined function tep_draw_prod_bottom() in ***/includes/modules/new_products.php on line 78

does this mean I'm a step closer...or further away :lol:

Now search google for "function tep_draw_prod_bottom". Surely this is obvious? You repeat for every time you come across an error.

Sounds like the template you got does not have all the files with it. I take it you did BUY it from a template vendor, or did you "acquire" it from somewhere else.
Me page.

#13 FWR Media

  • Community Member
  • 6,462 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 03 September 2010, 14:37

As I mentioned before, Template Monster add these ridiculous functions to includes/classes/boxes.php

Perhaps you are missing the template adaptation of this file.
Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls

KissMT Dynamic SEO Meta & Canonical Header Tags

KissER Error Handling and Debugging

If you found my post useful please click the green + sign to the right

Please only PM me for paid work.


#14 sera_archie

  • Community Member
  • 44 posts
  • Real Name:Sera

Posted 03 September 2010, 14:43

View Postburt, on 03 September 2010, 14:22, said:

Now search google for "function tep_draw_prod_bottom". Surely this is obvious? You repeat for every time you come across an error.

You mean I can use google more than once!?

I fail to see how you're actually helping here... I do attempt to sort these things out for myself...but this is a support forum..for strangely enough...support.

As I said in my original post. I searched before I posted. Though clearly my understanding that you could only use google once a day was wrong :rolleyes:

Someone else may get the same errors I have...they may use google...they may come across my posts. If I were them I'd appreciate the follow up to the issue rather than not knowing what the proposed code changes may acheive. Just because I don't state "I am now going to input this error into google" it doesn't mean I'm sitting here deperately refreshing hoping someone will fix it for me.

As you said. Surely this is obvious?

Edited by sera_archie, 03 September 2010, 14:44.


#15 burt

  • Community Member
  • 6,765 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEVon/NULL -> get it, hardeharhar.

Posted 03 September 2010, 14:57

Why do you insist on using this osCommerce forum for support of a broken template. Go to the template vendor.

That is assuming you did legally purchase it from the vendor, and did not pick it up elsewhere - meaning you cannot go to the template vendor. Again, I'll ask; did you buy it from somewhere, or acquire it. Name and shame would be helping future people with the same errors.

If I had paid money for a template, and it did not work, I would not be here trying to get support. I'd be at the site of the vendor.
Me page.

#16 sera_archie

  • Community Member
  • 44 posts
  • Real Name:Sera

Posted 03 September 2010, 15:09

Burt. Read. Post 4. I did not pay for it. No. I did not illegally obtain it either. You're being incredibly offensive by implying that. I am unsure where this 'elsewhere' is but if I do find myself needing to steal I'll be sure to source that information from you.

I have managed to fix the error - but as it is 11pm I will come back and post the code changes I made so I don't over look something and confuse the heck out of someone.