UPDATED: 29/Sept/09 - corrected the code a bit...
I'm using uc_varprice with this patch: http://drupal.org/node/466262
(and this is how the code looks like: http://drupalbin.com/11597 )
I'm trying to submit a product form with uc_varprice feature enabled using drupal_execute(), but for some reason it fails to pass on the variable price that the product is added to the cart with its default price.
Here's the code I'm using:
$node = $item['nid'];
$varprice_form_state['values']['varprice_sel'] = $item['varprice_sel'];
$varprice_form_state['values']['varprice_arb'] = $item['varprice_arb'];
$varprice_form_state['values']['nid'] = $item['nid'];
drupal_execute('uc_product_add_to_cart_form', $varprice_form_state, $node);When uc_varprice_add_to_cart_data($form_values), which adds the variable price information to the product, is called through this process, $form_state loses both varprice_sel and varprice_arb. These values are of course successfully passed onto the hook implementation when the varprice form is submitted normally.
Am I passing the $form_state wrong?
