Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


sera_archie

Recommended Posts

Posted

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

Posted

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

Posted

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.

Posted

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!

Posted

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

Posted

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() {

}

Posted

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.

Posted

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:

Posted

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.

Posted

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.

Posted

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.

Posted

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?

Posted

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.

Posted

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...