Hi,
ich würde gerne von der Tabellenauflistung der Bestellung weg und gern jede Bestellung als ne Art Karte (also in einem Div dartstellen.)
Habs versucht aber mir zeigt er alle Bestellungen untereinander und verschachtelt die Bestellungen ineinander .
PHP
$customer_orders = get_posts( apply_filters( 'woocommerce_my_account_my_orders_query', array( 'numberposts' => $order_count,
'meta_key' => '_customer_user',
'meta_value' => get_current_user_id(),
'post_type' => wc_get_order_types( 'view-orders' ),
'post_status' => array_keys( wc_get_order_statuses() )
) ) );
if ( $customer_orders ) : ?>
<h2><?php echo apply_filters( 'woocommerce_my_account_my_orders_title', __( 'Immobilien', 'woocommerce' ) ); ?></h2>
<?php
foreach ( $customer_orders as $customer_order ) {
$order = wc_get_order( $customer_order );
$order->populate( $customer_order );
$item_count = $order->get_item_count();
?>
<div class="kd_orders">
<div class="kd_order-number" data-title="<?php esc_attr_e( 'Order Number', 'woocommerce' ); ?>">
<a href="<?php echo esc_url( $order->get_view_order_url() ); ?>">
<?php echo _x( '#', 'hash before order number', 'woocommerce' ) . $order->get_order_number(); ?>
</a>
</div>
<div class="kd_order-date" data-title="<?php esc_attr_e( 'Date', 'woocommerce' ); ?>">
<time datetime="<?php echo date( 'Y-m-d', strtotime( $order->order_date ) ); ?>" title="<?php echo esc_attr( strtotime( $order->order_date ) ); ?>"><?php echo date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ); ?></time>
</div>
<div class="kd_order-status-<?php echo wc_get_order_status_name( $order->get_status() ); ?>" data-title="<?php esc_attr_e( 'Status', 'woocommerce' ); ?>" style="text-align:left; white-space:nowrap;">
<?php echo wc_get_order_status_name( $order->get_status() ); ?>
</div>
<div class="kd_order-typ" data-title="<?php esc_attr_e( 'Immobilie', 'woocommerce' ); ?>">
<?php echo get_post_meta( $order->id, 'Immo-Typ', true ) ?>
</div>
<div class="kd_order-actions">
<?php
$portfolio = get_field('portfolio', $order->id );
$freigabe = get_field('freigabe', $order->id );
$actions = array();
if ( $order->needs_payment() ) {
$actions['pay'] = array(
'url' => $order->get_checkout_payment_url(),
'name' => __( 'Pay', 'woocommerce' )
);
}
if ( in_array( $order->get_status(), apply_filters( 'woocommerce_valid_order_statuses_for_cancel', array( 'pending', 'failed' ), $order ) ) ) {
$actions['cancel'] = array(
'url' => $order->get_cancel_order_url( wc_get_page_permalink( 'myaccount' ) ),
'name' => __( 'Cancel', 'woocommerce' )
);
}
$actions['view'] = array(
'url' => $order->get_view_order_url(),
'name' => __( 'View', 'woocommerce' )
);
if($portfolio) {
$actions['portfolio'] = array(
'url' => $portfolio,
'name' => __( 'Exposé', 'woocommerce' )
);
}
/*
if ( $order->has_status('on-hold') ) {
$actions['status'] = array(
'url' => $order->get_cancel_order_url( update_status( 'completed' ) ),
'name' => __( 'Freigabe', 'woocommerce' )
);
} */
$actions = apply_filters( 'woocommerce_my_account_my_orders_actions', $actions, $order );
if ( $actions ) {
foreach ( $actions as $key => $action ) {
echo '<a href="' . esc_url( $action['url'] ) . '" class="button ' . sanitize_html_class( $key ) . '">' . esc_html( $action['name'] ) . '</a>';
}
}
?>
</div>
<?php /*
<td class="order-freigabe" data-title="<?php esc_attr_e( 'Status', 'woocommerce' ); ?>" style="text-align:left; white-space:nowrap;">
<?php
if( $freigabe == 'freigabe' )
{
echo '<p class="portfolio-freigegeben"><i class="fa fa-check"></i></p>';
}
else
{
echo '<p class="portfolio-abgelehnt"><i class="fa fa-times"></i></p>';
}?>
</td>
*/ ?>
<?php
}
?></div>
Alles anzeigen