Login Form

#544 – "24 hours left to bid" notices sent out to bidder when auction closes with "BuyNow"?

Posted in ‘BF Auction’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Monday, 02 March 2015 21:12 AEDT
Joomla! version: 2.5
BF Auction Plus: 1.7.6

Hi again Tim, our auctions are live and so far everything's working pretty smoothly (except for the category filter in grid view, which I still have an open ticket for). We've already sold a couple items with BuyNow....which leads to my question.

A functionality that doesn't make sense to me -- when someone ends an auction by hitting "BuyNow", all the other previous bidders are sent a "24 hours left to place a bid" notice. That shouldn't happen, should it? They aren't able to place bids any more because the auction is closed.

Is there a way to stop those emails when an auction ends with BuyNow?
Monday, 02 March 2015 22:06 AEDT 20'
BF Quiz Plus 3 Years
There are 8 email types in BF Auction Plus, BidConfirm, Outbid, WinningBid, LoosingBid, BuyNow, ReserveNotMet, Watchlist, and Seller. When a buy now purchase occurs, it triggers two emails, BuyNow and Outbid.
Looking at the code, the 24 hours before auction ends email trigger only applies to Watchlist emails (you can see the code for this in /components/com_bfauction_plus/controller.php around line 1297-1334).
The conditions on this watchlist email checks to see if the email has been sent
//line 1036
$query->where('emailSent = 0');

So I'm thinking that buynow should also be setting emailSent flag in all the associated watchlist items to avoid this issue.
Can you try adding the following to /components/com_bfauction_plus/controller.php around line 833

$rightNow = JFactory::getDate();
$db2 = JFactory::getDbo();
$query2 = $db2->getQuery(true);
$query2->set('emailSent= 2');
if(is_callable(array('JDate', 'toSql'))){
$query2->set('emailDate='.$db2->quote( $db2->escape( $rightNow->toSql() ), false ));
$query2->set('emailDate='.$db2->quote( $db2->escape( $rightNow->toMySQL() ), false ));
$query2->where('itemid = '.(int)$itemId);

Let me know how you go.
Follow us on twitter http://twitter.com/tamlynsoftware
Saturday, 07 March 2015 02:21 AEDT
Hi Tim, sorry for the delay in getting back to you.

If I understand you correctly, I think this should solve the problem -- essentially you are going to set an "emailSent" flag at the time of the BuyNow, which will happen BEFORE the system starts preparing the email notifications.

Looking at your suggested code, though, I'm not sure exactly where I need to put it. Lines 839-841 in my controller.php read

839 //send email confirmation
840 if($allowEmail){
841 //Prepare notification emails

Does your code go inside the if($allowEmail) block? or at line 838, at the same level as the if($allowEmail) block? (Line 833 for me is a "return" in the middle of a "if ($db->getErrorNum())" statement)

Thanks as always!

Saturday, 07 March 2015 15:02 AEDT 5'
BF Quiz Plus 3 Years
Add the new code above 839 //send email confirmation
I've already added it into my current dev version, and this change will be included in the next version release (assuming that it solves your problem).

Let me know if you need me to email you my current dev version.


Follow us on twitter http://twitter.com/tamlynsoftware
Friday, 13 March 2015 08:38 AEDT
Hi Tim, I don't think this solves the problem.

We've just had another auction close with "BuyNow", but the 24 hour emails were sent out even though I put in the code you gave me. As before, the "congratulations" email went out to the winner and at the same time all the other bidders received "24 hours left to bid" notices.

Is it possible the "email sent" flag isn't being set before the confirmation mail is actually sent?
Friday, 13 March 2015 08:52 AEDT
Actually, all the bidders got TWO emails each this time -- INCLUDING the winner! Definitely doesn't solve the problem.

For now I have just disabled the Watchlist emails until we can figure this out.
Saturday, 14 March 2015 09:32 AEDT 15'
BF Quiz Plus 3 Years
Looking at the code, I'm thinking you might need to add an additional check within the triggerEmails function where the watchlist email is sent in addition to those code changes above.

//around line 1063, you should see:
}else if($emailType == "Watchlist"){
bfauction_plusController::sendHTMLNotificationEmail($body, $rows[0]->email, $subject);

You could try something like:
}else if($emailType == "Watchlist"){
if($rows[0]->emailSent == 0){
bfauction_plusController::sendHTMLNotificationEmail($body, $rows[0]->email, $subject);

In theory, this should not send emails for buy now purchases, and the emailSent flag should already be set before this code runs. I don't have time right now to test this, as I'm getting ready to fly to China tomorrow, but let me know how you go with this.


Follow us on twitter http://twitter.com/tamlynsoftware
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.
Go to top