Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Shipping address the same as billing checked? Rate Topic   - - - - -

 
  • exosto
  • Member
  • Members
  • Join Date: 30-Nov 11
  • 25 posts

Posted 24 August 2012 - 03:56 PM #1

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!

 
  • Pascal
  • Senior Member
  • Members
  • Join Date: 13-Jun 12
  • 236 posts

Posted 27 August 2012 - 07:05 AM #2

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

 
  • posto
  • Senior Member
  • Members
  • Join Date: 19-Sep 11
  • 160 posts

Posted 27 August 2012 - 12:23 PM #3

Hi my solution in order_info.tpl -> yourskin/customer/blocks/checkout/
{if $completed_steps.step_two}
{if !$cart.ship_to_another}
<h4>{$lang.billing_shipping_address}:</h4>
{assign var="profile_fields" value="I"|fn_get_profile_fields}
<div class="checkout-address">
    <ul class="shipping-adress clearfix">
		{foreach from=$profile_fields.B item="field"}
			{assign var="value" value=$cart.user_data|fn_get_profile_field_value:$field}
			{if $value}
				<li class="{$field.field_name|replace:"_":"-"}">{$value}</li>
			{/if}
		{/foreach}
	</ul>
    </div>
{else}
<h4>{$lang.billing_address}:</h4>
{assign var="profile_fields" value="I"|fn_get_profile_fields}
<div class="checkout-address">
    <ul class="shipping-adress clearfix">
		{foreach from=$profile_fields.B item="field"}
			{assign var="value" value=$cart.user_data|fn_get_profile_field_value:$field}
			{if $value}
				<li class="{$field.field_name|replace:"_":"-"}">{$value}</li>
			{/if}
		{/foreach}
	</ul>
</div>
<hr>
<h4>{$lang.shipping_address}:</h4>
    <div class="checkout-address">
<ul class="shipping-adress clearfix">
		{foreach from=$profile_fields.S item="field"}
			{assign var="value" value=$cart.user_data|fn_get_profile_field_value:$field}
			{if $value}
				<li class="{$field.field_name|replace:"_":"-"}">{$value}</li>
			{/if}
		{/foreach}
	</ul>
    </div>
{/if}
{if $cart.shipping}
  <hr><h4>{$lang.shipping_method}:</h4>
  <ul>
   {foreach from=$cart.shipping item="shipping"}
    <li> {$shipping.shipping}</li>
   {/foreach}
		 
  </ul>
{/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
Templates for v3

**see Posto's Templates Tread**

 
  • exosto
  • Member
  • Members
  • Join Date: 30-Nov 11
  • 25 posts

Posted 29 August 2012 - 01:53 PM #4

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 :) :

<div class="address-switch clearfix">
<div class="float-left"><span>{if $section == "S"}{$lang.shipping_same_as_billing}{else}{$lang.text_billing_same_with_shipping}{/if}</span></div>
<div class="float-right">
<input class="radio cm-switch-availability cm-switch-inverse cm-switch-visibilty" type="radio" name="copy_address" value="Y" id="sw_{$body_id}_suffix_yes" {if !$ship_to_another}checked="checked"{/if} /><label for="sw_{$body_id}_suffix_yes">{$lang.yes}</label>
<input class="radio cm-switch-availability cm-switch-visibilty" type="radio" name="copy_address" value="" id="sw_{$body_id}_suffix_no" {if $ship_to_another}checked="checked"{/if} /><label for="sw_{$body_id}_suffix_no">{$lang.no}</label>
</div>
</div>

 
  • exosto
  • Member
  • Members
  • Join Date: 30-Nov 11
  • 25 posts

Posted 03 September 2012 - 10:42 AM #5

Anybody?

 
  • tom437
  • Senior Member
  • Members
  • Join Date: 10-Jul 10
  • 635 posts

Posted 08 September 2012 - 03:55 AM #6

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!

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

Thank you
Tom
3.0.4
Hosting for less.
www.step2stephosting.com

 
  • kemeris
  • Member
  • Members
  • Join Date: 06-Oct 11
  • 46 posts

Posted 21 September 2012 - 11:29 AM #7

I also interested in solution.

Anyone, please!

 

Posted 24 September 2012 - 05:12 AM #8

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!
Spiritual Self Transformation
Transform From Within to Improve Your Life
CS-Cart Online Store

 
  • profs77
  • Member
  • Members
  • Join Date: 26-Sep 12
  • 21 posts

Posted 02 October 2012 - 12:07 AM #9

Try this method for V3. It might not be the best, but cs cart didn't think it fully through I guess.
  • Make a backup then edit the file /core/fn.users.php
  • <CTRL>+<F> 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.


 
  • tom437
  • Senior Member
  • Members
  • Join Date: 10-Jul 10
  • 635 posts

Posted 02 October 2012 - 01:15 AM #10

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

  • Make a backup then edit the file /core/fn.users.php
  • <CTRL>+<F> 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.


Hey,

Thanks, but it didn't work for me.
3.0.4
Hosting for less.
www.step2stephosting.com

 
  • tom437
  • Senior Member
  • Members
  • Join Date: 10-Jul 10
  • 635 posts

Posted 02 October 2012 - 01:49 AM #11

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 :) :


Hey

Did you get it to work?
3.0.4
Hosting for less.
www.step2stephosting.com

 
  • DonDan
  • Junior Member
  • Trial users
  • Join Date: 26-Mar 09
  • 11 posts

Posted 29 January 2013 - 10:38 PM #12

My method is for 3.0.2 version:

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

change 14-15 row to:

<input class="radio cm-switch-availability cm-switch-inverse cm-switch-visibilty" type="radio" name="copy_address" value="Y" id="sw_{$body_id}_suffix_yes" checked="checked" /><label for="sw_{$body_id}_suffix_yes">{$lang.yes}</label>
<input class="radio cm-switch-availability cm-switch-visibilty" type="radio" name="copy_address" value="" id="sw_{$body_id}_suffix_no" /><label for="sw_{$body_id}_suffix_no">{$lang.no}</label>

2. add to css:

.address-switch {
display: none;
}
#ba{
display: none;
}

It's work for me 8)

 
  • Roto
  • Advanced Member
  • Banned
  • Join Date: 23-May 12
  • 127 posts

Posted 06 May 2013 - 10:38 AM #13

perfect! @DonDan thank you! 8)
...

 
  • ffwd
  • Junior Member
  • Members
  • Join Date: 22-Aug 09
  • 22 posts

Posted 02 October 2013 - 04:51 AM #14

I have modified DonDan Mod to work for 4.02

1. find /design/themes/basic/templates/views/profiles/components/profile_fields.tpl

change 14-15 row to:

<input class="radio cm-switch-availability cm-switch-inverse cm-switch-visibility" type="radio" name="ship_to_another" value="0" id="sw_{$body_id}_suffix_yes" checked="checked" /><label for="sw_{$body_id}_suffix_yes">{__("yes")}</label>
<input class="radio cm-switch-availability cm-switch-visibility" type="radio" name="ship_to_another" value="1" id="sw_{$body_id}_suffix_no" /><label for="sw_{$body_id}_suffix_no">{__("no")}</label>

2. add to css:

.address-switch {
display: none;
}
#ba{
display: none;
}

 

Posted 04 October 2013 - 04:56 PM #15

Go to Customers > Profile fields in your CS-Cart admin panel.
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.

 
  • meetshamee
  • Advanced Member
  • Trial users
  • Join Date: 12-Feb 13
  • 92 posts

Posted 11 October 2013 - 08:42 AM #16

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

2. change prifile_fields.tpl

{if $profile_fields.$section}
{if $address_flag}
<div class="address-switch clearfix">
<div class="float-left"><span>{if $section == "S"}{$lang.shipping_same_as_billing}{else}{$lang.text_billing_same_with_shipping}{/if}</span></div>
<div class="float-right">
<input class="radio cm-switch-availability cm-switch-visibilty" type="radio" name="copy_address" value="Y" id="sw_{$body_id}_suffix_no" {if !$ship_to_another}checked="checked"{/if} /><label for="sw_{$body_id}_suffix_yes">{$lang.yes}</label>
<input class="radio cm-switch-availability cm-switch-inverse cm-switch-visibilty" type="radio" name="copy_address" value="" id="sw_{$body_id}_suffix_no" {if $ship_to_another}checked="checked"{/if} /><label for="sw_{$body_id}_suffix_yes">{$lang.no}</label>
</div>
</div>
{/if}



3. Clear Cache

 

Posted 06 May 2015 - 09:42 AM #17

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

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21589 posts

Posted 06 May 2015 - 10:08 AM #18

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


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

<div class="address-switch clearfix">

with

<div class="address-switch clearfix hidden">

Note that there should be identical list of product fields for the Shipping and Billing address sections.
GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 

Posted 06 May 2015 - 11:26 AM #19

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

https://scontent-fra...93b&oe=55D03001



 

Posted 06 May 2015 - 11:43 AM #20

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

https://scontent-fra...5ce&oe=55D49B00