Auctions are able to be viewed after they are closed
10 posts
• Page 1 of 1
The current version doesn't do this, however some small changes would allow this to happen.
1. In the tables/products/fields.ini file, change the first line from __sql__="select p.*,current_high_bid from products p left join (select product_id,max(bid_amount) as current_high_bid from bids group by product_id) as b on p.product_id=b.product_id" to __sql__="select p.*,current_high_bid, c.close_date from products p left join (select product_id,max(bid_amount) as current_high_bid from bids group by product_id) as b on p.product_id=b.product_id left join closed c on p.product_id=c.product_id" (i.e. we are adding a caculated field close_date to the products table). 2. In the tables/products/products.php file, find the block__result_list method. It will look like:
Add a line:
SO that it becomes:
This will make it so that average users will only see the auctions that are not closed yet. The admins will still see all auctions. -Steve
Actually I made a mistake with this source code. The line
should have been
The previous version probably showed only the closed auctions, rather than the unclosed auctions. -Steve
Hey. Steve -
I tried this, and the result was that some of my users could not successfully complete an auction. They received a winning email with the correct product name, but a price of $0.00. And then when I would go view reports, the winner field was blank, and the bid amount field was 0. Oh! Heartache! This behavior was fixed as soon as I restored the _sql_ bit in the fields.ini file to original. Of course, I will keep testing, as my project needs to be working 100% ASAP. : ) Thanks for your time and hard work!
Yes.. the __sql__ bit is crucial. Make sure you used a left join (no inner joins). I haven't tested out the mods in this post personally but I can't see any problem with them. Please confirm that your changes to the __sql__ field were exactly as in the post .
-Steve
My changes were cut and pasted, so I'm pretty dang sure they were identical. It took me a long time to track down the problem, and I don't understand WHY this was the issue, but everything went back to normal as soon as I changed it back.
This is what I do know - 1.View_product.html would display fine, so that means that the field high_bid_amount was OK. 2.Reports were not fine, and reports.php is looking for bid_amount. 3. Winner's email was not fine, and the email sending part of functions.inc.php is looking for bid_amount. So, something got goofed up when bid_amount was calculated. I guess. This has been a fascinating crash course in the way databases work, but I think I melted a little part of my brain. ; ) And I don't get to stop now - I have to make reserve prices work, come hell or high water! -Beth
what TYPE is the calculated field? datetime?
Forgive my ignorance I replaced the line in fields.ini , changed the code in products.php and added the close_date field (as datetime) I'm uncertain if I am supposed to enter a value into the field (same as closing time?) when adding a new product or leave it empty. When leaving it empy, it doesnt ever generate a value and the open or closed auction always shows. Any value inputted makes the open or closed auction never show.
10 posts
• Page 1 of 1
Return to Web Auction Discussion Who is onlineUsers browsing this forum: No registered users and 21 guests |