Answer the question
In order to leave comments, you need to log in
How to pass cost value from cart js script?
Hello. There is a js code for the cart, where the total cost is deducted. I'm trying to pass it to post.php, where the payment form is already being processed. But the cost is not transferred, I'm trying to do it like this:
totalprice = (unitsprice + delcost).toFixed(2);
$.ajax({
url: "post.php",
type: "POST",
data: {"&amount" : JSON.stringify(totalprice)},
});
$data = "entityId=8ac9a4ca7a13eba8017a1dedeec37130" .
json_decode($_POST["&amount"]) .
"¤cy=EUR" .
"&paymentType=DB";
$data = "entityId=8ac9a4ca7a13eba8017a1dedeec37130" .
"&amount=92.00"
"¤cy=EUR" .
"&paymentType=DB";
Answer the question
In order to leave comments, you need to log in
let totalprice = (unitsprice + delcost).toFixed(2);
$.ajax({
url: "post.php",
type: "POST",
data: {
amount: totalprice,
},
});
$data = "entityId=8ac9a4ca7a13eba8017a1dedeec37130" .
"&amount=" . $_POST["amount"] .
"¤cy=EUR" .
"&paymentType=DB";
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question