Jump to content
Sign in to follow this  
deathgod

[Contribution] Auction Module

Recommended Posts

I have tried some moves with the email but since I'm no programmer I've had no success.

There is also a SEO_URLS dimension to [auction_url]

Maybe the other vars can be stuffed into hidden fields in the bidding form?

 

A possible workaround can be to leave these var out of the email message, like:

Desperate solution? Yes!

I have never seen the "same amount bidding" feature actually. I'll try it some day.

//Micke

 

Many thnx Micke for the quick reply,

 

For now, indeed this is an acceptable option. :thumbsup:

I noticed another 'error';

In the auction the overbid amount can be fooled. For instance, a product costs 25 dollars, the overbid amount is 5 dollars, now you still can overbid with 1 dollar. Would be great if the bidding amount raises with 5 dollars pro session.

Any solution would be appreciated.

Best regards;

Mike.

Share this post


Link to post
Share on other sites

The Countdown was very buggy (all solutions) and to complicated... so i've fixed it.

 

All you have to do is:

 

In includes/modules/auction_bids.php replace following line:

$datetime_count_down = tep_date_count_down($auction_infor['expires_date']);

with:

$datetime_count_down = strtotime($auction_infor['expires_date'])-time();

 

The function tep_date_count_down is not used anymore!

 

Also replace the Javascript Code on the bottom of the file with this:

<script type="text/javascript">

var tz = 0;		 //  Offset for your timezone in hours from UTC
var lab = 'countdown_date';	//  The id of the page entry where the timezone countdown is to show

function start() {displayTZCountDown(<?=$datetime_count_down?>,lab);}

// **	The start function can be changed if required   **
window.onload = start();

////////// DO NOT EDIT PAST THIS LINE //////////////////

function displayTZCountDown(countdown,tzcd) 
{
if (countdown < 0) document.getElementById(tzcd).innerHTML = "Sorry, you are too late."; 
else {var secs = countdown % 60; 
if (secs < 10) secs = '0'+secs;
var countdown1 = (countdown - secs) / 60;
var mins = countdown1 % 60; 
if (mins < 10) mins = '0'+mins;
countdown1 = (countdown1 - mins) / 60;
var hours = countdown1 % 24;
var days = (countdown1 - hours) / 24;
document.getElementById(tzcd).innerHTML = days + " <?php echo COUNTDOWN_DAYS; ?> "+hours+ '<?php echo COUNTDOWN_HOURS; ?>'+'  : ' +mins+ '<?php echo COUNTDOWN_MINS; ?> : '+secs+'<?php echo COUNTDOWN_SECS;?>';
setTimeout('displayTZCountDown('+(countdown-1)+',\''+tzcd+'\');',999);
}
}
</SCRIPT>

 

so you don't need the Javascript Function setTZCountDown(month,day,hour,tz)... it is much more easy than the old "solution" and it's always displaying the correct countdown...

Share this post


Link to post
Share on other sites

great to see that people are working to improve this script. There are still quite a few improvements this auctions script deserves. See previous pages to see what need to be done on the script.

 

Thanks to everyone who is improving the script!!!

 

:thumbsup:

Share this post


Link to post
Share on other sites
great to see that people are working to improve this script. There are still quite a few improvements this auctions script deserves. See previous pages to see what need to be done on the script.

 

Thanks to everyone who is improving the script!!!

 

:thumbsup:

 

And special thanks to you, starting this contribibution... It saved my a lot of development time...

 

I'm working on a bigger shop Project. The Auction is a big part of this Project. The shop will go public in 2 weeks. I will inform you about it...

 

beside the countdown, I've also solved some other problems.

At the moment I want to implement a short overview of the Auction "winners" in the back end.

Share this post


Link to post
Share on other sites
Hello everybody,

 

I have just installed your contrib on an newly created store, so just copied all the NEW files into te right folders. But when I press the "Auction Products" link in the admin area to start using the contrib, and place products in auction, I get the following error:

Products Auction Price Status Action

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

 

select p.products_id, pd.products_name, p.products_price, a.auctions_id, a.auctions_starting_price, a.auctions_date_added, a.auctions_last_modified, a.expires_date, a.date_status_change, a.status,a.overbid_amount from products p, auctions a, products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = a.products_id and a.status='1' order by pd.products_name limit -20, 20

 

[TEP STOP]

 

Would you know what have I done wrong?

 

Thanks in advance...

 

Regards

 

 

See http://forums.oscommerce.com/index.php?showtopic=250909

 

