Forums / Addon Payment Modules / Need help with writing module

Need help with writing module

Locked

Started by mxg on 18 Dec 2006, 9:20 PM · Views: 1,492

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
18 Dec 2006, 9:20 PM
#1
mxg avatar

mxg

New Zenner

Join Date:
Dec 2006
Posts:
7
Plugin Contributions:
0

Need help with writing module

Hello,

I'm currently writing a ZC module for Nochex which is almost finished. I would appreciate any assistance getting the final touches done.

Because Nochex now allow you to specify a custom HTML header and footer when you forward buyers for payment, I would like the Zen module to produce this custom HTML automatically, using a store's current template. I have done something similar with another popular cart package by producing a dummy page on-the-fly with custom content (in this case, an HTML comment) and capturing the page into a PHP variable. I was then able to split the page appropriately into a header and a footer, filtering out everything except the contents of the <body> tags in the process.

Trying to accomplish something similar with Zen is trying to say the least. Can anyone explain how the template system works, and why I can't simply perform the following?```php
// Switch on output-buffering, print the page, capture it and clean/stop the output buffer
ob_start();
include($template->get_template-dir('tpl_main_page.php', DIR_WS_TEMPLATE, $current_page_base, 'common') . '/tpl_main_page.php');
$page = ob_get_contents();
ob_end_clean();