Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Auction Module


deathgod

Recommended Posts

auction_v1.4.4_1

First of all thanx to everyone spending time on this great contribution.

I've inserted it in my Oscommerce merchant 2.2 rc1. I didn't have much problems to have the aution up and running, but the terms and conditions page wasn't showing up at first. I found that it was situated as an update in the installation file from Contrib 1.3 -> Auction Contrib 1.4 so at first didn't understand, since I was doing a new install, I left it out at first.

 

Anyway at administration site I don't see any monitoring at all, I understand that I have to take the winner from the catalog site and make a manual order in Admin.

Therefor I need manual order maker (is this correct?) in the installation file of manual order maker, it says it wil only work if also order editor is installed.......

So from one comes another is this correct? Do I need to install two contributions?

 

Second thing emails are not sent, I have seen some info on this forum from Juerg Schumacher almost at the bottom of the page I wil definitaly try this out.

Unfortunately the bug if a known bidder makes another bid the timestamp says 0000000000000 instead of the real time still exist.

This is a bit strange to customers bidding on an auction, still no cure for this??

 

And last but not least I've seen on the site from Beltespenner that he displays the winner at the site, I was wondering how that has been done.

 

If anyone of you can answer it would be mucht appreciated.

Thanx :lol:

Link to comment
Share on other sites

  • Replies 220
  • Created
  • Last Reply

Top Posters In This Topic

Changed the code as Juerg Shumacher did before, (this was only a slight change) so now the email function when a higher bid has been made works fine.

Remains the question on the admin site, en the timestamp.

Link to comment
Share on other sites

Noticed this: Limor01 at this page wrote:

it has SQL injection risks.

you need to make sure you clean the data from the URL before you insert it into your database as a query.

 

$mfo_auction_query = mysql_fetch_object(tep_db_query('select auctions_starting_price, expires_date, overbid_amount from ' . TABLE_AUCTIONS_PRODUCTS . ' where products_id = ' . $_GET['products_id'] . ' and status'));

 

In the downloaded package you will find this slightly different in the file catalog/includes/modules/auction_bids.php

 

$mfo_auction_query = mysql_fetch_object(tep_db_query("select auctions_starting_price, expires_date, overbid_amount from " . TABLE_AUCTIONS_PRODUCTS . " where products_id = '" . $product_info['products_id']. "' and status = '1' "));

 

Which one should we use?

Link to comment
Share on other sites

  • 3 weeks later...

Hey everyone,

 

First off, thanks to all who are working on this fabulous contibution, it's exactly what we need when you sell 1`of a kind products!! :)

 

But I really need some help here, cause I've installed it twice and still have the same problem.

My admin is fine, I can list auctions and and find "Auction Listings" under Configuration.

 

