Same address for shipping unchecked by default

  • Posts: 627
  • Thank you received: 18
  • Hikashop Business
3 years 11 months ago #326442

Hi is it possible to let the checkbox empty for the option "Same address for shipping" in the checkout?

If it's possible, ho do we achieve that?

Thanks !

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 11 months ago #326458

Hi,

Edit the file show_block_address.php via the menu Display>Views and change the line:

<label><input type="checkbox" checked="checked" name="data[address_bothtypes_<?php echo $this->step . '_' . $this->module_position; ?>]" value="1"> <?php
to:
<label><input type="checkbox" name="data[address_bothtypes_<?php echo $this->step . '_' . $this->module_position; ?>]" value="1"> <?php

Please Log in or Create an account to join the conversation.

  • Posts: 627
  • Thank you received: 18
  • Hikashop Business
3 years 11 months ago #326596

I tried this but it changed nothing. Still checked by default.

The only difference I see is that we remove the"checked="checked"" code.

I'm really not very good with PHP. Is there an unchecked code?

Do you have another another idea?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 11 months ago #326601

Hi,

I have no other idea.
I actually tested the modification in my end and it works just fine.
I actually don't know of any other way to have a checkbox unchecked by default in HTML. That's how it is supposed to be done and the solution which works.

So if you don't see any difference, it means that you must have edited the view file for another template than the template you're using on your frontend. Or you've modified the file from your test website while you're looking at the checkout on your live website or vice-versa. Or we're not talking about the same checkout.

This modification I proposed is for when you create/edit an address in the checkout's "address" view. There is a similar checkbox on the registration/guest form of the "login" view but the login view already has a setting to uncheck the checkbox by default so no modification is necessary. Looking at your screenshot, I can't say which one you're talking about but since there is already a setting for the "login" one, I assumed you were talking about the "address" one, but maybe you don't know about the setting and are talking about the "login" one.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum