Jump to content

Recommended Posts

41 minutes ago, hungryfrank said:

for some reason the code didn't work but I guess fix the error reporting level.

Which PHP level

Share this post


Link to post
Share on other sites
3 minutes ago, hungryfrank said:

7.1.33

eh ???  I added   echo $page_content;  but nothing

Please read and follow the instructions. 😁

Share this post


Link to post
Share on other sites
1 hour ago, raiwa said:

 Needs adding the content module call.

I Don't get how to do this.  no idea how??what?? where??😯

I changed the lines to 

                                  'newsletter' => empty($_POST['newsletter']) ? 0 :$_POST['newsletter'] ,
                                  'order_number' => empty($_POST['order_number']) ? 0 :$_POST['order_number'] ,
                                  'order_info' => empty($_POST['order_info']) ? 0 :$_POST['order_info'] ,

and it worked.


you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites
18 minutes ago, hungryfrank said:

I Don't get how to do this.  no idea how??what?? where??😯

 

 

51 minutes ago, raiwa said:

Please read and follow the instructions. 😁

 

Share this post


Link to post
Share on other sites

one more question the customer (end user) can not remove the discount code.  

either empty out the form or putting 0 will not remove the discount. is this the correct behavior and where do I change that.


you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites
22 minutes ago, hungryfrank said:

one more question the customer (end user) can not remove the discount code.  

either empty out the form or putting 0 will not remove the discount. is this the correct behavior and where do I change that.

This has been discussed several times before and is considered O.K.

Share this post


Link to post
Share on other sites

Uploaded Version 5.2.1.

Discount Codes 5.2.1

- Fixed undefined errors in admin/discount_codes.php. Thanks to @hungryfrank
- Fixed PayPal standard support errors. Thanks to @ecartz
- Fixed Stripe support error.

 

Share this post


Link to post
Share on other sites

Hi, I installed this discount code module, everything is working as it should. But I have recently noticed a problem, we have a valid discount code setup to use as a one-time use only but we have found out that customers who pay using PayPal Pro (card payments) can use the code over and over again.

Does anyone know how I can fix this?

Thank you in advance.

Share this post


Link to post
Share on other sites
8 minutes ago, pete2007 said:

Hi, I installed this discount code module, everything is working as it should. But I have recently noticed a problem, we have a valid discount code setup to use as a one-time use only but we have found out that customers who pay using PayPal Pro (card payments) can use the code over and over again.

Does anyone know how I can fix this?

Thank you in advance.

I do not use paypal pro and can't test it. But you could try to apply similar modifications like explained in the instructions for paypal standard. Just add the same code before the e-mail confirmation.

Share this post


Link to post
Share on other sites
17 minutes ago, raiwa said:

I do not use paypal pro and can't test it. But you could try to apply similar modifications like explained in the instructions for paypal standard. Just add the same code before the e-mail confirmation.

Thank you @raiwa I'll give it a try.

Share this post


Link to post
Share on other sites

Hello,

Thanks for a great addon, seems to work well.

Can anyone help me on how to implement a small change?

I use some Quickbooks import code which complains the totals do not add up properly when the discount is greater than 2 decimal places, due to rounding errors.

Rather than change the Quickbooks import code, which would then import an invoice with slightly different totals to the website, an easier fix would be to round up or down the discount value so it doesn't go to 4 decimal places. i.e. just  down to 2 decimal places.

Where do I change the code to do this?

 

Share this post


Link to post
Share on other sites
39 minutes ago, yahalimu said:

Hello,

Thanks for a great addon, seems to work well.

Can anyone help me on how to implement a small change?

I use some Quickbooks import code which complains the totals do not add up properly when the discount is greater than 2 decimal places, due to rounding errors.

Rather than change the Quickbooks import code, which would then import an invoice with slightly different totals to the website, an easier fix would be to round up or down the discount value so it doesn't go to 4 decimal places. i.e. just  down to 2 decimal places.

Where do I change the code to do this?

 

includes/modules/order_totals/ot_discount.php line 286:

                                'value' => -$discount);

or just before the output array round the $discount variable.

Share this post


Link to post
Share on other sites

Hello,

I thnk it would still create issues if placed there as it is after all the calculations are done using the 4 decimal point version. eg. $discount_formatted may now have a different value to the rounded version.

The only time I have 4 decimals is in the percentage discount function.

I was looking to apply it only at that point. ie. where it calculates a percentage discount.

