Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

STS 4.5.2 and Customer Testimonials v2.0


Guest

Recommended Posts

Hello all,

 

I am trying to get Customer Testimonial v2.0 to work with STS 4.5.2. The MOD installed fine and is working in admin ( I can make a testimonial there) and is shown in both my index.php.html and sts_template.html and it deos show the testimonail created from the admin section but I cannot get it to create from the site itself.

 

the error I get after trying is....

 

Fatal error: Call to a member function on a non-object in F:\hshome\sparrz1\sparrz.com\rimcatalog\catalog\includes\classes\sts.php on line 185

 

this line on sts.php lists as .....

 

Line 185	if ($messageStack->size('header') > 0) {
Line 186	  $this->template['content'] = $messageStack->output('header') . $this->template['content'];
Line 187	}

 

I have gone as far as commenting these out and it will go through but then later on in the process I get continuing errors of the same type on other lines of the same sts.php location.

 

Is it possible that the layout and setup of STS is not going to allow this contribution at all. As it is the site must be able to have the Customer Testimonial, but would hate to have to drop STS to do so.

 

Please can anyone help??????? :'(

 

I have scanned through searching and mouse crawling through this forum and the contributions for a couple of days now to locate a possible fix for this but came up with nothing. If I have missed it please let me know where I can find this thread or contribution

Edited by sparrz
Link to comment
Share on other sites

  • 3 weeks later...

I have the same problem -

 

Fatal error: Call to a member function on a non-object in /home/housses/public_html/test/includes/classes/sts.php on line 185

 

(same code as below)

 

Customer Testimonials v2.0 works fine with STS 4.5.2 disabled through /admin

 

Any help much appreciated!

Link to comment
Share on other sites

  • 2 weeks later...

I'm having the same problem as well - testimonial works fine from teh admin side, works fine from the user side when the templates are turned off, but if the templates are on I'm getting the same error msg.

 

I'm presuming that it has something to do with a directory path that sts is messing up while the customer_testimonials.php is being submitted from with in a template, but other than that I'm lost - Has anyone solved this problem yet?

 

Cheers

Link to comment
Share on other sites

Hey, the only fix for this that I've managed to find is to simply comment out the code causing the problems:

(in includes/classes/sts.php)

/* Comment this out

// Add messages before the content

if ($messageStack->size('header') > 0) {

$this->template['content'] = $messageStack->output('header') . $this->template['content'];

}

end comment out */

end comment out */

I assume the code is needed for something - but so far I havent had any problems with any of the functionality of the site.

 

Cheers

Shane

Edited by Shanke
Link to comment
Share on other sites

Hey, the only fix for this that I've managed to find is to simply comment out the code causing the problems:

(in includes/classes/sts.php)

 

end comment out */

I assume the code is needed for something - but so far I havent had any problems with any of the functionality of the site.

 

Cheers

Shane

I do not advise this solution since it will cause several basic osC functionallity problems.

 

Since I do not use the testimonial contribution, I can only offer a partial solution:

 

This STS fix should solve problems with any contribution that is supposed to display error messages during checkout (including Authroize.Net, Discount Coupons, Gift Vouchers,etc.):

 

I beleive this applys to the Testomonial Contribution as well:

 

In your catalog/includes/classes/sts.php,

Find this:

	// Add messages before the content
if ($messageStack->size('header') > 0) {
  $this->template['content'] = $messageStack->output('header') . $this->template['content'];
}

 

And Replace it with this:

 

	// Add messages before the content
if ($messageStack->size('header') > 0) {
  $template['content'] = $messageStack->output('header') . $template['content'];
}
////////Start Error Messages - Bill Kellum modified version of Tom Wojcik code for use with STS 4x
if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
$messageStack->add('error_message', $HTTP_GET_VARS['error_message']);
$this->template['content'] =  $messageStack->output('error_message') . $this->template['content'];
}
////// End Error Messages

Modify this to work for your needs. Please let me know if the above solved your issues.

 

Also, when posting questions such as the ones in this thread, they should really be posted in the support thread for that particular contribution; either in STSv4 Forum or the Testimonial Forum. This allows users of those contributions to benefit from any solutions that may come of this issue. :thumbsup:

 

See STSv4 Forum link in my signature below.

 

Hope this helped,

Bill Kellum

 

Sounds Good Productions

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

Link to comment
Share on other sites

  • 1 month later...

Hi there,

 

I am having the exact same problem! I have scoured all over this forum there seems to be many people having this problem. The code above does not seem to fix it. I have also commented out the offending code and everything seems to be working fine, but there must be a better way. Has anybody managed to work a way around it?

Edited by bluns1
Link to comment
Share on other sites

The error is due to the bad use of $messageStack inside catalog/customer_testimonials.php.

 

This variable is created in header.php and is an object, with methods and properties, like all objects. Adding a new error message should be done using the corresponding method.

In customer_testimonials.php, $messageStack is just filled with one text, thus overwriting the original object created in header.php .

 

The only solution is to modify customer_testimonials to use the object's method to add error messages, check header.php to see how to do it.

 

- Chris

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