OsCommerce – Call to a member function buildBlocks()

I just ran into this error when upgrading a OsCommerce Site:

Fatal error: Call to a member function buildBlocks() on a non-object in public_html/includes/template_top.php on line 13

I saw that others had this error, but no one was able to help them. In case anyone else runs into this error check the following:

In catalog/includes/application_top.php you want to make sure you instantiate oscTemplate.

@@ -420,6 +420,9 @@
require(DIR_WS_FUNCTIONS . 'specials.php');
tep_expire_specials();

+ require(DIR_WS_CLASSES . 'osc_template.php');
+ $oscTemplate = new oscTemplate();
+

// calculate category path
if (isset($HTTP_GET_VARS['cPath'])) {
$cPath = $HTTP_GET_VARS['cPath'];

This code snippet comes from the OsCommerce V2.2RC2a to V2.3 Upgrade guide found here

1 comment

Leave a Reply