Merge pull request #18212 from WPprodigy/hide-add-coupon

Only show 'Apply coupon' in admin if coupons are enabled
This commit is contained in:
Claudiu Lodromanean 2017-12-18 08:41:12 -08:00 committed by GitHub
commit 052fbc73c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -203,7 +203,9 @@ if ( wc_tax_enabled() ) {
<p class="add-items">
<?php if ( $order->is_editable() ) : ?>
<button type="button" class="button add-line-item"><?php esc_html_e( 'Add item(s)', 'woocommerce' ); ?></button>
<button type="button" class="button add-coupon"><?php esc_html_e( 'Apply coupon', 'woocommerce' ); ?></button>
<?php if ( wc_coupons_enabled() ) : ?>
<button type="button" class="button add-coupon"><?php esc_html_e( 'Apply coupon', 'woocommerce' ); ?></button>
<?php endif; ?>
<?php else : ?>
<span class="description"><?php echo wc_help_tip( __( 'To edit this order change the status back to "Pending"', 'woocommerce' ) ); ?> <?php esc_html_e( 'This order is no longer editable.', 'woocommerce' ); ?></span>
<?php endif; ?>