<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/** @var \Magento\Multishipping\Block\Checkout\Success $block */
?>
<form action="<?= $block->escapeUrl($block->getContinueUrl()); ?>" method="post">
    <div class="multicheckout success">
        <p><?= $block->escapeHtml(__('For successfully order items, you\'ll receive a confirmation email including '.
                'order numbers, tracking information and more details.')) ?></p>
        <?php if ($orderIds = $block->getOrderIds()) : ?>
            <h3><?= $block->escapeHtml(__('Successfully ordered'))?></h3>
            <div class="orders-succeed">
            <ul class="orders-list">
            <?php foreach ($orderIds as $orderId => $incrementId) : ?>
                <li class="shipping-list">
                    <div class="order-id"><a href="<?= $block->escapeUrl($block->getViewOrderUrl($orderId)); ?>">
                        <?= $block->escapeHtml($incrementId); ?></a>
                    </div>
                <?php $shippingAddress = $block->getCheckoutData()->getOrderShippingAddress($orderId); ?>
                    <div class="shipping-item">
                        <?php if ($shippingAddress) : ?>
                        <span class="shipping-label"><?= $block->escapeHtml(__('Ship to:')); ?></span>
                        <span class="shipping-address">
                            <?= $block->escapeHtml(
                                $block->getCheckoutData()->formatOrderShippingAddress($shippingAddress)
                            ); ?>
                        </span>
                        <?php else : ?>
                            <span class="shipping-address">
                                <?= $block->escapeHtml(__('No shipping required.')); ?>
                            </span>
                        <?php endif; ?>
                    </div>
                </li>
            <?php endforeach; ?>
            </ul>
            </div>
        <?php endif; ?>
        <?= $block->getChildHtml() ?>
        <div class="actions-toolbar" id="review-buttons-container">
            <div class="primary">
                <button type="submit"
                        class="action primary submit"><span><?= $block->escapeHtml(__('Continue Shopping')); ?></span>
                </button>
            </div>
        </div>
    </div>
</form>
