• Welcome to KonaKart Community Forum. Please login or sign up.
 

Free Shipping over $100 taking discounted price into account

Started by Cavs123, November 19, 2009, 12:01:13 am

Previous topic - Next topic

Cavs123

Hi there,

We have added free shipping on items over 100 dollors. However, when a member discount is applied to an item bringing its total price down to less than 100 dollors (e.g 120 - discount of 30) the free shipping still applies. Is this the standard functionality?

We only want free shipping if the total amount (including discount) is more than 100 dollors. I am guessing that this functionality would involve writing a custom shipping module. For that shipping module, would it actually be possible to get the total order amount including the discount?

Any ideas on whether this is possible? Is the total order amount calculated prior to the shipping module code?
thanks,
Laura

trevor


Cavs123

Hi there,

Thanks for your reply!

The free discount is added as follows.
1. There are are a list of coupons, one for each user with an id and a name.
2. A promotion is created and applied to these coupons.

So, basically, the customer chooses to checkout, enters their coupon details and gets a discount which is shown after the shipping on the checkout list
e.g.

cost 120
shipping 0
discount -50%
order total    60 

If I modify the code in the C:\Program Files\KonaKart\custom\modules\src\com\konakart\bl\modules\ordertotal\shipping.java file to get the value of the total -discount then this will work, but I'm not sure where the total- discount value is stored. Is there any way to know whether or not a discount has been applied in this case (in the code) other than checking the database?


Cavs123

I've been doing some research in the konakart file system, looking for a way to change the way free shipping is applied- so that it is applied, for us, to order-discount rather than two order amount prior to discount.

Does anyone know a) Where is the free shipping applied in the code? b)Where the conditional : Is this order value > free shipping lower limit applied?  Would this be in the konakart engine? In the orderMgr bean?

It does not seem to be applied in any of the shipping modules or in the orders total shipping module. Confusingly, the minimum order value required for free shipping is set in admin app and applied to the constant MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER in the code. But this constant is never read.

thanks,

Laura

trevor

One way of getting what you want is to add the shipping discount module after the normal discount module so that your order looks like:

cost 120
discount -50% 60
shipping 5
shipping discount 5
order total    60 

In this case the shipping module can get the current order total from order.getSubTotalExTax() and the shipping cost from order.getShippingQuote().getTotalExTax() .