Page 1 of 1

extend an auction

PostPosted: Tue Dec 16, 2008 4:53 pm
by dmcwilliams
Is there any way to extend an auction if someone bids within the last x amount of minutes or seconds?

Thank you,

PostPosted: Wed Dec 17, 2008 10:48 am
by shannah
In the tables/products/products.php file:

Code: Select all
function field__cooked_closing_time_seconds(&$record){
        $closing_time = $record->strval('closing_time');
        if ( !$closing_time ){
            $app =& Dataface_Application::getInstance();
            $closing_time = $app->_conf['df_auction']['closing_time'];
        }
       
        $closing_time_seconds = strtotime($closing_time);
        $high_bid = $record->val('high_bid');
        if ( $high_bid ){
            $bid_time = $high_bid->strval('time_of_bid');
            $closing_time_seconds = max($closing_time_seconds, strtotime($bid_time));
        }
        return $closing_time_seconds;
    }


Change the line:

Code: Select all
$closing_time_seconds = max($closing_time_seconds, strtotime($bid_time));


to

Code: Select all
$closing_time_seconds = max($closing_time_seconds, strtotime($bid_time)+300);


To extend auctions to 300 seconds (or 5 minutes) after the last bid.

-Steve

PostPosted: Sat Sep 12, 2009 5:30 am
by ltdan
Hi there

This is exactly what I wanted but although it does extend the auction, it doesn't show it's been extended anywhere, i.e. the closing time doesn't change. Is there a way of transferring the extended time on to the displayed closing time. I'm thinking it can't because the closing time is in the MySQL database, whereas this script modification is an 'on the fly' adjustment.

So would it be possible to show this on the bidding page somewhere like a countdown timer, similar to the way e-bay works where it shows the minutes/seconds remaining till the auction closes and adjusts when the browser is refreshed?

Cheers

PostPosted: Thu Sep 17, 2009 9:42 am
by shannah
Neat idea! Certainly anything is possible and this would probably be a simple modification. If you add it to the issue tracker as a feature request I can see if I can get to it. But reallistically it could be some time before I'm able to devote the time to this as I'm pretty tied up right now with other projects.

PostPosted: Thu Sep 17, 2009 11:19 am
by ltdan
Yeah, I think it should be pretty straight forward to update the mysql database with a new end time rather than the on the fly method, but the countdown timer may need some java script. I've had a play with WeBid and that seems to do it with some modification, but they don't have the single seller mod working that I need :( which this has :D