Guest User

Untitled

a guest
Jan 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. function modulename_form_alter(&$form, $form_state, $form_id) {
  2. if (strpos($form_id, "add_to_cart_form") !== FALSE || $form_id == 'uc_order_add_product_form') {
  3. if (!empty($form['attributes']) && is_array($form['attributes']) && count($form['attributes']) > 0) {
  4. if ($form_id === 'formID') {
  5. // how to create attributes & assign it to current form & preserve the data.
  6. $copyAttributes = $form['attributes']['12'];
  7. $form['attributes'][] = $copyAttributes;
  8. // krumo($form);
  9. }
  10. }
  11. }
  12. }
Add Comment
Please, Sign In to add comment