Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Auctions 2.0 BETA


Guest

Recommended Posts

The above code exists in my file. I run the whole project locally and I am not using any online Server. I am using wamp apache server and my PHP version is 5.2.5. I just can't find what the error is

 

Can you please show me the error log which relates to loading of the page?

Link to comment
Share on other sites

I have a little problem here psy:

 

I'm testing your contrib on my test amp by an item I previously added to my catalog, and this shows on the header products info page:

 

"44

Warning: Cannot modify header information - headers already sent by (output started at c:\shop\product_info.php:91) in c:\shop\product_info.php on line 109"

 

and this on the Time Remaining box:

 

"Warning: countdown(setup.php): failed to open stream: No such file or directory in c:\shop\includes\modules\auction_bids.php on line 112

 

Fatal error: countdown(): Failed opening required 'setup.php' (include_path='.;C:\\php\pear\') in c:\shop\includes\modules\auction_bids.php on line 112"

 

I'm using the newest auction_bids.php you posted recently, and this is my product_info.php:

 

K, The first problem you've got relates to the auto-refresh feature. Basically this needs to happen in the header of the file. There is a test to see if the page is an auction page or not. If so, the page should reload every 120 secs. This updates the PHP countdown. (Similar to ebay). Could you please post your product_info.php file for me to look at.

 

secondly it sounds as if your setup.php file is either missing or in the wrong directory. Try copying it to the includes/modules directory and the /catalog directory and tell me what happens.

 

My bad, it looks as if I've put it in the wrong folder. Sorry <:)

 

 

Dan

Link to comment
Share on other sites

K, The first problem you've got relates to the auto-refresh feature. Basically this needs to happen in the header of the file. There is a test to see if the page is an auction page or not. If so, the page should reload every 120 secs. This updates the PHP countdown. (Similar to ebay). Could you please post your product_info.php file for me to look at.

 

secondly it sounds as if your setup.php file is either missing or in the wrong directory. Try copying it to the includes/modules directory and the /catalog directory and tell me what happens.

 

My bad, it looks as if I've put it in the wrong folder. Sorry <:)

Dan

 

One more thing, read below :

 

Sometimes programmers want to change some of the header values. For example, if the PHP if generating XML output, the Content-Type should be changed to reflect this. Another common example is in redirecting the user's browser to a different web page using the Location header element as described in this Tech-Recipe.

 

The header must come first in the response from a web server and is separated from the body by one blank line. The reason this error occurs is that some part of the body of the web page has been sent to the user already when a request is made to set a header value. Because PHP simplifies many things for you, the problem may be hiding in plain site. Here are some guidelines for finding the problem:

 

1) Find the header() statement that is causing the problem. The error must be at or before this line.

 

2) Look for any statements that could send output to the user before this header statement. If you find one or more, find some way to move the header statement before them. Complex conditional statements may complicate the issue, but they may also help solve the problem. Consider a conditional expression at the top of the PHP script that determines the header value as early as possible and sets it there.

 

3) Make sure there is no white space outside of the php start and end tags. While a blank line before the <?php start tag may look innocent, when processed by PHP, it will turn into an echo statement printing out a blank line. This is a common culprit.

 

Dan - I didn't write that, got it off tech recipies

Link to comment
Share on other sites

Thank you so much for your reply,

 

I moved the setup.php to modules and it worked like charm, for the header problem:

 

product_info.php

<?php 
//DANS AUCTION SCRIPT -REFRESH
$cquery="select products_id from ".TABLE_AUCTIONS_PRODUCTS." where products_id =".(int)$HTTP_GET_VARS['products_id'];
$cresult=mysql_query($cquery);

$cnum=mysql_numrows($cresult);

$z=0;
while ($z < $cnum) {

$casprodid=mysql_result($cresult,$z,"products_id");

echo $casprodid;
$z++;
}
if ($casprodid==(int)$HTTP_GET_VARS['products_id']) {
header('Refresh: 120');} else {									 -= I think this line's causing problem =-
echo '';}
//END DANS AUCTION SCRIPT
?>

 

But I'm not sure about the arrangement of the code, startings and endings are in the right place and there's a blank line before the starting, I tried to remove it but no result.

Link to comment
Share on other sites

Dan my problem now ( i think it is the last one :P) is that whenever a bid ends the product is added in the cart but the selling price is not the one which the bid ends but is the default price of the product .

Link to comment
Share on other sites

Dan my problem now ( i think it is the last one :P) is that whenever a bid ends the product is added in the cart but the selling price is not the one which the bid ends but is the default price of the product .

 

 

Let me look into this, I've obviously missed something somewhere, It certainly works for me, my problem is I don't know how I got it to work. I spent HOURS on this. Fingers crossed I'll figure it out.

 

Stay tuned

Link to comment
Share on other sites

Thank you so much for your reply,

 

I moved the setup.php to modules and it worked like charm, for the header problem:

 

product_info.php

<?php 
//DANS AUCTION SCRIPT -REFRESH
$cquery="select products_id from ".TABLE_AUCTIONS_PRODUCTS." where products_id =".(int)$HTTP_GET_VARS['products_id'];
$cresult=mysql_query($cquery);

$cnum=mysql_numrows($cresult);

$z=0;
while ($z < $cnum) {

$casprodid=mysql_result($cresult,$z,"products_id");

echo $casprodid;
$z++;
}
if ($casprodid==(int)$HTTP_GET_VARS['products_id']) {
header('Refresh: 120');} else {									 -= I think this line's causing problem =-
echo '';}
//END DANS AUCTION SCRIPT
?>

 

But I'm not sure about the arrangement of the code, startings and endings are in the right place and there's a blank line before the starting, I tried to remove it but no result.

 

Here's my code, do a compare and see if you pick up anything. Please note: This is from a heavily modded site. Some of this may not work for you, best to simply the whole lot down first to see exactly where there error occurs.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <?php echo HTML_PARAMS; ?>>

<?php 
//DANS AUCTION SCRIPT -REFRESH
$cquery="select products_id from ".TABLE_AUCTIONS_PRODUCTS." where products_id =".(int)$HTTP_GET_VARS['products_id'];
$cresult=mysql_query($cquery);

$cnum=mysql_numrows($cresult);

$z=0;
while ($z < $cnum) {

$casprodid=mysql_result($cresult,$z,"products_id");

//echo $product_info_queryA;
$z++;
}
if ($casprodid==(int)$HTTP_GET_VARS['products_id']) {
header('Refresh: 90');} else {
echo '';}
//END DANS AUCTION SCRIPT
echo $aaprodname;
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo $header_tags[title_tag]; ?></title>
<meta name="description" content="<?php echo $header_tags[desc_tag]; ?>">
<meta name="keywords" content="<?php echo $header_tags[keywords_tag]; ?>">
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="style.css">
<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

Link to comment
Share on other sites

Let me look into this, I've obviously missed something somewhere, It certainly works for me, my problem is I don't know how I got it to work. I spent HOURS on this. Fingers crossed I'll figure it out.

 

Stay tuned

 

 

OK Lets just work through this step by step so I know where the problem lies,

 

If the product is added to the shopping_cart,

 

can you find the product in the customers_basket table?

does the customers_basket table contain a column called "auction_product" and "Final_price"?

If so, does the "auction_product" field contain the number 1?

also does the "final_price" field contain the final auction price?

If none of this is true, add some dummy information to these fields - "1" in auction_product and say "99" in final price. Then log in as the winning bidder and have another look at your cart, then tell me what happens.

Edited by psylencer
Link to comment
Share on other sites

Both the final_price and the auction_product include the values you specified but i still in my shopping cart I get the default price:(

 

 

By any chance do you have installed any of those contributions?

Separate price per customer,

Product quantity price brake

or Make an offer?

If yes, than the way final price is calculate in your stoner will be different and given installation instructions won’t work.

Link to comment
Share on other sites

I found one bug.

I have created 3 users, and was placing bids randomly. After auction ended email with winning info was send to the bidder who had highest number in auctions_bids_id in table auctions bids.

Problem is if customer will place bid again he still will have the same auctions_bids_id and if he won email will be send to someone else.

Problem is in aucton2.php

$query="select MAX

I will look on it tomorrow and give correct query.

Link to comment
Share on other sites

By any chance do you have installed any of those contributions?

Separate price per customer,

Product quantity price brake

or Make an offer?

If yes, than the way final price is calculate in your stoner will be different and given installation instructions won’t work.

 

Nop I haveno , auctions is the only contribution I have installed so far

Link to comment
Share on other sites

Nop I haveno , auctions is the only contribution I have installed so far

 

If this is a virgin site, I know it's a big ask, but is there any chance I could install this for you? The whole reason this is a BETA version is because it has not been tested properly on a virgin install. I can't even doucment this correctly because I don't have virgin site to do so on.

 

Not that it means much, but you have my word I will not steal your site or any information within. PM me if interested.

 

By the way, we now have an admin console!

 

Featuring : Checkout status : NA/Added to cart/Complete

A paged list of all auctions with highest bidder, highest bid, ammount of bids, starting price, auction status, description, image, auction end date etc. Basically all the information one needs to be able to see the status of their auctions at a glance.

 

I've also polished the "My Account" section with a paged list of all auctions bid on,

 

Recreated an catalog/auctions.php page with most of the information from the admin console.

 

Dan

 

Dan

Link to comment
Share on other sites

I found one bug.

I have created 3 users, and was placing bids randomly. After auction ended email with winning info was send to the bidder who had highest number in auctions_bids_id in table auctions bids.

Problem is if customer will place bid again he still will have the same auctions_bids_id and if he won email will be send to someone else.

Problem is in aucton2.php

$query="select MAX

I will look on it tomorrow and give correct query.

 

Not quite sure I understand the problem. To be honest, I have not been able to reproduce the error you describe, however Im not sure I understand exactly what you are saying. As far as I know, "select MAX(ab.bid_price) as bid_price" selects the highest bid only which should have nothing to do with customers_id. None the less, I'd be very interested to see a more solid way to do this.

 

By the way, thanks for the constructive feedback

Dan

Edited by psylencer
Link to comment
Share on other sites

Not quite sure I understand the problem. To be honest, I have not been able to reproduce the error you describe, however Im not sure I understand exactly what you are saying. As far as I know, "select MAX(ab.bid_price) as bid_price" selects the highest bid only which should have nothing to do with customers_id. None the less, I'd be very interested to see a more solid way to do this.

 

By the way, thanks for the constructive feedback

Dan

Well i am customizing this contribution to fit my already customized store maybe thats the problem.

I can provide server for testing with fresh os cstore, let me know if you would like to work on it so i will provide you some access, or pm me.

Link to comment
Share on other sites

Not quite sure I understand the problem. To be honest, I have not been able to reproduce the error you describe, however Im not sure I understand exactly what you are saying. As far as I know, "select MAX(ab.bid_price) as bid_price" selects the highest bid only which should have nothing to do with customers_id. None the less, I'd be very interested to see a more solid way to do this.

 

By the way, thanks for the constructive feedback

Dan

 

I took the latest version of the contrib and the same problem came, here is the case. Try to recreate that

there are 3 customers, John, Mike and Tom.

John bid 10

Mike bid 20

Tom bid 30

Again John bid 40

After auction finish Tom got email that he won auction with price of 40. not john, i was studying the select MAX query. I will consult that with friend of my and we will come with some solution.

Link to comment
Share on other sites

Well i am customizing this contribution to fit my already customized store maybe thats the problem.

I can provide server for testing with fresh os cstore, let me know if you would like to work on it so i will provide you some access, or pm me.

 

FANTASTIC- Finally, someone is intersted enough to give me something fresh to install this on - we may get out of the Beta versions yet!

 

PM the the details including DB IP, L/P, Site URL, L/P and FTP L/P and I'll get started right away. Sorry I was a bit quiet last week, I was busy working on my Calendar Deals contrib (crazystu.com.au) - This will not be publicly relseased as I don't want every man and his dog doing the same thing.

 

I'll consider private requests. -The best thing? There's next to no PHP modification, simply copy the files, include the calendar and you're done.

 

Dan

Link to comment
Share on other sites

I took the latest version of the contrib and the same problem came, here is the case. Try to recreate that

there are 3 customers, John, Mike and Tom.

John bid 10

Mike bid 20

Tom bid 30

Again John bid 40

After auction finish Tom got email that he won auction with price of 40. not john, i was studying the select MAX query. I will consult that with friend of my and we will come with some solution.

 

 

Hmmm Let me look into it - I understand the problem a bit better now. I'll figure it out - There is another way to do the query which may work better. I'll get back to you tomorrow.

 

Also stay tuned as I've just completed the admin side to this contrib- Give all auction details and payment status similar to ebay. I was going to post this last week, but like I said, I've been busy on other things.

 

D

Link to comment
Share on other sites

Hmmm Let me look into it - I understand the problem a bit better now. I'll figure it out - There is another way to do the query which may work better. I'll get back to you tomorrow.

 

Also stay tuned as I've just completed the admin side to this contrib- Give all auction details and payment status similar to ebay. I was going to post this last week, but like I said, I've been busy on other things.

 

D

 

Something like this will do:

 

select max(ab.bid_price),

ab.customers_id,ap.auctions_id,

ap.products_id, pp.products_name,

pr.products_model,

cc.customers_firstname,

cc.customers_lastname,

cc.customers_email_address

from auctions_bids ab,

auctions ap,

customers cc,

products_description pp,

products pr

where ab.auctions_id=ap.auctions_id

and ab.customers_id = cc.customers_id

and ap.products_id = pp.products_id

and ap.products_id = pr.products_id

and ap.status = 1

and pr.products_id = ap.products_id

and ap.expires_date < 'now()'

group by ab.bid_price

order by ab.bid_date_added asc

limit 1

 

I will have account ready today and pm you with all info.

Link to comment
Share on other sites

Something like this will do:

 

select max(ab.bid_price),

ab.customers_id,ap.auctions_id,

ap.products_id, pp.products_name,

pr.products_model,

cc.customers_firstname,

cc.customers_lastname,

cc.customers_email_address

from auctions_bids ab,

auctions ap,

customers cc,

products_description pp,

products pr

where ab.auctions_id=ap.auctions_id

and ab.customers_id = cc.customers_id

and ap.products_id = pp.products_id

and ap.products_id = pr.products_id

and ap.status = 1

and pr.products_id = ap.products_id

and ap.expires_date < 'now()'

group by ab.bid_price

order by ab.bid_date_added asc

limit 1

 

I will have account ready today and pm you with all info.

 

One step ahead of you. THis is what I used (I prefer your way though - a lot simpler. I wish I'd remembers the ORDER BY and LIMIT functions before! :

 

select max(ar.bid_price) as bid_price, ar.customers_lastname, ar.customers_firstname,ar.customers_email_address

FROM (SELECT ab.customers_id, ab.bid_price, c.customers_lastname, c.customers_firstname,c.customers_email_address

FROM auctions_bids ab, customers c

WHERE ab.customers_id =c.customers_id and ab.auctions_id =***22*** <-for instance! ) ar

Group by bid_price DESC

LIMIT 1,1

 

Auctions 2.0.5 BETA is now released. Y'all may want to hold off though as we now have a Vanilla Site to install, test and document this on (Thanks marcinmf). This means we MAY be very close to a polished release. Fingers crossed I'll have some good news for everyone tomorrow. (It's going to be a late night)

 

Here's the detail on fixes for 2.0.5

 

• Updated auctions.sql file - please check for changes and perform them!

• product_info.php A few changes to the code for sending emails and a few queries, please perform step 1 again. - Fixed higher bid notification bug

• New auctions_bids.php file - Fixed Winning email bug -sent to wrong person

• New admin/auctions.php file - Plenty of new features here - This is the NEW ADMIN CONSOLE!!!! -Please make sure you've updated your database from the auctions.sql file. Please note this file is for new installs only, If you're upgrading, be sure to check what has changed and manually do so. Changes are documented in the file

• New account.php file (STEP 0)- Lets users know whats happening with auctions they've bid on! I've included MY OWN file here. I've changed the file name from account.php to dansaccount.php so you don't copy over your existing file. My Site is heavily modded- I think I've got the changes document here (STEP 0), but just in case - my file is there for your reference - Works for me.

• NEW auctionslister.php file. This displays all current auctions. to be copied to your /catalog/ directory. This file is formated for my own site. Mine is heavily modified, if you try to open this on your own site, you may need to modify the file for it work correctly.Still yet to create a link for and document this. It's a similar file to the privacy.php file (Not an include, but full file).

• NEW auctions_info.php language file

• NEW auctions_bids.php language file

• NEW auction.php language file

• NEW auctions.php language file

• Changes to /catalog/filenames.php (Step 2)

•Changes to /admin/filenames.php (Step 8)

• auction_terms.php <---Probably doesnt work - Still can't be stuffed doing this- Will probably be last on the list.

• auction_info.php <--Not sure if this file is necessary, none the less it was in my catalog directory, so I included it.

 

Dan

Edited by psylencer
Link to comment
Share on other sites

Well i am customizing this contribution to fit my already customized store maybe thats the problem.

I can provide server for testing with fresh os cstore, let me know if you would like to work on it so i will provide you some access, or pm me.

 

Auctions 2.1 Released. This is a final- tested version. Completely re-documented.

 

Thanks for the help everyone:

 

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

 

Dan

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...