diff --git a/index.php b/index.php index 681444f..e1a1b61 100644 --- a/index.php +++ b/index.php @@ -39,11 +39,13 @@ $router->post('/', function () { // Calculate totals $additionalContribution = convertPossibleFloatToCents($_POST['additionalContribution']); + list($tableTicketQty, $eventTicketQty) = eventPricing($eventTicketQty); $eventTicketPrice = convertPossibleFloatToCents($eventTicketQty * $_SERVER['EVENT_TICKET_PRICE']); + $tableTicketPrice = convertPossibleFloatToCents($tableTicketQty * $_SERVER['TABLE_TICKET_PRICE']); $ticketEnhancerPrice = convertPossibleFloatToCents($ticketEnhancerQty * $_SERVER['ENHANCER_TICKET_PRICE']); // Sum the cart totals - $cartTotal = $eventTicketPrice + $ticketEnhancerPrice + $additionalContribution; + $cartTotal = $eventTicketPrice + $tableTicketPrice + $ticketEnhancerPrice + $additionalContribution; include 'views/common/head.php'; include 'views/step2.php'; include 'views/common/footer.php'; diff --git a/src/.env.example b/src/.env.example index 5fb71e7..993e83f 100644 --- a/src/.env.example +++ b/src/.env.example @@ -1,4 +1,5 @@ EVENT_TICKET_PRICE="55" +TABLE_TICKET_PRICE="350" ENHANCER_TICKET_PRICE="20" DB_HOST="localhost" DB_USER="root" diff --git a/src/functions.php b/src/functions.php index 34ff29d..7d18fb7 100644 --- a/src/functions.php +++ b/src/functions.php @@ -49,16 +49,38 @@ function shoppingCartLineItem($name, $price, $description = '')