Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Checkout in one single page


sinopia

Recommended Posts

Hello, I'm trying to get some addons working to get my checkout in one single page instead 3 different pages in a 2.3.4 version. But I'm getting some error due the payments..

I've tried:

Simple Checkout for 2.3.1 v 2.0 by osCbyJetta (which I get -> PHP Fatal error:  Cannot redeclare class ot_fixed_payment_chg in /../includes/modules/order_total/ot_fixed_payment_chg.php on line 17)

One Step Checkout for 2.3 by TiM's osC Solutions (which I get -> PHP Fatal error:  Cannot redeclare class payment in /../includes/classes/payment.php on line 13)

 

Anyone knows any solution on alternative? 

Best regards.

Link to comment
Share on other sites

On the Simple Checkout for 2.3.1 v3.0 I've figure it out: it didn't import all the sql so in some files it wasn't working.

if(SIMPLE_CHECKOUT_ENABLED == 'True') tep_redirect(tep_href_link(FILENAME_CHECKOUT, '', 'SSL'));

But anyone with the One Step Checkout for 2.3 by TiM's osC Solutions that had this issue about ot_fixed_payment_chg?

Link to comment
Share on other sites

Does anybody know a simple OPC (One Page Checkout) working? I'm trying to create a checkout.php with is the checkout_shipping.php plus the checkout_payment.php but it keeps to redirect me to the shipping I've verify checkout_process.php and everything..

Link to comment
Share on other sites

It seems to work now but having some problems due the checkout_confirmation.php and checkout_process.php because it isn't recording the shipping stuff so it keeps redirect me -> tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

Here's my checkout (checkout_shipping.php + checkout_payment.php):

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
  
*/

  require('includes/application_top.php');
  require('includes/classes/http_client.php');

// if the customer is not logged on, redirect them to the login page
  if (!tep_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
  }

// if there is nothing in the customers cart, redirect them to the shopping cart page
  if ($cart->count_contents() < 1) {
    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
  }

// if no shipping method has been selected, redirect the customer to the shipping method selection page
  if (!tep_session_is_registered('shipping')) {
    //tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
  }

// avoid hack attempts during the checkout procedure by checking the internal cartID
  if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
    if ($cart->cartID != $cartID) {
      tep_redirect(tep_href_link(FILENAME_CHECKOUT, '', 'SSL'));
    }
  }

// Stock Check
//++++ QT Pro: Begin Changed code
  if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
    $products = $cart->get_products();
    $any_out_of_stock = 0;
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
     if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
       $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity'], $products[$i]['attributes']);
     }
     else{
       $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']);
     }
     if ($stock_check) $any_out_of_stock = 1;
  	}
    if ($any_out_of_stock == 1) {
      tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
      break;
    }
 	}
//++++ QT Pro: End Changed Code

// if no shipping destination address was selected, use the customers own address as default
  if (!tep_session_is_registered('sendto')) {
    tep_session_register('sendto');
    $sendto = $customer_default_address_id;
  } else {
// verify the selected shipping address
    if ( (is_array($sendto) && empty($sendto)) || is_numeric($sendto) ) {
      $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'");
      $check_address = tep_db_fetch_array($check_address_query);

      if ($check_address['total'] != '1') {
        $sendto = $customer_default_address_id;
        if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');
      }
    }
  }

// if no billing destination address was selected, use the customers own address as default
  if (!tep_session_is_registered('billto')) {
    tep_session_register('billto');
    $billto = $customer_default_address_id;
  } else {
// verify the selected billing address
    if ( (is_array($billto) && empty($billto)) || is_numeric($billto) ) {
      $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'");
      $check_address = tep_db_fetch_array($check_address_query);

      if ($check_address['total'] != '1') {
        $billto = $customer_default_address_id;
        if (tep_session_is_registered('payment')) tep_session_unregister('payment');
      }
    }
  }

  require(DIR_WS_CLASSES . 'order.php');
  $order = new order;

// register a random ID in the session to check throughout the checkout procedure
// against alterations in the shopping cart contents
  if (!tep_session_is_registered('cartID')) {
    tep_session_register('cartID');
  } elseif (($cartID != $cart->cartID) && tep_session_is_registered('shipping')) {
    tep_session_unregister('shipping');
  }

  $cartID = $cart->cartID = $cart->generate_cart_id();

