{# **
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 * #}

<div class="card" data-role="order-information">
  <h3 class="card-header">{{ 'Cart information'|trans({}, 'Admin.Orderscustomers.Feature') }}</h3>
  <div class="card-body">
    <p class="mb-0">
      {{ 'Created:'|trans({}, 'Admin.Orderscustomers.Feature') }}
      {{ cartView.cartSummary.date_add }}
    </p>
    <p class="mb-0">
      {{ 'Last updated:'|trans({}, 'Admin.Orderscustomers.Feature') }}
      {{ cartView.cartSummary.date_upd }}
    </p>
    <hr class="mt-2 mb-2">
    {% if cartView.orderInformation.id is not empty %}

      <p>{{ 'Order %orderid% was created from this cart on %orderdate%.'|trans({}, 'Admin.Orderscustomers.Feature')|replace({
        '%orderid%': '<a href="' ~ path('admin_orders_view', {orderId: cartView.orderInformation.id}) ~ '">#' ~ cartView.orderInformation.id|format('"%06d') ~ '</a>',
        '%orderdate%': cartView.orderInformation.placed_date,
      })|raw }}</p>

      <a href="{{ path('admin_orders_view', {orderId: cartView.orderInformation.id}) }}" class="btn btn-primary">
        <i class="material-icons">remove_red_eye</i>
        {{ 'View order'|trans({}, 'Admin.Orderscustomers.Feature') }}
      </a>
    {% else %}
      <p class="mb-0">{{ 'The customer has not proceeded to checkout yet.'|trans({}, 'Admin.Orderscustomers.Feature') }}</p>

      {% if cartView.customerInformation.id %}
        <a href="{{ createOrderFromCartLink }}" class="btn btn-primary mt-3" id="create-order-from-cart">
          <i class="material-icons">add_circle_outline</i>
          {{ 'Create an order from this cart'|trans({}, 'Admin.Orderscustomers.Feature') }}
        </a>
      {% endif %}
    {% endif %}
  </div>
</div>
