I have 5 shipping rules in virutemart:
1) Inside city - maximum order sum 1399 - delivery price: 200
2) Inside city - minimum order sum 1400 - delivery price: 0
3) Outside city - maximum order sum 1399 - delivery price: 350
4) Outside city - minimum order sum 1400 - delivery price: 200
5) Pickup from point of delivery - no minimum no maximum order sum - delivery price: 0
When i changed
if ( function_exists( 'AC' ) && ! empty($cart_prices['salesPriceCoupon'] ) ) {
to
if ( function_exists( 'AC' ) ) {
It seemed to work, orders are now confirming correctly, shipping is calculated with coupon codes taking into account, i was almost happy, but... :(
Now there is a glitch / bug i dont now how it even makes sense. \
When i clear browser cache, go to site, add goods worth 1400 - it shows me "Inside city 0" shipping method, everything is fine. Then i apply 5% coupon code that gives 70 amount of discount. Order sum becomes 1400-70=1330 - it shows me "Inside city 200", everything is fine. Now i remove coupon code from cart (it is removing with ajax, without reloading page, but even after reloading the page) - and it still shows me "Inside city 200" although order sum is back to 1400 and it must show "Inside city 0" again :( So without coupon code when i add more products so order sum becomes 1480 - it shows "Inside city 0".
I mean now it is somehow "remembering" that coupon code discount and always taking it into account even if coupon code is already removed from cart, it "remembers" that coupon code gives 5% and is taking that into account while calculating shipping methods. In other words, it needs order sum be 1400 + 5% to let me free shipping Inside city, i dont know how is it even possible, it does not make sense :(
Nevertheless, when i change code back to
if ( function_exists( 'AC' ) && ! empty($cart_prices['salesPriceCoupon'] ) ) {
it is still calculating correctly, when order sum is 1400, i add 5% discount - it shows me inside city 200, when i remove coupon code - it shows me Inside city 0, so in this case it does not "remember" the applied coupon code, calculation is good, but as i said before, order just can not be confirmed with changing price shipping method. But, for example, if i choose "Pickup from point of delivery" that does not have minimum or maximum order sum - order confirm successfully, so the issue is with changing-price shipping methods.