Zen Cart Logo
Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Gift Certificate only orders failing on order confirmation

Gift Certificate only orders failing on order confirmation

Locked

Views: 4,530

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
22 Nov 2007, 6:19 AM
#1
ficiousjigs_com avatar

ficiousjigs_com

New Zenner

Join Date:
Nov 2007
Posts:
17
Plugin Contributions:
0

Gift Certificate only orders failing on order confirmation

I recently added gift certificates and have configured the products as virtual=yes and always free shipping=yes.

If only virtual products are in the cart, I get the followig message:
1264 Out of range value adjusted for column 'delivery_address_format_id' at row 1
in:
[INSERT INTO zen_orders (customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, payment_module_code, shipping_method, shipping_module_code, coupon_code, cc_type, cc_owner, cc_number, cc_expires, date_purchased, orders_status, order_total, order_tax, currency, currency_value, ip_address) VALUES ('15', 'Test Customer', '', '1313 Mockinbird Lane', '', 'Los Angeles', '90021', 'California', 'United States', '3137718151', '[email protected]', '2', ' ', '', '', '', '', '', '', '', '', 'Test Customer', '', '1313 Mockinbird Lane', '', 'Los Angeles', '90021', 'California', 'United States', '2', 'Check/Money Order', 'moneyorder', 'Free Shipping', 'free', '', '', '', '', '', now(), '1', '1', '0', 'USD', '1.00000000', '71.10.39.136 - 71.10.39.136')]

However, if I add an item that needs shipping ... everything works just fine.

It appears to me that the values being applied in the SQL insert statement are not really aligning to their corresponding columns. It looks as if the phone number is in the place where the delivery_address_format_id is supposed to be.

Anyone have any ideas on how I can fix this?

Thanks in advance,

Ficous

22 Nov 2007, 7:31 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Gift Certificate only orders failing on order confirmation

