When I add a product to the cart, I can add it but it shows the message:
Notice: Undefined property: stdClass::$is_auc em uc_auction_form_alter() (linha 281 de /var/www/drupal7/sites/all/modules/uc_auction/uc_auction.module).

Comments

xpete’s picture

This can be fixed with this code:

foreach (element_children($form['items']) as $key) {
    if (isset($form['items'][$key]['cart_item_id'])) {
        $form['items'][$key]['remove'] = array(
            '#type' => 'item',
        );
         $form['items'][$key]['qty'] = array(
             '#type' => 'item',
         );
    }
}
    
rfarm’s picture

xpete,

I have the same error as silviacm.

Should your code replace lines 280 to 294 in uc_auction.module? I am a little lost on this one.

Thanks for your help.

xpete’s picture

Should your code replace lines 280 to 294 in uc_auction.module?

yes.

rfarm’s picture

It worked - thank you very much!

batosti’s picture

I made this changes, but when I add the product to cart the amount is the Sell price, not the High bid. Someone checked this?

batosti’s picture

Priority: Normal » Critical

I found an issue, the uc_auction_uc_cart_item method aren't called, because the Ubercart API as changed, and the 'load' op code was removed:
CHANGELOG.txt: * Removed 'load' op from hook_uc_cart_item().

So I think this is not working under the lastest version of Ubercart in drupal 7. Anyone can help me out to make this working? I'm new in drupal and this is very complex.

I also changed the priority to critial. Since you can't buy the product by the auction price, the auction isn't working at all.

Thanks in advance

xpete’s picture

Here is a better fix:

foreach (element_children($form['items']) as $key) {
            if (isset($form['items'][$key]['#entity']->uc_auction)) {

                // This is a sneaky tricky dirty hack. It's waeome that it works though.
                //removes the "remove" button 
                $form['items'][$key]['remove'] = array('#type' => 'item',);
                //disable the quantity field.
                $form['items'][$key]['qty']['qty'] = $form['items'][$key]['qty'];
                $form['items'][$key]['qty']['qty']['#type'] = 'value';
                $form['items'][$key]['qty']['qty']['#value'] = $form['items'][$key]['qty']['qty']['#default_value'];
                $form['items'][$key]['qty']['#tree'] = TRUE;
                if (isset($form['items'][$key]['qty']['#attributes'])) {
                    $form['items'][$key]['qty']['#attributes']['disabled'] = 'disabled';
                } else {
                    $form['items'][$key]['qty']['#attributes'] = array('disabled' => 'disabled');
                }

            }
        }

batosi, your problem is already reported here:
http://drupal.org/node/1360280

kalabro’s picture

Patch with fix attached.

SeanA’s picture

Issue summary: View changes
Priority: Critical » Normal
Status: Active » Needs review
SeanA’s picture

It looks like kalabro's patch contains additional changes that address a different issue. Re-rolled patch.