Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2009
    Location
    Longs, SC
    Posts
    626
    Plugin Contributions
    2

    Default Display terms and conditions if an order is from a particular country

    I want to display terms and conditions which a customer must agree to during checkout. These terms relate to international shipping and only apply if the ship to country is not the US. Since I wasn't using the built in terms and conditions regulation I thought this would be almost perfect. I was able to modify the code so that it only built the terms and conditions radio box if the country code didn't equal 223. That works perfectly when it's an international order but if it's an order from the US I get a message that the terms weren't agreed to and get redirected back to the payment page. Any idea how to get around this?

  2. #2
    Join Date
    Aug 2009
    Location
    Longs, SC
    Posts
    626
    Plugin Contributions
    2

    Default Re: Display terms and conditions if an order is from a particular country

    I wanted to document what needed to change in case anybody else ever wants to do this. I includes/modules/pages/checkout_confirmation/header_php.php make the following changes: find the following code around line 54:
    PHP Code:
    if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') {
      if (!isset(
    $_POST['conditions']) || ($_POST['conditions'] != '1')) {
        
    $messageStack->add_session('checkout_payment'ERROR_CONDITIONS_NOT_ACCEPTED'error');
      }
    }
    //echo $messageStack->size('checkout_payment');

    require(DIR_WS_CLASSES 'order.php');
    $order = new order
    Change it to this:
    PHP Code:
    require(DIR_WS_CLASSES 'order.php');
    $order = new order;
    if ((
    DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') && ($order->delivery['country']['id'] != 223)) {
      if (!isset(
    $_POST['conditions']) || ($_POST['conditions'] != '1')) {
        
    $messageStack->add_session('checkout_payment'ERROR_CONDITIONS_NOT_ACCEPTED'error');
      }

    Make the following changes to includes/templates/YOUR CUSTOM TEMPLATE FOLDER/templates/tpl_checkout_payment_default.php around line 26 from
    PHP Code:
    <?php
      
    if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') {
    ?>
    <fieldset>
    <legend><?php echo TABLE_HEADING_CONDITIONS?></legend>
    <div><?php echo TEXT_CONDITIONS_DESCRIPTION;?></div>
    <?php echo  zen_draw_checkbox_field('conditions''1'false'id="conditions"');?>
    <label class="checkboxLabel" for="conditions"><?php echo TEXT_CONDITIONS_CONFIRM?></label>
    </fieldset>
    <?php
      
    }
    ?>
    to:
    PHP Code:
      if ((DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') && ($order->delivery['country']['id'] != 223)) {
    ?>
    <fieldset>
    <legend><?php echo TABLE_HEADING_CONDITIONS?></legend>

    <div><?php echo TEXT_CONDITIONS_DESCRIPTION;?></div>
    <?php echo  zen_draw_checkbox_field('conditions''1'false'id="conditions"');?>
    <label class="checkboxLabel" for="conditions"><?php echo TEXT_CONDITIONS_CONFIRM?></label>
    </fieldset>
    <?php
      
    }

    ?>

 

 

Similar Threads

  1. v150 Adding terms and conditions to order confirmation email both text and html
    By OLCS in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 18 Sep 2012, 10:21 PM
  2. How do I remove the Terms and Conditions from checkout?
    By lpeek in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 18 Mar 2009, 08:09 PM
  3. UK terms and conditions
    By DaveS in forum General Questions
    Replies: 4
    Last Post: 12 Dec 2007, 03:01 PM
  4. Display, but not require, Terms and Conditions - Possible?
    By DogTags in forum General Questions
    Replies: 2
    Last Post: 26 Aug 2007, 03:11 PM
  5. How to display Terms and Conditions during Create Account?
    By zerocool in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 12 Dec 2006, 04:24 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR