WeBid Bug Tracking

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000465WeBid[All Projects] Generalpublic2014-06-02 19:372015-02-08 13:49
Reporterjjjason84 
Assigned To 
Priority@0@SeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version1.1.1 
Target VersionFixed in Version1.1.2 
Summary0000465: Paying for multiple items (FIX)
DescriptionI found how to fix the buying multiple items problem that people been having with webid when they by multiple items that are waiting for a payment and when the person click on the pay button and has multiple items it will show the incorrect total because it is pulling the wrong item data from the winners table it is getting the first item that is waiting for a payment from the winners table that the winner has to pay. Because it is looking in the winners table for the auctions id and it should be looking for the id of the id column in the winners table.



Example:

I bought 3 items from the same auction and each item total is $3.50



I click on the pay button for the 2nd item and it will get the first item that comes up for payment that is not the correct item i am paying for because all 3 items have the same auction id.



So to fix this problem we need to change it from looking for the auction id in the winner table to the id column to pull the correct info.



This is a easy fix.



Open the buy_now.php page



Find this code

[PHP]$template->assign_vars(array(

        'ERROR' => (isset($ERR)) ? $ERR : '',[/PHP]



Add before it

[PHP]$query = "SELECT LAST_INSERT_ID() as id";

                $res = mysql_query($query);

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

                $winner_id = mysql_result($res, 0, 'id');[/PHP]



Find this code

[PHP]$template->assign_vars(array(

        'ERROR' => (isset($ERR)) ? $ERR : '',[/PHP]



Add after it

[PHP]'WINID' => $winner_id,[/PHP]



Save and Close the buy_now.php



Open the buy_now.tpl open



Find this code

[PHP]<input type="hidden" name="pfval" value="{ID}">[/PHP]



Replace it with this code

[PHP]<input type="hidden" name="pfval" value="{WINID}">[/PHP]



Save and Close the buy_now.tpl



Open the outstanding.php page



Find this code

[PHP]"SELECT w.auction As id, w.id As winid,[/PHP]



replace it with this

[PHP]$query = "SELECT w.id, w.winner,[/PHP]



Find this code

[PHP]'WINID'=> $row['winid'],[/PHP]



replace it with this

[PHP]'WINID'=> $row['winner'],[/PHP]



Save and Close the outstanding.php



Open the pay.php page



Find this code

[PHP]case 2: // pay for an item

        $query = "SELECT w.id, 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__);[/PHP]



Replace it with this code

[PHP]case 2: // pay for an item

        $query = "SELECT w.id, 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.id = " . intval($_POST['pfval']);

        $res = mysql_query($query);

        $system->check_mysql($res, $query, __LINE__, __FILE__);[/PHP]



Save and Close the pay.php



Open buying.php



Find this code

[PHP]$query = "SELECT DISTINCT a.qty,[/PHP]



Replace it with this code

[PHP]$query = "SELECT DISTINCT a.id, a.qty,[/PHP]



Find this code

[PHP]'TITLE' => $row['title'],[/PHP]



Add after it

[PHP]'ID' => $row['id'],[/PHP]



Save and Close the buying.php



Open buying.tpl



Find this code

[PHP]<input type="hidden" name="pfval" value="{items.AUC_ID}">[/PHP]



Replace it with this code

[PHP]<input type="hidden" name="pfval" value="{items.ID}">[/PHP]



Save and Close the buying.tp



And that should fix the paying for multiple items and it will now look for the id in the winners table and not the auction id so the winner pays for the correct item.



If you have any problems please let me know
TagsNo tags attached.
import_id472
Thread
Attached Files

- Relationships

-  Notes
(0001304)
N3M3SIS (viewer)
2014-10-14 12:39
edited on: 1970-01-01 00:00

After this fix order_print.php show me an error incorrect bill
(0001305)
athera (reporter)
2014-10-20 20:00
edited on: 1970-01-01 00:00

Hi N3M3SIS,
Look at
http://www.webidsupport.com/forums/i...l-shipping-bug[/url] [^]
and
http://www.webidsupport.com/forums/s...items-progress[/url] [^]
as they have the related fixes
(0001306)
N3M3SIS (viewer)
2014-10-21 18:15
edited on: 1970-01-01 00:00



athera thx but the links not works ;)
(0001307)
athera (reporter)
2014-10-21 20:33
edited on: 1970-01-01 00:00

N3M3SIS wrote

athera thx but the links not works ;)


Hi N3M3SIS

I am sorry here you go

http://www.webidsupport.com/forums/issue.php?481-shipping-fee-and-additional-shipping-bug[/url] [^]

and

http://www.webidsupport.com/forums/showthread.php?8034-Buy-now-only-with-multiple-items-progress[/url] [^]

- Issue History
Date Modified Username Field Change
2015-04-01 13:17 renlok New Issue
2015-04-01 13:17 renlok import_id => 472
2015-04-01 13:17 renlok Date Submitted 2015-04-01 13:17 => 2014-06-02 19:37
2015-04-01 13:17 renlok Last Update 2015-04-01 13:17 => 2015-02-08 13:49


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker