Jump to content

Help New bie making Ajax Submit Module


Recommended Posts

I am first time ever making Prestashop Module ..Please help.


Under Module page i am calling content text on tpl file but its not showing anything ...

public function getContent() {
$html .= '<h2>'.$this->l('NewsSubmit').'</h2>
 <form action="'.$_SERVER['REQUEST_URI'].'" method="post">
  <label>'.$this->l('News Form').'</label>
  <div class="margin-form">
	<input type="text" name="tutorial_img" value="'.$tutorial_img.'" />
  <div class="clear center">
	<p> </p>
	<input class="button" type="submit" name="submitTutorial" value="'.$this->l('   Save   ').'" />
 return $html;
public function hookShoppingCart($params)
global $smarty;
  $smarty->assign('mytest', Configuration::get('MOD_TUTORIAL_IMG'));
return $this->display(__FILE__, 'mytemplate.tpl');


And in mytemplate.tpl file i am calling that assign variable {$mytest}


But its showing me blank page instead of showing form.. please help where i am doing wrong..



Edited by naal1 (see edit history)
Link to comment
Share on other sites

Ok fine ... sorry i mean to ask is how can i call $html variable from getcontent and assign to mytemplate.tpl... actually i have lots of question related to Ajax single textbox submit module ....


Please help me.

Link to comment
Share on other sites

ohh soryy i just come to know getContent is for backoffice and i want it for front office but any way i have added form code on tpl file and i can see the form on shoppingcart page..


Basically i am making module of vocher for that i made form text box and submit through ajax. After i submit through ajax i successfully able to send code to thirdparty server and fetch the result and discount amt... but now how can i merge discount amount with prestashop shopping cart ? Can you please help or explain me or any kind of guidence ... Please.

Link to comment
Share on other sites

I have nearly solved lots issue while making module .. but now stuck in last part .. nearly need your help..


In module after enter coupon code (not on default voucher i have made new form for user input) , while on submit i am to create cart rules then my question is how can i apply that cart rules with client order just like after adding voucher code it will show discounted amount and less final amount etc.


Please help me here i am stuck and not getting any clue to goahead.


Please do reply me...

Edited by naal1 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...