Zen Cart Logo
Forums / Bug Reports / [Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

[Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

Locked

Views: 4,117

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
27 Jun 2007, 2:18 AM
#1
calculoso avatar

calculoso

New Zenner

Join Date:
Jun 2007
Posts:
5
Plugin Contributions:
0

[Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

Version 1.3.7
MySQL 5.0.10-community-nt via TCP/IP

First Reported in thread:
http://www.zen-cart.com/forum/showthread.php?t=63993

When trying to checkout an order with all virtual products, I got a few errors. The first ones were described and fixed using the modifications in the thread above.

Afterwards, I got this error:


1366 Incorrect decimal value: 'f' for column 'value' at row 1
in:
[INSERT INTO zen2_orders_total (orders_id, title, text, value, class, sort_order) VALUES ('1', 'Free Shipping:', '$0.00', 'f', 'ot_shipping', '200')]

As summarized in the thread above, it looks like the 'shipping_cost' (and possibly other settings) is never set for shipping values of the 'free_free' type.

Adding the line below in red to the /includes/modules/order_total/ot_shipping.php file seems to fix it.

        if ($_SESSION['shipping'] == 'free_free')
        {
            $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
[I][B]Added:                  $order->info['shipping_cost'] = 0;
[/B][/I]

Is this valid or is there more to add?

27 Jun 2007, 3:36 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: [Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

Have you loaded the Cart with the Demo product set?

Try it as there are virtual products there and you can view the admin settings for these

Zen-Venom Get Bitten

27 Jun 2007, 5:39 AM
#3
calculoso avatar

calculoso

New Zenner

Join Date:
Jun 2007
Posts:
5
Plugin Contributions:
0

Re: [Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

Same problem.

I just did a fresh install (in a separate directory and Sql server), and installed the demo product set.

I tried to purchase a $5 gift certificate - a virtual product.

Ran into the same problems as before. Had to follow the first instructions (add the '(int)' in front of the format id values), and then witnessed this same error:

1366 Incorrect decimal value: 'f' for column 'value' at row 1
in:
[INSERT INTO zenorig_orders_total (orders_id, title, text, value, class, sort_order) VALUES ('2', 'Free Shipping:', '$0.00', 'f', 'ot_shipping', '200')]
27 Jun 2007, 6:16 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: [Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

Did you read th post by DrByte?

DrByte:

'f' should never be in the "value" field, as the "value" field is supposed to contain a numeric value.

Starting from installation, how exactly have you configured your shop?
What modules have you installed?
What addons have you installed?
What currencies have you edited? What did you change in currency settings?
What taxes have you added?
Which languages have you installed?
Do the errors stop if you switch back to English?
'f' seems to be the issue....

Zen-Venom Get Bitten

27 Jun 2007, 4:46 PM
#5
calculoso avatar

calculoso

New Zenner

Join Date:
Jun 2007
Posts:
5
Plugin Contributions:
0

Re: [Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

I agree that the 'f' is the issue.. but I was trying to figure out where the 'f' came from.

It seems to come from the 'free_free' shipping that was automatically set in the script. I don't think that everything that needs to be set is actually set.

8 Nov 2007, 5:57 AM
#6
murrah avatar

murrah

New Zenner

Join Date:
Oct 2007
Posts:
12
Plugin Contributions:
0

Re: [Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

Adding the line below in red to the /includes/modules/order_total/ot_shipping.php file seems to fix it.

        if ($_SESSION['shipping'] == 'free_free') {
            $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
[I][B]Added:                  $order->info['shipping_cost'] = 0;
[/B][/I]
         }

Yes, I added the same extra line and it fixed the problem. I cant see any side affects anywhere so it seems to solve the problem.

(I just added the closing bracket to your code to make it clearer to others)

Thanks for posting your solution.

Murray

10 Nov 2007, 7:39 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

Just for giggles and grins, what happens if you install a test copy into a test database with the demo products of the current version of Zen Cart v1.3.7.1 ...
http://www.zen-cart.com/forum/showthread.php?t=69769

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

12 Nov 2007, 9:16 AM
#8
jaycode avatar

jaycode

Zen Follower

Join Date:
Jun 2007
Location:
Australia - Melbourne
Posts:
306
Plugin Contributions:
1

Re: [Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

Great post, thanks everybody, had the same problem but now fixed.

However now the new orders made are not shown in user account and admin. I've checked the database and the orders are there. Think I'll do some search on the forum for this problem.

The greatest pleasure in life is doing what people say you cannot do.

Check on www.WebExtremeCustomiser.com for my modules (free contribution):
AJAX Image Swapper
AJAX Banner Swapper
Fixed Navigation

12 Nov 2007, 5:55 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

If you do a Search on orders_id do they show?

If so, check the Modules ... Order Total ... and make sure Total ot_total is installed and enabled ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 Nov 2007, 10:58 PM
#10
jaycode avatar

jaycode

Zen Follower

Join Date:
Jun 2007
Location:
Australia - Melbourne
Posts:
306
Plugin Contributions:
1

Re: [Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

Yes they show and yes ot_total has been enabled...

Ah but the problem has been fixed in zen-cart 1.3.7.1

thanks ;)

The greatest pleasure in life is doing what people say you cannot do.

Check on www.WebExtremeCustomiser.com for my modules (free contribution):
AJAX Image Swapper
AJAX Banner Swapper
Fixed Navigation

16 Dec 2007, 7:27 AM
#11
nascar81054 avatar

nascar81054

New Zenner

Join Date:
Dec 2007
Posts:
4
Plugin Contributions:
0

Re: [Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

I'm having the same problem and this isn't working"
$order->info['shipping_cost'] = 0;
Any suggestions?
Thanks everone.

16 Dec 2007, 7:30 AM
#12
nascar81054 avatar

nascar81054

New Zenner

Join Date:
Dec 2007
Posts:
4
Plugin Contributions:
0

Re: [Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

I'm having the same problem and this isn't working:
$order->info['shipping_cost'] = 0;
Thanks everyone.

17 Dec 2007, 3:10 AM
#13
nascar81054 avatar

nascar81054

New Zenner

Join Date:
Dec 2007
Posts:
4
Plugin Contributions:
0

Re: [Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

I have done all of this and now it goes to the checkout success page but the product does not download. Any suggestions? Thanks.

19 Dec 2007, 4:03 AM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done v1.3.7.1]Checking out virtual products leads to SQL error (MySQL 5)

When you look at the Order, what is the orders_status?

If the orders_status is not between the values set in the Attributes Settings, >= 2 (Processing) and <= 4 (Upgraded) then you will not be able to download the Download until the Order is updated for the orders_status ...

The orders_status can be configured on the Payment Module on a per Payment Module basis ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!