Site administrators can modify the sell price of an auctioned item so that it is no longer equal to the value of the highest bid placed on that item. The result is that the high bidder may win an auction, but when they add the product to their cart to purchase it, the price they are asked to pay will differ from the price they bid.

A Q&D solution would be to disable the sell price field while a product node is being auctioned.

Comments

Garrett Albright’s picture

Status: Active » Fixed

Hmm. Disabled fields don't seem to be submitted by the browser… ?

Working on this problem has brought to life another what if: What if a store administrator goes to edit a node's sell price even before bids are placed (which is acceptable behavior), but a bid is placed before the admin saves the node?

The solution I've come up so far is that, when the node is loaded, Ubercart Auction checks to see if $node->sell_price equals the value of the highest bid. If not, then the price is set to the highest bid, the node saved (saving nodes in node_load() is somewhat cringeworthy), and a message thrown into watchdog. I'm not totally proud of this solution, but it works.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

carlazitroc’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Closed (fixed) » Needs work

The system message that this issue is now fixed but I still get this error, the sell price is always set as the sell price not the high bid when the winner checkout the product he has won. How will I fix this bug?

jday’s picture

I'm having the same problem, when a winning bidder adds the item to their cart, the sell price is displayed, not the high bid price.

igoen’s picture

Same problem here. Can anyone help us?

khwab’s picture

I am having same issue. What changes do we need to make ( drupal 7 ) to fix this?

johnkareoke’s picture

Anyone able to resolve this issue?

John

Ram_doss’s picture

What is the status of this issue? is it fixed?

Ram_doss’s picture

I have installed uc_auction module one month before and have been using in
dev site.I didn't test it out actually what happends after expiry of a
product is completed. After seeing this
page(https://drupal.org/node/348592#comment-8153823), i came to a
conclusion
that the highest bid value doesn't reflect in the add to cart option. Is
this
issue fixed in the latest dev version? Should i replace the module to
latest
version?

Have You guys found any solution for this ??? If so please help me out how
you fixed it ??

Jack_S’s picture

Issue summary: View changes

Same problem here, when auction ends and the produc is added to the shopping cart the Ubercart Sell Price is used and the bid ammount is disregarded. This renders the module broken as the bids have no meaning as it is always the default price never the price of the bid that is added to the cart!

Iner44’s picture

Someone working on this?
Please fix this issue!

dpickerel’s picture

I'm working on this now. It didn't start happening until I added patches for another bug.

I can find where the cart total is added in, and i can see where the sub-total is calculated, but I'm having trouble finding where i should insert the bid price for an item when the item is loaded in the cart.

Anyone want to compare notes?

ABDUL7887’s picture

Guys did any one solve this or at least a way around it ?

I tried every possible way that I know of such as making some events/actions with rule module but it was silly idea.

It seems like the high bid (display_price) is not being seen by drupal at all, I intended the following:

Set starting price to $100, Sell price to $1000.

I placed bids to increase the High bid to $2000, which is higher than the sell price. and when I proceed to payment the price in the cart is $1000.

Can someone please tell us how to work around this.

ABDUL7887’s picture

I found this patch which make the high bid is the price processed to payment
https://www.drupal.org/files/uc_auction-undefined_property_is_uac-155683...

But in my case, I applied this and it made the high bid is always the price processed to payment even if the user select
Buy now, the High bid is what the user asked to pay for. So I inserted extra if in the uc_auction_uc_cart_item_load()

diff --git a/uc_auction.module b/uc_auction.module
index e96b28d..eeefccf 100755
--- a/uc_auction.module
+++ b/uc_auction.module
@@ -277,8 +277,9 @@ function uc_auction_form_alter(&$form, $form_state, $form_id) {
   // a generic hook_form_alter(), we'll just include them here.
   elseif ($form_id === 'uc_cart_view_form' && variable_get('uc_auction_force_one', TRUE)) {
 
-    foreach ($form_state['build_info']['args'][0] as $key => $item) {
-      if ($item->is_auc) {
+    foreach (element_children($form['items']) as $key) {
+      $item = $form['items'][$key];
+      if (!empty($item->is_auc)) {
         // This is a sneaky tricky dirty hack. It's waeome that it works though.
         $form['items'][$key]['qty']['qty'] = $form['items'][$key]['qty'];
         $form['items'][$key]['qty']['qty']['#type'] = 'value';
@@ -1378,25 +1379,26 @@ function uc_auction_uc_add_to_cart($nid, $qty, $data) {
 }
 
 /**
- * Implements hook_uc_cart_item() (an Ubercart hook)().
+ * Implements hook_uc_cart_item_load().
  */
-function uc_auction_uc_cart_item($op, $item) {
-  if ($op === 'load') {
+function uc_auction_uc_cart_item_load($items) {
+  foreach ($items as $i => $item) {
-   $query = db_select('uc_auction','ua');
// the expiry is set here as well to check the expiry value
+   $query = db_select('uc_auction','ua')->fields('ua',array('expiry'));
     $query->leftjoin('uc_auction_bids','uab','ua.high_bid = uab.bid');
     $query->fields('ua',array('high_bid'));
     $query->fields('uab',array('amount'));
     $query->condition('ua.nid',$item->nid,'=');
+
     if ($info = $query->execute()->fetchAssoc()) {
-      $item->sell_price = $item->price;
+      $items[$i]->sell_price = $item->price;
-       if ($info['amount'] !== NULL) {
// This is the change I made hope it works for you
+      if ($info['amount'] !== NULL && $info['expiry'] < REQUEST_TIME) {
-        $item->price = floatval($info['amount']);
-        $item->display_price = $item->price;
+        $items[$i]->price = floatval($info['amount']);
+        $items[$i]->display_price = $items->price;
       }
-      $item->is_auc = TRUE;
+      $items[$i]->is_auc = TRUE;
     }
     else {
-      $item->is_auc = FALSE;
+      $items[$i]->is_auc = FALSE;
     }
   }
 }

This is what I have done to make it work.

ABDUL7887’s picture

Status: Needs work » Needs review
SeanA’s picture

Assigned: Garrett Albright » Unassigned
Priority: Normal » Major
Related issues: +#1556830: Notice: Undefined property: stdClass::$is_auc em uc_auction_form_alter()
SeanA’s picture

Status: Needs review » Closed (fixed)

The original problem was fixed, and then this issue was hijacked at comment #3. That issue is here: #1035658: Price in cart is not the high bid price