Jump to content

Fatal error: Using $this when not in object context


chrism2011

Recommended Posts

I get the error code "Fatal error: Using $this when not in object context in /home/feenetwo/public_html/language/english/mails/sale_third_party_notification.php on line 7" when I complete the form from the link in the screenshot atached...

 

the site is feenetwork.com and im getting really fustrated with it....

 

Can anyone help?

 

[attachment deleted by admin]

Link to comment
Share on other sites

sorry here is the file thats getting the error...

 

<?
## Email File -> notify buyer on a successful purchase
## called only from the $item->assign_winner() function!

if ( !defined('INCLUDED') ) { die("Access Denied"); }

$sale_details = $this->get_sql_row("SELECT w.*, u.name, u.email 
a.name AS item_name, a.currency FROM " . DB_PREFIX . "winners w 
LEFT JOIN " . DB_PREFIX . "applications_details u ON u.application_id=w.application_id
LEFT JOIN " . DB_PREFIX . "auctions a ON a.auction_id=w.auction_id
WHERE w.winner_id='" . $mail_input_id . "'");

$send = true;

## text message - editable
$text_message = 'Dear %1$s,

You have successfully purchased %2$s.

Purchase Details:

- price: %3$s
- quantity purchased: %4$s
- auction url: %7$s

For more details about the purchase, please access the "Won Items" page, by clicking on the link below:  

%5$s

After you have accessed the page above, click on the "Message Board" link next to each item won.
This message board is your direct communication board with the seller. Please use this board to ask 
any post sale questions you might have.

Important: To help resolve any possible disputes ensure you use the board for all queries and updates.

Best regards,
The %6$s staff';

## html message - editable
$html_message = 'Dear %1$s, <br>
<br>
You have successfully purchased %2$s. <br>
<br>
Purchase Details: <br>
<ul>
<li>Price: <b>%3$s</b> </li>
<li>Quantity Purchased: <b>%4$s</b> </li>
<li>Auction URL: [ <a href="%7$s">Click to View</a> ] </li>
</ul>
For more details about the purchase, please access the [ <a href="%5$s">Won Items</a> ] page. <br>
<br>
After you have accessed the page above, click on the "Message Board" link next to each item won. <br>
This message board is your direct communication board with the seller. Please use this board to ask 
any post sale questions you might have. <br>
<br>
Important: To help resolve any possible disputes ensure you use the board for all queries and updates. <br>
<br>
Best regards, <br>
The %6$s staff';


$items_won_link = SITE_PATH . 'login.php?redirect=' . process_link('members_area', array('page' => 'bidding', 'section' => 'won_items'));
$auction_link = process_link('auction_details', array('name' => $sale_details['item_name'], 'auction_id' => $sale_details['auction_id']));

$this->fees = new fees();
$this->fees->setts = $this->setts;
$sale_price = $this->fees->display_amount($sale_details['bid_amount'], $sale_details['currency']);

$text_message = sprintf($text_message, $sale_details['name'], $sale_details['item_name'], $sale_price, $sale_details['quantity_offered'], $items_won_link, $this->setts['sitename'], $auction_link);
$html_message = sprintf($html_message, $sale_details['name'], $sale_details['item_name'], $sale_price, $sale_details['quantity_offered'], $items_won_link, $this->setts['sitename'], $auction_link);

send_mail($sale_details['email'], 'Auction ID: ' . $sale_details['auction_id'] . ' - Successful Purchase', $text_message, 
$this->setts['admin_email'], $html_message, null, $send);
?>

Link to comment
Share on other sites

I think the issue starts here:

 

<?php
...
$this->fees = new fees();
$this->fees->setts = $this->setts;
...
?>

 

When creating an instance of a class, it should be more like:

 

<?php
...
fees = new fees();
fees->setts = 'some value';
...
?>

 

 

 

It might be helpful to review the PHP manual section for classes:

http://www.php.net/manual/en/language.oop5.basic.php

Link to comment
Share on other sites

Thanks for all your help...

 

I think it was written by one of my past collegues but not quite sure...

 

Its part of a site thats built on php probid.

 

Ill keep cracking on with it, im sure i will come up with something.

 

if anyone can shed some light on it please let me know.

 

Thanks again. 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.