WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Terms and conditions as lightbox (5 posts)

  1. Kokkekniven
    Member
    Posted 1 year ago #

    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,
    Kristian

    http://wordpress.org/extend/plugins/woocommerce/

  2. cdnance
    Member
    Posted 1 year ago #

    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.

  3. Freetagger
    Member
    Posted 1 year ago #

    Is there already a solution?

  4. IgniteWoo
    Member
    Posted 1 year ago #

    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.

  5. adaldesign
    Member
    Posted 1 year ago #

    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" />
      </p>
    <?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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic