Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Nov 2007
    Posts
    17
    Plugin Contributions
    0

    red flag 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', 'test_customer62######################', '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

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default 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:
    Code:
        $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' => (int)$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' => (int)$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' => (int)$billing_address->fields['address_format_id']);
    It's already been fixed in the upcoming v1.3.8
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Nov 2007
    Posts
    17
    Plugin Contributions
    0

    red flag 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 !

  4. #4
    Join Date
    Nov 2007
    Posts
    17
    Plugin Contributions
    0

    red flag 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!

  5. #5
    Join Date
    Nov 2007
    Posts
    17
    Plugin Contributions
    0

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

  6. #6
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Nov 2007
    Posts
    17
    Plugin Contributions
    0

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

  8. #8
    Join Date
    Nov 2007
    Posts
    17
    Plugin Contributions
    0

    Default Re: Gift Certificate only orders failing on order confirmation

    The fix you suggested worked. Thanks!

  9. #9
    Join Date
    Sep 2007
    Location
    Melbourne Australia
    Posts
    60
    Plugin Contributions
    0

    Default 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

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default 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?
    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: v1.5.5]
    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!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Only show gift certificate option on payment page if customer has a gift certificate
    By ShopVille in forum Templates, Stylesheets, Page Layout
    Replies: 25
    Last Post: 21 Jul 2014, 08:03 PM
  2. Disable Gift Certificate confirmation email...
    By joyjoy in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 4 May 2011, 12:56 PM
  3. Order Confirmation Email Failing (sometimes!)
    By LowlyWorm in forum General Questions
    Replies: 9
    Last Post: 29 Jun 2009, 10:04 PM
  4. Want to use a printed gift certificate (with code) in the gift certificate process?
    By HelenSama in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 9
    Last Post: 15 Apr 2008, 02:04 PM
  5. Gift Certificate Order with no Gift Certificate?
    By Jeff_Mash in forum Bug Reports
    Replies: 20
    Last Post: 14 Oct 2006, 09:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR