Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function modulename_form_alter(&$form, $form_state, $form_id) {
- if (strpos($form_id, "add_to_cart_form") !== FALSE || $form_id == 'uc_order_add_product_form') {
- if (!empty($form['attributes']) && is_array($form['attributes']) && count($form['attributes']) > 0) {
- if ($form_id === 'formID') {
- // how to create attributes & assign it to current form & preserve the data.
- $copyAttributes = $form['attributes']['12'];
- $form['attributes'][] = $copyAttributes;
- // krumo($form);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment