Jump to content



Latest News: (loading..)

* * * * * 1 votes

Auctions V2.1 Support Thread


  • Please log in to reply
79 replies to this topic

#61   mmosttler

mmosttler
  • Members
  • 21 posts
  • Real Name:Marcus Mosttler

Posted 12 November 2008 - 02:15 AM

FYI,
I have gotten more of the auctions working on my dvel site.  I have had to make some changes along the way.
-More changes for HTTP_GET/POST_VAR to _GET/POST
-Auction admin page didn't allow for updating of the bid increments so i added that ability.

below is the new update section of the admin/auctions.php
			
	case 'update':
				$auctions_id = tep_db_prepare_input($_POST['auctions_id']);
				$products_price = tep_db_prepare_input($_POST['products_price']);
				$auctions_price = tep_db_prepare_input($_POST['auctions_price']);
				$overbid_amount = tep_db_prepare_input($_POST['overbid_amount']);	
				$day = tep_db_prepare_input($_POST['day']);
		
				if (substr($auctions_price, -1) == '%') 
				{
					$auctions_price = ($products_price - (($auctions_price / 100) * $products_price));
				}
		
				tep_db_query("update " . TABLE_AUCTIONS_PRODUCTS . " set auctions_starting_price = '" . tep_db_input($auctions_price) . "', auctions_last_modified = now(), expires_date = '" . $day . "', overbid_amount = '". tep_db_input($overbid_amount) . "' where auctions_id = '" . (int)$auctions_id . "'");
		
				tep_redirect(tep_href_link(FILENAME_AUCTIONS_PRODUCTS, 'page=' . $_GET['page'] . '&aID=' . $auctions_id));
				break;



#62   marcermens

marcermens
  • Members
  • 4 posts
  • Real Name:marc ermens
  • Gender:Male
  • Location:netherlands

Posted 16 November 2008 - 06:07 PM

Hello,
I am installing auctions in my shop. I cant find this bit under step 10. I made a complete new install for oscommerce-2.2ms2 om my computer (i was thinking i changed it with another contribution) but here i cant find it also. I think i have to change it. Or is there another way to fix it.

Step 10)

catalog/includes/classes/shopping_cart.php

/// FIND :

function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) {
global $new_products_id_in_cart, $customer_id;

$products_id_string = tep_get_uprid($products_id, $attributes);
$products_id = tep_get_prid($products_id_string);

if (defined('MAX_QTY_IN_CART') && (MAX_QTY_IN_CART > 0) && ((int)$qty > MAX_QTY_IN_CART)) {
$qty = MAX_QTY_IN_CART;
}

$attributes_pass_check = true;

if (is_array($attributes)) {
reset($attributes);
while (list($option, $value) = each($attributes)) {
if (!is_numeric($option) || !is_numeric($value)) {
$attributes_pass_check = false;
break;
}
}
}

if (is_numeric($products_id) && is_numeric($qty) && ($attributes_pass_check == true)) {
$check_product_query = tep_db_query("select products_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$check_product = tep_db_fetch_array($check_product_query);

if (($check_product !== false) && ($check_product['products_status'] == '1')) {
if ($notify == true) {
$new_products_id_in_cart = $products_id;
tep_session_register('new_products_id_in_cart');
}

if ($this->in_cart($products_id_string)) {
$this->update_quantity($products_id_string, $qty, $attributes);
} else {
$this->contents[$products_id_string] = array('qty' => (int)$qty);
// insert into database
if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$qty . "', '" . date('Ymd') . "')");

if (is_array($attributes)) {
reset($attributes);
while (list($option, $value) = each($attributes)) {
$this->contents[$products_id_string]['attributes'][$option] = $value;
// insert into database
if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$option . "', '" . (int)$value . "')");
}
}
}

$this->cleanup();

// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
$this->cartID = $this->generate_cart_id();
}
}
}

