WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Woocommerce] Accept Terms and conditions by default (14 posts)

  1. zookie_333
    Member
    Posted 1 year ago #

    Is it any way to have the checkbox in the cart/checkout(terms and conditions) checked by default? I have a very low conversion rate because many customers cant see the checkbox and its a big problem for me.

    I want to remove it or make it enabled by default.

    I have looked in woocommerce-functions.php and i cant find anything. I guess the cart is a separate file but i have no idea. HELP!

    Thanks

  2. zookie_333
    Member
    Posted 1 year ago #

    I found this file "class-wc-checkout.php" is the solution in this file?

    [ 756 lines of code moderated, that's just way too much. For that many lines of code please use pastebin.com instead. ]

  3. zookie_333
    Member
    Posted 1 year ago #

    Can this be the one to change from 0 to 1?

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser. ]

    // Terms
    		if ( ! isset( $_POST['woocommerce_checkout_update_totals'] ) && empty( $this->posted['terms'] ) && woocommerce_get_page_id( 'terms' ) > 0 )
    			$woocommerce->add_error( __('You must accept our Terms & Conditions.', 'woocommerce') );
  4. Putting aside that you're posting way to much code here (pastebin.com is your friend and should be used) do you really think a default "accept the terms and conditions" is really a good idea?

  5. zookie_333
    Member
    Posted 1 year ago #

    apple use "accept terms and conditions" by default. I dont say its a good idea but it realy helps me with my conversion rate. I just want the user to disable checkbox if he dont agree with the terms.

  6. zookie_333
    Member
    Posted 1 year ago #

    Solved

  7. LarsJ3
    Member
    Posted 1 year ago #

    Could you tell us how you fixed it?

  8. citynode
    Member
    Posted 1 year ago #

    I'd like to know too.

  9. Saimo_mx70
    Member
    Posted 1 year ago #

    Took me a bit to figure it out:

    Woocommerce > Settings > Pages > Terms > on the drop-down for the Terms page you need to have it blank if you have a page selected it will be required. By the arrow is an "X" in a circle hit that and it will clear the page that has been selected as the Terms page, no page selected will remove the "I have read and accept the terms & conditions" from your check out page.

  10. LarsJ3
    Member
    Posted 1 year ago #

    Thanks Saimo_mx70, but i don't want to remove it, i just want to make it "accepted" by default.

  11. Saimo_mx70
    Member
    Posted 1 year ago #

    Sorry I couldn't help you out LarsJ3. I'll keep my eyes open and post the info if I find a way to get that changed!
    All the best, good luck on your fix!

  12. citynode
    Member
    Posted 1 year ago #

    If it is accepted by default what is the point of it?

    Since you won't sell to someone that refuses the terms and conditions (right?), and you won't require them to check the checkbox, you could just as well state "by ordering you are accepting the terms and conditions" and put a BIG CAN'T MISS IT RED BUTTON link up for "reject terms and conditions" that empties the shopping cart and forwards them to a goawayidontwantyourmoney.com site.

  13. LarsJ3
    Member
    Posted 1 year ago #

    Citynode: Yea, i could do that, but the other way seemed easier.

  14. amprescott
    Member
    Posted 7 months ago #

    After trying to find a solution in the dashboard, the way I solved this was to dig into the php code of my site.

    In my case (using the Mystile theme), the appropriate file is found here:

    MY-SITE-ROOT/wp-content/plugins/woocommerce/templates/checkout/review-order.php

    Find the code that applies to your terms checkbox. Mine looks like this:

    <p class="form-row terms">
    				<label for="terms" class="checkbox"><?php _e( 'I have read and accept the', 'woocommerce' ); ?> <a>" target="_blank"><?php _e( 'terms & conditions', 'woocommerce' ); ?></a></label>
    				<input type="checkbox" class="input-checkbox" name="terms" <?php checked( isset( $_POST['terms'] ), true ); ?> id="terms" />

    Then, right behind
    name="terms"
    add:
    checked="checked"
    and save the edited file. The "agree with terms" checkbox should now be selected by default.

    Hope that helps!

Topic Closed

This topic has been closed to new replies.

About this Topic