WeBid Bug Tracking - WeBid
View Issue Details
0000444WeBid[All Projects] Generalpublic2013-07-16 12:532017-07-21 10:49
itze 
 
noneminorhave not tried
newopen 
1.1.0 
1.2.1 
446
0000444: (Ver 1.1.0) Paying for multiple bought items doesn't work if user bought the same item before in a different amount
Example: A buyer buys one item from a 'buy now only' auction where an amount of i.e. 10 items is available (let's say 2,50$ each). If he then buys i.e. 3 more items from that auction and want's to pay for the 1 + 3 = 4 items, there are two positions in outstanding.php listed correctly with 1 * 2,50$ = 2,50 and 3 * 2,50$ = 7,50 Euro. When he wants to pay for the 3 items, and clicks on 'pay now' button, he will get to the pay.php page where the total amount to pay will be 2,50$ instead of 7,50$. That is because of the quantity in pay.php (case 2: //pay for an item) is always the amount of the first time the buyer bought the item. So if he had bought 2 items at first and after that 3 items, pay.php would say he had to pay 5,00$ for the 3 items instead of 7,50$.



So is there a way to read out the quantity of the second buying?



case 2: // pay for an item

  $query = "SELECT w.id, a.id AS auctid, a.title, a.shipping_cost, a.shipping_cost_additional, a.shipping, w.bid, u.paypal_email, u.authnet_id, u.authnet_pass,

                u.id As uid, u.nick, a.payment, u.worldpay_id, u.toocheckout_id, u.moneybookers_email, w.qty

                FROM " . $DBPrefix . "auctions a

                LEFT JOIN " . $DBPrefix . "winners w ON (a.id = w.auction)

                LEFT JOIN " . $DBPrefix . "users u ON (u.id = w.seller)

                WHERE a.id = " . intval($_POST['pfval']);

        $res = mysql_query($query);

        $system->check_mysql($res, $query, __LINE__, __FILE__);



        // check its real

        if (mysql_num_rows($res) < 1)

        {

            header('location: outstanding.php');

            exit;

        }



        $data = mysql_fetch_assoc($res);

        $payment = explode(', ', $data['payment']);

        $pp_paytoemail = (in_array('paypal', $payment)) ? $data['paypal_email'] : '';

        $extrastring = sprintf($MSG['778'], $data['uid'], $data['auctid'], $data['nick']);

        $an_paytoid = (in_array('authnet', $payment)) ? $data['authnet_id'] : '';

        $an_paytopass = (in_array('authnet', $payment)) ? $data['authnet_pass'] : '';

        $wp_paytoid = (in_array('worldpay', $payment)) ? $data['worldpay_id'] : '';

        $tc_paytoid = (in_array('toocheckout', $payment)) ? $data['toocheckout_id'] : '';

        $mb_paytoemail = (in_array('moneybookers', $payment)) ? $data['moneybookers_email'] : '';

        $additional_shipping = $data['additional_shipping_cost'] * ($data['qty'] - 1);

        $shipping_cost = ($shipping == 1) ? ($data['shipping_cost'] + $additional_shipping) : 0;

        $payvalue = ($data['bid'] * $data['qty']) + $shipping_cost;

        $custoncode = $data['id'] . 'WEBID2';

        $message = sprintf($MSG['581'], $system->print_money($payvalue));

        $title = $system->SETTINGS['sitename'] . ' - ' . $data['title'];

       



          

break;





the line



$extrastring = sprintf($MSG['778'], $data['uid'], $data['auctid'], $data['nick']);




was changed and is not the same as in the downloaded package



How can we get the correct data from the database? I can read the php code a littel bit but don't know hot to deal with databases. I already read http://www.webidsupport.com/forums/showthread.php?6399-Multiple-Buy-It-Now-Purchase-Charge-Fixed-%28Outstanding-and-Pay-PHP%29&highlight=multiple+items" [^" title="]another thread">]another thread where there was a solution, but i couldn't apply it becuase my pay.php (Version 1.1.0) seems to differ from the example that was given in that thread. May it's a customized or an older Version there. Does anybody have a fix for Ver 1.1.0 or can give an instruction how to modify the changes in the other thread to fit for Ver 1.1.0?



Thank you in advance!
No tags attached.
Issue History
2015-04-01 13:17renlokNew Issue
2015-04-01 13:17renlokimport_id => 446
2015-04-01 13:17renlokDate Submitted2015-04-01 13:17 => 2013-07-16 12:53
2015-04-01 13:17renlokLast Update2015-04-01 13:17 => 2013-09-27 21:15
2016-04-24 14:16renlokTarget Version => 1.2.0
2016-07-19 08:12renlokPriority@0@ => none
2016-07-19 08:12renlokTarget Version1.2.0 => 1.2.1
2016-07-19 08:12renlokDescription Updatedbug_revision_view_page.php?rev_id=35#r35

Notes
(0001117)
pani100   
2013-07-16 18:21   
(edited on: 1970-01-01 00:00)
Hi itze,
 multi buy now only has major problems. It looks like it was designed only for Dutch auction. At some point it got enabled for the standard auction, but to get it to work correctly it is going to take a major re-write of code. That being said, now we have the invoice system in progress we at least have a way of pulling the correct value for the correct sale, where before all item sales had the same id. I think Renlok will be needed as a few more files need altering to close the sale, ratings etc.
(0001126)
itze   
2013-07-18 12:44   
(edited on: 1970-01-01 00:00)
pani100 wrote

Hi itze,
 multi buy now only has major problems. It looks like it was designed only for Dutch auction. At some point it got enabled for the standard auction, but to get it to work correctly it is going to take a major re-write of code. That being said, now we have the invoice system in progress we at least have a way of pulling the correct value for the correct sale, where before all item sales had the same id. I think Renlok will be needed as a few more files need altering to close the sale, ratings etc.


Thank you for your answer!

I figured out that also the final price fee is only calculated for one article, independet from the amount of items the buyer bought. Let's say the buy now price was 10$ and the fee is 10% and a buyer buys 10 items, then the final price fee will be 1$ (should be 10$). If the buyer buys 5 items the final price fee will also be 1$ (should be 5$).
(0001164)
Susan Skinner   
2013-09-24 03:23   
(edited on: 1970-01-01 00:00)
Is there any update on a resolution for this issue?

Itze, the post that you link to does not claim to fix the issue when the same user buys the more than once on a multi-quantity listing. It only claims to fix issues related to multiple buyers buying from a multi-quantity listing.
(0001165)
itze   
2013-09-24 16:27   
(edited on: 1970-01-01 00:00)
I'm also still waiting for a fix... For me it is the most urgent issue with webid.
(0001166)
Susan Skinner   
2013-09-27 01:31   
(edited on: 1970-01-01 00:00)
I think I'm close to finding a solution but need some help with the last little bit. I tweaked the code changes found here http://www.webidsupport.com/forums/showthread.php?6399-Multiple-Buy-It-Now-Purchase-Charge-Fixed-(Outstanding-and-Pay-PHP)&highlight=sort" [^" title="]]http://www.webidsupport.com/forums/showthread.php?6399-Multiple-Buy-It-Now-Purchase-Charge-Fixed-(Outstanding-and-Pay-PHP)&highlight=sort[/URL] [^] to work with my version of 1.1.0.

As stated in the post that I've linked to this fixes the amount billed to users with unique ID's, but if the same user buys from the same auction twice they will always get charged the amount of the first time they bought.

I believe the answer is to modify sell.php for Case 2 around line 46 such that the WHERE statement looks for unpaid auctions that have a unique user ID, and a unique winning ID (ID column of the webid_winners table in the MySQL database). What is the PHP code to pull the winning ID?

This is an example of what I tried, but I know I got the database call wrong for w.id.

[PHP] case 2: // pay for an item
        $query = "SELECT w.id, a.id AS auctid, a.title, a.shipping_cost, a.shipping_cost_additional, a.shipping, w.bid, u.paypal_email, u.authnet_id, u.authnet_pass,
                u.id As uid, u.nick, a.payment, u.worldpay_id, u.toocheckout_id, u.moneybookers_email, w.qty
                FROM " . $DBPrefix . "auctions a
                LEFT JOIN " . $DBPrefix . "winners w ON (a.id = w.auction)
                LEFT JOIN " . $DBPrefix . "users u ON (u.id = w.seller)
                WHERE w.paid = 0 AND w.winner = " . $user->user_data['id'] . " AND w.id = " . $winner->winner_data['id'] . " AND
                 a.id = " . intval($_POST['pfval']);[/PHP]
(0001167)
itze   
2013-09-27 08:46   
(edited on: 1970-01-01 00:00)
I would really love to have a solution for that! Please keep going!
My solution for the problem so far: deactivate the buy now feature.... :-(
(0001168)
pani100   
2013-09-27 21:15   
(edited on: 2013-09-27 21:16)
I have been wanting this for so long too.
I will try and backtrack and see what changes are in the new version and old version and what modifications we have done to get the sales showing correctly in the pay page. We should open a new thread: Adding multi-buy in buy-now-only auctions.
This will include sorting the auctions, database changes, and finalizing the closing of the auction looking into the rating system too as that will be affected too. Its not going to be an easy ride (alway hated cron.php!)