            <div id="summary-details">
                <div class="section-title">
                    <h3><i class="fas fa-shopping-cart"></i> <?php $this->_('Summary.index.heading_summary');?></h3>
                    <p><?php $this->_('Summary.index.summary_note');?></p>
                </div>


                <div class="card bg-light p-3 card-order">
                    <table class="table table-curved">
                        <thead>
                            <tr>
                                <th><?php $this->_('Summary.index.table_description');?></th>
                                <th></th>
                                <th><?php $this->_('Summary.index.table_price');?></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            foreach ((isset($summary['cart']['display_items']) ? $summary['cart']['display_items'] : []) as $item) {
                            ?>
                                <tr>
                                    <td>
                                        <?php
                                        switch ((isset($item['type']) ? $item['type'] : null)) {
                                            case 'addon':
                                            case 'config_fee':
                                                echo (isset($item['description']) ? $this->Html->safe($item['description']) : null);
                                                break;
                                            default:
                                                ?>
                                                <strong><?php echo (isset($item['description']) ? $this->Html->safe($item['description']) : null);?></strong>
                                                <?php
                                        }
                                        ?>
                                    </td>
                                    <td>
                                        <?php $this->_('Cart.index.quantity', false, $this->CurrencyFormat->truncateDecimal((isset($item['qty']) ? $item['qty'] : 1), 0));?>
                                    </td>
                                    <td class="price-col float-right">
                                        <strong class="currency_value"><?php echo (isset($item['price']) ? $this->Html->safe($item['price']) : null);?></strong>
                                    </td>
                                </tr>
                            <?php
                            }
                            ?>
                        </tbody>
                    </table>
                    <hr>

                    <?php
                    if ((isset($summary['totals']) ? $summary['totals'] : null)) {
                    ?>
                    <table class="table table-curved">
                        <tbody>
                            <tr>
                                <td><?php $this->_('Summary.index.totals.subtotal');?></td>
                                <td><span class="price-col float-right"><strong class="currency_value"><?php echo (isset($summary['totals']['subtotal']['amount_formatted']) ? $this->Html->safe($summary['totals']['subtotal']['amount_formatted']) : null);?></strong></span></td>
                            </tr>
                            <?php
                            if ((isset($summary['totals']['discount']['amount_formatted']) ? $summary['totals']['discount']['amount_formatted'] : null)) {
                            ?>
                            <tr>
                                <td><?php $this->_('Summary.index.totals.discount');?></td>
                                <td><span class="price-col float-right"><strong class="currency_value"><?php echo (isset($summary['totals']['discount']['amount_formatted']) ? $this->Html->safe($summary['totals']['discount']['amount_formatted']) : null);?></strong></span></td>
                            </tr>
                            <?php
                            }
                            if ((isset($summary['totals']['tax']) ? $summary['totals']['tax'] : null)) {
                                foreach ($summary['totals']['tax'] as $description => $tax) {
                            ?>
                                <tr>
                                    <td><?php $this->_('Summary.index.totals.tax', false, $description);?></td>
                                    <td><span class="price-col float-right"><strong class="currency_value"><?php echo (isset($tax['amount_formatted']) ? $this->Html->safe($tax['amount_formatted']) : null);?></strong></span></td>
                                </tr>
                            <?php
                                }
                            }
                            ?>
                        </tbody>
                    </table>
                    <hr>
                    <?php
                    }
                    ?>

                    <div class="row p-2">
                        <div class="col-md-6 mb-2">
                            <?php
                            if ((isset($order_form->allow_coupons) ? $order_form->allow_coupons : null) == '1') {
                            ?>
                                <strong><a href="#coupon_box" data-toggle="collapse"><i class="fas fa-tag"></i> <?php $this->_('Summary.index.have_coupon');?></a></strong>
                                <div id="coupon_box" class="collapse">
                                    <?php
                                    $this->Form->create((isset($this->base_uri) ? $this->base_uri : null) . 'order/cart/applycoupon/' . (isset($order_form->label) ? $order_form->label : null), ['id' => 'applycoupon']);
                                    ?>
                                    <div class="input-group">
                                        <?php
                                        $this->Form->fieldText('coupon', (isset($summary['cart']['coupon']) ? $summary['cart']['coupon'] : (isset($temp_coupon) ? $temp_coupon : null)), ['class' => 'form-control' . ((isset($summary['cart']['coupon']) ? $summary['cart']['coupon'] : null) ? ' is-valid' : ''), 'id' => 'coupon', 'placeholder' => $this->_('Summary.index.coupon', true)]);
                                        ?>
                                        <div class="input-group-append">
                                            <button class="btn <?php echo ((isset($summary['cart']['coupon']) ? $summary['cart']['coupon'] : null) ? 'btn-success' : 'btn-secondary');?> m-0" type="submit"><i class="fas fa-sync-alt"></i> <?php $this->_('Summary.index.coupon_btn');?></button>
                                        </div>
                                    </div>
                                    <?php
                                    $this->Form->end();
                                    ?>
                                </div>
                            <?php
                            }
                            ?>
                        </div>
                        <div class="col-md-6 total-due">
                            <?php
                            if ((isset($summary['totals']) ? $summary['totals'] : null)) {
                            ?>
                                <small><?php $this->_('Summary.index.totals.total');?></small>
                                <h4><strong class="currency_value"><?php echo (isset($summary['totals']['total']['amount_formatted']) ? $this->Html->safe($summary['totals']['total']['amount_formatted']) : null);?></strong></h4>
                            <?php
                            }

                            if ((isset($summary['totals_recurring']) ? $summary['totals_recurring'] : null)) {
                            ?>
                                <small><?php $this->_('Summary.index.totals.total_recurring');?></small>
                                <p>
                                <?php
                                $i = 0;
                                foreach ($summary['totals_recurring'] as $totals) {
                                    // Determine the period to use
                                    $term = $this->Html->safe($totals['term']);
                                    $period = $this->Html->safe(($term == 1 ? (isset($periods[$totals['period']]) ? $periods[$totals['period']] : null) : (isset($periods[$totals['period'] . '_plural']) ? $periods[$totals['period'] . '_plural'] : null)), true);
                                    $amount = $this->Html->safe($totals['totals']['total']['amount_formatted']);

                                    if ($i++ > 0) {
                                    ?>
                                    <br />
                                    <?php
                                    }
                                    ?>
                                    <strong><?php $this->_('Summary.index.totals.total_recurring_amount', false, $term, $period, $amount);?></strong>
                                    <?php
                                }
                                unset($i);
                                ?>
                                </p>
                                <?php
                            }
                            ?>
                        </div>
                    </div>
                </div>
                <?php
                $this->Form->create($this->base_uri . 'order/cart/removeAll/' . (isset($order_form->label) ? $order_form->label : null), ['class' => 'disable-on-submit']);
                $this->Form->fieldHidden('redirect_to', $this->base_uri . 'order/main/index/' . (isset($order_form->label) ? $order_form->label : null));
                ?>
                    <button type="submit" class="btn btn-secondary btn-sm float-right" id="empty_cart">
                        <i class="fas fa-trash"></i> <?php $this->_('Summary.index.empty_cart');?>
                    </button>
                <?php
                $this->Form->end();
                ?>
                <div class="clearfix"></div>
            </div>
<script type="text/javascript" src="<?php echo $this->Html->safe($this->view_dir . 'javascript/summary.js');?>"></script>
<?php
// Attempt to auto-apply a temp coupon by submitting the coupon form
if (!empty($temp_coupon) && empty($summary['cart']['coupon'])) {
?>
<script type="text/javascript">
$(document).ready(function() {
    $('#applycoupon').trigger('submit');
});
</script>
<?php
}
?>