Maybe this is more complicated than I first thought.

Share this post


Link to post
Share on other sites
4 hours ago, yahalimu said:

I use some Quickbooks import code which complains the totals do not add up properly when the discount is greater than 2 decimal places, due to rounding errors.

Rather than change the Quickbooks import code, which would then import an invoice with slightly different totals to the website, an easier fix would be to round up or down the discount value so it doesn't go to 4 decimal places. i.e. just  down to 2 decimal places.

Perhaps this is just the way you've expressed it but this doesn't sound entirely logical. If the discounted lines are truncated to 2 dp then don't they add up the same as they do online? Or is the VAT coming out wrongly? QB used to have a choice of calculating VAT line by line or for the whole order (as either way is ok with HMRC) and it may be that changing that would help if it's still there.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Hello,

For example a sub-total {excl. VAT) = £932.09

Activating a 7.5% discount, OsC gives a displayed discount of £69.91. (Actual $discount value is £69.9068)

VAT is displayed in admin as £172.44 and TOTAL is displayed as £1034.63

Now, when I import the values, £932.09 - £69.9068 + £172.44= £1034.62 NOT £1034.63, a penny out, Thus Quickbooks complains they don't add up.

Using the rounded discount of £69.91 also doesn't work as its still a penny out.

IF I work it out accurately, using as many decimals as necessary,  (£932.09 - 7.5%) * 1.2 = £1034.6199. This rounds to £1034.62 but QsC says total is £1034.63

IF the discount was rounded BEFORE sending to order_total and it then works out the VAT etc all is good and it all adds up.

Now I noticed this issue also with percentage discounts in specials. If I limit all prices to 2 decimal places at all points all is good and it imports correctly, if not I have penny out errors.

Rounding errors. hard to pinpoint. As I said, no rounding errors if all values set to 2 d.p.

 

Share this post


Link to post
Share on other sites
Posted (edited)

I think this is caused by the VAT being rounded up. I could just reduce the total by a penny (which WOULD make the invoice more accurate) but an easier fix is to limit any discount value to 2d.p because anyone seriously examining the total lines below will notice its a penny out.

Just to re-iterate, this only occurs with discount values greater than 2d.p.

Screenshot.png

Edited by yahalimu

Share this post


Link to post
Share on other sites
On 4/22/2020 at 1:01 PM, raiwa said:

includes/modules/order_totals/ot_discount.php line 286:


                                'value' => -$discount);

or just before the output array round the $discount variable.

Hello, is the problem solved? please let me know about your procedure.

Share this post


Link to post
Share on other sites
Posted (edited)

how about limiting it to two decimal point  and no rounding.

a while back someone stole millions of dollars by diverting these fraction to his account, until a little old lady came in the bank looking for her money😁😂😂

Edited by hungryfrank

you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites
1 hour ago, ChristopherFisher said:

Hello, is the problem solved? please let me know about your procedure.

Hi.

I changed the $discount to round up, so it rounded it up to £61.91.

Alas £932.09 - £61.91 + £172.44 STILL comes to £1034.62 NOT £1034.63 so I still cannot import the order_total values as they do not add up.

I thought removing the extra d.p. this might change the VAT and total calculations so they add up properly but obviously not.

 

Share this post


Link to post
Share on other sites
1 hour ago, yahalimu said:

£932.09 - £61.91 + £172.44 STILL comes to £1034.62

It would - if you want them always to agree you probably need all the order total calculation outputs in osc to 2 dp not just the discount code one.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Indeed, but because I had this issue with percentage discounts before, which was easily fixed but removing the last 2 d.p. I though it might work for this issue also.

In truth, an Invoice should always add up to the total. If it doesn't I would suggest that is a bug.

 

Share this post


Link to post
Share on other sites
42 minutes ago, yahalimu said:

an Invoice should always add up to the total. If it doesn't I would suggest that is a bug

No dissent from me on that


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
Posted (edited)

Still getting many errors when using discount codes, mostly just 1pence out but this one many pence out.

The totals plainly do NOT add up to the grand total.

image.png.de1d286e3470e3a9be0475de065bb945.png

Total should be £362.96 according to the totals.

I think the VAT is calculating incorrectly as £363.06 is actually correct. (£308 - 5%)  + £9.95.... VAT should be  £60.51 which wpould then all add up to £363.06

 

Edited by yahalimu

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×