Coupons

Posted By Supermac Tue 10 May 2016
Add to Favorites0
Author Message
Supermac
 Posted Thu 19 May 2016
Supreme Being

Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)

Group: Forum Members
Last Active: Wed 22 Jul 2020
Posts: 153, Visits: 874
Hmmm now after above modifications coupon is applied correctly (inc/extax) but I still got some problem in BasketView about functioning of coupons.

This is my cart with coupon applied:
http://forum.kartris.com/Uploads/Images/d265b9a8-3d42-40f8-b9ab-ec61.PNG
It correctly counts the value of coupon and subtract it from total order amount... but it strangely creates two rows in cart view, one for the promotion (with discount applied) and one for the coupon (with 0 import).

When I delete the coupon clicking on the bin icon I obtain this situation:
http://forum.kartris.com/Uploads/Images/842568e5-74ee-4bb2-a0d7-c403.PNG

It removes the row of coupon (the one with 0 import) but it doesn't remove the promotion row and it doesn't update cart's total.
If I reload the page by browser I see the correct situation with coupon/promotion removed and total amount correct, but I can't say if it is a refreh problem or a basketview layout/codebehind problem...
Thu 19 May 2016 by Supermac
Supermac
 Posted Thu 19 May 2016
Supreme Being

Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)

Group: Forum Members
Last Active: Wed 22 Jul 2020
Posts: 153, Visits: 874
Thank you Tiggywinkler for your patience.
I verified, inctax/extax have correctly negative value but maybe we got it: I think the following code in BasketBLL.CalculatePromotions() is wrong.

Case "a" 'Total spend promotion
If GetKartConfig("general.tax.pricesinctax") = "y" Then
numTotalBasketAmount = TotalIncTax
vQuantity = CInt(TotalIncTax / vSpend)
Else
vQuantity = CInt(TotalExTax / vSpend)
End If

'If total in basket (inc or ex, depending on settings)
'is more than the vSpend required, Qty will be above zero
vQuantity = CInt(numTotalBasketAmount / vSpend)

.....and should be changed as following:

Case "a" 'Total spend promotion
If GetKartConfig("general.tax.pricesinctax") = "y" Then
numTotalBasketAmount = TotalIncTax
Else
numTotalBasketAmount = TotalExTax
End If

'If total in basket (inc or ex, depending on settings)
'is more than the vSpend required, Qty will be above zero
vQuantity = CInt(numTotalBasketAmount / vSpend)


What do you think?
In the original version it works only when general.tax.pricesinctax is set to "y" (I got it set to "n" and I have the troubles I described)
bug
Thu 19 May 2016 by Supermac
Tiggywiggler
 Posted Wed 18 May 2016
Supreme Being

Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)

Group: Forum Members
Last Active: Mon 6 Dec 2021
Posts: 235, Visits: 750
The coupon being rejected is normal behaviour. The coupon is false because the coupon is just used to apply the promotion. The code you are looking for is in BasketBLL.CalculatePromotions() and the real work begins on line 2117 in version 2.9003.

The start of the code block looks like this:

If InStr(strPromoIDs, vPromoID) = 0 Then
vPromoID = drSpend("PROM_ID")
For Each drSpend As DataRow In drwSpends
drwSpends = tblPromotions.Select(strList)
strList = "PP_PartNo='a' and PP_ItemType='a'"
Dim vSpend As Double'get spend value from basket

There are multiple accesses of the back end. I would assume that even though you have your own database connection method it should still work okay, however, it may be work stepping through the code to ensure everything is being read okay.

you want to ensure that by the time you get to row 2292 that the variables vIncTax or vExcTax have a negative value in them (e.g. vIncTax = -9.99)


We are always willing to help out the community or pitch in to help you fix a problem. However, if you want a complete solution made such as a code module or new feature added you have two options. Either
1) Reach out to the Kartris internal development team at http://www.kartris.com/Contact.aspx.
2) Contact one of the Kartris approved partners at http://www.kartris.com/t-Worldwide-Developers.aspx.