See also post 22 of this support thread from marcusdesign

Share this post


Link to post
Share on other sites
Anyone tell me what I've done wrong here?

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'and status' at line 1

 

select auctions_starting_price, expires_date, overbid_amount from auctions where products_id = and status

 

[TEP STOP]

 

Hello everybody,

 

I have just installed your contrib on an newly created store, so just copied all the NEW files into te right folders. But when I press the "Auction Products" link in the admin area to start using the contrib, and place products in auction, I get the following error:

Products Auction Price Status Action

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

 

select p.products_id, pd.products_name, p.products_price, a.auctions_id, a.auctions_starting_price, a.auctions_date_added, a.auctions_last_modified, a.expires_date, a.date_status_change, a.status,a.overbid_amount from products p, auctions a, products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = a.products_id and a.status='1' order by pd.products_name limit -20, 20

 

[TEP STOP]

 

Would you know what have I done wrong?

 

Thanks in advance...

 

Regards

 

It cannot be told from your post which version of the Auction code you have installed, BUT MySql and PHP is sensitive between versions of it - so see

 

See http://forums.oscommerce.com/index.php?showtopic=250909

 

See also post 32 of this support thread from marcusdesign

 

In reality you should read the entire support thread

 

Bob

Share this post


Link to post
Share on other sites

Hi All:

 

This is going to be the "killer app" to eBay - lots of little bees all swarming to sting at once who own there own stores and destinys !!

 

I have a Language problem that is created somewhere causing tep_db_connect error

 

I have Auction 1.4_1 installed. It's a language problem which produces a tep_db_connect error that points to database.php.

 

I have PHP version 4.4.4 and MySQL version 4.1.21-standard

 

I have already fixed the 1064 errors. See http://forums.oscommerce.com/index.php?showtopic=250909

 

I downloaded Auctions 1.4 and was able to get it working - but only by commenting out the language statements in product_info.php as thus:

 

The contrib when installed caused a fatal error tep_db_connect error.

 

I get this from the browser . . . it is pointing to database.php and it is . . .

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /home/centcom/public_html/onlinestore/includes/functions/database.php:13) in /home/centcom/public_html/onlinestore/includes/functions/database.php on line 13

 

If I go anywhere else but product_info.php the OSC site works

 

SO . . . this is how I get OSC to come up and work from these changes to product_info.php below:

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

// BAD CODE BELOW - CAUSES tep_db_connect() error

//require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 

// bof added for auction product contribution

// BAD CODE BELOW - CAUSES tep_db_connect() error

// require(DIR_WS_LANGUAGES . $language . '/' . 'auction.php');

 

