Plugin Author
Dan
(@dangoodman)
Hi,
The plugin is not aware of discounts for now. It will be implemented some day but not sure when. Unfortunately, I can’t think of any workaround to make it work for you right now.
Consider using our advanced shipping plugin which can handle discounted subtotal well. Feel free to contact us there for more detail.
Hi,
I appreciate the response. I have attempted to make my own edit to the codes just to try and get it to work, and right now it shows the shipping options when the subtotal falls below $50 after the discounts, but do not hide the options after it exceeds the $50 set in max_subtotal.
public function calculate_shipping()
{
$cart = WC()->cart;
$weight = $cart->cart_contents_weight;
$actual_subtotal = $cart->subtotal_ex_tax - $cart->discount_cart;
$actual_subtotal_with_tax = $cart->subtotal - $cart->discount_cart_tax;
if ($this->min_weight && $weight < $this->min_weight) {
return;
}
if ($this->max_weight && $weight > $this->max_weight) {
return;
}
if ($this->min_subtotal || $this->max_subtotal) {
$subtotal = $this->subtotal_with_tax ? $actual_subtotal_with_tax : $actual_subtotal;
if ($this->min_subtotal && $subtotal < $this->min_subtotal) {
return;
}
if ($this->max_subtotal && $subtotal > $this->max_subtotal) {
return;
}
}
Do you have any idea what went wrong since I basically only replaced the variables with the discounted subtotals?
Hmm. Could be a problem on the theme end, since it works fine when I add items to the cart from scratch instead of updating the cart.
Plugin Author
Dan
(@dangoodman)
I’d say it should work. Can’t say for sure without running and testing.
It also could be a caching issue. Make sure you changed the cart in some way after code modification, e.g. by increasing item quantity.