gezuvor Posted March 10, 2006 Posted March 10, 2006 My website has been up and functional for several months. However, I recently installed the official osCommerce PayPal contribution. I don't think that has any impact, but wanted to mention it. Anyway, on my checkout confirmation page I get the following error: Warning: reset(): Passed variable is not an array or object in .../includes/modules/order_total/ot_tax.php on line 29 Warning: Variable passed to each() is not an array or object in .../includes/modules/order_total/ot_tax.php on line 30 I don't know much about php, so I don't know if this is server or software or what. I could really use some help! The website is OEMPL.US if anyone wants to give it a try. Thanks!
gezuvor Posted March 10, 2006 Author Posted March 10, 2006 Okay, I did a bit more digging without any luck. - Disable OSC Paypal contrib: same problem - Disable all payments except check: same problem
boxtel Posted March 10, 2006 Posted March 10, 2006 Okay, I did a bit more digging without any luck. - Disable OSC Paypal contrib: same problem - Disable all payments except check: same problem this is a tax group issue: reset($order->info['tax_groups']); Treasurer MFC
satish Posted March 10, 2006 Posted March 10, 2006 My website has been up and functional for several months. However, I recently installed the official osCommerce PayPal contribution. I don't think that has any impact, but wanted to mention it. Anyway, on my checkout confirmation page I get the following error: Warning: reset(): Passed variable is not an array or object in .../includes/modules/order_total/ot_tax.php on line 29 Warning: Variable passed to each() is not an array or object in .../includes/modules/order_total/ot_tax.php on line 30 I don't know much about php, so I don't know if this is server or software or what. I could really use some help! The website is OEMPL.US if anyone wants to give it a try. Thanks! You can block the warnings from getting displayed. In application_top add $ ~E_WARNING after ~E_NOTICE so you have your site going and then check what is causing it to happen. Also you can place the code creating that warning to be placed in an if block so it does not execute if proper arguments are not getting in. Satish Mantri Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does.
gezuvor Posted March 10, 2006 Author Posted March 10, 2006 Satish, THank you for th suggestion on suppressing the error. That worked very well, but I used & ~E_WARNING rather than $, which I what I assumed you meant. However, my cart total is still $0.00 regardless of what I put in it. So, I think these variables are important... ??
gezuvor Posted March 10, 2006 Author Posted March 10, 2006 Satish, THank you for th suggestion on suppressing the error. That worked very well, but I used & ~E_WARNING rather than $, which I what I assumed you meant. However, my cart total is still $0.00 regardless of what I put in it. So, I think these variables are important... ??
satish Posted March 10, 2006 Posted March 10, 2006 Satish, THank you for th suggestion on suppressing the error. That worked very well, but I used & ~E_WARNING rather than $, which I what I assumed you meant. However, my cart total is still $0.00 regardless of what I put in it. So, I think these variables are important... ?? You need to check ny echo when you add a product to cart as to which variable is resulting in this.This can also happen if you are loosing your session.It can also be because a variable name is not matching or it can be bcause of some other but. I suggets you to check for session being lost. Satish Mantri Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does.
gezuvor Posted March 10, 2006 Author Posted March 10, 2006 Satish, THank you for th suggestion on suppressing the error. That worked very well, but I used & ~E_WARNING rather than $, which I what I assumed you meant. However, my cart total is still $0.00 regardless of what I put in it. So, I think these variables are important... ??
gezuvor Posted March 10, 2006 Author Posted March 10, 2006 Sorry for the triple response. Dumb computer! Anyway, can you give some suggestions on how to check sessions? I'm not sure I follow your thinking here... Thanks, ~Rich
gezuvor Posted March 11, 2006 Author Posted March 11, 2006 this is a tax group issue: reset($order->info['tax_groups']); How would I go about working on this aspect of it? I tried turning off the last two mods I did and nothing changed... :(
boxtel Posted March 11, 2006 Posted March 11, 2006 How would I go about working on this aspect of it? I tried turning off the last two mods I did and nothing changed... :( well, it is complaining that $order->info['tax_groups'] is not an array or object. but that array is created via info['tax_groups'] = arra() when the order object is instantiated with $order = new order; so normally that should be an array, appropriately filled or not. That tends to indicate that maybe indeed you lose your session along the way and your cart and order object with it. So I would first set my browser to refuse all cookies so that you can see the session id in the url. Then go over the site and verify that that session id remains and remains the same. Treasurer MFC
boxtel Posted March 11, 2006 Posted March 11, 2006 well, it is complaining that $order->info['tax_groups'] is not an array or object.but that array is created via info['tax_groups'] = arra() when the order object is instantiated with $order = new order; so normally that should be an array, appropriately filled or not. That tends to indicate that maybe indeed you lose your session along the way and your cart and order object with it. So I would first set my browser to refuse all cookies so that you can see the session id in the url. Then go over the site and verify that that session id remains and remains the same. or maybe more specific: add this code : print_r ($order); just after this code $order = new order; in checkout_confirmation. so you can see what the order object contains. Treasurer MFC
gezuvor Posted March 12, 2006 Author Posted March 12, 2006 or maybe more specific: add this code : print_r ($order); just after this code $order = new order; in checkout_confirmation. so you can see what the order object contains. Okay, I added print_r ($order); where you asked. This is what I get. No change to the rest of the page... order Object ( [info] => Array ( ) [totals] => Array ( ) [products] => Array ( ) [customer] => Array ( ) [delivery] => Array ( ) [content_type] => ) Any ideas?
boxtel Posted March 12, 2006 Posted March 12, 2006 Okay, I added print_r ($order); where you asked. This is what I get. No change to the rest of the page... order Object ( [info] => Array ( ) [totals] => Array ( ) [products] => Array ( ) [customer] => Array ( ) [delivery] => Array ( ) [content_type] => ) Any ideas? looks like an empty order. normally the order object is (re)created on every page of checkout with $order = new order; it then automatically fills itself with the cart contents and related product info. The order object as such is not session based like the cart. So maybe you do lose the cart before this by losing the session. try to put : print_r ($cart); just before: print_r ($order); so you can see if the cart still has contents at that time. Treasurer MFC
gezuvor Posted March 12, 2006 Author Posted March 12, 2006 looks like an empty order.normally the order object is (re)created on every page of checkout with $order = new order; it then automatically fills itself with the cart contents and related product info. The order object as such is not session based like the cart. So maybe you do lose the cart before this by losing the session. try to put : print_r ($cart); just before: print_r ($order); so you can see if the cart still has contents at that time. Okay, code inserted! Now I get this: shoppingcart Object ( [contents] => Array ( [85{16}36] => Array ( [qty] => 1 [attributes] => Array ( [16] => 36 ) ) [149] => Array ( [qty] => 1 ) ) [total] => 2910 [weight] => 105 [cartID] => [content_type] => [shiptotal] => ) line break inserted by me... order Object ( [info] => Array ( ) [totals] => Array ( ) [products] => Array ( ) [customer] => Array ( ) [delivery] => Array ( ) [content_type] => ) It looks like the contents are still there, but things like cartID and shiptotal are missing...? Am I reading it correctly?
boxtel Posted March 12, 2006 Posted March 12, 2006 Okay, code inserted! Now I get this: shoppingcart Object ( [contents] => Array ( [85{16}36] => Array ( [qty] => 1 [attributes] => Array ( [16] => 36 ) ) [149] => Array ( [qty] => 1 ) ) [total] => 2910 [weight] => 105 [cartID] => [content_type] => [shiptotal] => ) line break inserted by me... order Object ( [info] => Array ( ) [totals] => Array ( ) [products] => Array ( ) [customer] => Array ( ) [delivery] => Array ( ) [content_type] => ) It looks like the contents are still there, but things like cartID and shiptotal are missing...? Am I reading it correctly? cart id does not need to be filled but I thought the content_type should and I don't know where that shiptotal comes from. so the problem occurs when the order object executes the cart() function to fill itself. Best choice is to backup both classes and replace them with the working backups one at a time to see if it is the shopping cart class or the order class which fails. Otherwise you need to trace the cart() function in the order class to see what instruction fails. Treasurer MFC
gezuvor Posted March 12, 2006 Author Posted March 12, 2006 cart id does not need to be filled but I thought the content_type should and I don't know where that shiptotal comes from. so the problem occurs when the order object executes the cart() function to fill itself. Best choice is to backup both classes and replace them with the working backups one at a time to see if it is the shopping cart class or the order class which fails. Otherwise you need to trace the cart() function in the order class to see what instruction fails. shiptotal comes from a contribution I installed to assign shipping to individual products. I think I'll back that out and see where it gets me...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.