Author |
Topic |
|
Ronnie
VP-CART New User
Australia
52 Posts |
Posted - May 17 2005 : 04:05:26
|
Hi folks We sell cheap items with a discount on the number sold. VPASP works excellently for discounts of more than $1 per item but below this the system uses a percentage discount. When it uses the discount per item to work out the total for that product, there is a rounding of up to 5 cents per item. Obviously this is not good enough to show customers. Anybody got a workaround that still allows the stock control to work. Thanks
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - May 17 2005 : 04:58:14
|
if the discount is less than 1, then it assumes that the discount is a percentage rather than a fixed amount.
eg a discount of "2" will be a $2 discount a discount of "0.5" will be a 50% discount
so, to get round that problem, if it's less than $1, change it to use a corresponding pct discount rather than a fixed amount discount
eg if your product costs $5 and you want to discount it by $0.50, then use a discount of 0.1 to discount it by 10%
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
|
|
Ronnie
VP-CART New User
Australia
52 Posts |
Posted - May 18 2005 : 04:48:34
|
HI Thanks Simon but I know that. It's what I said in my post. My problem is that when using a percentage discount that's very small, it gives me rounding errors when my customers buy a number of the products. i.e the discount is only .00354768 % but when vpasp applies this to the produc and multiplies the price say 15 times, the total will be 5 cents away from the actual price. The problem is we're setting the discount up on a total basis i.e I sell 1 x product for $5.95 buy you can buy 6 for 35.00 and work back the discount from there. Here's an example I sell 1 for $9.60 and 6 for $56.00 i.e discount per item of 0.027777777777777700000000000000 With the rounding vpasp calculates it as $55.98.
See what I mean. Thanks if you can shed any light on this
|
|
|
greatphoto
VP-CART Super User
USA
304 Posts |
Posted - May 21 2005 : 22:12:04
|
Hi Ronnie-
If you are confident that you never want to use the percent feature and just want it to always use a dollar (or cent amount if less than 1 dollar) discount amount, then you could disable the percent feature in the ASP code. It should be a pretty straight-forward mod to the ASP code. I could point you in the right direction for where this code is located as could others on the forum.
If you post this question to support (here: http://www.vpasp.com/virtprog/helpdesk) then they will likely tell you which code to change. In fact, it makes sense for you to contact them directly so they'll know that the feature operation isn't ideal for everyone.
|
|
|
|
Topic |
|