Jump to content

How to update product from clientArea and display custom page?


mps.sudipta

Recommended Posts

In my module I need to let the client update some of the details he provided during ordering my module's services.

 

so my client area code is something like:

function test_module_ClientArea($params) {
$uid = $params["configoption1"];
       $pw = $params["configoption2"];
$url = $params["configoption3"];

$code = '
<div>
	<form method="post" action="clientarea.php?action=productdetails">
		<input type="hidden" name="id" value="'.$params['serviceid'].'" />
		<input type="hidden" name="modop" value="custom" />
		<input type="hidden" name="a" value="redirect" />
		<input type="submit" value="pass random val" />
	</form>
</div>';
return $code;
}

 

 

And my redirect function is:

function test_module_redirect($params){
/*$page = array(
   'templatefile' => 'redirect',
   'breadcrumb' => ' > <a href="#">Generate Random Crumb</a>',
   'vars'			=> array(
   						'php' 			=> 'asd adasd asdasd asd', 
   						'asp' 			=> 'ff ff ad afasdf', 
   						'jsp' 			=> "hdfg fgsdf sdfsdf", 
   						'javascript' 	=> 'asdasd asd asdasdasd'  ),
   );
 return $page;*/
 echo "TESTTING ajsdh ahd asjdlksajdk sjadlka sjdlkasj dlakjd";
 return "success";
}

 

As you can see, I tried displaying a custom template( my redirect.tpl is located in same directory as module, meaning module/servers/test_module/). But nothing was shown, so I tried echoing and returning strings (yes, i did try stuff other than "success"), But nothing shows up when I hit the button in the client area, except the page reloads. I am not even sure at this stage, if the redirect function is even called.

 

Any ideas what i am doing wrong and how to debug? Also if I have more input fields, how will i capture their values in the clientArea or redirect() functions?

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