add option to enable / disable coupon form on cart page

This commit is contained in:
Max Rice 2012-07-20 17:19:52 -04:00
parent a239922632
commit 28f9c40700
2 changed files with 11 additions and 2 deletions

View File

@ -147,7 +147,16 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
'checkboxgroup' => 'start',
'show_if_checked' => 'option'
),
array(
'desc' => __( 'Enable coupon form on cart', 'woocommerce' ),
'id' => 'woocommerce_enable_coupon_form_on_cart',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => '',
'show_if_checked' => 'yes'
),
array(
'desc' => __( 'Enable coupon form on checkout', 'woocommerce' ),
'id' => 'woocommerce_enable_coupon_form_on_checkout',

View File

@ -106,7 +106,7 @@ global $woocommerce;
<tr>
<td colspan="6" class="actions">
<?php if ( get_option( 'woocommerce_enable_coupons' ) == 'yes' ) { ?>
<?php if ( get_option( 'woocommerce_enable_coupons' ) == 'yes' && get_option( 'woocommerce_enable_coupon_form_on_cart' ) == 'yes') { ?>
<div class="coupon">
<label for="coupon_code"><?php _e('Coupon', 'woocommerce'); ?>:</label> <input name="coupon_code" class="input-text" id="coupon_code" value="" /> <input type="submit" class="button" name="apply_coupon" value="<?php _e('Apply Coupon', 'woocommerce'); ?>" />