Fixed problem where not having checkout page top text in settings was masking checkou...
authorChuck Scott <cscott@gaslightmedia.com>
Mon, 10 Sep 2018 20:47:51 +0000 (16:47 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 10 Sep 2018 20:47:51 +0000 (16:47 -0400)
index.php
readme.txt
views/front/registrations/checkout.html

index 437738a..bd61992 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -3,7 +3,7 @@
  * Plugin Name: GLM Associate - Event Registrations Add-On
  * Plugin URI: http://www.gaslightmedia.com/
  * Description: Add-on to integrate registrations into Events add-on.
- * Version: 1.0.16
+ * Version: 1.0.17
  * Author: Gaslight Media
  * Author URI: http://www.gaslightmedia.com/
  * License: GPL2
@@ -17,7 +17,7 @@
  * @package glmMembersRegistrationsAddOn
  * @author Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.0.16
+ * @version 1.0.17
  */
 
 // Check that we're being called by WordPress.
@@ -41,7 +41,7 @@ if (!defined('ABSPATH')) {
  *  so that we're sure the other add-ons see an up to date
  *  version from this plugin.
  */
-define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_VERSION', '1.0.16');
+define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_VERSION', '1.0.17');
 define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '1.0.1');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
index 0eb4604..d672d49 100755 (executable)
@@ -25,6 +25,9 @@ e.g.
 1. Activate the plugin through the 'Plugins' menu in WordPress
 
 == Changelog ==
+= 1.0.17 =
+* Fixed checkout error messages not showing on checkout page if not checkout page top text provided in settings
+
 = 1.0.16 =
 * Fixed card expiration date changing when user fails at checkout page and checkout is redisplayed
 
index 7c0b687..6214765 100755 (executable)
@@ -4,9 +4,10 @@
     <div class="row progress-row">
         <div class="progress-container columns">
             <ul class="progressbar">
-              <li>{$terms.reg_term_register_cap}</li>
-              <li >View Cart</li>
-              <li class="active">Checkout</li>
+                <li>Select {$terms.reg_term_event_cap}</li>
+                <li>{$terms.reg_term_register_cap}</li>
+                <li >View Cart</li>
+                <li class="active">Checkout</li>
             </ul>
         </div>
     </div>
 {if $checkoutPageText}
     <div id="checkout-page-text" class="glm-row">
         <p>{$checkoutPageText}</p>
+    </div>
+{/if}
 
-    {if $haveMessages}
-        <div class="glm-registrations-messages glm-reg-warning" class="glm-row">
-            <i>Please Note:</i>
-            <ul>
-    {foreach $messages as $m}
-                <li>{$m}</li>
-    {/foreach}
-            </ul>
-        </div>
-    {/if}
-
-
+{if $haveMessages}
+    <div class="glm-registrations-messages glm-reg-warning" class="glm-row">
+        <i>Please Note:</i>
+        <ul>
+{foreach $messages as $m}
+            <li>{$m}</li>
+{/foreach}
+        </ul>
     </div>
 {/if}
 
+
 {if $haveCart}
 
     {if $settings.reg_not_submitted_dialog}
         <div class="glm-center" style="border: 1px solid black; padding: 10px; margin: 20px">
             <span class="glm-reg-warning">NOTE: Your {$terms.reg_term_registration} is not complete until you click the "{$terms.reg_term_button_checkout_page_submit}" button at the bottom of this page.</span> <img src="{$assetUrl}/fingerDownRed.svg" style="height: 2em;">
         </div>
-    {/if}                
+    {/if}
         <div id="glm-reg-checkout-form">
 <!--
             <div>
                 <h3 class="glm-left" style="clear: none;">Checkout</h3>
             </div>-->
             <div class="glm-row">
-                <div class="glm-large-6 glm-small-12 glm-columns">                    
-                    <div class="glm-reg-billing-info">                    
+                <div class="glm-large-6 glm-small-12 glm-columns">
+                    <div class="glm-reg-billing-info">
                         <div class="row">
                             <div class="columns medium-8 small-12 text-left glm-reg-required">
                             <h4>Billing Information</h4>
                             <div class="glm-reg-checkout-field-label glm-small-12 glm-large-3 glm-columns glm-reg-nowrap{if $regAccount.fieldRequired.email} glm-reg-required{/if}">E-Mail Address{if $regAccount.fieldRequired.email} *{/if}</div>
                             <div class="glm-reg-checkout-field-data glm-small-12 glm-large-9 glm-columns{if $regAccount.fieldFail.email} glm-reg-fail{/if}"><input type="text" name="email" value="{$regAccount.fieldData.email}"{if $regAccount.fieldRequired.email} required{/if}></div>
                         </div>
-                        
+
                     </div>
                 </div>
                 <div class="glm-small-12 glm-large-6 glm-columns glm-reg-cart-summary">
                          <h4 id="cart-summary">{$terms.reg_term_registration_cap} Summary</h4>
-    
+
                         {assign var="summaryType" value="checkout"}
                         {include file='front/registrations/cartSummary.html'}
                 </div>
 
             {if $pmName == "NoCharge"}
                 {* Nothing here for now *}
-            {else if $pmName == "OnArrival"} 
+            {else if $pmName == "OnArrival"}
                 {* Nothing here for now *}
-            {else if $pmName == "Cash"} 
+            {else if $pmName == "Cash"}
                 {* Nothing here for now *}
-            {else if $pmName == "Check"} 
+            {else if $pmName == "Check"}
                         <div class="payMethod_{$pmNumb} payMethodSelection glm-hidden">
                             <div class="glm-reg-row">
                                 <div class="glm-reg-checkout-field-label glm-small-12 glm-large-3 glm-columns glm-reg-nowrap{if $regAccount.fieldRequired.cc_name} glm-reg-required{/if}">Name on Check{if $regAccount.fieldRequired.cc_name} *{/if}</div>
                             </div>
                         </div>
             {else if $pmName == "CreditCard"}
-            
+
                         <div class="payMethod_{$pmNumb} payMethodSelection glm-hidden">
                 {if $settings.reg_proc_methods == 2 && $regAccount.fieldData.customer_profile_id != ''} {* If using Authorize.net and have a stored credit card profile *}
                             <div class="glm-reg-row">
                             <div class="glm-reg-row">
                                 <div class="glm-reg-checkout-field-data glm-small-5 glm-large-3 glm-columns">
                                     <p>{$settings.reg_authorize_net_merchant_seal|unescape}</p>
-                                </div>                        
+                                </div>
                                 <div class="glm-reg-checkout-field-data glm-small-7 glm-large-9 glm-columns">
-                                    <br>Your credit card will be processed through Authorize.Net. Click the image to the left to verify our security.                                      
+                                    <br>Your credit card will be processed through Authorize.Net. Click the image to the left to verify our security.
                                </div>
-                            </div>                        
+                            </div>
                     {/if}
                 {/if}
                         </div>
                                 </div>
                             </div>
                         </div>
-                                    
+
             {else}
                         <div class="payMethod_{$pmNumb} payMethodSelection glm-hidden">
 
                         </div>
             {/if}
-        
+
     {/foreach}
-                    
+
                 </div>
   {/if} {* / total charges > 0 *}
             </div>
     {if apply_filters('glm-members-customfields-plugin-active', false)}
       {foreach $cart.events as $event}
-        {assign var="fid" value="glm_reg_customfields_reg_event_`$event.reg_event`"} {* assemble the uid with the current event ID *}      
+        {assign var="fid" value="glm_reg_customfields_reg_event_`$event.reg_event`"} {* assemble the uid with the current event ID *}
         {if apply_filters('glm-members-customfields-have-fields', false, $fid)}            <div class="glm-row">
                 <div class="glm-large-6 glm-small-12 glm-columns">
                     <h4>Additional information requested:</h4>
                         <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 $haveGlobalTerms}                    
