function uc_atctweaks_add_to_cart_pre_submit in UC Add to Cart Tweaks 6
Same name and namespace in other branches
- 7 uc_atctweaks.module \uc_atctweaks_add_to_cart_pre_submit()
1 string reference to 'uc_atctweaks_add_to_cart_pre_submit'
- uc_atctweaks_form_alter in ./
uc_atctweaks.module - Implementation of hook_form_alter().
File
- ./
uc_atctweaks.module, line 74 - Defines a product feature to tweak the add to cart form behavior.
Code
function uc_atctweaks_add_to_cart_pre_submit($form, &$form_state) {
if (!empty($form_state['values']['atctweaks_data'])) {
$data = $form_state['values']['atctweaks_data'];
// Empty the shopping cart if the feature specifies to do so.
if ($data->cart_empty) {
uc_cart_empty(uc_cart_get_id());
}
}
}