Jump to content

How to pass local tpl variable to a php file.


sarfaraz.r1406

Recommended Posts

This is how I am writing my ajax request.

$.ajax({
url: "C:\xampp\htdocs\prestashop1\prestashop\classes\PaymentModule.php",
cache: false,
data : {
varNew : '1',
},
success : function(res,textStatus,jqXHR)
{
}
});


I want to receive this var "varNew" in PaymentModule.php. Please tell me how to write the receiving statement because the syntax provided in that link isn't working.
I am hooking this module on the 4th step(carrier) of the payment page. So I dont think I am submitting any form there.
 
Thank you.
 
Regards
Sarfaraz
Edited by sarfaraz.r1406 (see edit history)
Link to comment
Share on other sites

i think that this: 

url: "C:\xampp\htdocs\prestashop1\prestashop\classes\PaymentModule.php",

is wrong url :)

you can't call PaymentModule.php file because it's a class, not static script...

take a look what kind of code uses homeslider (in homeslider.php file) to call ajax request - it's a very good example

Link to comment
Share on other sites

Hi vekia,

Thank you for your answer.

I would appreciate if you help me with my issue. 

Actually I want to write this variable newVar into my database in ps_order along with the order_id. So that I an keep a track for which order what is the value of my variable. The writing into the database is initiating in PaymentModule.php. So I need to access this variable from that class. 

Kindly suggest a way to do this.

 

Regards

Sarfaraz

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...