if (isset($_POST['placebid']) ) {

 

The contrib's mods to product_info.php caused this it appears, (or maybe I pasted something wrong - but I believe I have checked four times now) as when the DIR_WS_LANGUAGES was loaded, and so it had to be commented out as below. (Normally line 15 of product_info.php)

 

// BAD CODE BELOW - CAUSES tep_db_connect() error

// require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 

AND the one inside the auction BOF area also

 

The error went away and the site then loaded - but of course with no TEXT variable defines loading so now everything on the site loads - AND WORKS FINE - in ENGLISH ONLY and like this for any variables of javascript links => TEXT_MORE_INFORMATION, and TEXT_DATE_ADDED in the product info pages and all other pages that use variable TEXT information.

 

Other support pages suggested the tep_db_connect error was caused by usually language code.

 

For instance another forum - OSCMax - a commercial version of OSC user had the same problem and here is what the developer said when he solved the problem

 

michael_s michael_s is offline

osCMax Developer

 

Default RE: Re: RE: Re: RE: Please help... going nuts

Jose, the original file was renamed to index.nested2.tpl.php and there was the other incorrect file index.nested.tpl.php in its place. So somewhere along the line you switched them (probably testing something) and you most likely forgot about the change. I do it all the time

 

An error like that, where it says a function cannot be redelcared is usually not caused by the file where the error shows up. What happened is that your index.nested.tpl.php was calling database.php a second time when it was not supposed to. It was easy to track down when I compared your template files against the standard osCMax templates. Your index.nested.tpl.php was about 5 times larger in size than the correct template, so it stood out clearly. [bold and italics emphasis added by me]

 

You can find the entire thread at http://www.oscmax.com/forums/oscmax-v1-7-d...going-nuts.html

 

To me this looks like a case of the code doubling back on itself somehow as Micheal_s suggests above.

 

Everywhere else I have gone in support forums - where parties have solved this kind of error - either they don't know what they did to fix it; or it was fixed like above by replacing standard files. EXCEPT for one OSC forum below which had to stop double loading by using the require_once or include_once statement

 

NOW I do have a few contribs on this site like CCVG gift voucher, and OSC Affiliate and Google Checkout (wouldn't cause this though) and Anti_Robot Registration (but installed after this) Auction Process and some others I can't recall right now.

 

There was another problem just like this which was solved with require_once statements, but I don't know what might be re-loading database.php to go into as files and look to start using require_once or include_once statements in http://forums.oscommerce.com/index.php?showtopic=191078 - but that support thread was not specific where the user found the offending files to put the require_once statements on.

 

I don't know this code for Auctions well enough to know where to look either because it basically uses all of OSC - and somehow it looks like a Language problem is created somewhere causing the tep_db_connect error. I do not know how the languages work that could cause this AT ALL.

Has anyone got any clues OR can you tell me how to get this maybe working in ENGLISH only without the dynamic path - that is to hard code product info.php to ENGLISH only for right now?

Share this post


Link to post
Share on other sites
Hi All:

 

This is going to be the "killer app" to eBay - lots of little bees all swarming to sting at once who own there own stores and destinys !!

 

I have a Language problem that is created somewhere causing tep_db_connect error

 

I have Auction 1.4_1 installed. It's a language problem which produces a tep_db_connect error that points to database.php.

 

I have PHP version 4.4.4 and MySQL version 4.1.21-standard

 

I have already fixed the 1064 errors. See http://forums.oscommerce.com/index.php?showtopic=250909, , ,

 

My last posts on the teb_db_error are MOOT for now. I changed ALL require and include statements in /includes/application_top.php to require_once and include_once - so now the new error is:

 

Fatal error: Call to undefined function: tep_end_auction_invalid() in /home/centcom/public_html/onlinestore/includes/languages/english/product_info.php on line 19

 

This is my line 19 of that product_info.php file

 

if (strtotime($mfo_auction_query->expires_date)<time()) {

 

OF

 

if (strtotime($mfo_auction_query->expires_date)<time()) {

$products_auction_id = $_GET['products_id'];

tep_end_auction_invalid($products_auction_id);

 

I applied the fix of post #81 - http://forums.oscommerce.com/index.php?s=&...t&p=1008296 Nothing – but I didn’t expect it to fix anything as an auction has not ended yet

 

There is still an issue of the code double calling the database or some file – but it’s muted by the “once” statements - for now

 

At least it appears I am approaching the language directories now but on a different error that APPEARS TO BE the auction contrib.related.and appears to say it does not know what “tep_end_auction_invalid “ is.

 

This one has stopped me - did I miss a fix along the way?

 

Bob

Share this post


Link to post
Share on other sites
My last posts on the teb_db_error are MOOT for now. I changed ALL require and include statements in /includes/application_top.php to require_once and include_once - so now the new error is:

 

Fatal error: Call to undefined function: tep_end_auction_invalid() in /home/centcom/public_html/onlinestore/includes/languages/english/product_info.php on line 19

 

This is my line 19 of that product_info.php file

 

if (strtotime($mfo_auction_query->expires_date)<time()) {

 

OF

 

if (strtotime($mfo_auction_query->expires_date)<time()) {

$products_auction_id = $_GET['products_id'];

tep_end_auction_invalid($products_auction_id);

 

I applied the fix of post #81 - http://forums.oscommerce.com/index.php?s=&...t&p=1008296 Nothing – but I didn’t expect it to fix anything as an auction has not ended yet

 

There is still an issue of the code double calling the database or some file – but it’s muted by the “once” statements - for now

 

At least it appears I am approaching the language directories now but on a different error that APPEARS TO BE the auction contrib.related.and appears to say it does not know what “tep_end_auction_invalid “ is.

 

This one has stopped me - did I miss a fix along the way?

 

Bob

 

 

These issues above are all fixed now. I did miss a fix - it is not documented in the installation.txt, but is in the downloaded package as a part of the file general.php

 

The tep_db_error was caused by a script installed version of OSC which had a require statement for application_top. php which called the database twice in the /catalog/includes/language/english/product_info.php file. I replaced it with a virgin file.

 

The tep_end_auction_invalid function (and the one for "valid") is a define that are both in the catalog/includes/functions/general.php file, but is not mentioned in the install documentation.

 

The countdown fix of the post of sopinon Posted Feb 15 2007, 06:15 AM appears to work fine and allows you to clean up general.php by removing that countdown function declared there.

 

A bug I have found appears to be a limit of 5 auction listings - when I declared 6 in admin. One won't show.

 

Bob

Share this post


Link to post
Share on other sites

Installed it, love it, but have a problem. The date of expiry is not OK. It shows around 31 days more than it should. Any questions how to solve it?

 

Thank you,

DAnijel

Share this post


Link to post
Share on other sites

Congratulations for the auction.

 

A problem that I found was:

The User can buy a product in Auction that is a bad idea.

 

 

I installed Auction v1.4.2 am with the mistake below:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'and status' at line 1

 

select auctions_starting_price, expires_date, overbid_amount from auctions where products_id = and status

 

[TEP STOP]

 

Can they help me?

Thanks

Share this post


Link to post
Share on other sites

Auction on the Internet Suggestions :thumbsup:

 

Rules for bids at an internet auction:

 

I need to have an auction like the ebay auction.

 

First of all: The maximum bid will be a "hidden bid".

 

For example:

 

I have an item for US$ 50.

 

A "registered bidder" bid US$ 100 (hidden bid). You will see only US$ 50 and under these value : 1 bid.

 

After that supose we have another bidder. He bid US$ 70 for the same item. These bidder will see at the screen BID AGAIN and the value US$ 71, 2 bids.

 

It will appear the message YOU ARE THE HIGHER BIDDER only if we have bids above US$ 100 (bid US$ 101 for example). In these moment the ex-higher bidder will receive na email regarding these event.

 

It is necessary to have the option with "reserve price" to list for example US$ 20 with a hidden reserve price of US$ 50. Is possible to bid US$ 25, 30 or 40, but he will receive a message: bid under the reserve price. If auction ends without reaching the reserve price a private treaty is possible. Over the reserve price we have the auction following the old way. Is necessary to have the option BUY IT NOW . Listed with a start price of 20 but is possible to interrupt the auction buiyng now for 50, for example.

 

Visiting ebay will be very easy to undestand the correct way to do these work.

 

Is nice to have many oprions for days (3, 7, 10 and 30 days auction).

 

 

Best regards

Share this post


Link to post
Share on other sites
Many thnx Micke for the quick reply,

 

For now, indeed this is an acceptable option. :thumbsup:

I noticed another 'error';

In the auction the overbid amount can be fooled. For instance, a product costs 25 dollars, the overbid amount is 5 dollars, now you still can overbid with 1 dollar. Would be great if the bidding amount raises with 5 dollars pro session.

Any solution would be appreciated.

Best regards;

Mike.

Dear All,

 

amazing staff !! Well done !!!

 

Do you have some ideas about the issue above? Because it seems to work successfully on your reference website: WWW.BELTESPENNER.COM

 

Thanks in advance from Paris :thumbsup:

 

Gregg

Edited by GreggBazin

Share this post


Link to post
Share on other sites

Hi,

 

I'm actually new in auction modul. I've downloaded the latest version 1.4.2 and try to install. But the installation.txt is a little bit chaotic. I should take some changes in file product_info.php. It's ok. But I found some of new sections is allready inserted, others is similar to the original ones and so on.

Is there anybody out there has an absolutly corrected verson of these file? No need to change it just upload to the server.

 

 

Best regards and thanks

 

Mátyás

Share this post


Link to post
Share on other sites

hi

 

am i overlooking something or overbid is still not working (not to mention that emails are not sent)

 

Auction price was 1 EUR .. i bidded with 2 EUR so it says

 

01. Gregor (ID: 2) 2.00 EUR 2007-03-14 22:05:41

 

then logged with other ID bidded for 1 EUR .. now says

 

02. Gregor (ID: 3654) 1.00 EUR 2007-03-14 22:26:39

 

 

now, what is the final price? 1, 3 or 4 EUR? Overbid ammount is set to 1

 

/confused

Share this post


Link to post
Share on other sites
The Countdown was very buggy (all solutions) and to complicated... so i've fixed it.

 

All you have to do is:

 

.....

so you don't need the Javascript Function setTZCountDown(month,day,hour,tz)... it is much more easy than the old "solution" and it's always displaying the correct countdown...

 

Sopinon....this is FANTASTIC! What a wonderful script to not only reduce code, but make the timer work correctly. Props...

Share this post


Link to post
Share on other sites

Hi All!

Has anyone a solution for closing the auction at another time than midnight?

Our customers are most active during day-time...

//Micke

Share this post


Link to post
Share on other sites

Modified e-Mail notification for higher bids which really works:

(in .../catalog/product_info.php, starting around line # 50)

 

This slightly modified code will send correct mails including firstname, lastname and clickable URL link to the corresponding product. Enjoy it!

 

(Find in .../catalog/product_info.php, starting around line # 50)

// send email notify about higher bid than the other customer's bid who won
$sql_customer = 'select customers_lastname, customers_firstname,customers_email_address from '. TABLE_CUSTOMERS." c,". TABLE_AUCTIONS_BIDS." ab  where c.customers_id=ab.customers_id and ab.auctions_id= '$auction_id' and ab.bid_price<".(int)$bid_price."";
$acustomer_query = tep_db_query($sql_customer);

while ($acustomer = tep_db_fetch_array($acustomer_query)) {

 $acustomer_firstname = $acustomer['customers_firstname'];
 $acustomer_lastname = $acustomer['customers_lastname'];
 $acustomer_email = $acustomer['customers_email_address'];
 $acustomer_name = $customer_firstname .' '.$customer_lastname;
 $auction_url = tep_href_link(FILENAME_PRODUCT_INFO,'products_id='.$products_id);
 $email_text = str_replace('[customer_firstname]',$acustomer_firstname,str_replace('[customer_lastname]',$acustomer_lastname,str_replace('[customer_email]',$acustomer_email,str_replace('[auction_name]',$auction_name,str_replace('[auction_url]',$auction_url,str_replace('[bid_price]',$bid_price,AUCTION_HIGHER_BID_NOTIFY_EMAIL))))));

 tep_mail($acustomer_name, $acustomer_email, AUCTION_HIGHER_BID_NOTIFY_EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO,'products_id='.$products_id));

 

Regards

www.swissmodell.ch

Juerg


Juerg

Share this post


Link to post
Share on other sites

Thanks Juerg, it's right that didn't work successfully :thumbsup:

 

And do you have a solution for the issue with the overbid amount?

 

See you soon I hope :blush:

 

Gregg

Share this post


Link to post
Share on other sites

Hi All!

Thanks, juerg for the "modified e-Mail notification for higher bids which really works".

I have a question regarding these messages.

Sometime long ago I must have managed to wreck some code somewhere in this Auction module.

The e-mail notifications are recieved with the message header and all.

The other mail messages the site sends all work as you expect (in html by the way).

Does anyone know a good place to start looking?

//Micke

Share this post


Link to post
Share on other sites
Hi All!

Thanks, juerg for the "modified e-Mail notification for higher bids which really works".

I have a question regarding these messages.

Sometime long ago I must have managed to wreck some code somewhere in this Auction module.

The e-mail notifications are recieved with the message header and all.

The other mail messages the site sends all work as you expect (in html by the way).

Does anyone know a good place to start looking?

//Micke

The messages recipient field is empty too.

//Micke

Share this post


Link to post
Share on other sites
Anyone tell me what I've done wrong here?

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'and status' at line 1

 

select auctions_starting_price, expires_date, overbid_amount from auctions where products_id = and status

 

[TEP STOP]

 

hi all.

First of all thank you for this contribution .. excelent :)

Now DJ for your problem that also happened to me, and please try this solution (it worked for me)

1º - Use the original ./catalog/product_info.php

2º - Do NOT replace it with the one in this package

3º - DO what is told to replace in the file in the Instalation.txt

 

And that solved the problem to me.

 

Thank you.

Share this post


Link to post
Share on other sites

Hello all.

 

A simple question ...

 

Is there a admin part of this module ??

 

meaning .. for the customer who won the auction, is there a place where i can make that auction a order and send to customer ???

Am i missing something on the admin part ???

 

Thank you

Share this post


Link to post
Share on other sites
Hello all.

 

A simple question ...

 

Is there a admin part of this module ??

 

meaning .. for the customer who won the auction, is there a place where i can make that auction a order and send to customer ???

Am i missing something on the admin part ???

 

Thank you

You'll need this manual order maker contribution to do that. If you can activate an auction you are not missing anything inside the contrib package...

//Micke

Share this post


Link to post
Share on other sites

When a person bids less than or equal to the current bid price I'm getting this error:

 

Warning: Cannot modify header information - headers already sent by (output started at /home/herohost/public_html/product_info.php:57) in /home/herohost/public_html/includes/functions/general.php

 

Anybody fixed this yet?

 

Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×