Support » Plugin: WooCommerce » Terms and conditions as lightbox

  • Hi all,
    Ive noticed that when youre on the checkout page, you have to agree to the terms and conditions of the site. However when you click on the link to read them, youre automaticly sent to the whole page of terms.

    This is not good for user experiense, since they are pulled away from the checkout page.
    Is it possible to make the link as a pop up or in a lightbox and if so, could anybody help with some coding?

    Best regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • I would also be interested in hearing this answer, as I agree that it is important not to take the customer away from the checkout page right when you are about to make a sale.

    Is there already a solution?

    This possible. You need to write a tiny bit of jQuery code and add an ajax function to your theme. I don’t have step by step info for you – just saying it’s possible to do and a competant WooCommerce developer could get this working in maybe 30 minutes.

    This is quite simple:

    Copy /plugins/woocommerce/templates/checkout/review-order.php
    To /themes/yourTheme/woocommerce/checkout/review-order.php

    around line 197, look for if (woocommerce_get_page_id('terms')>0)

    Change the PHP/HTML you find there to something like this:

    <?php if (woocommerce_get_page_id('terms')>0) : $terms_page = get_post( woocommerce_get_page_id('terms') ); ?>
      <div id="terms_page" class="reveal-modal small"><?php echo apply_filters('the_content', $terms_page->post_content); ?><a class="close-reveal-modal">×</a></div>
      <p class="form-row terms">
        <label for="terms" class="checkbox"><?php _e( 'I have read and accept the', 'woocommerce' ); ?> <a href="#" data-reveal-id="terms_page" 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" />
    <?php endif; ?>

    The specific lightbox I’m using is Reveal, part of Zurb’s Foundation that I built my theme on. So if you want to use a different lightbox, you’ll just need to change the HTML a little to accommodate.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Terms and conditions as lightbox’ is closed to new replies.