+        {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}   
-        {if $haveEventTerms}                 
+        {/if}
+        {if $haveEventTerms}
           {foreach $cart.events as $event}
             {if $event.event_terms != ''}
                     <div class="glm-row">
             <div style="text-align: right;">(There is no charge for your request.)</div>
     {/if}
             <div class="glm-right" style="white-space; nowrap;">
-                <!--<span class="glm-reg-warning">You have one more step to complete your {$terms.reg_term_registration}!</span> <img src="{$assetUrl}/fingerRightRed.svg" style="height: 2em;">--> 
+                <!--<span class="glm-reg-warning">You have one more step to complete your {$terms.reg_term_registration}!</span> <img src="{$assetUrl}/fingerRightRed.svg" style="height: 2em;">-->
     {if $settings.reg_show_navigation_aids}
                 <div class="glm-reg-warning">Your {$terms.reg_term_registration} is not complete until you click here! <img src="{$assetUrl}/fingerRightRed.svg" style="height: 2em;"></div>
     {/if}
                 <input id="payPalPayButton" type="submit" value="Pay with PayPal" class="button glm-reg-button glm-hidden" disabled>
-                <input id="regSubmitButton" type="submit" value="{$terms.reg_term_button_checkout_page_submit}" class="button glm-reg-button">                
+                <input id="regSubmitButton" type="submit" value="{$terms.reg_term_button_checkout_page_submit}" class="button glm-reg-button">
             </div>
         </form>
-    
-       
+
+
         <div id="regSubmitDialog" title="Please wait...">Please wait while we process your {$terms.reg_term_registration} request. If you don't see a new page, your {$terms.reg_term_registration} request may not have been processed.</div>
         <div id="regSubmitFailDialog" title="Oops!">
             <h3>Something may have gone wrong.</h3>
         <div id="paypal-button-container"></div>
     </center>
     <br>
-    <span class="glm-reg-warning">NOTE:</span> Your {$terms.reg_term_registration_plur} are not complete until you accept the PayPal payment and see the checkout summary page! 
+    <span class="glm-reg-warning">NOTE:</span> Your {$terms.reg_term_registration_plur} are not complete until you accept the PayPal payment and see the checkout summary page!
     <br>
     <div id="payPalPaymentWarningMessage" class="glm-reg-warning"></div>
     <div id="payPalPaymentMessage"></div>
     jQuery(function($){
 
         var payMethodNumb = false;
-        
+
         // When payment method selection changes
         $('.payMethodSelector').on('change', function() {
 
             // Get the value from the selected Payment Method
             payMethodNumb = $(this).val();
             payMethodSelection(payMethodNumb);
-            
+
         });
         function payMethodSelection(payMethodNumb) {
 
                 $('#payPalPayButton').addClass('glm-hidden');
                 $('#payPalPayButton').attr('disabled','disabled');
             }
-            
+
         }
 
         // Dissable checkout button when first clicked to prevent multiple attempts
                 // Don't actually do a submit yet
                 return false;
             }
-            
+
             // If something else is preventing submission, stop here. Use this with custom fields when there are required fields.
             if (e.isDefaultPrevented()) {
                 return false;
             }
-            
+
             // Show submit dialog box
             $( "#regSubmitDialog" ).dialog( "open" );
 
 
         // Start with all pay method inputs dissabled
         $( document ).ready(function() {
-            
+
             // Dialog box to show when submitting checkout page
             $( "#regSubmitDialog" ).dialog({
                 autoOpen: false,
                     }
                 }
             });
-            
+
             // Start with all payment method sections hidden
             $('.payMethodInput').attr('disabled', true);
 
-            // Get currently checked payment method - works after browser back button - Should never be needed, but just in case          
+            // Get currently checked payment method - works after browser back button - Should never be needed, but just in case
             var payMethodNumb = $("input[name='payMethod']:checked").val()
             if (payMethodNumb == '') {
                 payMethodNumb = {$defaultPayMethod}+0;
             }
-                
+
             payMethodSelection(payMethodNumb);
 
         });
         $(".cvv-input").mask("000#");
 
         // Registration not submitted Dialog actions
-        {if $settings.reg_not_submitted_dialog}    
+        {if $settings.reg_not_submitted_dialog}
 
           var notSubmittedTimer;
           notSubmittedDialog = $( "#regNotSubmittedDialog" ).dialog({
               open: function(event,ui) {
                   clearInterval(notSubmittedTimer);
               },
-              close: function(event,ui) { 
+              close: function(event,ui) {
                   resetNotSubmittedTimer();
               },
               buttons: [
           });
           startNotSubmittedTimer();
 
-        {/if}  
+        {/if}
 
-        // When the checkout button is clicked and a PayPal payment is requested, this code is called to create a PayPal button inside of the dialog box 
+        // When the checkout button is clicked and a PayPal payment is requested, this code is called to create a PayPal button inside of the dialog box
         var payPalButtonGenerated = false;
         function displayPayPalButton() {
 
             }
             payPalButtonGenerated = true;
 
-            
+
             // PayPal button actions
             paypal.Button.render({
-    
+
                 // Set your environment
-    
+
         {if $payPalMode}
                 env: 'sandbox',
         {else}
                 env: 'production',
         {/if}
-    
+
                 // Specify the style of the button
                 style: {
                     label: 'pay',
                     shape: 'rect',   // pill | rect
                     color: 'blue'   // gold | blue | silver | black
                 },
-    
+
                 // To create a PayPal see app: https://developer.paypal.com/developer/applications/create
                 client: {
                     sandbox:    '{$payPalSandboxClientId}',
                     production: '{$payPalClientId}'
                 },
-    
+
                 // Wait for the PayPal button to be clicked
                 payment: function(data, actions) {
                     return actions.payment.create({
-                        invoice_number: '{$cartId}', 
+                        invoice_number: '{$cartId}',
                         payment: {
                             payer: {
                                 payer_info: {
                                 {
                                     description: '{$settings.reg_org_name} {$terms.reg_term_registration_plur_cap}',
                                     invoice_number: '{$cartId}',
-                                    amount: { 
-                                        total: '{$cart.grandTotal}', 
-                                        currency: 'USD' 
+                                    amount: {
+                                        total: '{$cart.grandTotal}',
+                                        currency: 'USD'
                                     },
                                     item_list: {
                                         items: [
-            {foreach $cart.chargeItems as $item}                                        
-                                            { 
+            {foreach $cart.chargeItems as $item}
+                                            {
                                                 name: '{$item.name|escape}',
                                                 quantity: {$item.quantity},
                                                 price: {$item.price},
                                             },
             {/foreach}
                                         ]
-                                    } 
+                                    }
                                 }
                             ]
                         }
                         $('#payPalPaymentWarningMessage').html('<br>You canceled the PayPal Payment. Payment is required to submit your {$terms.reg_term_registration_plur}. If you don\'t wish to pay with PayPal, click the button below and select another payment method.');
                 },
                 onError: function(err) {
-console.log(err);                    
+console.log(err);
                     $('#payPalPaymentWarningMessage').html('<br>There was a problem with your PayPal Payment. Payment is required to submit your {$terms.reg_term_registration_plur}. If you\'re unable to pay with PayPal, click the button below and select another payment method.');
                 },
                 // Wait for the payment to be authorized by the customer
@@ -666,7 +666,7 @@ console.log(err);
 
                         // Notify submit code above that it's OK to checkout
                         payPalSubmitOK = true;
-                        
+
                         $( "#payPalPaymentDialog" ).dialog("close");
 
                         // Add PayPal payment details to form
@@ -679,11 +679,11 @@ console.log(err);
                         $("#checkoutForm").submit();
                     });
                 }
-    
+
             }, '#paypal-button-container');
-                
+
         }
 
-        
+
     });
 </script>