I had a case where I was using panels to override the node template for a node that had a payment form on it. In order to show the progress bar within a panels pane - I had to:
1) do a separate call to node_load even though the node object is already loaded once
2) manually call pay_node_nodeapi with the $op = 'view' to get it to add the 'pay_node' content to the node
3) call drupal_render to get the pay_node content rendered as HTML.
pay_node should provide a simple function that would let me retrieve the markup for a payment progress bar without having to jump through all those hoops. - And it would be super cool if I could create a progress bar regardless of how the default payment form rendering is set for the given node.
The attached patch creates a function pay_node_progress_bar($node,$paid,$html) that makes it simple to grab a progress bar for either total paid ($paid = TRUE which is the default) or total amount ($paid = FALSE). Output is returned either as formatted HTML ($html = TRUE - defualt) or as an FAPI array
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | pay_node_progress_bar_fixed.patch | 1.15 KB | letapjar |
| pay_node_progress_bar.patch | 1.26 KB | letapjar |
Comments
Comment #1
letapjar commentedWoops!
The patch above will not work - it mistakenly put the new function within the pay_node_nodeapi function
please test the attached patch with places it correctly outside other functions.