<section class="<?php print $class; ?> "> <div> <p>Let's try to add a field</p> </div> <?php require_once drupal_get_path('module', 'commerce_product') . '/includes/commerce_product.forms.inc'; require_once drupal_get_path('module', 'commerce_product') . '/includes/commerce_product_ui.products.inc'; $form = commerce_product_ui_product_form_wrapper(commerce_product_new('product')); dpr($form); print render($form); ?> </section>
// $theNode = $wrapper->getIdentifier(); // $theReference = node_load($theNode); // print $theNode; // print $wrapper->label(); // print $wrapper->field_description->value(); //print drupal_render($wrapper->propertyInfo['bundles']['product']['properties']); //required paths for loading wrapper require_once drupal_get_path('module', 'commerce_product') . '/includes/commerce_product.forms.inc'; require_once drupal_get_path('module', 'commerce_product') . '/includes/commerce_product_ui.products.inc'; //$passwordForm = drupal_get_form('commerce_product_ui_product_form', 'product'); //$form = commerce_product_ui_product_form_wrapper(commerce_product_load(119000)); //$form = entity_metadata_wrapper(commerce_product_new('product')); // $form['#ajax_processed'] = TRUE; //$productId = 119000; //commerce product new creates a new product and load brings in it for the form to edit. $form = commerce_product_ui_product_form_wrapper(commerce_product_load(1)); //kpr($form); //$form = (commerce_product_load(1)); $date = getdate(); //$form_state = array(); //$form_state['values']['title'] = "Course Draft Started on " . $date['mon'] . "." . $date['mday'] . "." . $date['year']; //$renderedForm = render($newForm); // commerce_product_ui_product_form_submit($newForm, &$form_state); // drupal_form_submit('commerce_product_ui_product_form', &$form_state); //$editForm = commerce_product_ui_product_form_wrapper(commerce_product_load($productId)); //$passwordForm = drupal_get_form('user_pass'); // print render($form['field_course_upload']); // print $newForm->get_value($newForm, 'product_id'); print render($form); // print render($form['uploads']); // print render($form['basics']);