Plugin problems, questions
-
Hi,
Your plugin counts cart total value always without tax, which causes wrong coupons displayed when shop displays prices with tax. For example coupon is fromm $200, i have $230 in cart and cannot apply coupon because WC()->cart->get_subtotal() is $194 without tax. I had to add
if (WC()->cart->display_prices_including_tax()) {
$cart_subtotal = $cart_subtotal + WC()->cart->get_subtotal_tax();
}Second, i think this should not be negated (class-frontend.php) – if excluded categories intersect with product we want to remove it
if (! count(array_intersect($product_cats, $coupon->get_excluded_product_categories()))) {And third, why not just use internal woocommerce validation for coupons?
$discounts = new WC_Discounts(WC()->cart);
foreach ($coupon_ids as $coupon_id) {
$coupon = new WC_Coupon($coupon_id);
$valid = $discounts->is_coupon_valid($coupon);
if (is_wp_error($valid)) {
continue;
}
...
}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
You must be logged in to reply to this topic.