// if the order contains only virtual products, forward the customer to the billing page as
// a shipping address is not needed
  if ($order->content_type == 'virtual') {
    if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
    $sendto = false;
    if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') ) {
      tep_session_unregister('shipping');
    } else {
      $shipping = false;
      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
    }
  }

  if (!tep_session_is_registered('comments')) tep_session_register('comments');
  if (isset($HTTP_POST_VARS['comments']) && tep_not_null($HTTP_POST_VARS['comments'])) {
    $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
  }

  if (!tep_session_is_registered('billing_nif')) tep_session_register('billing_nif');
  if (isset($_POST['billing_nif']) && tep_not_null($_POST['billing_nif'])) {
    $nif = tep_db_prepare_input($_POST['billing_nif']); // NIF
  }

  $total_weight = $cart->show_weight();
  $total_count = $cart->count_contents();

// load all enabled payment modules
  require(DIR_WS_CLASSES . 'payment.php');
  $payment_modules = new payment;
// load all enabled shipping modules
  require(DIR_WS_CLASSES . 'shipping.php');
  $shipping_modules = new shipping;

  if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
    $pass = false;

    switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
      case 'national':
        if ($order->delivery['country_id'] == STORE_COUNTRY) {
          $pass = true;
        }
        break;
      case 'international':
        if ($order->delivery['country_id'] != STORE_COUNTRY) {
          $pass = true;
        }
        break;
      case 'both':
        $pass = true;
        break;
    }

    $free_shipping = false;
    if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
      $free_shipping = true;

      include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');
    }
  } else {
    $free_shipping = false;
  }

// process the selected shipping method
  if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken) ) {
    if (!tep_session_is_registered('comments')) tep_session_register('comments');
    if (tep_not_null($HTTP_POST_VARS['comments'])) {
      $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
    }

    if (!tep_session_is_registered('shipping')) tep_session_register('shipping');

    if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {
      if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) {
        $shipping = $HTTP_POST_VARS['shipping'];

        list($module, $method) = explode('_', $shipping);
        if ( is_object($$module) || ($shipping == 'free_free') ) {
          if ($shipping == 'free_free') {
            $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
            $quote[0]['methods'][0]['cost'] = '0';
          } else {
            $quote = $shipping_modules->quote($method, $module);
          }
          if (isset($quote['error'])) {
            tep_session_unregister('shipping');
          } else {
            if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
              $shipping = array('id' => $shipping,
                                'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
                                'cost' => $quote[0]['methods'][0]['cost']);

              tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
            }
          }
        } else {
          tep_session_unregister('shipping');
        }
      }
    } else {
      if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') ) {
        tep_session_unregister('shipping');
      } else {
        $shipping = false;

        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
      }
    }    
  }

  // get all available shipping quotes
  $quotes = $shipping_modules->quote();

  // if no shipping method has been selected, automatically select the cheapest method.
  // if the modules status was changed when none were available, to save on implementing
  // a javascript force-selection method, also automatically select the cheapest shipping
  // method if more than one module is now enabled

  if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping = $shipping_modules->cheapest();

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT);
  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SHIPPING);

  if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') && !tep_session_is_registered('shipping') && ($shipping == false)
   ) {
    $messageStack->add_session('checkout_address', ERROR_NO_SHIPPING_AVAILABLE_TO_SHIPPING_ADDRESS);
    tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL'));
  }

  /*
  $current_page = FILENAME_CHECKOUT_PAYMENT;
  $current_page = FILENAME_CHECKOUT_SHIPPING;
  */
  $current_page = FILENAME_CHECKOUT;

  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT, '', 'SSL'));

  require(DIR_WS_INCLUDES . 'template_top.php');
?>

<script type="text/javascript"><!--
var selected;

