Home › Forums › WoodMart support forum › Check box privacy in registration page
Check box privacy in registration page
- This topic has 3 replies, 2 voices, and was last updated 3 years, 7 months ago by
Luke Nielsen.
-
AuthorPosts
-
January 12, 2022 at 10:12 am #344779
manuel-logikaParticipantHow to set the check box in page of registration?
Attachments:
You must be logged in to view attached files.January 12, 2022 at 1:23 pm #344867
Luke NielsenKeymasterHello,
At the moment you already have this check box (newsletter subscription checkbox).
https://monosnap.com/file/zbp9Ik89hdrlp8mVBCXj9HZiZNWPw6
Could you please clarify in more detail your issue? I will do my best to help you.
Looking forward to hearing back from you!
Kind Regards
January 12, 2022 at 1:30 pm #344868
manuel-logikaParticipantthe newsletter subscription checkbox is automatic generated from plugin MC4WP (mailchimp). For privacy checkbox i don’t know how to integrate. can you help me?
January 13, 2022 at 1:22 pm #345137
Luke NielsenKeymasterHello,
In order to show the “privacy policy” checkbox on the registration page, try to add this code to the functions.php file in your child theme.
if ( ! function_exists('wd_add_registration_privacy_policy') ) { function wd_add_registration_privacy_policy() { woocommerce_form_field( 'privacy_policy_reg', array( 'type' => 'checkbox', 'class' => array('form-row privacy'), 'label_class' => array('woocommerce-form__label woocommerce-form__label-for-checkbox checkbox'), 'input_class' => array('woocommerce-form__input woocommerce-form__input-checkbox input-checkbox'), 'required' => true, 'label' => 'I\'ve read and accept the <a href="/privacy-policy">Privacy Policy</a>', )); } add_action( 'woocommerce_register_form', 'wd_add_registration_privacy_policy', 11 ); } // Show error if user does not tick if ( ! function_exists('wd_validate_privacy_registration')) { function wd_validate_privacy_registration( $errors, $username, $email ) { if ( ! is_checkout() ) { if ( ! (int) isset( $_POST['privacy_policy_reg'] ) ) { $errors->add( 'privacy_policy_reg_error', __( 'Privacy Policy consent is required!', 'woocommerce' ) ); } } return $errors; } add_filter( 'woocommerce_registration_errors', 'wd_validate_privacy_registration', 10, 3 ); }
https://gyazo.com/a905abaea3d82bb34db03b0b616173a8
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register