MrDerp Posted November 5, 2012 Share Posted November 5, 2012 Is anyone else having problems with discount values being incorrectly displayed on basket/checkout pages, as well as on order confirmation emails and the admin panel? It has been accepted that 5.1.4 had a very buggy coupon system which appears to have been fixed in 5.1.5. However, in both versions the actual total discounted value is inaccurate, despite the grand total being correct. If you look at the attached screenshot you can see that there are VAT display inconsistencies (the developers have said that they may rewrite the VAT module for 5.2.0) but the biggest issue is the "Total Discount" value. The "Grand Total" in this instance is correct, but - unless I have the mathematical ability of a 2 year old - £100 minus £4.17 does not equal £90. For anyone using the coupon system, how are you getting around this problem? The developers don't see this as an urgent issue, so can anyone advise how to deal with this in the meantime? To compound this problem, I have also noticed that when an order goes from a "pending" to "processing" state, the discounted value is recalculated...once again, incorrectly. Was this system even tested? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted November 5, 2012 Share Posted November 5, 2012 So are you using 5.1.5 now? If so, your feedback on this thread would be appreciated. Also, please create your sig, as it's very helpful to those with the knowledge to help solve issues. Quote Link to comment Share on other sites More sharing options...
Guest Pantaleone Posted November 7, 2012 Share Posted November 7, 2012 I'm having the same problem. This needs looking at urgently. Quote Link to comment Share on other sites More sharing options...
MrDerp Posted November 7, 2012 Author Share Posted November 7, 2012 The frustrating thing is that there is probably a really simple fix - the correct discount value is being used in the background as the grand total is correct, so how do we get this to display in the template file? Anybody with a bit of technical expertise have any ideas? Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 7, 2012 Share Posted November 7, 2012 MrDerp, please mention the name of the skin in your sig, although discussing any problems that it may be contributing will be over at the other forum. You may also be assuming that everyone here has a complete understanding of your tax laws - that would be wrong. Would you please give us a clue as to how a subtotal of 75 comes from 100. Please mention if your tax laws require taxes be included in displayed prices. How is VAT calculated? What is the 10% figure? Is that the coupon? Please mention what aspects of the order the 10% applies to: only one of the two items?, the subtotal?, including/excluding VAT? Quote Link to comment Share on other sites More sharing options...
MrDerp Posted November 8, 2012 Author Share Posted November 8, 2012 I've updated my signature as requested. I'm UK-based and therefore we attract a standard VAT rate of 20%. Not all of our products attract VAT (we act as an agent on behalf of the artists for our original works) but the product shown in the screenshot does attract VAT at the aforementioned rate. That's the thing - shouldn't this system make it clear where that subtotal comes from? Anyone that looks at the checkout/receipt screens should instantly be able to grasp how the calculations have been derived. The subtotal of £75 comes from a total price of £100, minus the 10% discount, minus VAT (100 - 10 - 15). This isn't as issue specific to any one skin - it is an issue related to the fact the classes don't offer enough variables. For example, there doesn't seem to be an option (without customising the classes) to display a line price inc. VAT AND exc. VAT. Back to the discounts, again, the classes don't offer up a discount price inc. VAT and exc. VAT. Nor do they multiply the discount by the quantity of the products purchased, which is extremely frustrating and looks plain unprofessional (hence my frustration at the lack of testing). Quote Link to comment Share on other sites More sharing options...
Toucan Web Design Posted November 8, 2012 Share Posted November 8, 2012 (edited) That's quite odd, I've had a run through the 5.1.5 code and as far as I can tell, it should be printing out the discount correctly. The only thing I can find which might be a discrepancy is on cubecart.class.php, line 1330, where it grabs the basket $contents = $GLOBALS['cart']->get(); That function there recalculates the grand totals and discounts.. however, the discount actually being printed out references: $this->_basket['discount'], which has not been updated. I suspect that $this->_basket is getting populated somewhere higher up, with the correct initial values, then the cart->get function is being called multiple times, and it's further diluting the discount somehow.. the discounts also seem to get called cumulatively, which is also a bit confusing.. far as I can tell, the first time it runs it'll run off £100 subtotal. The next it will run off £100 - £10 discount and calculate the discount as £9, then add that onto the discount level (making it then £19) .. which is fine in theory, and explains why some of the values might be different from some of the others.. .. except I haven't got a clue how it's managed to end up at £4.17 .. if anything it should be going up, not down Edit: .. no it isn't, got myself confused didn't I.. if anything, if $this->_basket is being correctly calculated earlier, the discount should be correct also, if anything it's the subtotals and grand total that should be wrong.. sadly I've got no idea other than printing out a lot of debugging info and trying to track it down that way Edited November 8, 2012 by Toucan Web Design Quote Link to comment Share on other sites More sharing options...
MrDerp Posted November 8, 2012 Author Share Posted November 8, 2012 Many thanks for taking the time to look at the code - it's much appreciated. I can contact the support team again but they were reluctant to look at this until the release of 5.2.0, so I'm a bit stuck really! What surprises me more than anything is that more people haven't come across this problem, which I'm guessing is a combination of not many people running CC 5 and a large percentage of those not using coupons (or people not noticing as their systems haven't been tested since upgrading). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.