Fixed problem with state and country picklists missing when a single registrant and...
authorChuck Scott <cscott@gaslightmedia.com>
Thu, 26 Apr 2018 20:39:47 +0000 (16:39 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Thu, 26 Apr 2018 20:39:47 +0000 (16:39 -0400)
models/front/registrations/checkout.php
views/front/registrations/checkout.html

index f73a339..f03805d 100644 (file)
@@ -293,6 +293,12 @@ class GlmMembersFront_registrations_checkout extends GlmRegCartSupport
                 $regAccount['fieldData']['bill_fax'] = $regAccount['fieldData']['fax'];
 
             // Otherwise if there's only one registrant, use their info, what's there
+
+            /*
+             * There is a problem with the state and country selectors due to the $acct array
+             * not having that data. If needed, use the account ID and grab the account record
+             * for editing then use the data from there for all this instead.
+             */
             } elseif (count($this->cart['accounts']) == 1) {
                 $acct = current($this->cart['accounts']);
                 $regAccount['fieldData']['bill_fname'] = $acct['fname'];
@@ -302,9 +308,9 @@ class GlmMembersFront_registrations_checkout extends GlmRegCartSupport
                 $regAccount['fieldData']['bill_addr1'] = $acct['addr1'];
                 $regAccount['fieldData']['bill_addr2'] = $acct['addr2'];
                 $regAccount['fieldData']['bill_city'] = $acct['city'];
-                $regAccount['fieldData']['bill_state'] = $acct['state'];
+//                $regAccount['fieldData']['bill_state'] = $acct['state'];
                 $regAccount['fieldData']['bill_zip'] = $acct['zip'];
-                $regAccount['fieldData']['bill_country'] = $acct['country'];
+//                $regAccount['fieldData']['bill_country'] = $acct['country'];
                 $regAccount['fieldData']['bill_phone'] = $acct['phone'];
                 $regAccount['fieldData']['bill_fax'] = $acct['fax'];
             }
index 9f3826a..6afbd98 100644 (file)
@@ -31,7 +31,6 @@
     </div>
 {/if}
 
-
 {if $haveCart}
     <form id="checkoutForm" href="{$regUrl}" method="post" class="glm-row">
         <input type="hidden" name="page" value="checkoutProcess">
@@ -91,7 +90,7 @@
                                 <select name="bill_state">
                                     <option value=""></option>
                         {foreach $regAccount.fieldData.bill_state.list as $s}
-                                    <option value="{$s.value}"{if $regAccount.fieldData.bill_state.value == $s.value} selected="selected"{/if}>
+                                    <option value="{$s.value}"{if $s.default} selected="selected"{/if}>
                                         {$s.name}
                                     </option>
                         {/foreach}