Answer the question
In order to leave comments, you need to log in
How to use javascript object values in php?
Good afternoon.
I have an object
order = {
price : this.cart.totalPrice(),
emailOrdersTo : this.emailOrdersTo,
site : window.location.host,
currency : this.currency,
language : this.language
}
I pass it to the server using the post method :
server.post(this.baseUrl + '/form/storeformprocessor.php', order, bind(function(err){
if(err){
var message = ''
+ escapeHtml(t('orderFailed')) + ''
this.cartPopupView.show(message)
}
}, this))
how to use the values of the order object in the storeformprocessor.php file, for example, display the site or price value in an email?
Answer the question
In order to leave comments, you need to log in
Try like this:
$data = json_decode( $_POST['data']);
$data->price; // 6230
$data->name; // 1111
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question