Have fun and good luck coding.
Supermac
 Posted Wed 18 May 2016
Supreme Being

Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)

Group: Forum Members
Last Active: Wed 22 Jul 2020
Posts: 153, Visits: 874
It seems that discounttype= 't' result in coupon considered as dodgy and ignored by CalculateCoupon sub
Supermac
 Posted Wed 18 May 2016
Supreme Being

Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)

Group: Forum Members
Last Active: Wed 22 Jul 2020
Posts: 153, Visits: 874
This is the couponsdatatable that BasketBLL.GetCouponDiscount builds when called...



Image is small however it shows discountvalue=1 and discounttype= 't'
Wed 18 May 2016 by Supermac
Supermac
 Posted Wed 18 May 2016
Supreme Being

Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)

Group: Forum Members
Last Active: Wed 22 Jul 2020
Posts: 153, Visits: 874
Start and end dates of coupon are the same of the promotion.
The following is not the coupon of previous order (I used it and cannot re-open) but it's identical to that one
http://forum.kartris.com/Uploads/Images/586a83c5-af92-470c-bcfc-b3f9.PNG
Supermac
 Posted Wed 18 May 2016
Supreme Being

Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)

Group: Forum Members
Last Active: Wed 22 Jul 2020
Posts: 153, Visits: 874
I'm running 2.8004

This is the promotion I created
http://forum.kartris.com/Uploads/Images/28a1a994-ef45-4cf0-b0b8-c03c.PNG

This is the result when I insert the coupon code in cart:
http://forum.kartris.com/Uploads/Images/5e19f075-d893-430d-afe7-e143.PNG

And this is the result when order is submitted:

http://forum.kartris.com/Uploads/Images/4a40b8fc-8224-4e76-a274-d3d0.PNG

Consider (but I think this shouldn't be related to the issue) that I customized kartris in a way that now prices of items are not stored in Kartris db with produtc's versions but are read on-the-fly from an external db...
Wed 18 May 2016 by Supermac
Tiggywiggler
 Posted Tue 17 May 2016
Supreme Being

Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)Supreme Being - (123,986 reputation)

Group: Forum Members
Last Active: Mon 6 Dec 2021
Posts: 235, Visits: 750
It will probably be calculated in BasketBLL somewhere (I would need to follow it through, by the nature of being open source several people contribute to the project), however, it is important to me that we can reproduce this fault so that I can see it as well as I would like to remove this issue if possible.

http://forum.kartris.com/Uploads/Images/970f9046-585e-4f2f-aa3f-6a90.png

As you can see from the image above, when I do it everything works fine. Can you show the result you get when you do it? Where is the coupon on the display?

Which version are you running?


We are always willing to help out the community or pitch in to help you fix a problem. However, if you want a complete solution made such as a code module or new feature added you have two options. Either
1) Reach out to the Kartris internal development team at http://www.kartris.com/Contact.aspx.
2) Contact one of the Kartris approved partners at http://www.kartris.com/t-Worldwide-Developers.aspx.

Have fun and good luck coding.
Supermac
 Posted Tue 17 May 2016
Supreme Being

Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)

Group: Forum Members
Last Active: Wed 22 Jul 2020
Posts: 153, Visits: 874
Note that normal coupon amount (by value or by %) are calculated correctly in cart, only the promotion linked coupon has this problem... may you indicate me the code portion where this type of coupon's amount is calculated?
Supermac
 Posted Tue 17 May 2016
Supreme Being

Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)Supreme Being - (84,749 reputation)

Group: Forum Members
Last Active: Wed 22 Jul 2020
Posts: 153, Visits: 874
I tried doing again a promo and then a coupon as suggested but I confirm the coupon's import -when used in cart- results alway 0.
Tue 17 May 2016 by Supermac

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top