Sei sulla pagina 1di 4

<div class="all-products">

<div class="left-table">
<table class="custom-product-table">
<thead>
<tr>
<th class="product-remove"><?php _e( '',
'woocommerce' ); ?></th>
<th class="product-name"><?php _e( 'Product',
'woocommerce' ); ?></th>
<th class="product-quantity"><?php
_e( 'Quantity', 'woocommerce' ); ?></th>
<th class="product-total"><?php _e( 'Total',
'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<?php

do_action( 'woocommerce_review_order_before_cart_contents' );
$post_count = count(WC()->cart->get_cart());
$counter = 0;
foreach ( WC()->cart->get_cart() as
$cart_item_key => $cart_item ) {
$_product =
apply_filters( 'woocommerce_cart_item_product', $cart_item['data'],
$cart_item, $cart_item_key );

if ( $_product && $_product->exists() &&


$cart_item['quantity'] > 0 &&
apply_filters( 'woocommerce_checkout_cart_item_visible', true,
$cart_item, $cart_item_key ) ) {
?>
<tr class="<?php echo
esc_attr( apply_filters( 'woocommerce_cart_item_class', 'cart_item',
$cart_item, $cart_item_key ) ); ?>">
<td>
<div>
<span class="update-quantity"
id="<?php echo $_product->get_id() ;?>" style="display:inline-
block;">&#9998;</span>
<img
src="https://tidly.cf/loading.gif" class="loading-icon"
style="display:none;">
</div>
<div>
<span class="remove-all-
product-button" id="<?php echo $_product->get_id() ;?>"
style="display:inline-block;">×</span>
<img
src="https://tidly.cf/loading.gif" class="loading-icon"
style="display:none;">
</div>
</td>
<td class="product-name">
<?php echo
apply_filters( 'woocommerce_cart_item_name', $_product-
>get_name(), $cart_item, $cart_item_key ) . '&nbsp;'; ?>
<?php //echo
apply_filters( 'woocommerce_checkout_cart_item_quantity', '
<strong class="product-quantity">' . sprintf( '&times; %s',
$cart_item['quantity'] ) . '</strong>', $cart_item, $cart_item_key ); ?>
<?php //echo
wc_get_formatted_cart_item_data( $cart_item ); ?>
</td>
<td class="product-quantity">
<input type="number" min=1
id="product-quantity" value="<?php echo $cart_item['quantity']; ?>">
</td>
<td class="product-total">
<?php echo
apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart-
>get_product_subtotal( $_product, $cart_item['quantity'] ),
$cart_item, $cart_item_key ); ?>
</td>
</tr>

<?php if($post_count % 2 == 0 &&


$counter === (int)($post_count/2)-1) { ?>
</tbody>
</table>
</div>
<div class="right-table">
<table class="custom-product-table">
<thead>
<tr>
<th class="product-remove"><?
php _e( '', 'woocommerce' ); ?></th>
<th class="product-name"><?
php _e( 'Product', 'woocommerce' ); ?></th>
<th class="product-
quantity"><?php _e( 'Quantity', 'woocommerce' ); ?></th>
<th class="product-total"><?
php _e( 'Total', 'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<?php }
if($post_count % 2 != 0 && $counter ===
(int)($post_count/2)) { ?>
</tbody>
</table>
</div>
<div class="right-table">
<table class="custom-product-table">
<thead>
<tr>
<th class="product-remove"><?
php _e( '', 'woocommerce' ); ?></th>
<th class="product-name"><?
php _e( 'Product', 'woocommerce' ); ?></th>
<th class="product-
quantity"><?php _e( 'Product', 'woocommerce' ); ?></th>
<th class="product-total"><?
php _e( 'Total', 'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<?php
}
$counter++;
}
}

do_action( 'woocommerce_review_order_after_cart_contents' );
?>
</tbody>
</table>
</div>
</div>

Potrebbero piacerti anche