Penny Auctions - Auto Extend

Details of modifications which users can incorporate within Enuuk Auction Platform free of charge
Post Reply
RWAP
Site Admin
Posts: 750
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Penny Auctions - Auto Extend

Post by RWAP » Wed Mar 24, 2010 7:22 pm

At the moment, Penny auctions will not extend automatically when bids are placed unless the site options have been set to enable auto extension. However, this would affect all auctions on the site, and with Penny Auctions, it is more common for shorter auctions (of only a few hours) and therefore for the auction to be reset to 30 seconds left if anyone bids in the last 30 seconds.

This is different to how the auto extension works - under the auto extension, if a bid is placed within the last few seconds (as defined in the admin backend), then the end date is extended by a specified number of minutes (again defined inthe admin backend).

If you wish to follow the normal method for extending Penny Auctions, you need to make a modification to:

class\Action\Offer.php

Find:

Code: Select all

                                if($this->context->siteOptions['enableAutoExtension']){
                                    $currentTime = time();
                                    $endTime = strtotime($offer->endDate);
                                    $diff = $endTime - $currentTime;
                                    if($diff <= $this->context->siteOptions['lastMomentAutoextension']){
                                        $newEndTime = $endTime + (60*$this->context->siteOptions['extraTimeForAutoextension']);
                                        $offer->endDate = date('Y-m-d H:i:s',$newEndTime);
                                    }
                                }
This needs to become:

Code: Select all

                                if($this->context->siteOptions['enableAutoExtension'] && $type!=Offer::PENNY){
                                    $currentTime = time();
                                    $endTime = strtotime($offer->endDate);
                                    $diff = $endTime - $currentTime;
                                    if($diff <= $this->context->siteOptions['lastMomentAutoextension']){
                                        $newEndTime = $endTime + (60*$this->context->siteOptions['extraTimeForAutoextension']);
                                        $offer->endDate = date('Y-m-d H:i:s',$newEndTime);
                                    }
                                }
                                elseif($type==Offer::PENNY){
                                    $currentTime = time();
                                    $endTime = strtotime($offer->endDate);
                                    $diff = $endTime - $currentTime;
                                    // If a bid is placed on a Penny auction in the last 30 seconds - reset the end time to now + 30 seconds
                                    if($diff <= 30){
                                        $newEndTime = $currentTime + 30;
                                        $offer->endDate = date('Y-m-d H:i:s',$newEndTime);
                                    }
                                }

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest