Page 1 of 1

Listing items with start price > 1000

Posted: Thu Nov 30, 2017 5:03 pm
by RWAP
There is a bug in class\Fee.php which means if you list an item with a start price of over 1000, you never get charged any fees - they are simply not added to the frozen fee table.

In Class\Fee.php, find:

Code: Select all

            $sql = 'insert into '.self::FEES_USERS_TABLE.'
                    (feeId, userId, `date`, amount, offerId, comment)
                    values
                    ("'.$this->_action.'", "'.$user->id.'", "'.$date.'", '.number_format(-$tempBalance, 2).',
                    '.($offerId && $offerId!='' ? $offerId : 'null').', "'.$comment.'")';
Change this to:

Code: Select all

            $sql = 'insert into '.self::FEES_USERS_TABLE.'
                    (feeId, userId, `date`, amount, offerId, comment)
                    values
                    ("'.$this->_action.'", "'.$user->id.'", "'.$date.'", '.-$tempBalance.',
                    '.($offerId && $offerId!='' ? $offerId : 'null').', "'.$comment.'")';
Find:

Code: Select all

            $sql = 'insert into '.self::FROZEN_TABLE.'
                    (feeId, userId, baseValue, offerId, comment)
                    values
                    ("'.$this->_action.'", "'.$user->id.'", '.number_format($base, 2).',
                    '.($offerId ? $offerId : 'null').', "'.$comment.'")';
Change this to:

Code: Select all

            $sql = 'insert into '.self::FROZEN_TABLE.'
                    (feeId, userId, baseValue, offerId, comment)
                    values
                    ("'.$this->_action.'", "'.$user->id.'", '.$base.',
                    '.($offerId ? $offerId : 'null').', "'.$comment.'")';
The number_format was adding in an extra comma which was throwing the SQL call !