BUT: When I finnish the installation my catalog side goes blank. :(

I suppose it would have something to do with either my database connection settings or other configure.php settings in catalog??

I've tried every to my knowledge imaginable setting, but still a blank catalog. :(

I'm still quite new to osc sooo, I could most certainly use a hand here...

What am I doing wrong? Could someone pls help me out? PRETTY PLS? I really want this contribution in my shop, I mean I want it BAD! :D

 

I'm running Osc version 2.2-MS2, PHP version 4.4.7 and MSQL 4.1.21 (checked with server info in admin).

I don't have a lot of other contributions running in the shop that might conflict with this one...

Oh and my site is not in the root, so perhaps have to change that configure.php??? So many questions..... :rolleyes:

Link to comment
Share on other sites

Hi!

 

Iæm trying to get this auction thing working, and I can't wait, because it is a fantastic addition to oscommerce. But I am having difficulties.

 

1146 - Table 'db102096.TABLE_AUCTIONS' doesn't exist

 

select auctions_starting_price, expires_date, overbid_amount from TABLE_AUCTIONS where products_id = 8 and status

 

[TEP STOP]

 

What to do?!

I do see in the phpmyadmin that a table with the name auctions does excist. but in small letters, not big... :-s HELP!?!

Link to comment
Share on other sites

And now I got this error:

 

Fatal error: Call to undefined function: tep_end_auction_invalid() in /home/csoren/www/auksjon/product_info.php on line 18

 

And on line 18 in this file, is says:

 

tep_end_auction_invalid($products_auction_id);

 

 

HELP?

Link to comment
Share on other sites

  • 3 weeks later...

Hi all,

 

Just thought you might like to know, I've picked up where marcusdesign left off and addressed many of the issues with this Contribution.

 

The following has been fixed. :

 

• Auction price now displays the current bid, instead of the start price. <--Did anyone else notice this or was it just me?

• Countdown timer is now in PHP instead of javascript. This allows for better time synchronization with server and works much the same way as with ebay (Auto refresh). It also allows me to use variables from within the script to trigger events. Not so important now, but may be later on.

• Auto email can now be sent to winning bidder once auction is complete: Here was the problem : PHP will only trigger events when a PHP page is loaded (hence the use of so much javascript to compensate these days). As such, I needed a way of the server testing conditions and sending emails when no-one was looking at or loading a page. For this, I have created a simple php script which is executed by a CRON every 5 mins to test if any auctions have been won, send and email to the winner and finally change the Auction status to completed so that multiple emails are not sent out. No doubt this will later involve automatic order generation; however I have not done this yet.

 

If you don't know what CRON is, google CRON and find out.

 

• I'm currently working on the admin side to this contrib to display Auction status, Bidders, etc. This is in infancy at this stage and should be completed in around 2-3 weeks.

 

I'll post the polished contrib for your scrutiny once the admin side is done, as I don't yet know what impact the admin side will have on the rest of the script I've written.

 

 

Dan

Link to comment
Share on other sites

Just an update on the status of my contribution to this contribution: Successful auctions are now sent directly to the shopping cart where the user does not have the ability to modify number of units or remove the unit from their shopping cart. An email is sent as a reminder to the customer Automatically when the auction is complete. Still a week or so before I release anything as Im stuck documenting my changes. However initial signs are very very good.

 

As I originally decided to do this for myself, It's going to be pretty difficult for me to say exactly what needs to be changed. However I can show you guys comparisons of what I had before and after installing this contrib.

 

I'd appreciate any help on this front.

 

Dan

Link to comment
Share on other sites

Well I don't know exactly what kind of changes you made Dan, but they sound extensive. From my standpoint I would suggest you call it version 2.0, and instead of listing all the changes and improvements you have done, list;

 

- Current Features

- Comparison of Before and After

- Known/Remaining Bugs

- (To-Do (for any future updates you might have planned after release, if any))

 

EDIT: As for installation, I wouldn't mind helping documenting changes and/or testing it.

 

Just a suggestion :)

Edited by JangoF
Link to comment
Share on other sites

Well I don't know exactly what kind of changes you made Dan, but they sound extensive. From my standpoint I would suggest you call it version 2.0, and instead of listing all the changes and improvements you have done, list;

 

- Current Features

- Comparison of Before and After

- Known/Remaining Bugs

- (To-Do (for any future updates you might have planned after release, if any))

 

EDIT: As for installation, I wouldn't mind helping documenting changes and/or testing it.

 

Just a suggestion :)

 

This is scary, now you're all going to see what a sloppy job I've done on this.

 

The code is very close to finished as far as I can tell (for the moment anyway) Sure, I will need all the help I can get documenting the changes. My problem is I don't have a "raw" site to install this on. Any help would be greatly appreciated. Im using this currently on a PHP V5 server.

 

Here's the bugs I've fixed from the previous version

 

• Overbid ammount :Fixed

• Starting Bid lower than starting price :Fixed

• Won Product added to winning bidders shopping cart (remove product and qty update disabled) (Basically the next person to load the page will trigger the PHP to add product to the winners shopping cart and update the winners sessions (if the winner is logged in and triggers the update), If the winner is not logged in and the page has not been loaded by anyone else, CRON will execute every X mins to update shopping carts and send winners emails etc.

 

One problem here is that if both a winner and looser is logged in at the same time (a pretty common occurence Im sure) and the looser loads the page before the winner does, the winners sessions will not be updated - meaning they will have to log out and log back in- in order to see the product in their shopping cart. <--Im working on this, -I think I'll dissable the ability for the looser to trigger the update to the winners shopping cart/seassions/send email. Thoughts anyone?

 

• email sent to winning bidder.

• Product_info page now displays "Highest Bid" instead of starting price.

• Countdown now works for both Date AND TIME- written in PHP with auto refresh to update time (if any) remaining.

• Countdown can be set to ANY time not just 12:00 with changes to the admin side to facilitate this.

 

I've got to go now. Im sure there's more. I'll get back to you when I remember.

 

PS I could do with some help to convert some of the sloppy programming into language definition files etc.

 

Dan

Link to comment
Share on other sites

While I haven't seen your work yet, I don't think it's sloppy. I think it sounds like a much needed improvement ;)

 

The language definition files isn't so hard to do:

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AUCTONS); (must be in includes\filenames.php)

 

Then instead of the actual text you use ' . TEXT_WHATEVER . ' in the files.

 

In includes\languages\english\auctions.php, add definition for each text: define('TEXT_WHATEVER', 'Auctions Whatever');

 

That's basically it.

Link to comment
Share on other sites

Lol. I know how to do it, I just can't be stuffed, my mind is boggling on other more important things. Language files can easily be sorted later on Thanks for the help though :)

Link to comment
Share on other sites

OK, I've set things now so that when the winner views a finished auction of which he/she has won, the auction status is updated, an email is sent to the winner, their sessions are updated (shopping cart) and subsequent views of the page from other users will result in a normal product page (with buy now). If the winner does NOT view the product page, the CRON job will still update the database every X mins, however the winner will not have the product added to their cart (sessions) untill they log off and log back on again.

 

Basically, this will only affect users who are logged on and don't know/care if they've won an auction. Sounds a little crap to me, personally, I'd like the product added to the winners cart wether they've looked to see if they've won or not, however something has to trigger this event, and with my limited knowledge of the OSC system, I don't know how to have a users' sessions updated if THEY are not the ones updating them. Does anyone understand what im talking about?

 

Suggestions would be really helpful. I'm thinking a script which would update ALL users sessions from data within the database would help, triggerd in the cron file- sort of a "refresh all sessions" script, however I've got ABSOLUTLY no idea how to do this. Help? Ideas?

 

Secondly, A bug I've just noticed is that IF the admin re-lists an auction before it is added to the winners cart (through the database), the winner will never get the product they've won because when a product is re-listed, the status must change to "current" or boolean "1" in the databse. This means the CRON file or user viewing the page (and hence executing the script/databse updates themselves) will not know the auction is finished - assuming that its' status is "current" and continuing the already won auction untill the end of the newly re-listed auction. - A possible fix here is to have the admin section automatically create/copy the product and create a unique product_id for each auction. This would have the added bonus of enabling the admin to list multiples of the same product at once and will be greatly beneficial im sure for record keeping and statistics (something i don't want to think about too much right now, but am sure will come in handy when creating product auction history prices etc.), however will extend the time it takes me to release this contrib for at least another week at best. As a consequence, I'll have to remove the current "feature" of having products with finished auction status automatically revert to "Buy now" status once an auction is finished. Any thoughts?

 

Dan

Edited by psylencer
Link to comment
Share on other sites

Ok homies,

 

Trash the last idea, this is what i've got happening, if everyone's happy with it, Ill install it, document it and post it. ...

Sessions are now automatically updated every time any winning bidder looks at their shopping cart, or - another client looks at an auction which is finished, or the cron file (executed every X mins) updates the shopping cart - which ever comes first. Only the winner can update their sessions containing won products. This is done in the shopping cart itself.

 

At the admin side - An auctions "folder" must be created in which auction products are to be copied from the main products/categories list. Basically, if you want to list an auction, copy it to the auctions folder , then go to the auction products link in your admin -categories list and enter details of the product for auction, auction exp. date/time , starting price, overbid price etc. When the auction expires, the product does NOT become available again. In order to relist the item, admin must copy the product they wish to auction to the auctions "folder" and then select the product for auction from the admin-categories auction products section of your admin console.

 

This seems to work for statistics gathering because a trail of all auctions will always exisit in the database. Someone else will have to impliment stats for this though.

 

All I need now is a few people with "vanilla" installs to help me document the changes as my own site is heavily modded.

 

For the moment, the catalog/auctions.php file has been dis-used as this is not necessary.

 

Dan

Edited by psylencer
Link to comment
Share on other sites

This is a beta release. I have not tested this on a vanilla install. Any help or feedback from those installing on a vanilla OSC would be greatly appreciated.

 

The purpose of this contribution is to allow one to run their own auctions.

 

Current features include :

Ability to run many auctions of one product at a time,

"Won Auctions automatically added to shopping cart with "remove" and Qty changing disabled.

Email automatically sent to winning bidder,

 

etc etc. Please see the original "Auctions" contribution txts. for a full list of features.

 

Auction 2.0 Beta

===============

New features/Bug Fixes

_____________

- PHP Countdown with auto-refresh

- "Won" auctions automatically added to shopping cart

- Countdown to any time and date you wish (instead of 12:00)

- Auction price now displays highest bid instead of starting price

- You can no longer bid lower than starting price

- You can no longer bid less than current bid +overbid ammount

____________________________________

Known bugs

 

-Possible multiple "higher bid" notification emails sent to everyone with lower bids when higher bid entered

-"higher bid" notification emails are converted into SMTP Logs on some email servers <--This does not affect winning bid emails

-Poor use of language definitions

-Old obsolete code to be deleted

-Terms and conditions link does not work

 

This contribution in tested on a heavily modded OSC. I have documented this install for a New installation only (not upgrade), however changes made from Version 1.4.4 have been commented with "Dans Auction Contribution". Saying that 100% credit must go to the original Author Celdish and MarcusDesign. This is simply a few minor fixes and patches to make the contribution functional.

 

Forgive me if I've left some files or Mods out. It is very difficult for me to keep track of all the changes made. No doubt, with some valuable help from the community, we'll be able to get a solid working version of this truly excellent contrib. -Saying that, this is working great on my own site. I hope it works for you guys too.

 

Here's the link :

 

http://addons.oscommerce.com/info/5843

 

Dan

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 weeks later...
Auctions 2.1 Released. This is a final version. Completely re-documented.

 

http://addons.oscommerce.com/info/5890

 

Thanks everyone for the help.

 

Dan

 

 

hi Dan:

 

I had a problem when clicking on add to cart whether or not you are log in:

 

 

Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in C:\wamp\www\auction\includes\classes\shopping_cart.php on line 345

 

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 90 in C:\wamp\www\auction\includes\classes\shopping_cart.php on line 352

 

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 90 in C:\wamp\www\auction\includes\classes\shopping_cart.php on line 353

 

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 90 in C:\wamp\www\auction\includes\classes\shopping_cart.php on line 354

 

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 93 in C:\wamp\www\auction\shopping_cart.php on line 195

 

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 93 in C:\wamp\www\auction\shopping_cart.php on line 196

 

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 93 in C:\wamp\www\auction\shopping_cart.php on line 197

 

 

thanks for your help.

Link to comment
Share on other sites

Hey....great to see some changes with this mod. It actually forced me to upgrade the entire OSC...not an entirely easy experience from an ancient version to the latest...

 

I installed then this new version of the mod as well....and everything seems fine....a number of 'headers already sent'-errors...but managed to hide them for now...

 

but the biggest prob I have at the moment is the following:

 

Overbid works....so it prevents you from bidding lower than the previous bid...however, no matter what the overbid amount is...(it actually does show the "Bidding increments must be at least: $xxxx" text) it accepts any bet higher than the previous.

 

I also had time-issues. The counter shows the "Auction expires on (EST): 2008-05-14 12:00:00

(Time Remaining : Countdown complete)" but still accepts bids.

 

cheers,

Kimmo

Link to comment
Share on other sites

  • 1 year later...

It is the time of the year again where I have to run our annual auction.

 

Everything works....except the timer...

 

Timer shows first everything fine.....then 1h1min before the end....the counter jumps to 1min left....does the countdown to 0....and stops showing the bid-box....but the timer goes back to 59min left....

I have implemented the alternate countdown script suggested in the forums....so I have a feeling that the product-info-page is still referring to a different countdown?

 

Can anyone help?

 

best regards,

Kimmo

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...