• Resolved Jim B

    (@shopdryft)


    Hello,
    I have the Terms and Conditions checkbox enabled on my checkout page. I would like to add a link to my Privacy Policy with the checkbox for consent to Terms and Conditions. The issue is when I insert the Privacy Policy shortcode, it appears to work while I am in the “Theme Optoins>Woocommerce>Checkout,” however when I publish it, the [privacy_policy] shortcode is displayed as shortcode text instead of a link. (This occurs despite the fact the [terms] shortcode displays the terms and conditions link.)

    Is it possible for me to link my Privacy Policy in the message for the checkbox regarding Terms and Conditions?

    Thank you for your help.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Phil

    (@fullysupportedphil)

    Automattic Happiness Engineer

    I would recommend that you have a Privacy Policy page set, otherwise the shortcode won’t like to anything.

    Go to WooCommerce > Settings > Accounts & Privacy. Once there, make sure that you’ve specified a page for your Privacy Policy, as well as filled out the “Registration Privacy Policy” and “Checkout privacy policy” fields. Your Terms & Conditions pages can both be the same page, or they can be different.

    Next go to Appearance > Customize > WooCommerce > Checkout. On this page you can double-check that your privacy policy and terms & conditions pages are set.

    That is all you should need to do.

    If the above steps aren’t working for you, I’d recommend checking if your theme is causing any issues. To do this, use the “Live Preview” option on one of the default themes (Twenty Twenty or Storefront). If it works in the live preview of either of those, then you’ll want to contact your theme’s developer and let them know about the issue.

    You can use a custom function.
    Just add in your theme functions.php the following code:

    //add checkbox
    function woo_add_custom_check_boxes_on_checkout() {
    woocommerce_form_field( ‘woo_custom_checkbox_privacy_policy’, 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 accept your Privacy Policy</stroing>‘, //replace [privacy_policy_permalink] with your web page permalink
    ));
    }

    // Show notice if customer does not tick
    add_action( ‘woocommerce_checkout_process’, ‘woo_custom_not_accepted_checkout_checkboxes’ );
    function woo_custom_not_accepted_checkout_checkboxes() {
    if ( ! (int) isset( $_POST[‘woo_custom_checkbox_privacy_policy’] ) ) {
    wc_add_notice( __( ‘Please accept our Privacy Policy Terms!’ ), ‘error’ );
    }
    }

    Thread Starter Jim B

    (@shopdryft)

    @fullysupportedphil Thank you for the help. I confirmed I had my privacy policies set in each location and then I tested it using the default TwentyTwenty theme. The shortcode worked in the TwentyTwenty theme, so I contacted my theme’s developer (Flatsome) and they are working on it.

    @dido76bg Thank you for the custom code to add the additional checkbox. I would use this, however, I am concerned adding another checkbox to the checkout page could increase my risk of a cart abandonment because it would be one more thing for the customer to do.

    Phil

    (@fullysupportedphil)

    Automattic Happiness Engineer

    @shopdryft – Glad to hear that you were able to identify your theme as the issue.

    The Flatsome development team seems to do a good job at keeping their theme compatible and up to date, so they should be able to resolve that for you quickly.

    I’ll mark this thread as resolved now.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to include Privacy Policy link in checkbox at Woocommerce Checkout’ is closed to new replies.