Shipping address the same as billing checked?

How to make “Shipping address the same as billing” checkbox on Checkout page to be checked by default and also to be hidden? CS-cart 3.0.2



My clients always use the same address for both also I disabled the shipping fields, so I use only the billing address fields and the checkbox is useless for me!

Hi, I’m looking how to do this too… if you find anything, I would be happy to get the clue :)

Hi my solution in order_info.tpl -> yourskin/customer/blocks/checkout/

```php

{if $completed_steps.step_two}

{if !$cart.ship_to_another}

{$lang.billing_shipping_address}:


{assign var="profile_fields" value="I"|fn_get_profile_fields}


    {foreach from=$profile_fields.B item="field"}
    {assign var="value" value=$cart.user_data|fn_get_profile_field_value:$field}
    {if $value}
  • {$value}

  • {/if}
    {/foreach}


{else}

{$lang.billing_address}:


{assign var="profile_fields" value="I"|fn_get_profile_fields}


    {foreach from=$profile_fields.B item="field"}
    {assign var="value" value=$cart.user_data|fn_get_profile_field_value:$field}
    {if $value}
  • {$value}

  • {/if}
    {/foreach}




{$lang.shipping_address}:




    {foreach from=$profile_fields.S item="field"}
    {assign var="value" value=$cart.user_data|fn_get_profile_field_value:$field}
    {if $value}
  • {$value}

  • {/if}
    {/foreach}


{/if}
{if $cart.shipping}

{$lang.shipping_method}:



    {foreach from=$cart.shipping item="shipping"}
  • {$shipping.shipping}

  • {/foreach}


{/if}
{/if}
{assign var="block_wrap" value="checkout_order_info_`$block.snapping_id`_wrap"}
```

So if shipping same billing not display twice adresses.
if you dont like the adress switch you can simply add display: none; in css .address-switch

Thanks for reply!

The solution you’ve posted for order_info.tpl is not for version 3, isn’t it? As my order_info.tpl doesn’t contain this code?



With the css change display: none; , I only hide the checkbox asking for “Shipping address the same as billing”, but the fields of Shipping Address still stay on the page.

I use billing address as main and shipping address I don’t need and deleted all the fields, so now on Shipping address section stays the E-mail field filled - is there any way to hide it or remove it too from the shipping section?



The other way is make the checkbox always checked somehow here in profile_fields.tpl, but how is the question :) :



{if $section == "S"}{$lang.shipping_same_as_billing}{else}{$lang.text_billing_same_with_shipping}{/if}


{$lang.yes}
{$lang.no}

Anybody?

[quote name='exosto' timestamp='1345823769' post='143559']

How to make “Shipping address the same as billing” checkbox on Checkout page to be checked by default and also to be hidden? CS-cart 3.0.2



My clients always use the same address for both also I disabled the shipping fields, so I use only the billing address fields and the checkbox is useless for me!

[/quote]

Hey

I need help with the samething. Did you fine a fix for it yet? please, let me know.



Thank you

Tom

I also interested in solution.



Anyone, please!

That's one of the many problems I'm experiencing since upgrading to CS-Cart v3.



I don't do any shipping. Yet, in step 2 of the check-out process, it asks for Email of shipping address (all other fields are de-activated and hidden but email can't be deactivated). Also, it displays a whole tab about Shipping Options which shouldn't be there.



How can I remove Shipping Address and Shipping Options? If there are no built-in features of this, I guess this request should go to the development team! It was working fine with v2.



Thanks!

Try this method for V3. It might not be the best, but cs cart didn't think it fully through I guess.[list=1]

[]Make a backup then edit the file /core/fn.users.php

[
]+ for “function fn_compare_shipping_billing”

