Login
Register

VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

Forum

IMPORTANT ANNOUNCEMENT: Plugin development ceased, all plugins made available freely (GPL)

With great sadness we have to announce that we are ceasing development of all our VirtueMart, WooCommerce and Joomla plugins. Effective immediately, all our plugins -- even those that were paid downloads -- are made available for free from our homepage (GPL license still applies), but we cannot and will not provide any support anymore.

It has been a great pleasure to be part of the thriving development communities of VirtueMart as well as WooCommerce. However, during the last year it became painstakingly clear that in addition to a full-time job, a young family and several other time-consuming hobbies at professional level (like being a professional singer) the plugin development and the support that it requires is not sustainable and is taking its toll. It has been an honor, but it is now time to say good bye!

×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Shipping Rule when product discount applied 22 Sep 2014 11:47 #1

  • totallybeads
  • totallybeads's Avatar Topic Author
Hi

we are having an issue where we offer FREE shipping for orders of £30 or more. we use AWO coupon to issue discounts for customers buying multiple products.

this is the code i am using at the moment
Name=1st Class; 0<=Amount<9.99; Shipping=1.99
Name=1st Class; 9.99<=Amount<29.99; Shipping=1.99
Name=FREE Delivery; 29.99<=Amount<49.99; Shipping=0
Name=FREE Delivery; 49.99<=Amount<9999; Shipping=0

however this does not take into account when the coupon has been applied to the order, so if the order amount falls below £30 to say £29 and a coupon has been used the system still gives FREE shipping at it is using the price before coupon is applied.

i have tried using

amountWithoutTax
priceWithoutTax
basePrice
basePriceWithTax
discountedPriceWithoutTax
taxAmount
salesPriceWithDiscount
discountAmount

but these do not help fix the issue

we are using advance shipping rules, please help.

Shipping Rule when product discount applied 07 Oct 2014 16:18 #2

  • totallybeads
  • totallybeads's Avatar Topic Author
Hi

I am still waiting to hear how the shipping rule can be adjusted to stop a coupon from being applied to an order after shipping has been calculated

Shipping Rule when product discount applied 08 Oct 2014 12:43 #3

  • totallybeads
  • totallybeads's Avatar Topic Author
ok done some more digging around myself and using the DEBUG rules have found that advance shipping is not looking at the value of the cart after ANY coupons has been applied

none of the price and total variables show the cart total after a coupon has been applied to the basket

there is NOT even a variable showing the coupon amount that i could then do a calculation on myself.

I would really like to know if i am missing something or does the module not work with COUPONS

PS i am using the very popular AWO Coupon plugin and VP One Page Checkout.

here are the results from the debug when the cart total is £26.10 after a coupons has been applied, the 26.10 does not appear anywhere

[amount] => 29.99964
[amountwithtax] => 29.99964
[amountwithouttax] => 24.9997
[baseprice] => 24.9997
[basepricewithtax] => 29.99964
[discountedpricewithouttax] => 24.9997
[salesprice] => 29.99964
[taxamount] => 4.99994
[salespricewithdiscount] => 0
[discountamount] => 0
[pricewithouttax] => 24.9997

Shipping Rule when product discount applied 10 Oct 2014 21:07 #4

Dear totallybeads,
Thank you for your investigations. I also did some more digging.
Your observation is correct: Currently the coupon discount given by awocoupon is NOT available to the shipping plugin's rules. The built-in discounts of VM are, though.

The reason for this is purely a technical one: VM's core function that calculates all prices in the cart first calculates the shipping costs and only after that calls the coupon plugins to get the coupon discount:
// Avalara wants to calculate the tax of the shipment. Only disadvantage
// to set shipping here is that the discounts per bill respectivly the tax per bill
// is not considered.
$this->calculateShipmentPrice($cart, $checkAutomaticSelected);

// next step is handling a coupon, if given
$this->_cartData['vmVat'] = TRUE;
$this->_cartPrices['salesPriceCoupon'] = 0.0;
if (!empty($cart->couponCode)) {
	$this->couponHandler($cart->couponCode);
}

This means that when VM calls my shipping plugin to calculate the shipping costs for the order, the coupon has not yet been handled and thus the coupon discount has not been calculated yet.

Sorry for this.
Reinhold

Shipping Rule when product discount applied 13 Dec 2015 19:09 #5

We have now created a first version of the awocoupon varaibles extension for the shipping by rules plugin:
open-tools.net/virtuemart/advanced-shipp...ipping-by-rules.html

That plugin (after installing and enabling it in the Joomla config) will make a number of variables available to the shipping by rules plugin, that include the AwoCoupon discounts. See the link above for a list of variables and their descriptions.

Note that for technical reasons, the first page load after a coupon is added or changed will NOT have the correct discounts (because AwoCoupon is called after the shipping methods, so the the first evaluation of the shipping methods after coupon changes will still get the old coupon values).

Best regards,
Reinhold

PS: I am aware that this is an old post, but I am posting this here nonetheless, because this forum is also searched by others who have the same issue.
  • Page:
  • 1