- If there is a javascript error in your checkout code, you may get directed to paypal, even if you specified sendform as your checkout method, and then you will see a paypal error page
- To get extra form elements into the checkout, all you really need is to bind to beforeCheckout, like this:
simpleCart.bind( 'beforeCheckout' , function( data ){
data.email_from = document.getElementById("email_from").value;
});
</script>
note: add below code in page sendjs.php
You don't need to use the extra_data tag in checkout for adding form fields. You just need to add the form field HTML to the page, and add the beforeCheckout handler, and the extra data will be included in the post. The form field HTML is like this:
<input type="email" name="email_from" placeholder="yourname@domain.com" title="Enter your e-mail address" class="required email" id="email_from">
-
To get the extra data in PHP, you just need to access the POST
variables. In most of the examples, POST is set to a content variable,
so you would do this:
$content = $_POST;
$body = '';
$body .= "Email: ".$content['email_from']."\n";
Post a Comment
Post a Comment