Coupon Order Total (Ship + Tax)
Coupon Order Total (Ship + Tax)
Is there a way to make a coupon calculate the minimum value including shipping + tax costs?
EDIT
If requirement for coupon is 25<
Order is 20, Shipping 4, tax 2, coupon valid.
Or any other random calculation in which the order doesn't meet the minimum requirement without the addition of shipping and tax, but does when S+T is added.
This solution from Mazhar sounded like it was what I was looking for, but I applied this and am still having an issue:
viewtopic.php?f=42&t=12878&start=0&hili ... x+shipping
EDIT
If requirement for coupon is 25<
Order is 20, Shipping 4, tax 2, coupon valid.
Or any other random calculation in which the order doesn't meet the minimum requirement without the addition of shipping and tax, but does when S+T is added.
This solution from Mazhar sounded like it was what I was looking for, but I applied this and am still having an issue:
viewtopic.php?f=42&t=12878&start=0&hili ... x+shipping
Re: Coupon Order Total (Ship + Tax)
Can you explain the issue you are facing after applying the mod.
Re: Coupon Order Total (Ship + Tax)
My coupon has a 25$ minimum
Right now my order total is $21.54, so obviously I can't use the coupon. However when I select a shipping method, my order summary naturally recalculates.
My order is now $21.54 + $7.89 = $29.43
However when I try to use the coupon, it still gives me the error: "The coupon code you've entered requires a minimum purchase of $25.00."
I didn't really see anything change once I applied the mod. Just still not functioning the way I was looking for.
Right now my order total is $21.54, so obviously I can't use the coupon. However when I select a shipping method, my order summary naturally recalculates.
My order is now $21.54 + $7.89 = $29.43
However when I try to use the coupon, it still gives me the error: "The coupon code you've entered requires a minimum purchase of $25.00."
I didn't really see anything change once I applied the mod. Just still not functioning the way I was looking for.
Re: Coupon Order Total (Ship + Tax)
Clarification on my last post, when I choose a shipping method, the price updates in the "Order Summary", but not in the actual Order Contents.
Could this be because the shipping method is not added to the basket line items until the order is complete? So even with the mod, the shipping isn't a part of the basket calculation?
Coupon is a fixed ORDER discount with a "Min Purchase" of 25.00. Valid for any product and All Groups.
Could this be because the shipping method is not added to the basket line items until the order is complete? So even with the mod, the shipping isn't a part of the basket calculation?
Coupon is a fixed ORDER discount with a "Min Purchase" of 25.00. Valid for any product and All Groups.
Re: Coupon Order Total (Ship + Tax)
Make a small change in the code of mod and locate
and update it as below
Now again test it and see if it cares for shipping charges as well or not.
Code: Select all
OrderItemType[] orderItemTypes = new OrderItemType[1]{OrderItemType.Product};
Code: Select all
OrderItemType[] orderItemTypes = new OrderItemType[1]{OrderItemType.Product,OrderItemType.Shipping};
Re: Coupon Order Total (Ship + Tax)
Here's the code I'm using now:
So far it's still not adding the shipping cost when calculating against the coupon.
Code: Select all
bool isValidCoupon = false;
isValidCoupon = CouponCalculator.IsCouponValid(Token.Instance.User.Basket, coupon, out couponValidityMessage);
if (Token.Instance.User.Basket.Shipments.Count > 1 && couponValidityMessage.StartsWith("The coupon code you've entered requires a minimum purchase of "))
{
OrderItemType[] orderItemTypes = new OrderItemType[1] { OrderItemType.Product, OrderItemType.Shipping };
isValidCoupon = Token.Instance.User.Basket.Items.TotalPrice(orderItemTypes) > coupon.MinPurchase;
}
if (isValidCoupon)
Re: Coupon Order Total (Ship + Tax)
I guess you made this change in PaymentPage.ascx.cs file. Did you made same change in ConLIb/CouponDialog.ascx.cs file. If not give a try and update this file as well.
Re: Coupon Order Total (Ship + Tax)
Not sure if I'm doing this right in CouponDialog.ascx.cs, I'm cookie cutting here with minimal understanding of the code so correct me if I'm wrong:
I changed
to
And I'm getting this error:
error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
I changed
Code: Select all
if (CouponCalculator.IsCouponValid(Token.Instance.User.Basket, coupon, out couponValidityMessage))
Code: Select all
bool isValidCoupon = false;
isValidCoupon = CouponCalculator.IsCouponValid(Token.Instance.User.Basket, coupon, out couponValidityMessage);
if (Token.Instance.User.Basket.Shipments.Count > 1 && couponValidityMessage.StartsWith("The coupon code you've entered requires a minimum purchase of "))
{
OrderItemType[] orderItemTypes = new OrderItemType[1] { OrderItemType.Product, OrderItemType.Shipping };
isValidCoupon = Token.Instance.User.Basket.Items.TotalPrice(orderItemTypes) > coupon.MinPurchase;
}
if (isValidCoupon)
error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement