Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal error: Using $this when not in object context


Rebootoz

Recommended Posts

Hi there

 

I have moved everything from one domain to another and it is working beautifully. There were some issues (i.e. global registers etc) which I gather form the forums are re php 4 to php 5 changes. However with some research on the the forums I was able to solve the problems.

 

Now at the final end of testing the site on the new domain I discover this little gem when a customer checks their orders in "Order Information". I found some talk of changing $this to $these which I did but the information on the "order information" page is missing billing information etc at the bottom...? :blink:

 

This is what the actual error says:

 

Fatal error: Using $this when not in object context in /home/rebootoz/public_html/RebootStore/includes/vendor_order_data.php on line 19

 

Then when I look at vendor_order_data.php line 19 is this:

 

$index2 = 0;
             //let's get the Vendors
             $vendor_data_query = tep_db_query("select orders_shipping_id, orders_id, vendors_id, vendors_name, shipping_module, shipping_method, shipping_cost from " . TABLE_ORDERS_SHIPPING . " where orders_id = '" . (int)$order_id . "'");
             while ($vendor_order = tep_db_fetch_array($vendor_data_query)) {

   $this->products[$index2] = array('Vid' => $vendor_order['vendors_id'],
                                    'Vname' => $vendor_order['vendors_name'],
                                    'Vmodule' => $vendor_order['shipping_module'],
                                    'Vmethod' => $vendor_order['shipping_method'],
                                    'Vcost' => $vendor_order['shipping_cost'],
                                    'Vnoname' => 'Shipper',
                                    'spacer' => '-');

 

Line 19 starts at $this->

 

My store is from the latest download from OS2.2 and has the latest version of MVS on it.

 

Can someone PLEASE HELP!!! I've spent the whole day looking throught he forum for help but I can't see anything. Am I blind?

 

Please help!

Rosie

Link to comment
Share on other sites

OK I haven't heard from anyone and I've persevered with some advice from

 

http://www.oscommerce.com/forums/index.php?sho...mp;#entry737657

 

I've changed the $this->products to $these_products and also changed the $this->info to $order and added the code

 

$order_query = tep_db_query("select currency, currency_value from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
 $order = tep_db_fetch_array($order_query);

 

as per someone else in the forum instructions. The above code is added to /includes/vendor_order_data.php after the comment at the top.

 

The information now shows in "Order Information" but the Billing Information on the result page is missing... (i.e. the billing address and payment method don't show)... :blink:

 

Any clues?

 

Rosie

Link to comment
Share on other sites

Ok so clearly no one knew what I was on about so I've decided to change to another domain that still uses php4. Everything moved over and the site is working fine. Still loading products but should be live tomorrow. www.reboot.com.au

 

I've been on a real learning curve! I'm really such a newbie!

 

Would like to warn others that are looking at changing domains that have newer sql or php - Not a good idea! Oscommerce is not geared up for it at this time and I love Oscommerce (hey! it's free! and lots of great contributions!)

 

Thanks anyway to those that looked at my request!

 

Rosie

Link to comment
Share on other sites

Guess you could always apply the mysql5 compatibility patches. Seems to have a fix for this error.

Edited by geoffreywalton

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

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