VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Quality & Testing VirtueMart 1.1.x => Virtuemart 1.1 Development (Archiv) => Q&T Resolved => Topic started by: Schafir on June 01, 2008, 01:37:18 AM

Title: [SOLVED] Error on checkout
Post by: Schafir on June 01, 2008, 01:37:18 AM
Hello, We are using VM 1.1.0 on Joomla 1.5.3 and we get the following error upon checkout confirmation:

Warning: Invalid argument supplied for foreach() in /home/.../administrator/components/com_virtuemart/classes/ps_checkout.php on line 1845

I am not a programmer, but I looked at this line in the ps_checkout.php file and it has to do with shipping fields:

1845 foreach( $shippingfields as $field ) {      

Can anyone tell me what this error is and how to fix it?

thank you,

Schafir
Title: Re: Error on checkout
Post by: Schafir on June 07, 2008, 23:05:05 PM
Anyone at Virtuemart have any ideas on this error?
Title: Re: Error on checkout
Post by: Nyquist on June 09, 2008, 11:17:47 AM
I have the same problem, but with even more errors...


Warning: Invalid argument supplied for foreach() in xxx\administrator\components\com_virtuemart\classes\ps_checkout.php on line 992

Warning: Invalid argument supplied for foreach() in xxx\administrator\components\com_virtuemart\classes\ps_checkout.php on line 1826

Warning: Invalid argument supplied for foreach() in xxx\administrator\components\com_virtuemart\classes\ps_checkout.php on line 1845

Notice: Undefined offset: 0 in xxx\administrator\components\com_virtuemart\html\checkout.thankyou.php on line 40

Notice: Undefined property: stdClass::$user_email in xxx\components\com_virtuemart\themes\default\templates\pages\checkout.thankyou.tpl.php on line 34


The order can also not be accessed from the backend but the order seems to get registered in the database. The strange thing is that it works flawlessly on my local computer (exact same website but with MySQL 5.0.27 running). Could it have something to do with which MySQL-version being used? The one that generates errors have MySQL 4.1.15 installed.
Title: Re: Error on checkout
Post by: Schafir on June 12, 2008, 21:50:56 PM
Aravot, can you please comment on these errors?  In my case, I am using a basic Joomlart shopping II template and I get this error on checkout.  It this a Virtuemart bug, a Joomla bug,
a configuration issue, or what?  We really need to get this resolved and would appreciate your help.

Thank you.
Title: Re: Error on checkout
Post by: aravot on June 13, 2008, 03:47:12 AM
@Nyquist could be SQL issue, try updating your remote site to v5

@Schafir, where do you get this error, what shipping and payment modules you have activated, are you using SEF, do you have cache on.
Title: Re: Error on checkout
Post by: Schafir on June 13, 2008, 04:10:07 AM
Aravot, first of all, thank you for responding.  I didn't realize you were unavailable. 

This error occurs when confirming the checkout. The error occurs when selecting "standard shipping" in checkout.  It appears on the confirmation page (see attached), in addition to another error in the confirmation email in the "ship to" field:

Warning: Invalid argument supplied for foreach() in /.../components/com_virtuemart/themes/default/templates/order_emails/confirmation_email.tpl.php on line 104

We are in development at this point and we only have activated Flex shipping and standard shipping enabled. Cache and SEF are turned off.

Thanks for any help you can give us.




[attachment cleanup by admin]
Title: Re: Error on checkout
Post by: gregdev on June 15, 2008, 00:42:36 AM
Did you upgrade from one of the earlier RC releases? It almost looks like you are missing a column in the userfields table.

Greg
Title: Re: Error on checkout
Post by: Schafir on June 15, 2008, 06:35:12 AM
Greg, thank you very much. It turns out that the userfields did not copy over
when I did a manual upgrade from the release candidate to VM 1.1.0 stable.

An uninstall/reinstall with the automatic installation did the trick.

Thanks again for your help.
Title: Re: Error on checkout
Post by: Nyquist on June 15, 2008, 08:29:38 AM
Quote from: aravot on June 13, 2008, 03:47:12 AM
@Nyquist could be SQL issue, try updating your remote site to v5

Yes, this did actually help. Thank you!
Title: Re: [NOT SOLVED] Error on checkout
Post by: teubernet on June 24, 2008, 17:27:25 PM
Did you find a solution for this issue, I have the same problem. The problem accurs also in a fresh installation with sample data here.
Similar errors happen when viewing the order in the account administration, the order confirmation emails and other places.

I have Joomla! 1.0.15; VM 1.1.0 with extra user fields.

Best regards

CT
Title: Re: [SOLVED] Error on checkout
Post by: Schafir on June 24, 2008, 19:26:51 PM
teubernet,

You may or may not have the same problem I had.  The best advice I can give you is to go into the admininstration area of Virtuemart and check to see if you have the default userfields installed.  You can get there by selecting "manage user fields".  In my case, the default fields were not installed when I upgraded for some reason.  An uninstall and reinstall of virtuemart solved the problem.

Good luck.
Title: Re: [NOT SOLVED] Error on checkout
Post by: teubernet on June 25, 2008, 09:55:02 AM
I did afresh install with sample data again, same problem:
QuoteWarning: Invalid argument supplied for foreach() in /srv/www/vhosts/sq-lab.com/httpdocs/administrator/components/com_virtuemart/classes/ps_checkout.php on line 992

Warning: Invalid argument supplied for foreach() in /srv/www/vhosts/sq-lab.com/httpdocs/administrator/components/com_virtuemart/classes/ps_checkout.php on line 1826

Warning: Invalid argument supplied for foreach() in /srv/www/vhosts/sq-lab.com/httpdocs/administrator/components/com_virtuemart/classes/ps_checkout.php on line 1845

After the confirmation also there are Errors like:
QuoteWarning: Invalid argument supplied for foreach() in /srv/www/vhosts/sq-lab.com/httpdocs/components/com_virtuemart/themes/default/templates/pages/account.order_details.tpl.php on line 98
and
QuoteWarning: Invalid argument supplied for foreach() in /srv/www/vhosts/sq-lab.com/httpdocs/components/com_virtuemart/themes/default/templates/pages/account.order_details.tpl.php on line 135
while viewing the order in the Account maintenance.

The confirmaion email also has warnings:
QuoteWarning: Invalid argument supplied for foreach() in /srv/www/vhosts/sq-lab.com/httpdocs/components/com_virtuemart/themes/default/templates/order_emails/confirmation_email.tpl.php on line 63
and
QuoteWarning: Invalid argument supplied for foreach() in /srv/www/vhosts/sq-lab.com/httpdocs/components/com_virtuemart/themes/default/templates/order_emails/confirmation_email.tpl.php on line 104

There is no customer information shown. There is nothing saved to the jos_vm_order_user_info table in the database.

Using 1.0.15, vm 1.1.1.

Best regards CT
Title: Re: [SOLVED] Error on checkout
Post by: Schafir on June 25, 2008, 18:24:12 PM
Sorry, I cannot help. Perhaps Gregdev or one of the other Virtuemart experts can respond and help you.

Title: Re: [SOLVED] Error on checkout
Post by: aravot on June 25, 2008, 18:38:54 PM
upgrade to php5
Title: Re: [SOLVED] Error on checkout
Post by: teubernet on June 26, 2008, 15:51:27 PM
Are there other possibilities to solve this problem?
I have an own server for one client, but on shared hostings upgrading can be a problem.

best regards

CT
Title: Re: [SOLVED] Error on checkout
Post by: braceyourselfusa on October 24, 2008, 20:57:30 PM
gregdev- I think you nailed the answer to this one... I'm also having this problem... I tried to reinstall through the automatic install but have never gotten it to work. I have no user fields in my Virtuemart Admin either.

I did a fresh install of Joomla, a fresh install of VirtueMart, then ported my database info over from my old site. If I'm missing the default userfields or a column in the userfields table, is there a default list I can add manually, or data I can add to the database to replace what I'm missing?

Joomla 1.5.7 & Virtuemart 1.1.2
Title: Re: Error on checkout
Post by: braceyourselfusa on October 24, 2008, 22:53:54 PM
This will kind of clarify my issue a little, I think...  I'm getting errors upon check out, order confirmation and on the e-mail confirmation... these all happen when trying to display the Ship To info...

Here are the errors I'm getting:

1. Order Confirmation Page
QuoteWarning: Invalid argument supplied for foreach() in /home/braceyou/domains/thepainreliever.net/public_html/administrator/components/com_virtuemart/classes/ps_checkout.php on line 1910

2. Order Information Page (in Account Maintenence)
QuoteWarning: Invalid argument supplied for foreach() in /home/braceyou/domains/thepainreliever.net/public_html/components/com_virtuemart/themes/default/templates/pages/account.order_details.tpl.php on line 135

3. E-mail Confirmation
QuoteWarning: Invalid argument supplied for foreach() in /home/braceyou/domains/thepainreliever.net/public_html/components/com_virtuemart/themes/default/templates/order_emails/confirmation_email.tpl.php on line 104

I did a fresh install of Joomla, a fresh install of VirtueMart, then ported my database info over from my old site. If I'm missing the default userfields or a column in the userfields table, is there a default list I can add manually, or data I can add to the database to replace what I'm missing?

Joomla 1.5.7 & Virtuemart 1.1.2 on a PHP 5 Host.
Title: Re: [SOLVED] Error on checkout
Post by: braceyourselfusa on October 24, 2008, 23:17:37 PM
Also, just found this when I when, checking out, I went to add a shipping address (as a customer)

Warning: Invalid argument supplied for foreach() in /home/braceyou/domains/thepainreliever.net/public_html/administrator/components/com_virtuemart/classes/ps_userfield.php on line 265


Warning: Invalid argument supplied for foreach() in /home/braceyou/domains/thepainreliever.net/public_html/administrator/components/com_virtuemart/classes/ps_userfield.php on line 296

It has something to do with the shipping info...
Title: Re: [SOLVED] Error on checkout
Post by: braceyourselfusa on October 24, 2008, 23:25:44 PM
And this, when I hit save (even though there are errors on the page)... just trying to see if I can't help narrow it down...

Warning: Invalid argument supplied for foreach() in /home/braceyou/domains/thepainreliever.net/public_html/administrator/components/com_virtuemart/classes/ps_user_address.php on line 49

Warning: Invalid argument supplied for foreach() in /home/braceyou/domains/thepainreliever.net/public_html/administrator/components/com_virtuemart/classes/ps_user_address.php on line 125