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

@ -148,6 +148,15 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
'show_if_checked' => 'option' '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( array(
'desc' => __( 'Enable coupon form on checkout', 'woocommerce' ), 'desc' => __( 'Enable coupon form on checkout', 'woocommerce' ),
'id' => 'woocommerce_enable_coupon_form_on_checkout', 'id' => 'woocommerce_enable_coupon_form_on_checkout',

View File

@ -106,7 +106,7 @@ global $woocommerce;
<tr> <tr>
<td colspan="6" class="actions"> <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"> <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'); ?>" /> <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'); ?>" />