Fixed problems with term and conditions at checkout and other changes
authorChuck Scott <cscott@gaslightmedia.com>
Mon, 2 Jul 2018 19:45:32 +0000 (15:45 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 2 Jul 2018 19:45:32 +0000 (15:45 -0400)
More thourough testing for the existance of any terms and conditions at checkout.
Updated checkout view file to implement stricter testing for terms and conditions.
Modified text header for editing messages that go out when a manual payment is completed.
Cleaned up readme.txt file.

models/front/registrations/checkout.php
readme.txt
views/admin/settings/registrationsMisc.html
views/front/registrations/checkout.html

index f032264..bb6c954 100644 (file)
@@ -366,6 +366,21 @@ class GlmMembersFront_registrations_checkout extends GlmRegCartSupport
         $Misc = new GlmDataRegistrationsMisc($this->wpdb, $this->config);
         $misc = $Misc->getEntry(1);
 
+        // Check for any terms and conditions
+        $haveTerms = false;
+        $haveGlobalTerms = false;
+        $haveEventTerms = false;
+        if (trim($misc['reg_terms']) != '') {
+            $haveTerms = true;
+            $haveGlobalTerms = true;
+        }
+        foreach ($this->cart['events'] as $event) {
+            if (trim($event['event_terms']) != '') {
+                $haveTerms = true;
+                $haveEventTerms = true;
+            }
+        }
+
         // Compile template data
         $templateData = array(
             'page'                          => 'checkout',
@@ -386,6 +401,9 @@ class GlmMembersFront_registrations_checkout extends GlmRegCartSupport
             'payMethodsNumb'                => $this->config['payment_method_numb'],
             'misc'                          => $misc,
             'checkoutPageText'              => $misc['checkout_page_text'],
+            'haveTerms'                     => $haveTerms,
+            'haveGlobalTerms'               => $haveGlobalTerms,
+            'haveEventTerms'                => $haveEventTerms,
             'globalTerms'                   => $misc['reg_terms'],
             'eventCustomFieldsFidPrefix'    => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG.'-customfields-reg-event-',
             'payPalClientId'                => $this->config['settings']['reg_paypal_clientid'],
@@ -393,7 +411,7 @@ class GlmMembersFront_registrations_checkout extends GlmRegCartSupport
             'payPalMode'                    => $this->config['settings']['reg_paypal_test']
         );
 
-        // echo "payMethods<pre>".print_r($availPaymentMethods,1)."</pre>";
+        // echo "payMethods<pre>".print_r($misc,1)."</pre>";
 
         // Return status, any suggested view, and any data to controller
         return array(
index e9c294e..269855c 100644 (file)
@@ -32,9 +32,12 @@ in mobile views.
 = 1.0.5 =
 For registrant front end list show more than just Complete status.
 
-= 1.0.0 =
+= 1.0.4 =
 
-* Initial production release - includes PayPal integration
+* Maintenance Release - Updates to "Settings"->"Registrations" page
+* Added more Merge Tags that can be used for Subject and body of E-Mail messages
+* Added a comprehensive Merge Tag reference at the bottom of page
+* Added button to print Merge Tag reference sheet
 
 = 1.0.1 =
 
@@ -43,9 +46,8 @@ For registrant front end list show more than just Complete status.
 * Added more information to checkout store failure reporting.
 * Various minor bug fixes.
 
-= 1.0.4 =
+= 1.0.0 =
+
+* Initial production release - includes PayPal integration
+
 
-* Maintenance Release - Updates to "Settings"->"Registrations" page
-* Added more Merge Tags that can be used for Subject and body of E-Mail messages
-* Added a comprehensive Merge Tag reference at the bottom of page
-* Added button to print Merge Tag reference sheet
index 9565fd2..69b03df 100644 (file)
                             {if $regMisc.fieldFail.registrant_notify_text}<p>{$regMisc.fieldFail.registrant_notify_text}</p>{/if}
                         </td>
                     </tr>
-                    <tr><td>&nbsp;</td><td><h3 class="glm-reg-message-title">Acknowledgement to Person Submitting the {$terms.reg_term_registration_plur_cap} (for payment types that are processed manually)</h3></td></tr>
+                    <tr><td>&nbsp;</td><td><h3 class="glm-reg-message-title">Acknowledgement to Person Submitting {$terms.reg_term_registration_plur_cap} when a manually processed payment is accepted.</h3></td></tr>
                     <tr>
                         <th {if $regMisc.fieldRequired.submission_ack_subject}class="glm-required glm-right"{/if}>Subject:</th>
                         <td {if $regMisc.fieldFail.submission_ack_subject}class="glm-form-bad-input"{/if}>
                             {if $regMisc.fieldFail.submission_ack_text}<p>{$regMisc.fieldFail.submission_ack_text}</p>{/if}
                         </td>
                     </tr>
-                    <tr><td>&nbsp;</td><td><h3 class="glm-reg-message-title">Acknowledgement to {$terms.reg_term_attendee_plur_cap} (for payment types that are processed manually)</h3></td></tr>
+                    <tr><td>&nbsp;</td><td><h3 class="glm-reg-message-title">Acknowledgement to {$terms.reg_term_attendee_plur_cap} when a manually processed payment is accepted.</h3></td></tr>
                     <tr>
                         <th {if $regMisc.fieldRequired.registrant_ack_subject}class="glm-required glm-right"{/if}>Subject:</th>
                         <td {if $regMisc.fieldFail.registrant_ack_subject}class="glm-form-bad-input"{/if}>
index a00ba5d..c4af6f2 100644 (file)
         {/if}
       {/foreach}
     {/if}
+    {if $haveTerms}
             <div class="glm-row">
                 <div class="glm-small-12 glm-columns glm-reg-terms-conditions">
                     <div class="glm-row">
                         <h4>Terms and Conditions</h4>
                         You <span class="glm-reg-required">must check</span> the boxes below to confirm that you agree to the Terms and Conditions for each {$terms.reg_term_event}.
                     </div>
-    {if $globalTerms != ''}                    
+        {if $haveGlobalTerms}                    
                     <div class="glm-row">
                         <div class="glm-large-1">&nbsp;</div>
                         <div class="glm-columns glm-reg-event-terms">
                             <input class="glm-reg-terms" id="terms" type="checkbox" name="terms" value="accept" required><label class="glm-reg-terms-label" for="terms"> {$globalTerms}</label><br>
                         </div>
                     </div>
-    {/if}                    
-    {foreach $cart.events as $event}
-      {if $event.event_terms != ''}
+        {/if}   
+        {if $haveEventTerms}                 
+          {foreach $cart.events as $event}
+            {if $event.event_terms != ''}
                     <div class="glm-row">
                         <div class="glm-large-1">&nbsp;</div>
                         <div class="glm-columns glm-reg-event-terms">
                             <input class="glm-reg-terms" id="terms_{$event.id}" type="checkbox" name="terms_{$event.id}" value="accept" required><label class="glm-reg-terms-label" for="terms_{$event.id}"> {$event.event_terms}</label><br>
                         </div>
                     </div>
-      {/if}
-    {/foreach}
+            {/if}
+          {/foreach}
+        {/if}
                 </div>
             </div>
-
+    {/if}
     {if $cart.totalCharges > 0}
             <div style="text-align: right;"><h2>Total Charge: ${$cart.totalCharges|number_format:2}</h2></div>
     {else}