sign up tos and woocommerce and other programs

Hi,

Does the sign up tos plugin work with woo commerce? Also can it work with this plugin?

https://wp-client.com/

  • Dimitris
    • Support Star

    Hello there cornelius_butler,

    hope you’re doing good! :slight_smile:

    In general, Signup TOS should work with every registration form that uses the native WordPress functions. I can’t be sure about the WP-Client plugin as I haven’t tested it and couldn’t find any previous threads around these two plugins. I tested with WooCommerce though and the form found in the “My Account” page though and don’t see that display in there. I’ve already contacted the lead developer of the plugin to double check if this is by design or some kind of bug, will keep you posted here as soon as possible.

    Warm regards,

    Dimitris

  • Dimitris
    • Support Star

    Hey cornelius_butler

    Pleasea add the exact following snippet in a new MU plugin file like

    wp-content/mu-plugins/tos-woo.php

    (just create the /mu-plugins/ folder if it doesn’t exist already)

    <?php
    // [Singup TOS] - Add TOS checkbox and validation for WC registration

    // Registration form
    add_action( 'woocommerce_register_form', function(){
    echo do_shortcode( '[signup-tos checkbox="1" multisite="false"]' );
    } );

    add_filter( 'woocommerce_registration_errors', function( $errors, $username, $email ){

    if ( ! isset( $_POST['tos_agree'] ) || ! $_POST['tos_agree'] ) {
    $errors->add( 'tos_agree', __( 'You need to agree with the terms of service' ) );
    }

    return $errors;
    }, 20, 3 );

    // Registration form on Checkout page
    add_filter( 'woocommerce_checkout_fields', function( $fields ){

    $fields['account']['account_tos'] = array(
    'type' => 'checkbox',
    'label' => 'Do you agree with TOS?',
    'required' => true,

    );

    return $fields;
    } );

    Let me know how that goes!

    Thank you,

    Dimitris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.