Skip to content

Commit

Permalink
Merge pull request #1472 from Piirka/patch-3
Browse files Browse the repository at this point in the history
Fixes "Go to shop" translate issue
  • Loading branch information
bacoords committed Oct 29, 2021
2 parents e281b3e + 4fbc90b commit 9f13587
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions woocommerce/myaccount/orders.php
Expand Up @@ -13,7 +13,7 @@
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates
* @package WooCommerce\Templates
* @version 3.7.0
*/

Expand All @@ -35,7 +35,7 @@
<tbody>
<?php
foreach ( $customer_orders->orders as $customer_order ) {
$order = wc_get_order( $customer_order ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Override
$order = wc_get_order( $customer_order ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
$item_count = $order->get_item_count() - $order->get_item_count_refunded();
?>
<tr class="woocommerce-orders-table__row woocommerce-orders-table__row--status-<?php echo esc_attr( $order->get_status() ); ?> order">
Expand Down Expand Up @@ -63,11 +63,11 @@

<?php elseif ( 'order-actions' === $column_id ) : ?>
<?php
$orders_actions = wc_get_account_orders_actions( $order );
$actions = wc_get_account_orders_actions( $order );

if ( ! empty( $orders_actions ) ) {
foreach ( $orders_actions as $key => $orders_action ) {
echo '<a href="' . esc_url( $orders_action['url'] ) . '" class="woocommerce-button btn btn-outline-primary ' . sanitize_html_class( $key ) . '">' . esc_html( $orders_action['name'] ) . '</a>';
if ( ! empty( $actions ) ) {
foreach ( $actions as $key => $action ) { // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
echo '<a href="' . esc_url( $action['url'] ) . '" class="woocommerce-button btn btn-outline-primary ' . sanitize_html_class( $key ) . '">' . esc_html( $action['name'] ) . '</a>';
}
}
?>
Expand Down Expand Up @@ -97,12 +97,9 @@

<?php else : ?>
<div class="woocommerce-message woocommerce-message--info woocommerce-Message woocommerce-Message--info woocommerce-info">
<a class="btn btn-outline-primary" href="<?php echo esc_url( apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink( 'shop' ) ) ); ?>">
<?php esc_html_e( 'Go to the shop', 'woocommerce' ); ?>
</a>
<a class="woocommerce-Button btn btn-outline-primary" href="<?php echo esc_url( apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink( 'shop' ) ) ); ?>"><?php esc_html_e( 'Browse products', 'woocommerce' ); ?></a>
<?php esc_html_e( 'No order has been made yet.', 'woocommerce' ); ?>
</div>
<?php endif; ?>

<?php
do_action( 'woocommerce_after_account_orders', $has_orders );
<?php do_action( 'woocommerce_after_account_orders', $has_orders ); ?>

0 comments on commit 9f13587

Please sign in to comment.