[]Go to the line where it says “if (empty($profile_fields[$from_section]) || empty($profile_fields[$to_section])) {”

[
]Then make that return true; instead of return false;

[*]Upload, clear cache using ?cc method, clear cookies, etc. Then test.

[/list]

[quote name='profs77' timestamp='1349136457' post='146133']

Try this method for V3. It might not be the best, but cs cart didn't think it fully through I guess.[list=1]

[]Make a backup then edit the file /core/fn.users.php

[
]+ for “function fn_compare_shipping_billing”

[]Go to the line where it says “if (empty($profile_fields[$from_section]) || empty($profile_fields[$to_section])) {”

[
]Then make that return true; instead of return false;

[*]Upload, clear cache using ?cc method, clear cookies, etc. Then test.

[/list]

[/quote]



Hey,



Thanks, but it didn't work for me.

[quote name=‘exosto’ timestamp=‘1346248422’ post=‘143930’]

Thanks for reply!

The solution you’ve posted for order_info.tpl is not for version 3, isn’t it? As my order_info.tpl doesn’t contain this code?



With the css change display: none; , I only hide the checkbox asking for “Shipping address the same as billing”, but the fields of Shipping Address still stay on the page.

I use billing address as main and shipping address I don’t need and deleted all the fields, so now on Shipping address section stays the E-mail field filled - is there any way to hide it or remove it too from the shipping section?



The other way is make the checkbox always checked somehow here in profile_fields.tpl, but how is the question :) :





[/quote]Hey



Did you get it to work?

My method is for 3.0.2 version:


  1. find skins/basic/customer/views/profiles/components/profile_fields.tpl



    change 14-15 row to:



    {$lang.yes}

    {$lang.no}


  2. add to css:



    .address-switch {

    display: none;

    }

    #ba{

    display: none;

    }



    It’s work for me 8)

perfect! @DonDan thank you! 8)

I have modified DonDan Mod to work for 4.02



[color=#282828][font=arial, verdana, tahoma, sans-serif]1. find [/font][/color]/design/themes/basic/templates/views/profiles/components/profile_fields.tpl



[color=#282828][font=arial, verdana, tahoma, sans-serif]change 14-15 row to:[/font][/color]









[color=#282828][font=arial, verdana, tahoma, sans-serif]2. add to css:[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif].address-switch {[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]display: none;[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]}[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]#ba{[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]display: none;[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]}[/font][/color]

[font=arial, verdana, tahoma, sans-serif][color=“#555555”]Go to [/color][/font]Customers > Profile fields [color=#555555][font=arial, verdana, tahoma, sans-serif]in your CS-Cart admin panel.[/font][/color]

[color=#555555][font=arial, verdana, tahoma, sans-serif]From there, make sure that under Billing address, the E-mail option is filled in and checked under both "Profile Show/Required and Checkout Show/ Required.[/font][/color]

  1. Make Shipping , Billing Profile fields Same under costomers > Profile fields in show / Required


  2. change prifile_fields.tpl



    ```php {if $profile_fields.$section}

    {if $address_flag}

{if $section == "S"}{$lang.shipping_same_as_billing}{else}{$lang.text_billing_same_with_shipping}{/if}


{$lang.yes}
{$lang.no}


{/if} ```


3. Clear Cache

I use the 4.1 V , How can I do it?

[quote name='MohammedMahani' timestamp='1430905346' post='213534']

I use the 4.1 V , How can I do it?

[/quote]



Do you want just to hide the checkbox? Open the “design\themes\YOUR_THEME\templates\views\profiles\components\profile_fields.tpl” file and replace:


```php


```

with

```php

```

Note that there should be identical list of product fields for the Shipping and Billing address sections.

the [font=“Lato”][color=“#4f5972”][size=3]Are shipping and billing addresses the same? Radio button isn't work. it still show the shipping address either if the radio button is checked. [/size][/color][/font]



https://scontent-fra.xx.fbcdn.net/hphotos-xft1/v/t1.0-9/11118461_10204190848587607_433933405726096875_n.jpg?oh=299d7b9764c2b8ef231baa6da690d93b&oe=55D03001



[font=“Lato”][color=“#4f5972”][size=3][/size][/color][/font]

No I want to activate it, it doesn't work, either if the radio button is checked the shipping is not hide.



[url=“https://scontent-fra.xx.fbcdn.net/hphotos-xpt1/v/t1.0-9/11139986_10204190884388502_4412777216909406485_n.jpg?oh=65ae3eb285ea384b3529e645783185ce&oe=55D49B00”]https://scontent-fra.xx.fbcdn.net/hphotos-xpt1/v/t1.0-9/11139986_10204190884388502_4412777216909406485_n.jpg?oh=65ae3eb285ea384b3529e645783185ce&oe=55D49B00[/url]