Jump to content

Problems calling custom function from Client Area template


Recommended Posts

I'm in the process of creating a custom provisioning module. In the module, I've added a custom function similar to this:

 

function mycustommodule_DoSomething($params);
    php code goes here...
    return "success";

 

I also have the following code to enable the custom template itself:

 

function mycustomtemplate_ClientAreaCustomPage($params) {
$pagearray = array(
'templatefile' => 'custompage',
'breadcrumb' => ' > <a href="#">Custom Page</a>',
'vars' => array(
	'variable1' => $params['customfields']['Account ID'],
       'variable2' => $params['configoption1'],
	'variable3' => $params['configoption2'],
	),
);
return $pagearray;
}

 

and

 

function mycustommodule_ClientAreaCustomButtonArray() { 
   $buttonarray = array( 
       "Custom Page" => "custompage",
   ); 
   return $buttonarray; 
}

 

In my custom Client Area template, I've put in the following form:

 

<form method="post" action="clientarea.php?action=productdetails">
<input type="hidden" name="id" value="{$serviceid}" />
<input type="hidden" name="modop" value="custom" />
<input type="hidden" name="a" value="DoSomething" />
<input type="submit" value="Do It" />
</form>

 

After hitting the submit button I'm returned to the product summary page (clientareaproducts.tpl) and no error message is displayed. I've enabled error reporting & display but nothing.

 

Anyone have an idea why it's not working?

Link to comment
Share on other sites

Ok, I guess I figured out how to make it work. I'm wondering if the documentation as stated wasn't meant for implementing the form in the custom template ('clientarea.tpl") file. Just in case anyone else gets aggravated by this, modifying the following line seems to make it work fine:

 

<input type="hidden" name="id" value="{$id}" />

 

Now, the next challenge... how to return the user to the original custom template file for the result. It seems to always want to return the user to the default productdetails (summary) page...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated