I just upgraded the module and am now getting this prompt:

The start price for this auctioned item is low enough that the minimum bid price ($0.50) is higher than the maximum bid price ($0.00). Please either increase the price or adjust the minimum and maximum bid values on the Auction settings page so that this problem does not occur.

I had my range set at $10/20, but since this has come up I've dropped it back to the default, and even reinstalled it.

Can you help with a proper range? Is there something that I'm missing?

thanks,
rmh

Comments

fossie’s picture

I think you can get around this by first creating the product without the auction settings.

Save

Edit again, change the auction settings again, see that the start price is higher than 0.

(I think this is still a bug when you have 'new products are auctions by default', you can directly submit a product when this setting is false)

coloryan’s picture

Correct, that worked. Thank you.

Note to self: Auction is collapsed on the second time around - don't look for it to be expanded.

andrewoke’s picture

Hey Garrett,

I think I found the reason why that error keeps coming up. On alot of stuff you have $form['#node']->uc_auction['is_auction'], but when I var_dump the form is_auction appears like this $form['#node']->is_auction.

By changing that value in the first couple lines of hook_form_alter I've eliminated that error. If you need more info I'll add that later, been working for too long and my brain needs a rest.

Garrett Albright’s picture

So just to clarify, the problem is that you had the "Product is auction by default" setting enabled (so that the new product you were creating had the "This is an auctioned product" check box checked automatically), but you hadn't put a price in the price field. Is that correct?

If so, then that's sort of the expected operation. Sorry. :P Although I suppose I could make it so that the "This is an auctioned product" check box is ignored if the starting price value is left blank…

fossie’s picture

I think the problem is that when the option is set (products are automatically auctions...) you can't create products if you set a selling price.

Maybe this box (starting price) should only be disabled if their are already auction bids. I think their is no need to block this field when no auction bids are made.

Maybe another approach : the check (price should be starting (0 if not set) + increment should not be checked on the product create page), because I think this check is causing the problem.

Fossie

Garrett Albright’s picture

Sorry, but I still can't duplicate the problem. Here's what I'm doing;

In the Auction Settings page, I have "New products are auctions by default" checked.

I create a new product. Since I don't want the product to be auctioned, I uncheck the "This is an auctioned product" box.

I set an SKU, a sell price and a title as normal, then click the "Submit" button.

And I then have a shiny new non-auctioned product… I'm not seeing where the problem is. =[

fossie’s picture

Hmm, that's not a problem, you can uncheck the auction.

But when you leave the auction checked, I can't create a product, because of that error mentioned on the first post.

The workaround if products are auctions by default is to uncheck, save, edit again, check and add a starting price.

So for testing purposes, I've set: the products are auctions by default, to off.

Fossie

Garrett Albright’s picture

Why aren't you adding a starting price the first time you save it, then?

Either way, it sounds like this isn't a bug - just some confusion over how the module works.

fossie’s picture

Maybe it's a conflict somehow, but that's the point, I can't add a starting price when this setting is active (thus new products are auctions by default).

I'll give the new .dev version a try, maybe it's fixed their.

Keep you informed,
Fossie

fossie’s picture

Previous comment was against the older dev (23th Jan), with version 28th Jan its working.

Fossie

fossie’s picture

Not solved, on the clean install site:

Auction settings:
- New products are auctions (checked)
- Default expiration: +7 days
- active exp count: checked
- hide standard price: checked

Bid limits:
- bid increment: 10.00
- min bid increase: 100.00
- max bid increase: 1000.00
- max bid increase %: 50

Product created:
sell price: 10000

auction: starting price: 5,000.00

and afterwards, I can't edit the product

When I set the auction settings to default, I can edit the product.

Should I open a new issue? Is their something wrong in my auction settings page? Can you reproduce the error with this settings?

Thx,
Fossie

gjerdery’s picture

I'm seeing the same issue as the original poster, in that I cannot have an auction starting price of $0.

In the scenario I'm testing, I'd like bidders to be able to place bids in multiples of $5 (yes, a little arbitrary -- but it mimics the behavior of a homegrown product we are using) -- so I have set both the bid increment and minimum bid increase settings to $5.

Now when creating a new product, whether I'm creating it as an auction by default or if it is a preexisting product I'm turning into an auction, I can't set the starting price of the auction to $0. It must start at $5 or higher, meaning that the first bid must be $10 or higher. Is this expected behavior?

fossie’s picture

I think I've found the problem:

Lets take a start_price of 10,000

In the function: uc_auction_form_validate

when testing the $max_bid_pctg value, the result = 10 * (100/100 +1) = 10*2=20
The minimum bid goes with the same problem; 10000 in the database and with the tests it results in 10...

Some watchdog output:

uc_auction 29/01/2009 - 17:34 Maxbid_pctg: 20 Maxbid flat: 25010 take minimum maxbid: 20
uc_auction 29/01/2009 - 17:34 start price: 10 (in db= 10,000)
uc_auction 29/01/2009 - 17:34 Calculated Minbid: 110
uc_auction 29/01/2009 - 17:34 Minbid db: 10,000.00

The problem is that the stored values aren't taken into account.

If I just uncomment the error message in in uc_auction_form_validate
if ($min_bid > $max_bid)
// form_set_error message

Bottom line: the prices aren't retrieved correct from the database, I think.

I can edit products and save them.

HTH,
Fossie

Garrett Albright’s picture

Okay, it sounds like both Fossie and gjerdery are expecting different things, but it's related to the same bit of code. I'm going to be a bit busy with other projects tomorrow, so I won't be able to take a look at it and see if I can find something to appease everyone, but hopefully early next week I'll be able to take a look at it. Thanks for the feedback.

fossie’s picture

Thx Garrett,

But I think it's the same issue and we expect the same result.

The issue : database has a value, but when processing it, it's truncated.
10,000 in db becomes: 10 (for the test) and in the case max_bid_pctg: should be 10000 * (100/100 +1), should be 20000 iso 20.

The other thing I've noticed:
If their is already a bid placed and you edit the product, the validate should not go with the start_price, but with the high_bid_amt, I suppose.

Anyway, take some time and we'll come back to it next week.

Have a good weekend,
Fossie

Garrett Albright’s picture

Okay, I've tweaked the system so that starting prices of zero are acceptable. Note that in this case, the maximum bid increase percentage value is ignored (because any percentage of zero is always zero, which was the problem), which might cause some unexpected results.

For example, given a maximum increase of $100 and a maximum increase percentage of 100%, if the start price is $0, the maximum bid value will be $100. But then if someone comes along and places a $2 bid on it, the percentage value will now apply, so the maximum bid value will be $4 - $96 less than it was before!

As for fossie's problem, I think I figured it out. When a number is entered with commas, PHP was throwing out all digits after the comma when converting it to a number; so 12,345.67 was simply becoming 12. I put in some code to strip out extra non-number characters before the value is converted to a number, so hopefully that won't be a problem anymore - please test the newest dev release once it becomes available. (I already had this code in place for placed bids, but for whatever reason didn't think to apply it to other places where I'm taking currency values.)

Garrett Albright’s picture

Status: Active » Closed (fixed)