function update_quantity($products_id, $quantity = '', $attributes = '') {
global $customer_id;

$products_id_string = tep_get_uprid($products_id, $attributes);
$products_id = tep_get_prid($products_id_string);

if (defined('MAX_QTY_IN_CART') && (MAX_QTY_IN_CART > 0) && ((int)$quantity > MAX_QTY_IN_CART)) {
$quantity = MAX_QTY_IN_CART;
}

$attributes_pass_check = true;

if (is_array($attributes)) {
reset($attributes);
while (list($option, $value) = each($attributes)) {
if (!is_numeric($option) || !is_numeric($value)) {
$attributes_pass_check = false;
break;
}
}
}

if (is_numeric($products_id) && isset($this->contents[$products_id_string]) && is_numeric($quantity) && ($attributes_pass_check == true)) {
$this->contents[$products_id_string] = array('qty' => (int)$quantity);

#63   reillyg

reillyg
  • Members
  • 17 posts
  • Real Name:gerald

Posted 19 November 2008 - 02:15 AM

View Postpsylencer, on Oct 13 2008, 12:51 AM, said:

Matt, heres the solution : in shopping_cart.php  you need to do a cart reset.  Check the code.  If not message me and Ill help you out.

mine certainly updates without a problem.

I'm having the same problem.  Can you help w/ the code?

Edited by reillyg, 19 November 2008 - 02:18 AM.


#64   reillyg

reillyg
  • Members
  • 17 posts
  • Real Name:gerald

Posted 19 November 2008 - 09:55 PM

View Postpsylencer, on Oct 13 2008, 12:51 AM, said:

Matt, heres the solution : in shopping_cart.php  you need to do a cart reset.  Check the code.  If not message me and Ill help you out.

mine certainly updates without a problem.


#65   batabe

batabe
  • Members
  • 2 posts
  • Real Name:batabé
  • Gender:Male
  • Location:Budapest

Posted 23 November 2008 - 06:57 PM

View Postpsylencer, on May 16 2008, 08:27 AM, said:

This problem, apparently occurs because I have not done a mysql_numrows before the offending lines.  Basically, the error occurs when there are no results to display.  If I could get a dump of the SQL tables related to this, I may be able to diagnose and repair.

Cheers everyone for the effort, I'll try and keep a closer eye out for any more questions.

hi Dan,

do you have the solution for the problem above? what should i do to solve it?

thanks.

#66   osc-betty

osc-betty
  • Members
  • 12 posts
  • Real Name:Bettina Swynnerton

Posted 08 December 2008 - 08:23 PM

Hi,

I have just started work with this interesting contribution.

If you get this error


Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home/jsphu/public_html/catalog/includes/classes/shopping_cart.php on line 345


you can fix it by changing

catalog/includes/classes/shopping_cart.php
line 345
$num=mysql_numrows($result);

to
$num=mysql_numrows($xresult);

This change has now enabled me to place a bid and proceed to checkout.

#67   osc-betty

osc-betty
  • Members
  • 12 posts
  • Real Name:Bettina Swynnerton

Posted 08 December 2008 - 09:46 PM

View Postjackkk, on Sep 19 2008, 11:57 AM, said:

...I just have some tiny little problems that maybe Dan or someone could help me solve :

- the currency shown in the auction start price always is and stays in US dollars. Even if I switch the main currency to EUR in the file , the auction start price still is in USD ..? How can I fix that ?

I have fixed the currency problem on my site with changes to two files:

file: catalog/product_info.php

Find around line 242
else {$products_price = "$".number_format($auction_price,2);}

and replace with
else {$products_price = $currencies->display_price($auction_price,tep_get_tax_rate($product_info['products_tax_class_id']));}

file: catalog/includes/modules/auction_bids.php

Find around line 433
echo "<br> &nbsp;Minumum Bid :$". $finprce;?></font>

and replace with
echo "<br> &nbsp;Minimum Bid :". $currencies->display_price($finprce,tep_get_tax_rate($product_info['products_tax_class_id']));?></font>

this takes also care of the typo :)

I haven't tested this with tax settings, but it works for me alright. My shop is now set up in £s.

#68   osc-betty

osc-betty
  • Members
  • 12 posts
  • Real Name:Bettina Swynnerton

Posted 09 December 2008 - 06:33 PM

View Postreillyg, on Nov 19 2008, 03:15 AM, said:

I'm having the same problem.  Can you help w/ the code?

I have added the cart reset into catalog/shopping_cart.php at around line 137

Look shortly after the start of body text for the line

if ($cart->count_contents() > 0) {


and add

  $cart->reset();
  $cart->restore_contents();

just above it. This has solved the reset problem for me.

#69   osc-betty

osc-betty
  • Members
  • 12 posts
  • Real Name:Bettina Swynnerton

Posted 11 December 2008 - 09:33 AM

View Postpsylencer, on Oct 10 2008, 10:26 PM, said:

HI Guys,

Im going to begin to re-develop Auction for OSC V3, .

Please list new feature requests here.

So far on my list is some sort of customer review module Ala Ebay.  One problem I've found with this is that customers just don't trust you.  I think if we can introduce a seller feedback option, thjis may solve the problem.

Dan


Hi Dan,

this is a great contribution. I've got it working kind of all right now, but I still need to work on two conceptual issues and I think they should be standard features with a newer version.

See below,

Bettina



One is that the inserted auction item re-uses a product id of a product that is already on the shelf in the shop. This causes a range of problems with the stored original price of the product and the new price from the auction. The problem trickles down to lots of places and the original price would show up again and again, like in the shopping cart box on the side, the previous order view or when using the buy now option. And it also meant I couldn't re-insert a product once it had been sold at auction.

On my site I have fixed this by creating a new unique product id for the auction item when it is inserted, with a product_price entry that is updated every time a bid is placed. This has fixed all the problems above. My client wants an auction overview that can be grouped by "finished auctions", "current auctions" and "auctions ending soon". This is now much easier to do.

The other issue I have is that this is currently not really ebay style bidding. Ebay have set a certain standard in bidding procedures and customers using an auction site will most certainly expect it to work this way. If I enter a higher amount than the current auction price in ebay, it still reverts back to the minimum bid (as long I am not outbid by someone else).

With this auction contribution, if I enter a higher amount than the minimum bid, this will be taken as the highest bid, causing me to spend more money than I would have needed to secure this bid. I will definitely need to change this for my client.

#70   webher

webher
  • Members
  • 6 posts
  • Real Name:Andrei

Posted 12 December 2008 - 12:44 PM

Hello,
I have a problem with this script.
I just installed oscommerce than overwrite the files from NEW_AND_MODIFIED_FILES. Anything was ok. Than I executed the SQL querry from auction.sql. No error 'till here. But then when I go in control panel at Catalog>Auction Products I get the following error:

Quote

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 a.products_id, a.notified, p.products_image, p.products_price as products_price2, pd.products_name, a.auctions_high_cust as customers_id, a.auctions_max as products_price, a.auctions_nb, 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 a.products_id = p.products_id and pd.language_id = '1' and p.products_id = a.products_id group by a.auctions_id order by a.expires_date asc limit -20, 20
I tried the addon on MySQL 4.1 and on MySQL 5 and the error appeared on both.
Any advice please?

#71   dezco

dezco
  • Members
  • 9 posts
  • Real Name:Patrick D.

Posted 15 December 2008 - 07:49 PM

This auction code has some pretty MAJOR bugs. Is the April 21st version still a beta? It doesn't look like it is posted as a beta.

I see this thread full of people reporting bugs and these are the same bugs that I have encountered but the solution to the fixes is to simply delete code!?!? Removing the check for taxes or refreshing??? I'm not understanding how this was posted with so many serious issues.

Thank GOD I backed up and only tested running this code on a test build of osCommerce.

There is a french version of this code. It seems to take this version translate it in french but more importantly the guy fixes the bugs. It would have been nice if they didn't simply repost in french though. Seeing as the original code was in english.

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

Does anyone have the ability to translate the fixed version back to english?

Edited by dezco, 15 December 2008 - 07:51 PM.


#72   FWR Media

FWR Media
  • Community Sponsor
  • 6,839 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 15 December 2008 - 07:58 PM

I was asked by a customer to install this and after some time spent analyzing the code came to the conclusion that it is never going to work. A lot of effort has gone into the idea but the implementation is extremely poor.

I have just about recoded the whole thing so may put it up as a contribution at some stage if there is sufficient interest.

#73   osc-betty

osc-betty
  • Members
  • 12 posts
  • Real Name:Bettina Swynnerton

Posted 16 December 2008 - 03:31 PM

View PostFWR Media, on Dec 15 2008, 07:58 PM, said:

I was asked by a customer to install this and after some time spent analyzing the code came to the conclusion that it is never going to work. A lot of effort has gone into the idea but the implementation is extremely poor.

I have just about recoded the whole thing so may put it up as a contribution at some stage if there is sufficient interest.


If you are happy to share your work I would love to see this as a contribution. I am just about to recode a lot of this too.

#74   FWR Media

FWR Media
  • Community Sponsor
  • 6,839 posts
  • Real Name:Robert Fisher
  • Gender:Male
  • Location:Stowmarket - Suffolk - UK

Posted 16 December 2008 - 03:34 PM

View Postosc-betty, on Dec 16 2008, 03:31 PM, said:

If you are happy to share your work I would love to see this as a contribution. I am just about to recode a lot of this too.

Well if you want to send me a personal email (not PM) there is a version available for "beta testing only".

admin at <my name> dot co dot uk

#75   diyAUDIOsupply

diyAUDIOsupply
  • Members
  • 49 posts
  • Real Name:David
  • Location:USA

Posted 14 January 2009 - 09:56 PM

Hello,

Is this auction contrib one that will allow me to host and operate auctions similar to ebay on my site?  In other words..............will this allow me to have other people come to my site and list their items for auction?  If not, could someone please recommend something that will integrate with my osc site?

Cheers,

David

#76   Pooya

Pooya
  • Members
  • 41 posts
  • Real Name:Pooya

Posted 30 January 2009 - 11:45 AM

View PostFWR Media, on Dec 16 2008, 03:34 PM, said:

Well if you want to send me a personal email (not PM) there is a version available for "beta testing only".

admin at <my name> dot co dot uk


Hello would love to try out your version, dosent seem like this addon could work that easily.

Let me know :)

my email pooya@parsi . com

#77   bellabacci

bellabacci
  • Members
  • 13 posts
  • Real Name:Frank

Posted 19 February 2009 - 10:29 PM

Status of recodes?

email me frank@bellabacci.com

#78   guytoronto

guytoronto
  • Members
  • 3 posts
  • Real Name:Matt
  • Gender:Male
  • Location:Toronto

Posted 18 April 2009 - 03:23 PM

After implementing this in a non-critical online store, I realized it does have some major flaws.

Unfortunately, all the little hacks and tweaks I've made to the code to get it to suit my purposes are almost impossible to document.

I would advise anybody who isn't comfortable troubleshooting PHP code to stay away from this. I've taught myself PHP over the past 6 months, and it has helped me immensely with OSCommerce and customization.

A few mods I made to the auction module:
- PROBLEM: For a lot of my auctions, nobody would bid on anything, so I would have to go in every few weeks, and reset the auction.
- SOLUTION : I hacked it so that items on auction would stay on auction indefinitely UNTIL the 1st bid was placed. That would essentially ACTIVATE the auction, for a 10-day countdown. (if you are interested in seeing it - http://computershopauction.com/secure/index.php)

- PROBLEM: I didn't like the way bidding increments worked. I wanted the first bidder to have an advantage.
- SOLUTION: Hacked so that the first bidder only has to bid one penny to activate the auction. Each additional bidder has to follow bidding increments.

- PROBLEM: Visitors would see the "Bid" open box, without having to create an account or log in.
- SOLUTION: Hacked it so that if they are not logged in, all they see is "This product is on auction. To bid, you must first log into your account or create a new account.  (Click Here)"

- PROBLEM: Prices people see throughout the site didn't accurately reflect the starting price or current bid on the product
- SOLUTION: Hacked a lot of the product listing coding to show starting bid or current high bid.

There were a lot of other coding tweaks and edits, and I would love to actually create a fresh module with everything I have learned over the past 6 months, but I just don't have the time.

Feel free to email me any questions about my implementation. Please don't ask me to completely solve any problems (I can't teach you PHP).

Edited by guytoronto, 18 April 2009 - 03:29 PM.


#79   ssnb

ssnb
  • Members
  • 283 posts
  • Real Name:Alan
  • Gender:Male

Posted 30 June 2009 - 01:07 AM

View PostFWR Media, on Dec 16 2008, 04:34 PM, said:

Well if you want to send me a personal email (not PM) there is a version available for "beta testing only".

admin at <my name> dot co dot uk


Yeah c'mon guys, share the spoils please :-)

#80   Lebohang

Lebohang
  • Members
  • 6 posts
  • Real Name:Yus

Posted 13 July 2009 - 10:42 AM

View PostKVallema, on May 15 2008, 10:04 AM, said:

Since I can't edit my own text....here's an update...
I was wrong on the shop-location...we're running auction on EST...

So my setup is
AUCTIONS TIME: UTC-4 (set up in the /includes/modules/setup.php)
SERVER TIME: UTC-5 (system clock)
ME: UTC+2...

I think it's okay that you have to enter the end-time for the auction taking the UTC-4 into account in your mind.
However...the countdown script is using the AUCTIONS-time, but the logic that allows bidding seems to be looking at the system-time...(same with the admin-page for auctions). Is there something that could be done with this? I think they should all refer to the AUCTIONS-time.

Also...curiousity is that I set up a product with start price at 1,000$...but the minimum bid (before any bids were made) was set at 51$...it also accepted it without having to tick the 'rules' -box. After the initial bid was done...the enforcement of minimum increments and rules-tickbox checks worked fine.
For my purposes I can go around it by creating a 'reserve-price' on the product and doing the first bid myself always....but it's not ideal.

Anyone help me with these??

cheers,
Kimmo

Hi did you find solution cause I am still battling with this problem