Add order-again button class

This commit is contained in:
“Chris 2023-04-21 19:02:48 +03:00
parent e88152ff3c
commit 65bf73835d
2 changed files with 3 additions and 2 deletions

View File

@ -2747,6 +2747,7 @@ if ( ! function_exists( 'woocommerce_order_again_button' ) ) {
'order/order-again.php', 'order/order-again.php',
array( array(
'order' => $order, 'order' => $order,
'wp_button_class' => wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '',
'order_again_url' => wp_nonce_url( add_query_arg( 'order_again', $order->get_id(), wc_get_cart_url() ), 'woocommerce-order_again' ), 'order_again_url' => wp_nonce_url( add_query_arg( 'order_again', $order->get_id(), wc_get_cart_url() ), 'woocommerce-order_again' ),
) )
); );

View File

@ -12,12 +12,12 @@
* *
* @see https://docs.woocommerce.com/document/template-structure/ * @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce\Templates * @package WooCommerce\Templates
* @version 3.5.0 * @version x.x.x
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
?> ?>
<p class="order-again"> <p class="order-again">
<a href="<?php echo esc_url( $order_again_url ); ?>" class="button"><?php esc_html_e( 'Order again', 'woocommerce' ); ?></a> <a href="<?php echo esc_url( $order_again_url ); ?>" class="button<?php esc_attr( $wp_button_class ); ?>"><?php esc_html_e( 'Order again', 'woocommerce' ); ?></a>
</p> </p>