Re: Error when using uc_cart_add_item with a product kit

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

The product kit module passes it's entire $form_values array to uc_cart_add_item() when the Add to Cart button is clicked. This array includes the product's nid and quantity which is passed to uc_product_add_to_cart_data() when each individual product is added to the cart. That would be the source of the error.

Use this:

<?php
$data
= array('products' => array(
 
$nid1 => array('nid' => $nid1, 'qty' => $qty1),
 
$nid2 => array('nid' => $nid2, 'qty' => $qty2),
 
//... etc.
));
?>

The 'module' is included as part of uc_product_kit_add_to_cart() so you don't need to specify it when you're calling uc_cart_add_item() on the product kit. Also, the "null, true, true" are the default values so you don't need to specify them.

Error when using uc_cart_add_item with a product kit By: dolittle (2 replies) Tue, 03/04/2008 - 14:28