Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

auctionTastic


FWR Media

Recommended Posts

includes/modules/auctions/classes/oscAuctions.php

Find ..

	if( $this->array_keys_exist($keys, $_POST) ){

Replace with ..

	if( $this->array_keys_exist($keys, $_POST) ){
	   if ( false !== strpos($_POST['bid_price'], ',') ){
		 $_POST['bid_price'] = str_replace(',', '', $_POST['bid_price']);
	   }

 

It works now.

includes/modules/auctions/classes/oscAuctions.php

Find ..

	&&( $this->array_keys_exist($keys, $_POST) ){

Replace with ..

	&&( $this->array_keys_exist($keys, $_POST) ){
	   if ( false !== strpos($_POST['bid_price'], ',') ){
		 $_POST['bid_price'] = str_replace(',', '', $_POST['bid_price']);
	   }

 

As always, FWR MEDIA your help is greatly appreciated. Sorry the pun came over incorrectly. I have nothing but praise and respect for what you are doing for all of us out here. (English is not my native language so I probably should not try to joke)

Link to comment
Share on other sites

(English is not my native language so I probably should not try to joke)

 

Forum comments are a bit "dry" sometimes, it is all to easy for the true meaning to be lost and the comment taken out of context .. even if speaking your native tongue.

Link to comment
Share on other sites

You are working from an older revision .. do the following: -

The latest version I believe is AuctionTastic 1.0_RC1-r22 ??? Uploaded May 9th. by you.

That is what I am working with - never tried any version prior to the May 9th. version.

 

After making the suggested changes of:

 function setPlaceBid(){
 global $messageStack;
 $keys = array('products_id','bid_price','auction_id','products_model','tax_rate','currency_modifier', 'validnewbid');
 if( $this->array_keys_exist($keys, $_POST) ){
   if ( false !== strpos($_POST['bid_price'], ',') ){
	 $_POST['bid_price'] = str_replace(',', '', $_POST['bid_price']);
   }
   // Reject bids if less than the required validnewbid
   if ( $_POST['bid_price'] < $_POST['validnewbid'] ){
	 $messageStack->add_session('header', 'A bid must meet the minimum required value', 'warning');
	 session_write_close();
	 tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO,'products_id='  . tep_sanitize_string($_POST['products_id']) . '&page=' .  $this->pageNum . '&auction_show=1'));
	 exit;
   }</span>

 

And placing a bid of 3,000,000.00 or 3000000.00 a new window shows up and states product not found. (I am not working with the latest OSCommerce version - could that have something to do with it ?)

Edited by usvi4me
Link to comment
Share on other sites

I would have liked to test also, but I can't right now, unfortunately.

 

Just so as you know Chris (and any other devs) .. I usually include a "drop on top" method with these contribs for devs.

 

So you can .. if you wish .. load up a new RC2a on local pc server .. drop the files on top (uploads and modifieds directories) .. run the DB installer .. done. Takes a couple of minutes.

Link to comment
Share on other sites

The latest version I believe is AuctionTastic 1.0_RC1-r22 ??? Uploaded May 9th. by you.

That is what I am working with - never tried any version prior to the May 9th. version.

 

After making the suggested changes of:

 function setPlaceBid(){
 global $messageStack;
 $keys = array('products_id','bid_price','auction_id','products_model','tax_rate','currency_modifier', 'validnewbid');
 if( $this->array_keys_exist($keys, $_POST) ){
   if ( false !== strpos($_POST['bid_price'], ',') ){
	 $_POST['bid_price'] = str_replace(',', '', $_POST['bid_price']);
   }
   // Reject bids if less than the required validnewbid
   if ( $_POST['bid_price'] < $_POST['validnewbid'] ){
	 $messageStack->add_session('header', 'A bid must meet the minimum required value', 'warning');
	 session_write_close();
	 tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO,'products_id='  . tep_sanitize_string($_POST['products_id']) . '&page=' .  $this->pageNum . '&auction_show=1'));
	 exit;
   }</span>

 

And placing a bid of 3,000,000.00 or 3000000.00 a new window shows up and states product not found. (I am not working with the latest OSCommerce version - could that have something to do with it ?)

 

I haven't a clue .. I just added the changed code to my local server .. made a bid of 32,000.00 and it worked perfectly.

Link to comment
Share on other sites

I haven't a clue .. I just added the changed code to my local server .. made a bid of 32,000.00 and it worked perfectly.

That is what I am trying now on the localhost. It's a fresh install of Oscommerce 2.2a (the latest anyway) and drop on top files. Get the same answer - after bidding the product is not found.

 

By changing the if statement to && a couple of posts up seems to work fine. Would you try that on your setup and see what happens ?

Link to comment
Share on other sites

That is what I am trying now on the localhost. It's a fresh install of Oscommerce 2.2a (the latest anyway) and drop on top files. Get the same answer - after bidding the product is not found.

 

By changing the if statement to && a couple of posts up seems to work fine. Would you try that on your setup and see what happens ?

 

Ok to avoid confusion .. replace the whole function setPlaceBid() function with ..

  function setPlaceBid(){
global $messageStack;
$keys = array('products_id','bid_price','auction_id','products_model','tax_rate','currency_modifier', 'validnewbid');
if( $this->array_keys_exist($keys, $_POST) ){
  if ( false !== strpos($_POST['bid_price'], ',') ){
	$_POST['bid_price'] = str_replace(',', '', $_POST['bid_price']);
  }
  // Reject bids if less than the required validnewbid
  if ( $_POST['bid_price'] < $_POST['validnewbid'] ){
	$messageStack->add_session('header', 'A bid must meet the minimum required value', 'warning');
	session_write_close();
	tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO,'products_id=' . tep_sanitize_string($_POST['products_id']) . '&page=' . $this->pageNum . '&auction_show=1'));
	exit;
  }
  if( is_numeric(str_replace(array('{','}'), '', $_POST['products_id'])) && is_numeric($_POST['auction_id']) ){
	$this->auctionProductsId = $_POST['products_id'];
	$this->auctionId = (int)$_POST['auction_id'];
  } else {
	$this->auctionProductsId = "";
	$this->auctionId = "";
  }
  if( is_numeric(str_replace(array(',', '.'), '', (float)$_POST['bid_price'])) ){
	$bid_notax = $_POST['bid_price'] - ($_POST['bid_price'] - ( $_POST['bid_price'] / (100 + $_POST['tax_rate']) * 100));
	$bid_less_currency_conversion = $bid_notax / $_POST['currency_modifier'];
	$this->bidPrice = (float)$bid_less_currency_conversion;
  } else {
	$this->bidPrice = 0;
  }
  $this->productsModel = tep_sanitize_string($_POST['products_model']);
  $this->productsName = tep_sanitize_string($_POST['products_name']);
} else {
	$this->auctionProductsId = "";
	$this->auctionId = "";
	$this->bidPrice = 0;
	$this->productsModel = "";
	$this->productsName = "";
}
 }

Link to comment
Share on other sites

Replaced the function as mentioned above and still get no product found after the bid:

 

http://localhost:8888/product_info.php?pro...;auction_show=1

 

The issue you have is that the products_id is missing from the querystring.

Link to comment
Share on other sites

The issue you have is that the products_id is missing from the querystring.

 

Yes, I see that there is no product id listed in the browser. But I have no idea how to fix this and where. Initial if replacement by && still works but you must feel it will give errors somewhere else.

 

Am I the only one with this challenge ?

Link to comment
Share on other sites

Yes, I see that there is no product id listed in the browser. But I have no idea how to fix this and where. Initial if replacement by && still works but you must feel it will give errors somewhere else.

 

Am I the only one with this challenge ?

 

I think I know what this is . .I gave you code from the latest revision but there were changes to other files.

 

Try this for me .. download the latest revision (uploaded today) .. you need to look at nothing more than the uploads directory .. overwrite your files with the files from the upload directory.

Link to comment
Share on other sites

I think I know what this is . .I gave you code from the latest revision but there were changes to other files.

 

Try this for me .. download the latest revision (uploaded today) .. you need to look at nothing more than the uploads directory .. overwrite your files with the files from the upload directory.

 

FWR Media:

 

I uploaded all files (with the exception of the two installer files) of AuctionTastic version 1.0_RC_r125 on the localhost (which is running the latest OScommerce 2 version). Everything works.

 

When uploading to the server which does not have the latest OScommerce version I received this error

 

Fatal error:  Call to undefined method currencies::calculate_price() in /home1/xxxxxx/public_html/xxxxxxxx/includes/modules/auctions/auction_bids.php on line 25

 

Changing line 25 in /home1/xxxxxxx/public_html/xxxxxxxx/includes/modules/auctions/auction_bids.php to

 

$with_tax = ($bid_unformatted);

 

Made it compatible with the earlier version of OSCommerce.

 

Thank you.

Link to comment
Share on other sites

Feature request:

 

Scenario:

I am running a shop that sells dishware.

In stock I have "top of the line" dishes that are in A1 condition.

 

I also have in stock "blemished" dishes that should not be sold for the same price. These "blemished" dishes I would like to put up for auction. In the auction itself I would like to describe exactly what these "blemishes" are to eliminate any confusion.

 

At first I thought the way around this would be to add the "blemished" dishes as a "separate" inventory item. BUT, adding this as a separate inventory item with the description that the auction is only good for blah blah blah, it ALSO shows up in the regular shop. I want to keep these "blemished" dishes separate from the shop's "top of the line" dishes.

 

Another scenario I can think of is "out of date" items or "expired" items that a shop owner has in their inventory but would like to auction off.

 

Solution (?):

Add a description under Auction Details: why these items are being auctioned off for less ...

 

The challenge:

The shop has 18 dishes product_id=xxxxxx

Out of these 18 dishes 1 set is slightly damaged on the bottom

Out of these 18 dishes another set is slightly damaged in another location

etc, etc, etc.

Can these dishes that have different blemishes be auctioned off for different prices and different auction ending times be auctioned at the same time ? (After all, product_id=xxxxxx is the same for all)

 

PS: at this time you can not have two auctions for the same product_id. I noticed that when you add a bid to the second auction of the same product, the first auction is changed to that bid. - which makes auctioning off individual pieces of inventory not possible at this time.

 

Input would be greatly appreciated.

Edited by usvi4me
Link to comment
Share on other sites

Feature request:

 

Scenario:

I am running a shop that sells dishware.

In stock I have "top of the line" dishes that are in A1 condition.

 

I also have in stock "blemished" dishes that should not be sold for the same price. These "blemished" dishes I would like to put up for auction. In the auction itself I would like to describe exactly what these "blemishes" are to eliminate any confusion.

 

At first I thought the way around this would be to add the "blemished" dishes as a "separate" inventory item. BUT, adding this as a separate inventory item with the description that the auction is only good for blah blah blah, it ALSO shows up in the regular shop. I want to keep these "blemished" dishes separate from the shop's "top of the line" dishes.

 

Another scenario I can think of is "out of date" items or "expired" items that a shop owner has in their inventory but would like to auction off.

 

Solution (?):

Add a description under Auction Details: why these items are being auctioned off for less ...

 

The challenge:

The shop has 18 dishes product_id=xxxxxx

Out of these 18 dishes 1 set is slightly damaged on the bottom

Out of these 18 dishes another set is slightly damaged in another location

etc, etc, etc.

Can these dishes that have different blemishes be auctioned off for different prices and different auction ending times be auctioned at the same time ? (After all, product_id=xxxxxx is the same for all)

 

Input would be greatly appreciated.

 

This would be easy enough ..

 

At the point of creating the auction have a textbox

 

Create a field in the auctions table auctions_text varchar 255 default NULL

 

At the point of showing the auction check if auctions_text is NULL if not show the text.

Link to comment
Share on other sites

This would be easy enough ..

 

At the point of creating the auction have a textbox

 

Create a field in the auctions table auctions_text varchar 255 default NULL

 

At the point of showing the auction check if auctions_text is NULL if not show the text.

 

You make it sound so simple - but way out of my league. Is this something you could/would do in your next release ?

 

At this time a shop can not run two auctions of the same product at the same time. Could that be solved as well ?

Link to comment
Share on other sites

You make it sound so simple - but way out of my league. Is this something you could/would do in your next release ?

 

Not at the moment. It may be considered if there are enough requests.

 

At this time a shop can not run two auctions of the same product at the same time. Could that be solved as well ?

 

I have no plans to enable multiple auctions of the same product.

Link to comment
Share on other sites

  • 3 weeks later...

Hi. Nice job with this contribution. Thank you very much.

 

 

I have a couple of things to mencion:

 

1) In some files you don't use: TABLE_TABLENAME (example: admin/auctions.php line 166 among others). May be it work just like it's now, but I'm usinAgag a DBPREFIX contribution and I've noted the TABLE_TABLENAME missing issue (I think it's more clean if the table names are taken from database_tables.php files) (If you want, I can make a list with all cases)

 

2) In admin/include/database_tables.php: define('TABLE_AUCTIONS_ATTRIBUTES','auctions_attributes'); is missing.

 

3) In admin/auctions.php, in 'update' case the overbid mount remains (it's not update). It's that ok? I can't see the reason for this (yet).

Adding:

 

$overbid_amount = tep_db_prepare_input($HTTP_POST_VARS['overbid_amount']);
...
tep_db_query("update " ...  overbid_amount = '" . tep_db_input($overbid_amount) . "' ....);

works fine

 

 

Again, thank you very much. Let me know if you want I detail the 1er point

Edited by imefisto
Link to comment
Share on other sites

The moment the auction ends, is the high bidder notified via email ?

 

Not necessarily "the moment" but the script is set to send the email and will do so the next time the auctions class is loaded.

Link to comment
Share on other sites

Hi Robert,

 

I am having a problem with the database installer on a already modified site. I am not getting past the first set of checks.

 

 

 

* At least one of the configuration values already exists!

* Tables look good to insert.

* No tables to alter it seems.

* At least one of the fields to insert already exists!

* No fields to alter it seems.

 

I tried changing the default configuration value and even the sort value but could not get past this error. Could you give me some insight into how I can resolve the errors ?

 

 

Thank you

 

Chris

Link to comment
Share on other sites

Hi Robert,

 

I am having a problem with the database installer on a already modified site. I am not getting past the first set of checks.

 

 

 

* At least one of the configuration values already exists!

* Tables look good to insert.

* No tables to alter it seems.

* At least one of the fields to insert already exists!

* No fields to alter it seems.

 

I tried changing the default configuration value and even the sort value but could not get past this error. Could you give me some insight into how I can resolve the errors ?

 

 

Thank you

 

Chris

 

Hi

 

The installer is designed to abort if any of the values are already in place. You have obviously previously installed an auctions contribution and some of the database entries are still in place.

 

You need to search the database configuration table for the configuration keys .. which are ..

 

AUCTION_END_OPTIONS

AUCTIONS_SHOW_STANDARD_PRICE

AUCTIONS_REFRESH_PAGE

 

The field to insert was "ALTER TABLE customers_basket ADD auction_product int(1) NOT NULL DEFAULT '0'"

 

For the installer to work these cannot be already in place.

Link to comment
Share on other sites

Thank you Robert,

 

 

I didn't think there had been an auction contribution installed already but the Auction Product column was present in the Customers Basket. Once I removed it, the installation went good.

 

 

 

Thank you again.

 

Chris

Link to comment
Share on other sites

Is there a reason while viewing the Auction (beta 4) and trying to go to bid on a product, it can not be viewed in Internet Explorer?

 

No no reason .. this doesn't happen with a fresh install so it must be local code.

 

<edit>Although you should now be using auctionTastic_1.0_RC1_r125, there were a number of fixes although I don't remember any being visual or browser errors</edit>

Edited by FWR Media
Link to comment
Share on other sites

No no reason .. this doesn't happen with a fresh install so it must be local code.

 

Local code?

 

Other contributions were added where the auction is also. Is that what you mean?

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