Esempio n. 1
0
 // This is where you would have your form validation  and all that jazz.
 // You would take your POST vars and load them into the class like below,
 // only using the POST values instead of constant string expressions.
 // For example, after ensureing all the POST variables from your custom
 // order form are valid, you might have:
 //
 // $p->add_field('first_name', $_POST['first_name']);
 // $p->add_field('last_name', $_POST['last_name']);
 /****** The order has already gone into the database at this point ******/
 //goes direct to this script as nothing needs showing on screen.
 if ($eshopoptions['cart_success'] != '') {
     $ilink = add_query_arg('eshopaction', 'paysonipn', get_permalink($eshopoptions['cart_success']));
 } else {
     die('<p>' . $derror . '</p>');
 }
 $p->add_field('notify_url', $ilink);
 $p->add_field('shipping_1', eshopShipTaxAmt());
 $sttable = $wpdb->prefix . 'eshop_states';
 $getstate = $eshopoptions['shipping_state'];
 if ($eshopoptions['show_allstates'] != '1') {
     $stateList = $wpdb->get_results("SELECT id,code,stateName FROM {$sttable} WHERE list='{$getstate}' ORDER BY stateName", ARRAY_A);
 } else {
     $stateList = $wpdb->get_results("SELECT id,code,stateName,list FROM {$sttable} ORDER BY list,stateName", ARRAY_A);
 }
 foreach ($stateList as $code => $value) {
     $eshopstatelist[$value['id']] = $value['code'];
 }
 foreach ($_POST as $name => $value) {
     //have to do a discount code check here - otherwise things just don't work - but fine for free shipping codes
     if (strstr($name, 'amount_')) {
         if (isset($_SESSION['eshop_discount' . $blog_id]) && eshop_discount_codes_check()) {
Esempio n. 2
0
 // This is where you would have your form validation  and all that jazz.
 // You would take your POST vars and load them into the class like below,
 // only using the POST values instead of constant string expressions.
 // For example, after ensureing all the POST variables from your custom
 // order form are valid, you might have:
 //
 // $p->add_field('first_name', $espost['first_name']);
 // $p->add_field('last_name', $espost['last_name']);
 /****** The order has already gone into the database at this point ******/
 //goes direct to this script as nothing needs showing on screen.
 if ($eshopoptions['cart_success'] != '') {
     $ilink = add_query_arg('eshopaction', 'paysonipn', get_permalink($eshopoptions['cart_success']));
 } else {
     die('<p>' . $derror . '</p>');
 }
 $p->add_field('notify_url', $ilink);
 $p->add_field('shipping_1', eshopShipTaxAmt());
 $sttable = $wpdb->prefix . 'eshop_states';
 $getstate = $eshopoptions['shipping_state'];
 if ($eshopoptions['show_allstates'] != '1') {
     $stateList = $wpdb->get_results("SELECT id,code,stateName FROM {$sttable} WHERE list='{$getstate}' ORDER BY stateName", ARRAY_A);
 } else {
     $stateList = $wpdb->get_results("SELECT id,code,stateName,list FROM {$sttable} ORDER BY list,stateName", ARRAY_A);
 }
 foreach ($stateList as $code => $value) {
     $eshopstatelist[$value['id']] = $value['code'];
 }
 foreach ($espost as $name => $value) {
     //have to do a discount code check here - otherwise things just don't work - but fine for free shipping codes
     if (strstr($name, 'amount_')) {
         if (isset($_SESSION['eshop_discount' . $blog_id]) && eshop_discount_codes_check()) {