Hello,

After upgrading to Ubercart 2.3 and later 2.x, products with attributes cannot be added to cart: cart is empty.
It seems to be a different problem than http://drupal.org/node/858816

I hope you will fix this issue quickly, as it is a real problem for us.

Kind regards,
Jean-Michel

Comments

grub3’s picture

Project: Ubercart » Ubercart Ajax Attribute Calculations
Component: Cart/checkout » Code

I disabled Ajax Attribute Calculations
and it worked fine again.

So moving to Ajax Attribute Calculations module.

ShadowMonster’s picture

The same problem for me.

I fix it by comment it:

/*
  if (substr($form_id, 'uc_product_add_to_cart_form_')) {
    $output['form'] = drupal_get_form('uc_product_add_to_cart_form_'. $nid, $product);
  }
  // Otherwise use the non-standard form.
  else {
    $output['form'] = drupal_get_form('uc_product_add_to_cart_form', $product);
  }
*/

I do not know for what is it this is my first time use this module anyway after comment it is working correctly now.

Anyway before do it I been have message:

warning: substr() expects parameter 2 to be long, string given in /public_html/sites/all/modules/uc_aac/uc_aac.module on line 258.

Hope so this help

encho’s picture

I can confirm this.

cyu’s picture

Status: Active » Postponed (maintainer needs more info)

With a base install of Drupal 6.17 with UC 6.x-2.3 and latest dev of uc_aac 2.x I create a product with 1 select box attribute containing 3 price affecting options, and I'm unable to see this problem. Can you please give me steps to replicate so that I can see this error message?

cyu’s picture

grub3’s picture

I am using Drupal 6.17, UC 6.x-2.3 and latest dev of uc_aac 2.x.
My products have several attributes.

grub3’s picture

string substr ( string $string , int $start [, int $length ] )

So substr($form_id, 'uc_product_add_to_cart_form_') is obviously wrong.

cyu’s picture

Status: Postponed (maintainer needs more info) » Active

Hmm...yes, looks like that was intended to be strstr instead of substr. I missed that when committing the patch at http://drupal.org/node/446942#comment-3205256

I've committed the fix to cvs, and if that fixes the issue this can be closed. Thanks for hunting down the bug.

grub3’s picture

Status: Active » Fixed

Thanks, the new dev version worked for me. Setting to fixed.

Status: Fixed » Closed (fixed)

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