WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Pay nothing for your order >>> problem: item in Dutch Media
  • Print
Pages: [1]   Go Down

Author Topic: Pay nothing for your order >>> problem: item in Dutch Media  (Read 6509 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

Logged

Offline Ruud

  • Posts: 3671
  • 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
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

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
Logged

Offline dbs

  • Betatester
  • **
  • Posts: 8915
  • 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*
Logged
https://onkel-franky.de

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
Logged

Offline dbs

  • Betatester
  • **
  • Posts: 8915
  • 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.
Logged
https://onkel-franky.de

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
Logged

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

Quote from: ronald32 on March 27, 2012, 02:15:14 PM
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
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Pay nothing for your order >>> problem: item in Dutch Media
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2