If you add a product kit product to the cart from the catalog listing page (not the products own) the number of copies of its constructing products are always zero.

This works find with the normal cart or of your on the product kits page.

Comments

deggertsen’s picture

Version: 6.x-1.0-rc9 » 6.x-1.0

I'm having the same problem. (I also have the same problem with 2.x)

Subscribing

tunic’s picture

Version: 6.x-1.0 » 6.x-2.x-dev
Status: Active » Needs work

This has to be tested using 2.x branch.

Nikit’s picture

Issue summary: View changes

For version = "6.x-2.3+4-dev"
I make next quick fix, so adding to cart from catalog work for me:

function uc_ajax_cart_add_item($data) {

  // Protect agains bad calls.
  if (!isset($data['form_id'])) {
    return;
  }

  if (!isset($data['qty'])) {
    $data['qty'] = 1;
  }

  $formID = explode('_', $data['form_id']);
  $nodeID = array_pop($formID);
  $formID = implode('_', $formID);
  $product = node_load($nodeID);

  if ($product->type == 'product_kit') {
    $formValues = array('values' => $data);
    // TODO This need to fix more concrete uc_product_kit_add_to_cart_form_NID
    drupal_execute('uc_product_kit_add_to_cart_form', $formValues, $product);
  }
  else {
    uc_product_load($product);
    $formValues = array('values' => $data);
    drupal_execute($data['form_id'], $formValues, $product);
  }

  return;
}