Author Topic: Pay nothing for your order >>> problem: item in Dutch Media  (Read 2824 times)

Offline ronald32

  • Posts: 28
  • Gender: Male
    • Uitwaaien op Ameland
Pay nothing for your order >>> problem: item in Dutch Media
« on: March 25, 2012, 12:38:10 PM »
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


Offline Ruud

  • Posts: 3660
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Pay nothing for your order >>> problem: item in Dutch Media
« Reply #1 on: March 25, 2012, 11:51:34 PM »
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) [Select]
if ($quantity < 0) $quantity = 0;
Ruud

Offline ronald32

  • Posts: 28
  • Gender: Male
    • Uitwaaien op Ameland
Re: Pay nothing for your order >>> problem: item in Dutch Media
« Reply #2 on: March 26, 2012, 09:03:44 AM »
Great, it works!
Thanks

Ronald

Offline dbs

  • Betatester
  • **
  • Posts: 8343
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Pay nothing for your order >>> problem: item in Dutch Media
« Reply #3 on: March 26, 2012, 07:58:12 PM »
thanks ruud!

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

freeSbee

  • Guest
Re: Pay nothing for your order >>> problem: item in Dutch Media
« Reply #4 on: March 26, 2012, 08:25:31 PM »
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: [Select]
$quantity =strip_tags($quantity);and replace it by
Code: [Select]
$quantity = abs(strip_tags($quantity));
Regards Christoph

Offline dbs

  • Betatester
  • **
  • Posts: 8343
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Pay nothing for your order >>> problem: item in Dutch Media
« Reply #5 on: March 27, 2012, 08:06:48 AM »
yepp, a better solution.

Offline ronald32

  • Posts: 28
  • Gender: Male
    • Uitwaaien op Ameland
Re: Pay nothing for your order >>> problem: item in Dutch Media
« Reply #6 on: March 27, 2012, 02:15:14 PM »
And the line: if ($quantity < 0) $quantity = 0; (suggestion from Ruud)
Should must that be erased?

Ronald

freeSbee

  • Guest
Re: Pay nothing for your order >>> problem: item in Dutch Media
« Reply #7 on: March 28, 2012, 09:04:39 AM »
Hi Ronald

And the line: if ($quantity < 0) $quantity = 0; (suggestion from Ruud)
Should must that be erased?

Yes, either
Code: [Select]
if ($quantity < 0) $quantity = 0;or
Code: [Select]
$quantity = abs(strip_tags($quantity));
Regards Christoph

 

postern-length