I'm pretty sure this was addressed as a bug earlier. Nevertheless, the fix is this:

  • edit /includes/classes/order.php

  • lines 373-411 contain code like this, with the exception of the three changes highlighted in red.

  • make the changes as shown:```
    $this->customer = array('firstname' => $customer_address->fields['customers_firstname'],
    'lastname' => $customer_address->fields['customers_lastname'],
    'company' => $customer_address->fields['entry_company'],
    'street_address' => $customer_address->fields['entry_street_address'],
    'suburb' => $customer_address->fields['entry_suburb'],
    'city' => $customer_address->fields['entry_city'],
    'postcode' => $customer_address->fields['entry_postcode'],
    'state' => ((zen_not_null($customer_address->fields['entry_state'])) ? $customer_address->fields['entry_state'] : $customer_address->fields['zone_name']),
    'zone_id' => $customer_address->fields['entry_zone_id'],
    'country' => array('id' => $customer_address->fields['countries_id'], 'title' => $customer_address->fields['countries_name'], 'iso_code_2' => $customer_address->fields['countries_iso_code_2'], 'iso_code_3' => $customer_address->fields['countries_iso_code_3']),
    'format_id' => [B]COLOR="Red"[/COLOR][/B]$customer_address->fields['address_format_id'],
    'telephone' => $customer_address->fields['customers_telephone'],
    'email_address' => $customer_address->fields['customers_email_address']);

    $this->delivery = array('firstname' => $shipping_address->fields['entry_firstname'],
    'lastname' => $shipping_address->fields['entry_lastname'],
    'company' => $shipping_address->fields['entry_company'],
    'street_address' => $shipping_address->fields['entry_street_address'],
    'suburb' => $shipping_address->fields['entry_suburb'],
    'city' => $shipping_address->fields['entry_city'],
    'postcode' => $shipping_address->fields['entry_postcode'],
    'state' => ((zen_not_null($shipping_address->fields['entry_state'])) ? $shipping_address->fields['entry_state'] : $shipping_address->fields['zone_name']),
    'zone_id' => $shipping_address->fields['entry_zone_id'],
    'country' => array('id' => $shipping_address->fields['countries_id'], 'title' => $shipping_address->fields['countries_name'], 'iso_code_2' => $shipping_address->fields['countries_iso_code_2'], 'iso_code_3' => $shipping_address->fields['countries_iso_code_3']),
    'country_id' => $shipping_address->fields['entry_country_id'],
    'format_id' => [B]COLOR="Red"[/COLOR][/B]$shipping_address->fields['address_format_id']);

    $this->billing = array('firstname' => $billing_address->fields['entry_firstname'],
    'lastname' => $billing_address->fields['entry_lastname'],
    'company' => $billing_address->fields['entry_company'],
    'street_address' => $billing_address->fields['entry_street_address'],
    'suburb' => $billing_address->fields['entry_suburb'],
    'city' => $billing_address->fields['entry_city'],
    'postcode' => $billing_address->fields['entry_postcode'],
    'state' => ((zen_not_null($billing_address->fields['entry_state'])) ? $billing_address->fields['entry_state'] : $billing_address->fields['zone_name']),
    'zone_id' => $billing_address->fields['entry_zone_id'],
    'country' => array('id' => $billing_address->fields['countries_id'], 'title' => $billing_address->fields['countries_name'], 'iso_code_2' => $billing_address->fields['countries_iso_code_2'], 'iso_code_3' => $billing_address->fields['countries_iso_code_3']),
    'country_id' => $billing_address->fields['entry_country_id'],
    'format_id' => B[/B]$billing_address->fields['address_format_id']);

22 Nov 2007, 5:02 PM
#3
ficiousjigs_com avatar

ficiousjigs_com

New Zenner

Join Date:
Nov 2007
Posts:
17
Plugin Contributions:
0

Re: Gift Certificate only orders failing on order confirmation

Thank you for the fix ... it seems to have taken care of that problem and now I have run into another. It looks as if the value in the SQL statement in not properly quoted.

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

HAPPY Thanksgiving !

22 Nov 2007, 5:03 PM
#4
ficiousjigs_com avatar

ficiousjigs_com

New Zenner

Join Date:
Nov 2007
Posts:
17
Plugin Contributions:
0

Re: Gift Certificate only orders failing on order confirmation

Oops ... never mind the not properly quoted commnet ... I can see now that it is.

I will see if I can find this code and figure out what is going on.

Thanks again for all your help!

22 Nov 2007, 7:08 PM
#5
ficiousjigs_com avatar

ficiousjigs_com

New Zenner

Join Date:
Nov 2007
Posts:
17
Plugin Contributions:
0

Re: Gift Certificate only orders failing on order confirmation

Well ... I've had no luck figuring this out and could use your help.

After looking at the columns and values in the SQL statement above, it almost seems as if the '0.00' and the 'f' need to have their order switched to 'f' and then '0.00'. Just a thought.

22 Nov 2007, 9:56 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Gift Certificate only orders failing on order confirmation

Upgrading to v1.3.7.1 should resolve it.
If that's not palatable, you could try one of the suggestions in this thread: http://www.zen-cart.com/forum/showthread.php?t=69172

23 Nov 2007, 3:42 AM
#7
ficiousjigs_com avatar

ficiousjigs_com

New Zenner

Join Date:
Nov 2007
Posts:
17
Plugin Contributions:
0

Re: Gift Certificate only orders failing on order confirmation

I will check out the thread you've posted and post back the results. My installation is a vanilla Zencart of the version you are suggesting upgrading to. I downloaded and installed about a month ago. Thanks for the ongoing help.

24 Nov 2007, 9:17 PM
#8
ficiousjigs_com avatar

ficiousjigs_com

New Zenner

Join Date:
Nov 2007
Posts:
17
Plugin Contributions:
0

Re: Gift Certificate only orders failing on order confirmation

The fix you suggested worked. Thanks!

3 Feb 2008, 2:24 PM
#9
fuzzybunny avatar

fuzzybunny

New Zenner

Join Date:
Sep 2007
Location:
Melbourne Australia
Posts:
60
Plugin Contributions:
0

Re: Gift Certificate only orders failing on order confirmation

I am getting a similar, but different problem - which is not solved with the previously suggested fixes.

On confirm order everything works perfect unless I try to pay some or all with a gift cert. If I put a value against the gift cert and press to confirm I get an error page saying:

Fatal error: Call to undefined method currencies::value() in /home/flo15885/public_html/direct/includes/modules/order_total/ot_gv.php on line 82

line 82 in ot_gv.php says:
if ($_SESSION['cot_gv'] > $currencies->value($this->user_has_gv_account($_SESSION['customer_id']))) {

I've been playing around with the code and trying to see if there is some way to fix it in the class or order files, but I am at a loss and can't seem to get anywhere.

If I remove line 82 I get the same error on a different line:
Fatal error: Call to undefined method currencies::value() in /home/flo15885/public_html/direct/includes/modules/order_total/ot_gv.php on line 208

This must be a class or define issue???

Can anyone help - PLEASE

3 Feb 2008, 2:46 PM
#10
ajeh avatar

ajeh

Oba-san

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

Re: Gift Certificate only orders failing on order confirmation

You appear to have an old version of Zen Cart running ...

What version of Zen Cart is this?

Clean installation or an upgrade?

How did you install? How did you upgrade?

3 Feb 2008, 3:25 PM
#11
fuzzybunny avatar

fuzzybunny

New Zenner

Join Date:
Sep 2007
Location:
Melbourne Australia
Posts:
60
Plugin Contributions:
0

Re: Gift Certificate only orders failing on order confirmation

Thanks for the reply. ;-)

Zen Cart 1.3.7
Database Patch Level: 1.3.7
v1.3.7 [2007-08-04 13:54:12] (Fresh Installation)

Has been working fine until now.

The only recent work I did was adding a tax invoice button to my customers account history info page - so they can print their own invoices for the tax man.

However, I am not sure why that would affect only the gift voucher being redeemed with the order?

Thanks for your help.

3 Feb 2008, 3:48 PM
#12
fuzzybunny avatar

fuzzybunny

New Zenner

Join Date:
Sep 2007
Location:
Melbourne Australia
Posts:
60
Plugin Contributions:
0

Re: Gift Certificate only orders failing on order confirmation

And if the answer is that all my problems will be fixed with upgrading to v1.3.8a my question is whether there is going to be a v1.3.8b out soon, to try and avoid any teething bugs with the new version?

If not, and there is another fix that would be great.

3 Feb 2008, 4:24 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Gift Certificate only orders failing on order confirmation

Zen Cart v1.3.8a is the current version and we really are not planning on an additional release for sometime ...
http://www.zen-cart.com/forum/showthread.php?t=81696

Be sure to also look at the thread on Known bugs also referrenced on that thread and you should be pretty set to go for some time ...

11 Jun 2008, 8:00 PM
#14
arkid77 avatar

arkid77

New Zenner

Join Date:
Jun 2008
Posts:
1
Plugin Contributions:
0

Re: Gift Certificate only orders failing on order confirmation

I have just installed a brand new installation of 1.38a, not made any changes really, just added one product to my inventory. from the start, all my orders dont complete as i get the same error after step 3 of checkout...

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

is what i constantly get.
can anyone assist? its the first time ive used zencart and its not been a very good start so far...

for ref, im using xp pro with built in IIS, mysql 5.051a, php 5.2.5