Merge pull request #2027 from brichards/master
Clean up My Account templates
This commit is contained in:
commit
64bdf33158
|
@ -17,38 +17,13 @@ $woocommerce->show_messages(); ?>
|
||||||
|
|
||||||
<?php do_action( 'woocommerce_before_my_account' ); ?>
|
<?php do_action( 'woocommerce_before_my_account' ); ?>
|
||||||
|
|
||||||
<?php if ( $downloads = $woocommerce->customer->get_downloadable_products() ) : ?>
|
<?php woocommerce_get_template( 'myaccount/my-downloads.php' ); ?>
|
||||||
|
|
||||||
<h2><?php _e( 'Available downloads', 'woocommerce' ); ?></h2>
|
<?php do_action( 'woocommerce_between_my_account_downloads_and_orders' ); ?>
|
||||||
|
|
||||||
<ul class="digital-downloads">
|
|
||||||
<?php foreach ( $downloads as $download ) : ?>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<?php
|
|
||||||
do_action( 'woocommerce_available_download_start', $download );
|
|
||||||
|
|
||||||
if ( is_numeric( $download['downloads_remaining'] ) )
|
|
||||||
echo apply_filters( 'woocommerce_available_download_count', '<span class="count">' . sprintf( _n( '%s download remaining', '%s downloads remaining', $download['downloads_remaining'], 'woocommerce' ), $download['downloads_remaining'] ) . '</span> ', $download );
|
|
||||||
|
|
||||||
echo apply_filters( 'woocommerce_available_download_link', '<a href="' . esc_url( $download['download_url'] ) . '">' . $download['download_name'] . '</a>', $download );
|
|
||||||
|
|
||||||
do_action( 'woocommerce_available_download_end', $download );
|
|
||||||
?>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<h2><?php _e( 'Recent Orders', 'woocommerce' ); ?></h2>
|
|
||||||
|
|
||||||
<?php woocommerce_get_template( 'myaccount/my-orders.php', array( 'recent_orders' => $recent_orders ) ); ?>
|
<?php woocommerce_get_template( 'myaccount/my-orders.php', array( 'recent_orders' => $recent_orders ) ); ?>
|
||||||
|
|
||||||
<h2><?php _e( 'My Address', 'woocommerce' ); ?></h2>
|
<?php do_action( 'woocommerce_between_my_account_orders_and_address' ); ?>
|
||||||
|
|
||||||
<p class="myaccount_address"><?php _e( 'The following addresses will be used on the checkout page by default.', 'woocommerce' ); ?></p>
|
|
||||||
|
|
||||||
<?php woocommerce_get_template( 'myaccount/my-address.php' ); ?>
|
<?php woocommerce_get_template( 'myaccount/my-address.php' ); ?>
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,10 @@ global $woocommerce;
|
||||||
$customer_id = get_current_user_id();
|
$customer_id = get_current_user_id();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<h2><?php echo apply_filters( 'woocommerce_my_address_title', __( 'My Address', 'woocommerce' ) ); ?></h2>
|
||||||
|
|
||||||
|
<p class="myaccount_address"><?php echo apply_filters( 'woocommerce_my_address_description', __( 'The following addresses will be used on the checkout page by default.', 'woocommerce' ) ); ?></p>
|
||||||
|
|
||||||
<?php if (get_option('woocommerce_ship_to_billing_address_only')=='no') : ?>
|
<?php if (get_option('woocommerce_ship_to_billing_address_only')=='no') : ?>
|
||||||
|
|
||||||
<div class="col2-set addresses">
|
<div class="col2-set addresses">
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* My Orders
|
||||||
|
*
|
||||||
|
* Shows recent orders on the account page
|
||||||
|
*
|
||||||
|
* @author WooThemes
|
||||||
|
* @package WooCommerce/Templates
|
||||||
|
* @version 1.6.4
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
|
||||||
|
global $woocommerce;
|
||||||
|
|
||||||
|
if ( $downloads = $woocommerce->customer->get_downloadable_products() ) : ?>
|
||||||
|
|
||||||
|
<h2><?php echo apply_filters( 'woocommerce_available_downloads_title', __( 'Available downloads', 'woocommerce' ) ); ?></h2>
|
||||||
|
|
||||||
|
<ul class="digital-downloads">
|
||||||
|
<?php foreach ( $downloads as $download ) : ?>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<?php
|
||||||
|
do_action( 'woocommerce_available_download_start', $download );
|
||||||
|
|
||||||
|
if ( is_numeric( $download['downloads_remaining'] ) )
|
||||||
|
echo apply_filters( 'woocommerce_available_download_count', '<span class="count">' . sprintf( _n( '%s download remaining', '%s downloads remaining', $download['downloads_remaining'], 'woocommerce' ), $download['downloads_remaining'] ) . '</span> ', $download );
|
||||||
|
|
||||||
|
echo apply_filters( 'woocommerce_available_download_link', '<a href="' . esc_url( $download['download_url'] ) . '">' . $download['download_name'] . '</a>', $download );
|
||||||
|
|
||||||
|
do_action( 'woocommerce_available_download_end', $download );
|
||||||
|
?>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
|
@ -24,6 +24,8 @@ $args = array(
|
||||||
);
|
);
|
||||||
$customer_orders = get_posts($args);
|
$customer_orders = get_posts($args);
|
||||||
|
|
||||||
|
echo '<h2>' . apply_filters( 'woocommerce_recent_orders_title', __( 'Recent Orders', 'woocommerce' ) ) . '</h2>';
|
||||||
|
|
||||||
if ($customer_orders) :
|
if ($customer_orders) :
|
||||||
?>
|
?>
|
||||||
<table class="shop_table my_account_orders">
|
<table class="shop_table my_account_orders">
|
||||||
|
|
Loading…
Reference in New Issue