coupon, discount and free shipping
-
hello
i found a problem about coupon.
if i set a discount price (ex -100) AND free shipping on cart i see only free shipping note, but nothing about -100so i change the function in this way
function wc_cart_totals_coupon_html( $coupon ) {
if ( is_string( $coupon ) ) {
$coupon = new WC_Coupon( $coupon );
}$discount_amount_html = ”;
if ( $amount = WC()->cart->get_coupon_discount_amount( $coupon->get_code(), WC()->cart->display_cart_ex_tax ) ) {
$discount_amount_html = ‘-‘ . wc_price( $amount ).”<br/>”;
}
if ( $coupon->get_free_shipping() ) {
$discount_amount_html .= __( ‘Free shipping coupon’, ‘woocommerce’ );
}$discount_amount_html = apply_filters( ‘woocommerce_coupon_discount_amount_html’, $discount_amount_html, $coupon );
$coupon_html = $discount_amount_html . ‘ get_code() ), defined( ‘WOOCOMMERCE_CHECKOUT’ ) ? wc_get_checkout_url() : wc_get_cart_url() ) ) . ‘” class=”woocommerce-remove-coupon” data-coupon=”‘ . esc_attr( $coupon->get_code() ) . ‘”>’ . __( ‘[Remove]’, ‘woocommerce’ ) . ‘‘;echo wp_kses( apply_filters( ‘woocommerce_cart_totals_coupon_html’, $coupon_html, $coupon, $discount_amount_html ), array_replace_recursive( wp_kses_allowed_html( ‘post’ ), array( ‘a’ => array( ‘data-coupon’ => true ) ) ) );
}i do someting wrong?
- The topic ‘coupon, discount and free shipping’ is closed to new replies.