<?php if(! $cart->items->isEmpty()): ?>
<section class="zt-cart-products-card">
    <div class="zt-cart-products-list">
        <?php $__currentLoopData = $cart->items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php
                $isHosting = $item->item_type === 'hosting';
                $isPricedDomain = in_array($item->item_type, ['domain_register', 'domain_transfer'], true);
                $isDomain = str_starts_with((string) $item->item_type, 'domain_');
                $product = $isHosting ? $pricing->findProductByPid((int) $item->api_pid, $cart->currency) : null;
                $cycles = $product['available_cycles'] ?? [];
                $preferredCycleKeys = ['monthly', 'annually', 'biennially', 'triennially'];
                $termCycles = array_intersect_key($cycles, array_flip($preferredCycleKeys));

                // Preserve an existing non-standard term while hiding the old
                // quarterly/semiannual dropdown options for normal selection.
                if ($isHosting && $item->billing_cycle && isset($cycles[$item->billing_cycle]) && ! isset($termCycles[$item->billing_cycle])) {
                    $termCycles = [$item->billing_cycle => $cycles[$item->billing_cycle]] + $termCycles;
                }

                if ($isHosting && count($termCycles) === 0) {
                    $termCycles = $cycles;
                }

                $domainOptions = $isPricedDomain
                    ? $pricing->domainBillingOptions($item->domain_name, $item->operation ?: 'register', $cart->currency)
                    : [];
                $domainTypeLabel = match ($item->item_type) {
                    'domain_register' => 'Domain registration',
                    'domain_transfer' => 'Domain transfer',
                    'domain_existing' => 'Existing domain',
                    default => 'Domain',
                };
            ?>
            <article class="zt-cart-product-row">
                <div class="zt-cart-product-icon" aria-hidden="true">
                    <i class="fa-solid <?php echo e($isHosting ? 'fa-server' : 'fa-globe'); ?>"></i>
                </div>

                <div class="zt-cart-product-main">
                    <strong><?php echo e($isDomain && $item->domain_name ? $item->domain_name : $item->name); ?></strong>
                    <span>
                        <?php if($isDomain): ?>
                            <?php echo e($domainTypeLabel); ?>

                        <?php else: ?>
                            <?php echo e($item->billing_cycle ? $pricing->cycleLabel($item->billing_cycle) : 'Service'); ?>

                        <?php endif; ?>
                    </span>

                    <?php if($isHosting && count($termCycles)): ?>
                        <form method="POST" action="<?php echo e(route('cart.update-item', $item)); ?>" class="zt-cart-period-form" data-ajax-cart>
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('PATCH'); ?>
                            <input type="hidden" name="billing_cycle" value="<?php echo e($item->billing_cycle); ?>">
                            <label>Select your term length</label>
                            <div class="zt-term-options" role="group" aria-label="Hosting term length">
                                <?php $__currentLoopData = $termCycles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cycleKey => $cyclePrice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <button
                                        type="button"
                                        class="zt-term-option <?php echo e($item->billing_cycle === $cycleKey ? 'is-active' : ''); ?>"
                                        data-cart-period-field="billing_cycle"
                                        data-cart-period-value="<?php echo e($cycleKey); ?>"
                                        onclick="ztSelectCartPeriod(this)"
                                        aria-pressed="<?php echo e($item->billing_cycle === $cycleKey ? 'true' : 'false'); ?>"
                                    >
                                        <span><?php echo e($pricing->termLabel($cycleKey)); ?></span>
                                        <strong><?php echo e($pricing->formatMoney($cyclePrice, $cart->currency)); ?></strong>
                                        <small><?php echo e($item->billing_cycle === $cycleKey ? 'Selected' : 'Choose term'); ?></small>
                                    </button>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </form>
                    <?php elseif($isPricedDomain && count($domainOptions)): ?>
                        <form method="POST" action="<?php echo e(route('cart.update-item', $item)); ?>" class="zt-cart-period-form" data-ajax-cart>
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('PATCH'); ?>
                            <input type="hidden" name="years" value="<?php echo e((int) $item->years); ?>">
                            <label>Select registration length</label>
                            <div class="zt-term-options zt-domain-term-options" role="group" aria-label="Domain registration length">
                                <?php $__currentLoopData = $domainOptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $year => $priceRow): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <button
                                        type="button"
                                        class="zt-term-option <?php echo e((int) $item->years === (int) $year ? 'is-active' : ''); ?>"
                                        data-cart-period-field="years"
                                        data-cart-period-value="<?php echo e((int) $year); ?>"
                                        onclick="ztSelectCartPeriod(this)"
                                        aria-pressed="<?php echo e((int) $item->years === (int) $year ? 'true' : 'false'); ?>"
                                    >
                                        <span><?php echo e($year); ?> Year<?php echo e((int) $year === 1 ? '' : 's'); ?></span>
                                        <strong><?php echo e($pricing->formatMoney($priceRow['unit_price'], $cart->currency)); ?></strong>
                                        <small><?php echo e((int) $item->years === (int) $year ? 'Selected' : 'Choose term'); ?></small>
                                    </button>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </form>
                    <?php endif; ?>
                </div>

                <div class="zt-cart-product-price">
                    <strong><?php echo e($pricing->formatMoney($item->total, $item->currency)); ?></strong>
                    <form method="POST" action="<?php echo e(route('cart.remove-item', $item)); ?>" data-ajax-cart>
                        <?php echo csrf_field(); ?>
                        <?php echo method_field('DELETE'); ?>
                        <button type="submit">Remove</button>
                    </form>
                </div>
            </article>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
</section>
<?php endif; ?>
<?php /**PATH /home/ovbopdha/public_html/ztcart.eagale.xyz/resources/views/checkout/partials/cart-items.blade.php ENDPATH**/ ?>