Jump to content

Remove Checkbox


CraigMcKee

Recommended Posts

Hi, 

I have a checkout page using Wordpress with Woocommerce.  It has a checkbox that says "Deliver to another address."  I want that to be always selected, which it is at the moment but I do not want users to be able to unselect it.  I have hidden the checkbox with css but, the user can click on the text and this toggles the checkbox.  This is the code I found which I think refers to it: 

 

		<h3 id="ship-to-different-address">
			<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
				<input id="ship-to-different-address-checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" <?php checked( apply_filters( 'woocommerce_ship_to_different_address_checked', 'shipping' === get_option( 'woocommerce_ship_to_destination' ) ? 1 : 0 ), 1 ); ?> type="checkbox" name="ship_to_different_address" value="1" /> <span><?php esc_html_e( 'Property Details', 'woocommerce' ); ?></span>
			</label>
		</h3>

Can I amend this so either the text isn't clickable or it is just a label and there is no checkbox at all (but the page acts like the checkbox has been selected)?  

Thank you! 

Link to comment
Share on other sites

2 hours ago, CraigMcKee said:

It has a checkbox that says "Deliver to another address."  I want that to be always selected, which it is at the moment but I do not want users to be able to unselect it.

But why? If my billing and shipping addresses are the same then why do I have to type it in again?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.