Completed formatting cart.
Started adding checkout page.
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><path d="M49.355,84.311H38.357h-14.32H12.731C8.461,84.311,5,80.85,5,76.58V37.265c0.181-4.54-1.49-4.339,10.453-8.754 l37.221-12.817c3.91,0,7.504,8.934-3.244,18.816h39.343c3.438,0,6.226,2.787,6.226,6.225c0,3.438-2.787,6.226-6.226,6.226H64.818 c3.438,0,6.225,2.788,6.225,6.226c0,3.438-2.787,6.226-6.225,6.226h-7.731c3.438,0,6.226,2.786,6.226,6.225 s-2.787,6.226-6.226,6.226H46.088l0,0h3.267c3.439,0,6.225,2.787,6.225,6.226C55.58,81.523,52.794,84.313,49.355,84.311z"></path></svg>
\ No newline at end of file
--- /dev/null
+<svg fill="#EC5D57" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><path d="M49.355,84.311H38.357h-14.32H12.731C8.461,84.311,5,80.85,5,76.58V37.265c0.181-4.54-1.49-4.339,10.453-8.754 l37.221-12.817c3.91,0,7.504,8.934-3.244,18.816h39.343c3.438,0,6.226,2.787,6.226,6.225c0,3.438-2.787,6.226-6.226,6.226H64.818 c3.438,0,6.225,2.788,6.225,6.226c0,3.438-2.787,6.226-6.225,6.226h-7.731c3.438,0,6.226,2.786,6.226,6.225 s-2.787,6.226-6.226,6.226H46.088l0,0h3.267c3.439,0,6.225,2.787,6.225,6.226C55.58,81.523,52.794,84.313,49.355,84.311z"></path></svg>
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><path d="M78.083,44.42c-3.438,0-6.225,2.786-6.225,6.225v3.267h-0.001V42.913c0-3.438-2.786-6.225-6.225-6.225 c-3.438,0-6.225,2.788-6.225,6.225v-7.732c0-3.438-2.787-6.225-6.225-6.225c-3.438,0-6.226,2.787-6.226,6.225V11.225 C46.958,7.787,44.171,5,40.733,5s-6.225,2.787-6.225,6.225V50.57c-9.883-10.748-18.816-7.154-18.816-3.245l12.814,37.221 C32.922,96.49,32.72,94.819,37.261,95h39.315c4.269,0,7.731-3.461,7.731-7.731V75.963v-14.32V50.645 C84.308,47.206,81.52,44.42,78.083,44.42z"></path></svg>
\ No newline at end of file
--- /dev/null
+<svg fill="#EC5D57" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><path d="M78.083,44.42c-3.438,0-6.225,2.786-6.225,6.225v3.267h-0.001V42.913c0-3.438-2.786-6.225-6.225-6.225 c-3.438,0-6.225,2.788-6.225,6.225v-7.732c0-3.438-2.787-6.225-6.225-6.225c-3.438,0-6.226,2.787-6.226,6.225V11.225 C46.958,7.787,44.171,5,40.733,5s-6.225,2.787-6.225,6.225V50.57c-9.883-10.748-18.816-7.154-18.816-3.245l12.814,37.221 C32.922,96.49,32.72,94.819,37.261,95h39.315c4.269,0,7.731-3.461,7.731-7.731V75.963v-14.32V50.645 C84.308,47.206,81.52,44.42,78.083,44.42z"></path></svg>
\ No newline at end of file
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><g><path fill="#000000" d="M34.572,7.39c-4.649,0-8.437,3.786-8.437,8.437c0,4.649,3.787,8.435,8.437,8.435 c4.653,0,8.438-3.785,8.438-8.435C43.011,11.176,39.226,7.39,34.572,7.39L34.572,7.39z"></path></g><g><g><path fill="#000000" d="M68.027,33.111V27.93H34.572c-5.18,0-20.502-0.013-20.502,15.37v15.278h5.15V40.62 c0-1.416,1.151-2.565,2.563-2.565c1.421,0,2.564,1.149,2.564,2.565v53.944h7.661V66.391c0-1.423,1.15-2.566,2.562-2.566 c1.415,0,2.564,1.15,2.564,2.566v28.182h7.631V35.683c0-1.414,1.149-2.571,2.565-2.571C48.754,33.111,68.027,33.111,68.027,33.111 z"></path></g></g><g><path fill="#000000" d="M68.025,38.698l-7.271,7.271l7.272,7.273l7.271-7.272L68.025,38.698L68.025,38.698z"></path></g><g><path fill="#000000" d="M82.348,58.624H54.266c-2.199,0-3.801,1.789-3.558,3.976l3.115,27.996c0.243,2.188,2.241,3.977,4.442,3.977 h20.082c2.199,0,4.198-1.789,4.441-3.977L85.904,62.6C86.148,60.413,84.548,58.624,82.348,58.624z M81.434,66.623h-5.521 l0.236-3.999h5.729L81.434,66.623z M65.68,82.623l-0.236-4h5.763l-0.235,4H65.68z M70.732,86.623L70.5,90.57h-4.352l-0.233-3.947 H70.732z M56.516,78.623h4.928l0.236,4h-4.719L56.516,78.623z M71.677,70.623l-0.235,4h-6.232l-0.236-4H71.677z M64.736,66.623 L64.5,62.624h7.648l-0.236,3.999H64.736z M61.208,74.623H56.07l-0.444-4h5.347L61.208,74.623z M75.205,78.623h4.893l-0.445,4 h-4.684L75.205,78.623z M75.439,74.623l0.236-4h5.311l-0.443,4H75.439z M60.5,62.624l0.236,3.999H55.18l-0.445-3.999H60.5z M57.799,90.152l-0.393-3.529h4.509l0.233,3.947h-3.883C58.104,90.57,57.816,90.312,57.799,90.152z M78.348,90.57H74.5l0.232-3.947 h4.475l-0.393,3.529C78.797,90.312,78.509,90.57,78.348,90.57z"></path></g></svg>
\ No newline at end of file
--- /dev/null
+<svg fill="#51A7F9" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><g><path fill="#51A7F9" d="M34.572,7.39c-4.649,0-8.437,3.786-8.437,8.437c0,4.649,3.787,8.435,8.437,8.435 c4.653,0,8.438-3.785,8.438-8.435C43.011,11.176,39.226,7.39,34.572,7.39L34.572,7.39z"></path></g><g><g><path fill="#51A7F9" d="M68.027,33.111V27.93H34.572c-5.18,0-20.502-0.013-20.502,15.37v15.278h5.15V40.62 c0-1.416,1.151-2.565,2.563-2.565c1.421,0,2.564,1.149,2.564,2.565v53.944h7.661V66.391c0-1.423,1.15-2.566,2.562-2.566 c1.415,0,2.564,1.15,2.564,2.566v28.182h7.631V35.683c0-1.414,1.149-2.571,2.565-2.571C48.754,33.111,68.027,33.111,68.027,33.111 z"></path></g></g><g><path fill="#51A7F9" d="M68.025,38.698l-7.271,7.271l7.272,7.273l7.271-7.272L68.025,38.698L68.025,38.698z"></path></g><g><path fill="#51A7F9" d="M82.348,58.624H54.266c-2.199,0-3.801,1.789-3.558,3.976l3.115,27.996c0.243,2.188,2.241,3.977,4.442,3.977 h20.082c2.199,0,4.198-1.789,4.441-3.977L85.904,62.6C86.148,60.413,84.548,58.624,82.348,58.624z M81.434,66.623h-5.521 l0.236-3.999h5.729L81.434,66.623z M65.68,82.623l-0.236-4h5.763l-0.235,4H65.68z M70.732,86.623L70.5,90.57h-4.352l-0.233-3.947 H70.732z M56.516,78.623h4.928l0.236,4h-4.719L56.516,78.623z M71.677,70.623l-0.235,4h-6.232l-0.236-4H71.677z M64.736,66.623 L64.5,62.624h7.648l-0.236,3.999H64.736z M61.208,74.623H56.07l-0.444-4h5.347L61.208,74.623z M75.205,78.623h4.893l-0.445,4 h-4.684L75.205,78.623z M75.439,74.623l0.236-4h5.311l-0.443,4H75.439z M60.5,62.624l0.236,3.999H55.18l-0.445-3.999H60.5z M57.799,90.152l-0.393-3.529h4.509l0.233,3.947h-3.883C58.104,90.57,57.816,90.312,57.799,90.152z M78.348,90.57H74.5l0.232-3.947 h4.475l-0.393,3.529C78.797,90.312,78.509,90.57,78.348,90.57z"></path></g></svg>
\ No newline at end of file
'use' => 'lg'
),
- // Selected Start Time
- 'event_datetime' => array (
- 'field' => 'event_datetime',
- 'type' => 'datetime',
- 'required' => true,
- 'use' => 'lgneud'
- ),
-
// Pointer to reg_request_event table entry
'reg_request_event' => array (
'field' => 'reg_request_event',
$this->cart['status'] = true;
$this->cart['validated'] = false;
-// echo "<br>getRegistrationCart() Results:<pre>".print_r($this->cart,1)."</pre>"; exit;
+ // echo "<br>getRegistrationCart() Results:<pre>".print_r($this->cart,1)."</pre>";
if ($json) {
color: red;
font-size: 10px;
}
+.glm-reg-warning {
+ color: red;
+}
}
if ($cartId) {
- $this->getRegistrationCart($cartId);
+
+ // Try to get a Validate cart with updated totals
+ $this->checkRegistrationRequest($cartId);
+
if ($this->cart) {
$haveCart = true;
}
- }
-
- $view = 'cart';
-
- switch ( $option ) {
-
- case 'showCart':
- default:
-
- if ($cartId) {
-
- // Try to get a Validate cart with updated totals
- $this->checkRegistrationRequest($cartId);
-
- }
+ }
- break;
- }
+ $view = 'cart';
// Compile template data
$templateData = array(
'cart' => $this->cart,
'regUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/',
'loggedIn' => ( isset( $_SESSION['LoginAccount'] ) ) ? $_SESSION['LoginAccount']: false,
+ 'assetUrl' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_ASSETS_URL
);
// echo "<pre>".print_r($templateData,1)."</pre>";
<?php
-require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
- class GlmMembersFront_registrations_checkout extends GlmDataRegistrationsRegEvent {
+
+// Load Registrations Support
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/regCartSupport.php';
+
+class GlmMembersFront_registrations_checkout extends GlmRegCartSupport
+{
/**
* WordPress Database Object
*
public function modelAction($actionData = false)
{
+ $cartId = false;
+ $haveCart = false;
+ $option = false;
+
// Get any provided option
if (isset($_REQUEST['option'])) {
$option = $_REQUEST['option'];
}
}
+ // Get cart ID if supplied
+ if (isset($_REQUEST['cartId'])) {
+
+ // Get ID from REQUEST Make sure it's numeric
+ $cartId = ($_REQUEST['cartId'] - 0);
+
+ // If bad cart ID, set to false
+ if ($cartId <= 0) {
+ $cartId = false;
+ } else {
+ // If good dart ID save that in the session
+ $_SESSION['glm_reg_cart_id'] = $cartId;
+ }
+
+ } elseif (isset($_SESSION['glm_reg_cart_id'])) {
+
+ // Get ID from session
+ $cartId = $_SESSION['glm_reg_cart_id'];
+
+ }
+
+ if ($cartId) {
+
+ $this->getRegistrationCart($cartId);
+
+ if ($this->cart) {
+ $haveCart = true;
+ }
+ }
+
$view = 'checkout';
- switch ( $option ) {
+ if ($cartId) {
+
+ // Try to get a Validate cart with updated totals
+ $this->checkRegistrationRequest($cartId);
}
+ $view = 'checkout';
+
+
// Compile template data
$templateData = array(
-
+ 'cartId' => $cartId,
+ 'haveCart' => $haveCart,
+ 'cart' => $this->cart,
+ 'checkoutUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/',
+ 'loggedIn' => ( isset( $_SESSION['LoginAccount'] ) ) ? $_SESSION['LoginAccount']: false,
+ 'assetUrl' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_ASSETS_URL
);
// Return status, any suggested view, and any data to controller
return array(
{if $haveCart}
<h2>Selected Registrations</h2>
- <table class="glm-admin-table">
+ <table class="glm-admin-table" width="100%">
<thead>
</tr>
{foreach $rate.registrants as $registrant}
<tr>
- <td> </td>
+ <td><a onClick="alert('When I get to it!'); return false;"><img src="{$assetUrl}/throwAwayBlue.svg" style="height: 2em;"></a></td>
<td>{$registrant.fname} {$registrant.lname}</td>
<td>{$registrant.event_time}</td>
<td style="text-align: right;">
</table>
- (if there's no problems the checkout button goes here)
+ {if $cart.blockCheckout}
+ <div>
+ <div class="glm-reg-warning">You have not yet submitted your registration. See above for issues! <img src="{$assetUrl}/fingerUpRed.svg" width="50";"></div>
+ </div>
+ {else}
+ <div class="glm-right">
+ <div class="glm-reg-warning">You have not yet submitted your registration! <img src="{$assetUrl}/fingerRightRed.svg" width="50";"> <a href="{$regUrl}?page=checkout" class="button tiny">Complete Registration</a></div>
+ </div>
+ {/if}
+
{else}
<tr class="alternate"><td colspan="2">No cart data</td></tr>
{/if}
+{include file='front/registrations/header.html'}
+
+{if $haveCart}
+ <form>
+
+ <table width="100%">
+
+ <tr><th>Name:</th><td><input type="text" name="name"></td></tr>
+
+ </table>
+
+ <div style="text-align: right;"><h2>Total Charged: ${$cart.totalCharges|number_format:2}</h2></div>
+
+ {if $cart.blockCheckout}
+ <div>
+ <div class="glm-reg-warning">You have not yet submitted your registration. See above for issues! <img src="{$assetUrl}/fingerUpRed.svg" width="50";"></div>
+ </div>
+ {else}
+ <div class="glm-right">
+ <div class="glm-reg-warning">You have one more step! <img src="{$assetUrl}/fingerRightRed.svg" width="50";"> <a href="{$regUrl}?page=checkout" class="button tiny">Submit Registration</a></div>
+ </div>
+ {/if}
+
+ </form>
+
+ <table class="glm-admin-table" width="100%">
+
+ <thead>
+
+ <tr>
+ <th>Registering</th>
+ <th>Registrant</th>
+ <th>Date/Time</th>
+ <th>Discount</th>
+ <th>Rate</th>
+ </tr>
+
+
+ </thead>
+ <tbody>
+ {foreach $cart.events as $event}
+ <tr>
+ <th colspan="5">Event: {$event.event_name}</th>
+ </tr>
+ {foreach $event.classes as $class}
+ <tr>
+ <td colspan="5"> {$class.class_name}</td>
+ </tr>
+ {foreach $class.rates as $rate}
+ <tr>
+ <td colspan="4">
+ {$rate.rate_name}
+ - Base Rate ({$rate.registrant_credits} registrants included)
+ </td>
+ <td style="text-align: right;">{$rate.rateBaseCharge|number_format:2}</td>
+ </tr>
+ {foreach $rate.registrants as $registrant}
+ <tr>
+ <td> </td>
+ <td>{$registrant.fname} {$registrant.lname}</td>
+ <td>{$registrant.event_time}</td>
+ <td style="text-align: right;">
+ {if $registrant.registrantDiscount > 0}
+ {$registrant.registrantDiscount|number_format:2}
+ {else}
+
+ {/if}
+ </td>
+ <td style="text-align: right;">
+ {if $registrant.registrantRate > 0}
+ {$registrant.registrantRate|number_format:2}
+ {else}
+ (included)
+ {/if}
+ </td>
+ </tr>
+ {/foreach}
+ {/foreach}
+ {/foreach}
+ {/foreach}
+ <tfoot>
+ <td colspan="2"> </td>
+ <td>Total registrants: {$cart.totalRegistrants}</td>
+ <td style="text-align: right;">
+ {if $cart.totalDiscounts > 0}
+ ${$cart.totalDiscounts|number_format:2}
+ {else}
+
+ {/if}
+ </td>
+ <td style="text-align: right;">${$cart.totalCharges|number_format:2}</td>
+ </tfoot>
+
+ </tbody>
+
+ </table>
+
+{else}
+ <tr class="alternate"><td colspan="2">No cart data</td></tr>
+{/if}
<div id="accountHeader">
{if $loggedIn}
Logged in as {$loggedIn.fname} {$loggedIn.lname}
- <a href="{$regUrl}?page=login&option=logout">Logout</a>
+ <a class="button tiny" href="{$regUrl}?page=login&option=logout">Logout</a>
{else}
- <a id="appLogin" href="{$regUrl}?page=login">Login</a>
- <a id="register" href="{$regUrl}?page=register">Register</a>
+ <a id="appLogin" class="button tiny" href="{$regUrl}?page=login">Login</a>
+ <a id="register" class="button tiny" href="{$regUrl}?page=register">Register</a>
{/if}
</div>
<div>
- <a href="{$regUrl}">Register for Another Event</a> (should be a button)
+ <a href="{$regUrl}" class="button tiny">Register for Another Event</a>
</div>