{*
* 2007-2024 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* 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 http://www.prestashop.com for more information.
*
*  @author    PrestaShop SA <contact@prestashop.com>
*  @copyright 2007-2024 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
<table class="table{if !$isAdmin}  table-striped table-bordered hidden-sm-down{/if}" id="shipping-grid-table">
    <thead{if !$isAdmin}  class="thead-default"{/if}>
    <tr>
        <th>{l s='Date' d='Modules.Agilemultisellerpro.Ordercarrierslist'}</th>
        <th>&nbsp;</th>
        <th>{l s='Seller' d='Modules.Agilemultisellerpro.Ordercarrierslist'}</th>
        <th>{l s='Carrier' d='Modules.Agilemultisellerpro.Ordercarrierslist'}</th>
        <th>{l s='Weight' d='Modules.Agilemultisellerpro.Ordercarrierslist'}</th>
        <th>{l s='Shipping cost' d='Modules.Agilemultisellerpro.Ordercarrierslist'}</th>
        <th>{l s='Tracking number' d='Modules.Agilemultisellerpro.Ordercarrierslist'}</th>
        {if $isAdmin}
            <th></th>
        {/if}
    </tr>
    </thead>
    <tbody>

{foreach from=$carriers item=carrier }
    <tr>
        <td class="date">{$carrier.date_add|escape:'htmlall':'UTF-8'}</td>
        <td>&nbsp;</td>
        <td class="carrier-seller">{$carrier.shopName|escape:'htmlall':'UTF-8'}</td>
        <td class="carrier-name">
            {$carrier.carrierName|escape:'htmlall':'UTF-8'}
            {if $carrier.location}
                <br>
                ({$carrier.location|escape:'htmlall':'UTF-8'})
            {/if}
        </td>
        <td class="carrier-weight">{$carrier.weight|string_format:"%.3f"|escape:'htmlall':'UTF-8'} {$carrier.weightUnit|escape:'htmlall':'UTF-8'}</td>
        <td class="carrier-price">{$carrier.shippingCostFormated|escape:'htmlall':'UTF-8'}</td>
        <td class="carrier-tracking-number">
        {if $carrier.trackingNumber}
            {if $carrier.trackingUrl}
                <a href="{$carrier.trackingUrl|escape:'htmlall':'UTF-8'}}" target="_blank" rel="noopener noreferrer nofollow">{$carrier.trackingNumber|escape:'htmlall':'UTF-8'}</a>
            {else}
                {$carrier.trackingNumber|escape:'htmlall':'UTF-8'}
            {/if}
        {/if}
        </td>
        {if $isAdmin}
            <td class="text-right">
                {if $carrier.canEdit}
                    <a href="#"
                       class="js-update-shipping-btn d-print-none"
                       data-toggle="modal"
                       data-target="#updateOrderShippingModal"
                       data-order-carrier-id="{$carrier.idOrderCarrier|escape:'htmlall':'UTF-8'}"
                       data-order-tracking-number="{$carrier.trackingNumber|escape:'htmlall':'UTF-8'}"
                    >
                        {l s='Edit' d='Modules.Agilemultisellerpro.Ordercarrierslist'}
                    </a>
                {/if}
            </td>
        {/if}
    </tr>
{/foreach}
    </tbody>
</table>

<script>
    $(document).ready(function() {
        $('#orderShippingTab .count').html({count($carriers)|intval});
    });
</script>