function selectRowEffect(object, buttonSelect) {
  if (!selected) {
    if (document.getElementById) {
      selected = document.getElementById('defaultSelected');
    } else {
      selected = document.all['defaultSelected'];
    }
  }

  if (selected) selected.className = 'moduleRow';
  object.className = 'moduleRowSelected';
  selected = object;

// one button is not an array
  // Payment
  if (document.checkout_payment.payment[0]) {
    document.checkout_payment.payment[buttonSelect].checked=true;
  } else {
    document.checkout_payment.payment.checked=true;
  }
  // Shipping
  if (document.checkout_address.shipping[0]) {
    document.checkout_address.shipping[buttonSelect].checked=true;
  } else {
    document.checkout_address.shipping.checked=true;
  }
}

function rowOverEffect(object) {
  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffect(object) {
  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}

<?php
  // Discount Code 3.1.1 - start
  if (MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'true') {
?>
$(document).ready(function() {
var a = 0;
discount_code_process();
$('#discount_code').blur(function() { if (a == 0) discount_code_process(); a = 0 });
$("#discount_code").keypress(function(event) { if (event.which == 13) { event.preventDefault(); a = 1; discount_code_process() } });
function discount_code_process() { if ($("#discount_code").val() != "") { $("#discount_code").attr("readonly", "readonly"); $("#discount_code_status").empty().append('<?php echo tep_image(DIR_WS_ICONS . 'dc_progress.gif'); ?>'); $.post("discount_code.php", { discount_code: $("#discount_code").val() }, function(data) { data == 1 ? $("#discount_code_status").empty().append('<?php echo tep_image(DIR_WS_ICONS . 'dc_success.gif'); ?>') : $("#discount_code_status").empty().append('<?php echo tep_image(DIR_WS_ICONS . 'dc_failed.gif'); ?>'); $("#discount_code").removeAttr("readonly") }); } }
});
<?php
  }
  // Discount Code 3.1.1 - end
?>

//--></script>
<?php echo $payment_modules->javascript_validation(); ?>

<?php echo tep_draw_content_top();?>

<?php echo tep_draw_title_top();?>
<h2><?php echo HEADING_TITLE; ?></h2>
<?php echo tep_draw_title_bottom();?>

<?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'post', '', true) . tep_draw_hidden_field('action', 'process'); ?>

<div class="contentContainer">
  <div class="contentBlock">
  <h4><?php echo TABLE_HEADING_SHIPPING_ADDRESS; ?></h4>
  <div class="contentText">
    <?php echo TEXT_CHOOSE_SHIPPING_DESTINATION; ?>
    <div class="fl_right" id="address_book" style="width:auto;">
      <?php echo tep_draw_title_top();?><h5 class="first_h3"><?php echo TITLE_SHIPPING_ADDRESS; ?></h5><?php echo tep_draw_title_bottom();?>
    <div class="infoBoxContents"><?php echo tep_draw_box_content_top();?>
        <?php echo tep_address_label($customer_id, $sendto, true, ' ', '<br />'); ?>
        <?php echo tep_draw_box_content_bottom();?></div>
          <div class="buttonSet">
              <span class="buttonAction"><?php echo tep_draw_button2_top();?><?php echo tep_draw_button(IMAGE_BUTTON_CHANGE_ADDRESS, 'home', tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL')); ?><?php echo tep_draw_button2_bottom();?></span>
          </div>        
    </div>
  </div>

<script type="text/javascript">
$(document).ready(function () {
    if ($(window).width() < 760 || $(window).height() < 760) {
    $("div#address_book").css({"float":"none"});
  }
});
</script>

  <div style="clear: both;"></div>

<?php
  if (tep_count_shipping_modules() > 0) {
?>

  <h4><?php echo TABLE_HEADING_SHIPPING_METHOD; ?></h4>
  <div class="contentText">
<?php
    if (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1) {
?>
 
    <div style="float: right;">
      <?php echo '<strong>' . TITLE_PLEASE_SELECT . '</strong>'; ?>
    </div>

    <?php echo TEXT_CHOOSE_SHIPPING_METHOD; ?>
  
<?php
    } elseif ($free_shipping == false) {
?>

    <?php echo TEXT_ENTER_SHIPPING_INFORMATION; ?>
 
<?php
    }
?>
    <table>

<?php
    if ($free_shipping == true) {
?>

      <tr>
        <td><strong><?php echo FREE_SHIPPING_TITLE; ?></strong>&nbsp;<?php echo $quotes[$i]['icon']; ?></td>
      </tr>
      <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, 0)">
        <td style="padding-left: 15px;"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></td>
      </tr>

<?php
    } else {
      $radio_buttons = 0;
      for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
?>

      <tr>
        <td colspan="3"><strong><?php echo $quotes[$i]['module']; ?></strong>&nbsp;<?php if (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon'])) { echo $quotes[$i]['icon']; } ?></td>
      </tr>

<?php
        if (isset($quotes[$i]['error'])) {
?>

      <tr>
        <td colspan="3"><?php echo $quotes[$i]['error']; ?></td>
      </tr>

<?php
        } else {
          for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
// set the radio button to be checked if it is the method chosen
            $checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false);

            if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {
              echo '      <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
            } else {
              echo '      <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
            }
?>

        <td width="75%" style="padding-left: 15px;"><?php echo $quotes[$i]['methods'][$j]['title']; ?></td>

<?php
            if ( ($n > 1) || ($n2 > 1) ) {
?>

        <td><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></td>
        <td align="right"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked); ?></td>

<?php
            } else {
?>

        <td align="right" colspan="2"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></td>

<?php
            }
?>

      </tr>

<?php
            $radio_buttons++;
          }
        }
      }
    }
