Forums / Basic Configuration / HOW DO I? Shipping address is never required

HOW DO I? Shipping address is never required

Locked

Started by djsmyers on 17 Feb 2007, 6:41 PM · Views: 1,540

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
17 Feb 2007, 6:41 PM
#1
djsmyers avatar

djsmyers

New Zenner

Join Date:
Dec 2006
Location:
Mesa, Arizona USA
Posts:
39
Plugin Contributions:
0

HOW DO I? Shipping address is never required

My brother has a local car wash. In my effort to help him, I've started to implement a zen-cart solution for him so his customers and actually select the services they want and pre-pay (which intitles them to a discount). I've set the categories up and added the three sub categories to each with 4 attributes to each of those. The check out process works great, across the board disounts works great (thanks to the mod by ???) however, when I get to step three of the checkout process (confirm the order) I get a

1264 Out of range value adjusted for column delivery_address_format_id' at row 1 in [INSERT INTO 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 ('1', 'Daniel Smyers', 'WEBTEAM', '8114 East B', '', 'Mesa', '85207', 'Arizona', 'United States', '480-984-9562', '[email protected]', '2', ' ', '', '', '', '', '', '', '', '', 'Daniel Smyers', 'WEBTEAM', '8114 East B', '', 'Mesa', '85207', 'Arizona', 'United States', '2', 'Credit Card', 'cc', 'Free Shipping', 'free', '', 'Visa', 'Daniel Smyers', '4111XXXXXXXX1111', '0108', now(), '1', '54', '0', 'USD', '1.00000000', '127.0.0.1 - 127.0.0.1')]

Attached are two screen shots for configuration.

How do I get around this?

Daniel Smyers
It can be done, it's just a matter of by who!!!!

Support your Zen team, they work hard to get this right for you. The least YOU could do is buy them a cup of coffee. ***Visit the zen cart donation page (click here)***

17 Feb 2007, 6:56 PM
#2
djsmyers avatar

djsmyers

New Zenner

Join Date:
Dec 2006
Location:
Mesa, Arizona USA
Posts:
39
Plugin Contributions:
0

Re: HOW DO I? Shipping address is never required

djsmyers:

(thanks to the mod by ???) If I going to give credit to a mod, than I best mention by whom.

Mod: Quantity Discounts version 1.4
By: Scott Wilson (swguy)
At: http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_61&products_id=235

This mod saved me a lot of effort in configuration.

Daniel Smyers
It can be done, it's just a matter of by who!!!!

Support your Zen team, they work hard to get this right for you. The least YOU could do is buy them a cup of coffee. ***Visit the zen cart donation page (click here)***

17 Feb 2007, 8:19 PM
#3
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,701
Plugin Contributions:
0

Re: HOW DO I? Shipping address is never required

On the shipping - mark all of your products as virtual- no shipping required. the shipping with be skipped.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

18 Feb 2007, 4:37 AM
#4
djsmyers avatar

djsmyers

New Zenner

Join Date:
Dec 2006
Location:
Mesa, Arizona USA
Posts:
39
Plugin Contributions:
0

Re: HOW DO I? Shipping address is never required

Thank you for the response Kim. I have marked all products as virtual, as a result, the 1264 error occurs. I really didn't want to make a core change, but should I just comment out line 595 in includes/classes/orders.php

//'delivery_address_format_id' => $this->delivery['format_id'],

or hard code the line to read

'delivery_address_format_id' => '1',

