Jump to content

Help me modify this PHP checkout page?


CodePythonGB

Recommended Posts

I would like to remove the following sections and text from this checkout page.

Shipping address, country, state, zip code, suburb, address - All needs to be removed including the boxes.

Also i would like to change the Note (Shipping Notes) box and text. I would like to increase the size of the box and make it so an unlimited number of words can be typed into the box. Currently the Notes box only allows for about 100 or so words to be entered. As said i want an unlimited number. 

Here is the current page source code.

Quote

 

<!--?php 
$show_form = true;
$show_ship = shipping_req();

if (!isset($_SESSION['shipping']) || !isset($_SESSION['sum_total']) 
|| !isset($_SESSION['cart']) || count($_SESSION['cart']) &lt; 1) {

  echo "&lt;p class='error_txt'&gt;".LANG('SESSION_RESET').' '.LANG('TRY_AGAIN_BACK')."&lt;/p&gt;";

} else {
  
  if (!empty($_POST['email'])) {
    if (is_injected($_POST['email']) || !validate_maxlength($_POST['email'], 50)) {  
      $errors['order_form'] = LANG('INJECTED_EMAIL');    
    } elseif(empty($_POST['c_email']) || ($_POST['email'] != $_POST['c_email'])) {
      $errors['order_form'] = LANG('DIFF_EMAIL_ADDS');
    } elseif (!empty($_SESSION['user_data']) &amp;&amp; $_SESSION['user_data']['Email'] != $_POST['email']) {
      $errors['order_form'] = LANG('INJECTED_EMAIL');
    } elseif (!empty($_POST['note']) &amp;&amp; strlen($_POST['note'] &gt; 200)) {
      $errors['order_form'] = LANG('NOTE_TOO_LONG');
    } elseif(empty($_SESSION['6_letters_code'] ) || 
    strcasecmp($_SESSION['6_letters_code'], $_POST['6_letters_code']) != 0) {
      $errors['order_form'] = LANG('BAD_SEC_CODE');    
    } else {

      if (!empty($_POST['client_type']) &amp;&amp; ($_POST['client_type'] == 'tcon')) {
        $_SESSION['client_type'] = 'tcon';
      } else {
        $_SESSION['client_type'] = 'ncon';
      }

      if (empty($_POST['note'])) {
        $_SESSION['order_note'] = 'n/a';
      } else {
        $_SESSION['order_note'] = $_POST['note'];
      }
      
      if (empty($_POST['gateway'])) {
        $_SESSION['gateway'] = 'default';
      } else {
        $_SESSION['gateway'] = $_POST['gateway'];
      }
      
      if ($show_ship) {
        if (empty($_POST['suburb']) || empty($_POST['country']) ||
        empty($_POST['state']) || empty($_POST['address']) ||
        (empty($_POST['zipcode']) &amp;&amp; strlen($_POST['zipcode']) &lt;= 1)) {
          $errors['order_form'] = LANG('SHIP_ADDRESS_REQ');
        } else {
          $_SESSION['address'] = $_POST['address']."\n".$_POST['suburb'].
          ", ".$_POST['state'].', '.$_POST['zipcode']."\n".$_POST['country'];
        }
      } else {
        $_SESSION['address'] = 'n/a';
      }
      
      if (!isset($account_id)) {
          $_SESSION['buyer_email'] = $_POST['email'];
          $account = get_account_byemail($_POST['email']);
          
          if (empty($account) || ($account === 'N/A')){
            if (check_email_dns($_POST['email'])) {
            
              $password = generate_password();
              $_SESSION['account'] = create_account($_POST['email'], pass_hash($password, $hash_rounds));
              
              if ($_SESSION['account']) {          
                $body = safe_str(str_replace('%', $seller, RAW_LANG('THANKS_SHOPPING')))."\n". 
                LANG('NEW_ACC_CREATED')."\n".LANG('LOGIN_WITH')."\n\n".
                LANG('EMAIL').": ".$_POST['email']." \n".
                LANG('PASSWORD').": $password";
                  
                if ($smtp_enable) {
                  $subject = RAW_LANG('NEW_ACCOUNT');
                  send_smtp_email($_POST['email'], $subject, $body);
                } else {
                  $subject = rfc1342b(RAW_LANG('NEW_ACCOUNT'));
                  mail($_POST['email'], $subject, $body, get_mail_headers());
                }
                  
              } else {
                $errors['order_form'] = LANG('DATABASE_ERROR');
              }
            } else {
              $errors['order_form'] = LANG('INJECTED_EMAIL');
            }
          } else {
            $account = mysqli_fetch_assoc($account);
            $_SESSION['account'] = $account['AccountID'];
          }  
      } else {
          $_SESSION['buyer_email'] = $_SESSION['user_data']['Email'];
          $_SESSION['account'] = $account_id;
      }

      if (empty($errors['order_form'])) {
        echo "&lt;p&gt;".LANG('WAIT_WHILE')."&lt;/p&gt;";
        redirect('./sci/process-order.php');
        $show_form = false;
      }
    }
  } elseif (!empty($_POST)) {
    $errors['order_form'] = LANG('EMPTY_EMAIL');
  }
  
  if ($show_form) {
?--> <!--?php if (!empty($errors['order_form'])) { ?-->
<div class="alert alert-block alert-error"><button type="button" class="close" data-dismiss="alert">&times;</button> <!--?php echo $errors['order_form']; ?--></div>
<!--?php } ?--><form name="order_form" method="post" action="">
<div class="row-fluid">
<div class="span6">
<h1><!--?php echo LANG('YOUR_ORDER'); ?-->:</h1>
<div class="well no_border"><!--?php 
          $ship_total = ($_SESSION['shipping'] === '-1') ? '0' : $_SESSION['shipping'];
          if (!manual_delivery_req()) {
            if (bccomp($ship_total, '0') == 0) {
              $_SESSION['shipping'] = '-1';
            }
          }
          $shs_btc = bitsci::btc_num_format($ship_total);
          $sub_btc = bitsci::btc_num_format($_SESSION['sub_total']);
          $sum_btc = bitsci::btc_num_format($_SESSION['sum_total']);
          $sum_fiat = bitsci::btc_num_format($_SESSION['sum_fiat'], 2);
          ?-->
<p><b><!--?php echo LANG('SHIPPING'); ?-->:</b> <!--?php echo $shs_btc; ?--> BTC</p>
<p><b><!--?php echo LANG('SUB_TOTAL'); ?-->:</b> <!--?php echo $sub_btc; ?--> BTC</p>
<p><b><!--?php echo LANG('TOTAL'); ?-->:</b> <!--?php echo $sum_btc; ?--> BTC (<!--?php echo $sum_fiat.' '.$curr_code; ?-->)</p>
</div>
<p><label id="conn_label" title="&lt;?php echo LANG('IF_CONN_THROUGH'); 
          ?&gt;"><b><!--?php echo LANG('SELECT_CONN_TYPE'); ?-->:</b><span><sup><a href="#" onclick="show_tooltip();">?</a></sup></span></label> <!--?php echo LANG('NORMAL_CLIENT'); ?-->: <input name="client_type" value="ncon" php="" if="" _session="" client_type="" ncon="" echo="" checked="checked" type="radio" /> /&gt; &nbsp;&nbsp; <!--?php echo LANG('TOR_CLIENT'); ?-->: <input name="client_type" value="tcon" php="" if="" _session="" client_type="" tcon="" echo="" checked="checked" type="radio" /> /&gt;</p>
<br /> <label><b><!--?php echo LANG('PAYMENT_GATEWAY'); ?-->:</b></label><select name="gateway" id="gateway_list" class="input-medium"><!--?php if ($use_defgate) { ?-->
<option value="default" selected="selected"><!--?php 
          echo LANG('DEFAULT').' '.LANG('GATEWAY'); ?--></option>
<!--?php }       
          foreach ($gateways as $key =&gt; $value) {
            if ($gateways[$key][0]) {
              echo "&lt;option value='$key'&gt;".safe_str($value[1]).' '.LANG('GATEWAY').'&lt;/option&gt;';
            }
          }
          ?--></select>
<p><u><!--?php echo LANG('PAY_METHODS'); ?-->:</u></p>
<p><!--?php if ($use_defgate) {
        echo LANG('DEFAULT').' '.LANG('GATEWAY').': BTC';
        if ($use_altrpc) {
          echo ', '.safe_str($altcoin_code);
        }
        ?--><br /><!--?php }       
        foreach ($gateways as $key =&gt; $value) {
          if ($gateways[$key][0]) {
            echo safe_str($value[1]).' '.LANG('GATEWAY').': '.safe_str($value[2]).'&lt;br ?-->'; } } ?&gt;</p>
<!--?php if ($show_captcha &amp;&amp; $show_ship) { ?--> <br clear="all" /> <img src="../inc/captcha_code_file.php?rand=&lt;?php echo rand(); ?&gt;" id="captchaimg" /><br /> <small><!--?php echo LANG('CANT_READ_IMG'); ?--> <a><!--?php 
        echo LANG('CLICK_HERE'); ?--></a> <!--?php echo LANG('TO_REFRESH'); ?--></small> <label for="message"><!--?php echo LANG('REPEAT_SEC_CODE'); ?-->:</label> <input name="6_letters_code" class="input-large" maxlength="6" required="required" type="text" /> <!--?php 
        } elseif ($show_ship) {
          $_SESSION['6_letters_code'] = 'abc';
          echo '&lt;input type="hidden" name="6_letters_code" value="abc" ?-->'; } ?&gt;</div>
<div class="span6">
<h5><!--?php echo LANG('COMPLETE_ORDER'); ?-->:</h5>
<label><!--?php echo LANG('EMAIL'); ?-->:</label> <input name="email" id="email" class="input-large" maxlength="50" php="" if="" empty="" _session="" user_data="" echo="" value="';
          safe_echo($_POST['email']);
          echo " readonly="readonly" elseif="" _post="" email="" required="required" type="text" /> /&gt; <!--?php if (empty($_SESSION['user_data'])) { ?--> <br clear="all" /> <label><!--?php echo LANG('CONFIRM_EMAIL'); ?-->:</label> <input name="c_email" id="c_email" class="input-large" maxlength="50" value="&lt;?php     
          if (!empty($_POST['c_email'])) { safe_echo($_POST['c_email']); } ?&gt;" required="required" type="text" /> <!--?php 
        } else {
          echo '&lt;input type="hidden" name="c_email" id="c_email" maxlength="50" value="';
          safe_echo($_SESSION['user_data']['Email']);
          echo '" ?-->'; } ?&gt; <br clear="all" /> <label><!--?php echo LANG('NOTE').' ('.LANG('OPTIONAL').')'; ?-->:</label> <textarea name="note" id="note" class="input-large" maxlength="500">&lt;?php 
        if (!empty($_POST['note'])) { safe_echo($_POST['note']); } ?&gt;</textarea> <!--?php 
        if (!empty($_SESSION['user_data']['AddressID'])) {
          $address_id = (int) $_SESSION['user_data']['AddressID'];
          $address_arr = mysqli_fetch_assoc(get_address($address_id));
        }
        
        if ($show_ship) {
        ?-->
<p><b><!--?php echo LANG('SHIPPING_ADDRESS'); ?-->:</b></p>
<label>Country:</label> <input name="country" class="input-large" maxlength="60" value="&lt;?php 
        if (!empty($_POST['country'])) { safe_echo($_POST['country']); } elseif 
        (!empty($address_arr['Country'])) { safe_echo($address_arr['Country']); } 
        ?&gt;" required="required" type="text" /> <br clear="all" />
<div class="float_left"><label>State:</label> <input name="state" class="input-small" maxlength="50" value="&lt;?php 
          if (!empty($_POST['state'])) { safe_echo($_POST['state']); } elseif 
          (!empty($address_arr['State'])) { safe_echo($address_arr['State']); } 
          ?&gt;" required="required" type="text" /></div>
<div class="float_left" id="zip_box"><label>Zipcode:</label> <input name="zipcode" class="input-small" maxlength="10" value="&lt;?php 
          if (!empty($_POST['zipcode'])) { safe_echo($_POST['zipcode']); } elseif 
          (!empty($address_arr['Zipcode'])) { safe_echo($address_arr['Zipcode']); } 
          ?&gt;" required="required" type="text" /></div>
<br clear="all" /> <label>Suburb:</label> <input name="suburb" class="input-large" maxlength="50" value="&lt;?php 
        if (!empty($_POST['suburb'])) { safe_echo($_POST['suburb']); } elseif 
        (!empty($address_arr['Suburb'])) { safe_echo($address_arr['Suburb']); } 
        ?&gt;" required="required" type="text" /> <label>Address:</label> <input name="address" class="input-large" maxlength="80" value="&lt;?php 
        if (!empty($_POST['address'])) { safe_echo($_POST['address']); } elseif 
        (!empty($address_arr['Address'])) { safe_echo($address_arr['Address']); } 
        ?&gt;" required="required" type="text" /> <!--?php } ?--> <!--?php if ($show_captcha &amp;&amp; !$show_ship) { ?--> <br clear="all" /> <img src="../inc/captcha_code_file.php?rand=&lt;?php echo rand(); ?&gt;" id="captchaimg" /><br /> <small><!--?php echo LANG('CANT_READ_IMG'); ?--> <a><!--?php 
        echo LANG('CLICK_HERE'); ?--></a> <!--?php echo LANG('TO_REFRESH'); ?--></small> <label for="message"><!--?php echo LANG('REPEAT_SEC_CODE'); ?-->:</label> <input name="6_letters_code" class="input-large" maxlength="6" required="required" type="text" /> <!--?php 
        } elseif (!$show_ship) {
          $_SESSION['6_letters_code'] = 'abc';
          echo '&lt;input type="hidden" name="6_letters_code" value="abc" ?-->'; } ?&gt;</div>
</div>
<hr /><center><a class="btn" href="../../../undefined//?page=cart"><!--?php echo LANG('GO_BACK'); ?--></a> <button type="submit" class="btn btn-primary"><!--?php echo LANG('GO_TO').
      ' '.LANG('PAYMENT_GATEWAY'); ?--></button></center></form><!--?php if (empty($_SESSION['user_data'])) { ?-->
<div class="alert alert-warning"><!--?php echo '&lt;b&gt;'.LANG('IMPORTANT').':&lt;/b&gt; '.
  LANG('IF_NOT_REGISTERED').' '.LANG('ENSURE_EMAIL_VALID'); ?--></div>
<!--?php } ?-->
<script language="JavaScript">// <![CDATA[
function show_tooltip() {
  $('#conn_label').tooltip('show');
}
// ]]></script>
<!--?php 
  }
}
?-->

 

 

I want everything in the orange box removing.

 

Screenshot (84).png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.