?>

    </table>
 
  </div>
<?php
  }
?>
  </div>
</div>
</form>

<?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"', true); ?>

<div class="contentContainer">
  <div class="contentBlock">

<?php
  if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) {
?>

  <div class="contentInfoText">
    <?php echo '<strong>' . tep_output_string_protected($error['title']) . '</strong>'; ?>

    <p class="messageStackError"><?php echo tep_output_string_protected($error['error']); ?></p>
  </div>

<?php
  }
?>


<div class="contentContainer">
  <div class="contentBlock">
  <h4><?php echo TABLE_HEADING_BILLING_ADDRESS; ?></h4>
  <div class="contentText">
  	<?php echo TEXT_SELECTED_BILLING_DESTINATION; ?>
    <div class="fl_right" id="address_book" style="width:auto;">
      <?php echo tep_draw_title_top();?><h5 class="first_h3"><?php echo TITLE_BILLING_ADDRESS; ?></h5><?php echo tep_draw_title_bottom();?>
	  <div class="infoBoxContents"><?php echo tep_draw_box_content_top();?>
        <?php echo tep_address_label($customer_id, $billto, true, ' ', '<br />'); ?>
        <?php echo tep_draw_box_content_bottom();?></div>
          <div class="buttonSet">
              <span class="buttonAction"><?php echo tep_draw_button2_top();?><?php echo tep_draw_button(IMAGE_BUTTON_CHANGE_ADDRESS, 'home', tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL')); ?><?php echo tep_draw_button2_bottom();?></span>
          </div>        
    </div>
  </div>


  <h4><?php echo ENTRY_NIF_NUMBER_TITLE; ?></h4>
  <div class="contentText" style="text-align: center;">

<?php
  // NIF
  $nif_query = tep_db_query("select customers_nif from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
  $nif_number = tep_db_fetch_array($nif_query);

  if (($nif_number['customers_nif'] != NULL) && ($nif_number['customers_nif'] != "")) { 
  	echo "O NIF que tem registado na sua conta é: <strong>";
  	echo $nif_number['customers_nif'];
  	echo "</strong><br>Prentede o NIF na fatura? ";
  	echo tep_draw_checkbox_field('billing_nif', $nif_number['customers_nif'], '', 'class="input"');
  } else {
  	echo "Insira abaixo o seu Número de Identificação Fiscal caso pretenda NIF na fatura: <span class='inputRequirement'>Facultativo</span><br>";
  	echo tep_draw_input_field('billing_nif','','class="input" maxlength="9" style="width:30%"');
  	echo "<p id='associar_nif' style='display:none;'>Deseja associar o NIF na sua conta para próximas encomendas? ";
	echo tep_draw_checkbox_field('customer_nif', '', '', 'class="input" style="display:none"');
	echo "</p><p id='errmsg'></p>";
  }

?>
  </div>

<script type="text/javascript">
$(document).ready(function () {
  $("input[name=billing_nif]").keypress(function (e) {
     if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
        $("#errmsg").html("Apenas são permitidos dígitos").show().fadeOut("slow");
        return false;
    } else {
    	$("p#associar_nif").show();
    	$("input[name=customer_nif]").show();
    }
   });
  	if ($(window).width() < 760 || $(window).height() < 760) {
	 	$("div#address_book").css({"float":"none"});
	}
});
</script>

  <div style="clear: both;"></div>

  <h4><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></h4>

<?php
  $selection = $payment_modules->selection();

  if (sizeof($selection) > 1) {
?>

  <div class="contentText">
    <div style="float: right;">
      <?php echo '<strong>' . TITLE_PLEASE_SELECT . '</strong>'; ?>
    </div>

    <?php echo TEXT_SELECT_PAYMENT_METHOD; ?>
  

<?php
    } else {
?>

  <div class="contentText">
    <?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?>
  

<?php
    }
?>
  <br /><br />

<?php
  $radio_buttons = 0;
  for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
?>

    <table>

<?php
    if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) {
      echo '      <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
    } else {
      echo '      <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
    }
