How to insert a werform in a checkout pane (or page ?)
Hi,
I want to insert an existing webform to a pane in a custom checkout page.
I try several things to load my webform and attach it to the checkout without success :
<?php
function BASE_checkout_form($form, &$form_state, $checkout_pane,
$order) {
$webform_nid = 38;
// option #1
$webform = entity_load('node', array($webform_nid));
// or option #2
$webform_node = node_load($webform_nid); // see Note below
$webform = node_view($webform_node);
$pane_form = array('#parents' => array(
$checkout_pane['pane_id']
));
field_attach_form('node', $webform, $pane_form, $form_state);
return $pane_form;
}
?>
Note : without node_view()
, it displays the webform 'edit form' (with the title, the summary ans the body like at node/%/edit).
In all cases, I have this error :
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids()
Can somebody help me ?
Regards,
Comments
Hi medden,
Thanks for your interest.
I've tried your suggestion but a problem is the submission of the forms :
However, while waiting for a better solution (?), i found one : see my next post.
Hi daveH,
What's the better solution you mentioned? I have the same desire here. Looking forward your answer. Thanks