if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( $order ) : ?>
<?php if ( $order->has_status( 'failed' ) ) : ?>
<div class="row">
<div class="colmd-24">
<p class="woocommerce-thankyou-order-failed"><?php _e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'woocommerce' ); ?></p>
<p class="woocommerce-thankyou-order-failed-actions">
<a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php _e( 'Pay', 'woocommerce' ) ?></a>
<?php if ( is_user_logged_in() ) : ?>
<a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php _e( 'My Account', 'woocommerce' ); ?></a>
<?php endif; ?>
</p>
</div>
</div>
<?php else : ?>
<div class="row">
<div class="col-md-24 thankyou--header text-center">
<h1 class="woocommerce-thankyou-order-received thankyou--header--title heading-2">
<?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you!', 'woocommerce' ), $order ); ?>
</h1>
<p class="seamless-text-medium--light thankyou--header--intro">
YOUR ORDER No #<?php echo $order->get_order_number(); ?> WAS PLACED AND IS CURRENTLY PROCESSING. </br>
YOU WILL RECEIVE AN EMAIL NOTIFICATION AS SOON AS YOUR ORDER HAS BEEN DISPATCHED.
</p>
</div>
<div class="col-md-24 thankyou--order-details">
<table class="table thankyou--table">
<thead class="thankyou--table--head">
<tr>
<th class="seamless-text-medium">Product</th>
<th class="seamless-text-medium text-center">OTY</th>
<th class="seamless-text-medium text-center">Size</th>
<th class="seamless-text-medium text-right">Price</th>
</tr>
</thead>
<tbody>
<?php
$order_id = $order->get_order_number();
foreach( $order->get_items() as $item_id => $item ) :
$product = apply_filters( 'woocommerce_order_item_product', $order->get_product_from_item( $item ), $item );
$is_visible = $product && $product->is_visible();
$product_permalink = apply_filters( 'woocommerce_order_item_permalink', $is_visible ? $product->get_permalink( $item ) : '', $item, $order );
$featurder_image = get_post_meta( $product->post->ID, 'product_metabox_custom_product_image', true );
?>
<tr class="thankyou--order-details--table-row">
<td>
<img src="<?php echo $featurder_image; ?>" class="thankyou--order-details--table-row--image" />
<div class="thankyou--order-details--table-row--product-title force-gray">
<?php echo apply_filters( 'woocommerce_order_item_name', $product_permalink ? sprintf( '<a class="paragraph-small" href="%s">%s</a>', $product_permalink, $item['name'] ) : $item['name'], $item, $is_visible ); ?>
</div>
</td>
<td>
<?php echo apply_filters( 'woocommerce_order_item_quantity_html', ' <p class=" text-center product-quantity paragraph-small force-gray">' . sprintf( '%s', $item['qty'] ) . '</p>', $item ); ?>
</td>
<td>
<p class="paragraph-small force-gray text-center"><?php echo $product->variation_data['attribute_size']; ?></p>
</td>
<td>
<p class="paragraph-small force-gray text-right thankyou--price-col"><?php echo $order->get_formatted_line_subtotal( $item ); ?></p>
</td>
</tr>
<?php
endforeach;
?>
<?php foreach ( $order->get_order_item_totals() as $key => $total ) :
$last_row = '';
if( $total['label'] == 'Payment Method:' ) {
continue;
}
if( $total['label'] == 'Total:' ) {
$total['label'] = 'GRAND TOTAL';
$last_row = ' last_row';
}
?>
<tr class="no-padding <?php echo $last_row; ?>">
<th scope="row" class="no-padding"> <p class="thankyou--table-text force-gray uppercase thankyou-footer-text"> <?php echo $total['label']; ?> </p> </th>
<td></td>
<td></td>
<td class="no-padding"> <p class="thankyou--table-text force-gray text-right v-middle thankyou-footer-text"> <?php echo trim($total['value']); ?> </p> </td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="col-md-24 text-center">
<a href="/shop" class="btn-cta" style="margin-top:50px;">Back to store</a>
</div>
<?php do_action('woocommerce_thankyou', $order->get_id()); ?>
<?php endif; ?>
<p class="woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you. Your order has been received.', 'woocommerce' ), null ); ?></p>