?>

        <td width="100%"><strong><?php echo $selection[$i]['module']; ?></strong></td>
        <td align="right">

<?php
    if (sizeof($selection) > 1) {
      echo tep_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $payment));
    } else {
      echo tep_draw_hidden_field('payment', $selection[$i]['id']);
    }
?>

        </td>
      </tr>

<?php
    if (isset($selection[$i]['error'])) {
?>

      <tr>
        <td colspan="2"><?php echo $selection[$i]['error']; ?></td>
      </tr>

<?php
    } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
?>

      <tr>
        <td>

<?php
      for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
?>

          <tr>
            <td><?php echo $selection[$i]['fields'][$j]['title']; ?></td>
            <td><?php echo $selection[$i]['fields'][$j]['field']; ?></td>
          </tr>

<?php
      }
?>

        </table></td>
      </tr>

<?php
    }
?>

    </table>

<?php
    $radio_buttons++;
  }
?>

  </div>


<?php
  // Discount Code 3.1.1 - start
  if (MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'true') {
?>

  <h4><?php echo TEXT_DISCOUNT_CODE; ?></h4>

  <div class="contentText">
    <table>
      <tr>
        <td valign="middle" height="25"><?php echo tep_draw_input_field('discount_code', $sess_discount_code, 'id="discount_code" size="10"'); ?></td>
        <td width="5"></td>
        <td valign="middle"><div id="discount_code_status"></div></td>
      </tr>
      <tr>
      	<td style="text-align: center;"><span>Tem um cupão de desconto? Indique o código do seu cupão de desconto.</span></td>
      </tr>
    </table>
  </div>
<?php
  }
  // Discount Code 3.1.1 - end
?>
  <h4><?php echo TABLE_HEADING_COMMENTS; ?></h4>
  <div class="contentText">
    <?php echo tep_draw_textarea_field('comments', 'soft', '60', '5', $comments); ?>
  </div>

  <div class="buttonSet">
    <div class="fl_right" align="right"><?php echo tep_draw_button1_top();?><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', null, 'primary'); ?><?php echo tep_draw_button1_bottom();?></div>
  </div>
  
  </div>

</div>

</form>

<?php echo tep_draw_content_bottom();?>

<?php
  require(DIR_WS_INCLUDES . 'template_bottom.php');
  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

In order to work I'd to comment this line in checkout_confirmation.php:

// if no shipping method has been selected, redirect the customer to the shipping method selection page
  if (!tep_session_is_registered('shipping')) {
    //tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
  }

There's something messing with the shipping. Any answer would be great.

Link to comment
Share on other sites

Hello, I would appreciate any answer, I'm getting only this on POST

array(4) { ["formid"]=> string(32) "cc39a28be37efb4471ce3f7f5234c723" ["payment"]=> string(3) "cod" ["discount_code"]=> string(0) "" ["comments"]=> string(0) "" }

As the shipping isn't registering (and I can't figure out why) if I keep the correct way in checkout_confirmation.php and checkout_process.php it keeps to redirect to checkout_shipping.php

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...