[SOLVED] "Winners details" Error. Help me please.

Discussion in 'General Support' started by Merkcuio, Oct 14, 2016.

  1. Merkcuio

    Merkcuio Member

    Joined:
    Jun 9, 2016
    Messages:
    37
    Likes Received:
    3
    Thank you!!!
    Create auction "Buy it now only". This is problem.
     
    nay27uk likes this.
  2. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,118
    Likes Received:
    236
    I am seeing something. I am running tests now. I can almost recreate what I saw on the video. This really does seem like a cron.php page problem.

    I can get a Test item to show in the Winners Details when I add a photo to an item. It will not add for me if I don't add a photo. I will continue to run tests to see what is triggering move the item sometimes to the Winners Details. Notice in the picture the closed on date is for tomorrow.
    capture-20161028-103403.png

    My Batch Procedures Settings Run Cron is set to non-batch.

    Looking at the database, I thought we matched up auctions with IDs but, looking at my Winners table, it sure don't look like it in the picture below. I know I have put up a lot of Test items in my 3 years of using Webid but, not even close to 1,000. This is showing over 2,000 IDs. I will have to further investigate the id and auction columns. The items that made it to the Winners Table on my Webid Site have no ID but, it shows when you look on the item page that the IDs are 265 & 268 but, there is no IDs showing on the selling.php page. They are both showing on my Home page as being opened...and guess what? They are not showing in the winners table in the actual database and you would think the selling.php page would be calling up the auctions from the winners table in the actual database and it's not. Nobody's won anything on my site the whole time I have had it in existence except once when I did sell an item a long time ago but, that item should not be in the Winners table anymore. If I delete most of the items then it will be easier for me to see if new items are added which I don't think anything has been added today.
    capture-20161028-102513.png

    These are just suggestions. I think we should be look at the selling.php page and the cron.php page. We got to ask why is the selling.php page is calling up an item and where exactly is it calling too if it's possibly not calling to the webid_winners table. It may be calling to items that aren't even in the webid_winners table. Then we can look at the cron.php page to see if we can see anything there.

    Update: I did manage to add a WINNER TEST ITEM without a photo and added shipping like in the video and it put it on the winner table(selling.php page). Looking at the webid_winners table in the database, there's no additional items added to it. This selling.php page seems to be calling for those items from somewhere else.
     
    Last edited: Oct 28, 2016
  3. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,118
    Likes Received:
    236
    Can anybody see the admin/viewwinners.php page? I try to load mine and it forwards to the admin/listauctions.php page. I checked to be sure that I have a admin/viewwinners.php in my folder and it's there.
     
  4. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,118
    Likes Received:
    236
    This was a code pani100 added about 3 years ago and I helped with this by testing everything he add. I had discovered a sold item problem back then. It was a GREAT fix pani100 came up with! The code will only check to see if they settings are set like that in the database. It will check if closed is 1 and sold as 'y'.
    PHP:
    // Close auction
            
    if ($Auction['sold'] != 's' AND $Auction['num_bids'] > AND $Auction['reserve_price'] > AND $Auction['current_bid'] < $Auction['reserve_price'])
            {
                
    $query "UPDATE " $DBPrefix "auctions SET closed = 1, sold = 'n' WHERE id = :auc_id";
            }
            else
            {
                
    $query "UPDATE " $DBPrefix "auctions SET closed = 1, sold = 'y' WHERE id = :auc_id";
            }
            
    $params = array();
            
    $params[] = array(':auc_id'$Auction['id'], 'int');
            
    $db->query($query$params);
        }
    I just put these some items up and they are not closed and all of them are showing in the my Winner's Details (selling.php) page and you can see in the database in the photo below that the new items I put up are marked as 1 and y. The item on the bottom is not a winner. So, I have discovered something here. Now to figure out why they are initially being marked as close and sold. That shouldn't happen.

    capture-20161028-1500181.png

    Here's the top part of my selling.php page. I did purchase that. My paypal was calling me up immediately when I spend $5,000 on the item. ;)
    capture-20161028-135151.png

    The item I bought showed up in the database correctly. At least the sold item listed correctly in the database.
    capture-20161028-151649.png


    I did also come to learn my seller got suspended for owing $30. I clicked the button to notify the admin but, I didn't get an email. It's probably because I using a Yahoo email and not a web based email like I should of been.
    capture-20161028-124729.png


    So what I mentioned at the top is what I would like to suggest to look for. We should try to figure out what query caused the item to immediately close and to be marked 'y' for sold.

    The items that are being closed and marked as sold immediately are not being added to the winners table! The test item I bought and got the seller suspended for....hehehe...is an item that did what it was supposed to do and got inserted into the winners table of the real database.
     

    Attached Files:

    Last edited: Oct 28, 2016
  5. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,118
    Likes Received:
    236
    There was lot's of discussion in this one thread about a related issue but, no final fix to the conclusion. So, what I mentioned back in here in July is the problem Sold items empty. It's a buy_now issue that never got fixed. It has something to do with the quantity.

    I just ran a test and selected buy now only and it and it was put in the selling.php page or Winners Details page. I ran a 2nd test and just put up a test item with just the reserve set and this time I didn't get the item in the Winner's details section. I ran a 3rd test with just buy now and it did not show in the Winners Details page.

    When you select Buy Now Only the disabled quantity selection becomes enabled but, it's supposed to be set up to select 1. This code on the buy_now.php page shows if quantity is equal to 0 then to force close the item. This whole query starting around line 188 on the buy_now.php page will have to be looked at and make sure it's making the UPDATE and at least adding 1 to the database.
    PHP:
    $query "UPDATE " $DBPrefix "auctions SET quantity = quantity - :quantity WHERE id = :auc_id";
                
    $params = array();
                
    $params[] = array(':quantity'$qty'int');
                
    $params[] = array(':auc_id'$id'int');
                
    $db->query($query$params);
                
    // force close if all items sold
                
    if (($Auction['quantity'] - $qty) == 0)
                {
                    
    $query "UPDATE " $DBPrefix "auctions SET ends = :time, bn_sale = 1, current_bid = :current_bid, current_bid_id = :current_bid_id, sold = 'y', num_bids = num_bids + 1, closed = 1 WHERE id = :auc_id";
                    
    $params = array();
                    
    $params[] = array(':time'$NOW'int');
                    
    $params[] = array(':auc_id'$id'int');
                    
    $params[] = array(':current_bid'$Auction['buy_now'], 'int');
                    
    $params[] = array(':current_bid_id'$current_bid_id'int');
                    
    $db->query($query$params);
                }
     
    Last edited: Oct 28, 2016
  6. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,118
    Likes Received:
    236
    I'm totally confused here. I managed to get the new items I just put up on my Webid page to show 0 for closed and n for sold on the auctions table in my database and it still added the item to the Winner Details. One thing is for sure, if I use the Buy Now Only then it will add the not closed item to the the Winners Details(selling.php) page. I will have to toy with this later.
     
  7. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,118
    Likes Received:
    236
    @Merkcuio and to Webid members. I believe I come up with a fix for this issue.

    On the selling.php page on line 82:
    Change:
    PHP:
    WHERE (a.closed OR a.bn_only 1) AND a.suspended AND a.user = :seller_id
    To:
    PHP:
    WHERE (a.closed AND a.bn_only 1) AND a.suspended AND a.user = :seller_id
    This should make all of those buy_now only items that aren't really sold disappear in the Winner Details(selling.php) page and keep the ones that reall are sold.

    I see a similar query up around line 60. It didn't make a difference when I ran tests whether if it was OR or AND but, might as well change it from:
    PHP:
    WHERE (a.closed OR a.bn_only 1) AND a.suspended AND a.user = :seller_id
    To:
    PHP:
    WHERE (a.closed AND a.bn_only 1) AND a.suspended AND a.user = :seller_id
    That issue drove me nuts. I could see what nay27uk was talking about leaving a...I forget the words he used but, like a ghost of the item that wasn't there. The item could of been closed and not sold and still showing there if the closed item(s) had buy now only selected. I had items on my Webid site that I didn't want to delete because they were real items. If I had deleted them then they would of disappeared for good. This winners table was collecting any items that had buy now only selected on it. I figured it out when I put test items up for sell with and without using the buy now only. It would add the item to the winners details list if I had selected Buy Now Only. If I didn't select Buy Now Only then it was not added to the Winners details list. If I had gone into the database and changed the auctions>bn_only from 1 to 0 then it would of removed it.

    I also sold 3 one dollar items and they were put on the Winners details list. When I changed the code back to using OR all of the Buy Now Only items came back to the list. I changed the code back to using AND and all of the Buy Now Only items disappeared and left the 3 one dollar items I had just sold.

    I believe this is issue is resolved now but, please let us know if it works for you or if improvements could be done!
     
    Last edited: Oct 29, 2016
    Merkcuio and nay27uk like this.
  8. Merkcuio

    Merkcuio Member

    Joined:
    Jun 9, 2016
    Messages:
    37
    Likes Received:
    3
    Hi. Does not work. I change the line to
    WHERE (a.closed = 1 AND a.bn_only = 1) AND a.suspended = 0 AND a.user = :seller_id
     
  9. Merkcuio

    Merkcuio Member

    Joined:
    Jun 9, 2016
    Messages:
    37
    Likes Received:
    3
    Working!!! I changed the line 83. It works!
    WHERE (a.closed = 1 AND a.bn_only = 1) AND a.suspended = 0 AND a.user = :seller_id
     
    Last edited: Oct 30, 2016
  10. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,118
    Likes Received:
    236
    I'm glad it worked for you! I've submitted the bug fix on github.

    What did you do the first time that it didn't work? Did you change the wrong code?
     
  11. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    marking the thread as solved.
    Well done David
     
    Merkcuio likes this.
  12. Merkcuio

    Merkcuio Member

    Joined:
    Jun 9, 2016
    Messages:
    37
    Likes Received:
    3
    I change in selling.php line 60
    WHERE (a.closed = 1 OR a.bn_only = 1) AND a.suspended = 0 AND a.user = :seller_id

    on

    WHERE (a.closed = 1 AND a.bn_only = 1) AND a.suspended = 0 AND a.user = :seller_id
    this variant not work!

    I changed the line 83. It works!
    WHERE (a.closed = 1 AND a.bn_only = 1) AND a.suspended = 0 AND a.user = :seller_id
     
  13. ian culter

    ian culter Member

    Joined:
    Sep 25, 2016
    Messages:
    70
    Likes Received:
    9
    Here is the Correct Code
    WHERE (a.bn_only = 1) AND a.suspended = 0 AND a.user = :seller_id
     
  14. ian culter

    ian culter Member

    Joined:
    Sep 25, 2016
    Messages:
    70
    Likes Received:
    9
    Guys , the Winner on auctions ( not buy it now ) does not appears on winner details page !!!
     
  15. ian culter

    ian culter Member

    Joined:
    Sep 25, 2016
    Messages:
    70
    Likes Received:
    9
    This is not solved . this fix is totally wrong . as after this the Ended auction with winner ( Regular auction not buy it now ) Wont Appears on "Winners details" page.
     
  16. NancyGraz

    NancyGraz New Member

    Joined:
    Apr 14, 2017
    Messages:
    17
    Likes Received:
    2
    I, too, am experiencing this issue - I have installed version 1.2.2.2 of the software.

    I created a test auction (not a Buy It Now) that I ran for 2 days with a limited number of buyers to see how things worked, behaved, and looked. The auction ended as expected and was "won."

    When I am logged in as the seller, the item shows up in my Sold Items tab as expected. However, when I click on the View Winners link associated with this sold item, the Winners details page is displayed, but the message No items found is displayed. (Please see my attached screen shots.)

    When I am logged in as the Site Admin and go to Auctions —> View Closed Auctions —> View Winners I do see the entire bidding history for the item, as well as the winning bid/bidder.

    I have my site configured for non-Batch cron jobs. The item "winner" did receive his email notifying him that he won.

    Any suggestions?

    TIA,
    Nancy Sold Items.JPG View Winers.JPG
     
  17. BabyDunk

    BabyDunk Active Member

    Joined:
    Feb 26, 2017
    Messages:
    279
    Likes Received:
    22
    Hi @NancyGraz

    if you open selling.php and on line 74 (at least thats where it is for me) and replace this
    PHP:
        WHERE (a.closed AND a.bn_only 1) AND a.suspended AND a.user = :seller_id
    with this
    PHP:
        WHERE (a.closed OR a.bn_only 1) AND a.suspended AND a.user = :seller_id
     
    Last edited: May 1, 2017
  18. BabyDunk

    BabyDunk Active Member

    Joined:
    Feb 26, 2017
    Messages:
    279
    Likes Received:
    22
    OOPS i didn't read the previous posts . you would have already got that from above, but i just tested on my own 1.2.2.2 version and it worked a treat for me
     
  19. NancyGraz

    NancyGraz New Member

    Joined:
    Apr 14, 2017
    Messages:
    17
    Likes Received:
    2
    Actually, I did need to make that change - when I saw Ian Culter's comment, I thought for sure there was something else amiss... besides, you actually gave me the Line Number that jived with my file, so all is good...

    Thanks!
     
  20. BabyDunk

    BabyDunk Active Member

    Joined:
    Feb 26, 2017
    Messages:
    279
    Likes Received:
    22
    No problem Nancy glad to help

    you might wanna change line 54 also
     

Share This Page