WebsiteBaker Support (2.8.x) > Bakery Shop

Pay nothing for your order >>> problem: item in Dutch Media

(1/2) > >>

ronald32:
today in the Dutch media:
http://www.melf.nl/algemeen/9393/cda-blameert-zich-met-webshop-andere-partijen-ook-vatbaar/

The problem:
order some products en change the number of items in a negative number.
order some other products of the same amount. And you wil pay nothing (except from the handling costs)
The "positive" number - the "negative" number = 0
This problem seems also to occur in Bakery...

It would be nice if this can be solved

Tested in version: 1.59

greetings
Ronald

Ruud:
I can confirm that putting a negative amount in the overview (and refresh the cart) can lower the amount to pay, or even set it negative.
A check on view.php after line 315 on negative values should be good to prevent this.

A quickfix would be to put on line 316

--- Code: (untested) ---if ($quantity < 0) $quantity = 0;
--- End code ---

Ruud

ronald32:
Great, it works!
Thanks

Ronald

dbs:
thanks ruud!

but it is/was not really a problem for the shop-owner.
only more emails to write. *g*

freeSbee:
Hi Ronald

Thank you for giving this hint.

Another fix than suggested by Ruud - thanks Ruud for the quick fix! - would be to use the php function abs(). This way the quantity is retained and the item in cart will not be deleted, in other words it will remain in cart.

Search line 315 in view.php

--- Code: ---$quantity =strip_tags($quantity);
--- End code ---
and replace it by

--- Code: ---$quantity = abs(strip_tags($quantity));
--- End code ---

Regards Christoph

Navigation

[0] Message Index

[#] Next page

Go to full version