I tried changing the table structure to allow nulls, default to 1, and default to 0 to no avail. I'm not to bad when it comes to coding (not to good either). I was just wondering if the cart requires a shipping address regardless of settings. Anyways, I'm at a loss (what's new).

Some configurations options with the virtual products I tried was setting Always free shipping to special, then to no, then to yes. Same error.

Now I know what happens with a commented line of code, I get this error:

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')]

Hardcoded with 0 or 1 generates the same error.

Daniel Smyers
It can be done, it's just a matter of by who!!!!

Support your Zen team, they work hard to get this right for you. The least YOU could do is buy them a cup of coffee. ***Visit the zen cart donation page (click here)***

18 Feb 2007, 6:10 AM
#5
djsmyers avatar

djsmyers

New Zenner

Join Date:
Dec 2006
Location:
Mesa, Arizona USA
Posts:
39
Plugin Contributions:
0

Re: HOW DO I? Shipping address is never required

I woke up and smelled some roses. The problem was the value had a charactor attached to it (ie 148.0f). By making a small change in includes/classes/order.php I fixed the second error (I hope I didn't make myself a new one). I add the builtin function 'floatval' to the element 'value' of the sql array for the table orders total insert. In other words, (okay you can kick me later drbyte for messing with your code) I changed


  for ($i=0, $n=sizeof($zf_ot_modules); $i<$n; $i++) {
     $sql_data_array = array('orders_id' => $insert_id,
                             'title' => $zf_ot_modules[$i]['title'],
                             'text' => $zf_ot_modules[$i]['text'],
                             'value' =>$zf_ot_modules[$i]['value'],
                             'class' => $zf_ot_modules[$i]['code'],
                             'sort_order' => $zf_ot_modules[$i]['sort_order']);
     zen_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
   }

to

 
    for ($i=0, $n=sizeof($zf_ot_modules); $i<$n; $i++) {
      $sql_data_array = array('orders_id' => $insert_id,
                              'title' => $zf_ot_modules[$i]['title'],
                              'text' => $zf_ot_modules[$i]['text'],
                              'value' => floatval($zf_ot_modules[$i]['value']),
                              'class' => $zf_ot_modules[$i]['code'],
                              'sort_order' => $zf_ot_modules[$i]['sort_order']);
      zen_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
    }

everything seems to work as expected during checkout.

Daniel Smyers
It can be done, it's just a matter of by who!!!!

Support your Zen team, they work hard to get this right for you. The least YOU could do is buy them a cup of coffee. ***Visit the zen cart donation page (click here)***

25 Apr 2007, 8:42 PM
#6
fibreiv avatar

fibreiv

New Zenner

Join Date:
Apr 2007
Posts:
1
Plugin Contributions:
0

Re: HOW DO I? Shipping address is never required

djsmyers:

I woke up and smelled some roses. The problem was the value had a charactor attached to it (ie 148.0f). By making a small change in includes/classes/order.php I fixed the second error (I hope I didn't make myself a new one). I add the builtin function 'floatval' to the element 'value' of the sql array for the table orders total insert. In other words, (okay you can kick me later drbyte for messing with your code) I changed

for ($i=0, $n=sizeof($zf_ot_modules); $i<$n; $i++) {
$sql_data_array = array('orders_id' => $insert_id,
'title' => $zf_ot_modules[$i]['title'],
'text' => $zf_ot_modules[$i]['text'],
'value' =>$zf_ot_modules[$i]['value'],
'class' => $zf_ot_modules[$i]['code'],
'sort_order' => $zf_ot_modules[$i]['sort_order']);
zen_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
}

>  
> to
>  
> ```php
 
    for ($i=0, $n=sizeof($zf_ot_modules); $i<$n; $i++) {
      $sql_data_array = array('orders_id' => $insert_id,
                              'title' => $zf_ot_modules[$i]['title'],
                              'text' => $zf_ot_modules[$i]['text'],
                              'value' => floatval($zf_ot_modules[$i]['value']),
                              'class' => $zf_ot_modules[$i]['code'],
                              'sort_order' => $zf_ot_modules[$i]['sort_order']);
      zen_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
    }
 

everything seems to work as expected during checkout.

I am having the exact same problem with a download. Works fine if I choose something that has to be shipped but when there is no shipping I get the same error. I changed my code to the moded code you posted but still same thing. Did you change anything else or was that it?

Thanks,
Brett

26 Apr 2007, 4:18 AM
#7
djsmyers avatar

djsmyers

New Zenner

Join Date:
Dec 2006
Location:
Mesa, Arizona USA
Posts:
39
Plugin Contributions:
0

Re: HOW DO I? Shipping address is never required

Those are the only changes I made. I installed the Quantity Discount Mod, marked all products virtual, and made that single line change in the code. If you could get me a screen shot of the actual error, maybe I could take a look and see what might be happening. I'm not much of a coder, but I am darn good with debugging and streamlining code others have developed.

Daniel Smyers
It can be done, it's just a matter of by who!!!!

Support your Zen team, they work hard to get this right for you. The least YOU could do is buy them a cup of coffee. ***Visit the zen cart donation page (click here)***