I have a custom tpl_checkout_shipping_default.php
Site functioned perfectly when running as v1.3.9h. Since upgrade i get a "Whoops! Sorry, but you are not allowed to perform the action requested." error and am redirected to /index.php?main_page=time_out when trying to move on from checkout_shipping if i selected out of bond, or in bond shipping.
I tracked it down to a problem with tpl_checkout_shipping_default.php.
If i put this file into a completely fresh install of zc1.51, along with the relevant shipping files in modules/shipping i get the same fault, so i know it isn't an issue caused by another module.
Comparing the zc1.3.9 tpl_checkout_shipping_default.php with the zc1.5.1 version they are identical, so theoretically the file should be ok, but not so.
I'm assuming some function within zc has changed and the custom coding in my file is not compatible, but i just don't know where.
Any help really appreciated because i've been trying all day to see what is wrong here and am now tearing out my hair.
Code is posted below:
<?php
* @version $Id: tpl_checkout_shipping_default.php 5316 2006-12-21 02:25:58Z drbyte $
*/
//print_r($_SESSION['shipping']);
$sel = $db->Execute('select Description from '. TABLE_TEXT_HEADER .'');
if ($sel->RecordCount() > 0) {
$text_header = $sel->fields['Description'];
}
$comments = $_POST['comments'];
?>
<?php
$ship_zone = $_POST['ship_zone'];
$sel_zone = $db->Execute('select * from '.TABLE_SHIP_ZONE.'');
if($sel_zone->RecordCount()>0){
while(!$sel_zone->EOF){
$zone_id = $sel_zone->fields['Id'];
$zonename = $sel_zone->fields['Zone_Name'];
$zonerate = $sel_zone->fields['Zone_Rate'];
$select_zone = $zone_id == $ship_zone ? 'selected="selected"' : '';
$zone_option .= '<option '.$select_zone.' value="'.$zone_id.'">'.$zonename.'</option>';
$sel_zone->MoveNext();
}
}
if($ship_zone){
$_SESSION['ship_zone'] = $ship_zone;
$sel_zone_rate = $db->Execute('select Zone_Rate from '.TABLE_SHIP_ZONE.' where Id = '.$ship_zone.'');
$zonerate = $sel_zone_rate->fields['Zone_Rate'];
}
?>
<script type="text/javascript" language="javascript">
function create_name(){
document.checkout_address.action.value = 'process';
}
</script>
<?php
$ship_type = $_POST['shipping_type'];
if($ship_type == 1){
$sel1 = 'selected="selected"';
$ship_type1 = 1;
}
if($ship_type == 2){
$sel2 = 'selected="selected"';
$ship_type1 = 2;
}
if($ship_type == 3){
$sel3 = 'selected="selected"';
$ship_type1 = 3;
}
if($ship_type == 4){
$sel4 = 'selected="selected"';
$ship_type1 = 4;
}
if($ship_type == 5){
$sel5 = 'selected="selected"';
$ship_type1 = 4;
}
if($ship_type1!=""){
$sel_ship_text = $db->Execute('select Description from '.TABLE_SHIPPING_TEXT.' where Shipping_Type = '.$ship_type1.'');
if ($sel_ship_text->RecordCount() > 0) {
$ship_text = '<div style="background-color:#393939; padding:7px;">'.$sel_ship_text->fields['Description'].'</div>';
}
}
?>
<div class="centerColumn" id="checkoutShipping">
<?php
if(($ship_type == 2) || ($ship_type == 3)){
echo zen_draw_form('checkout_address', zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
}else{
echo '<form name="checkout_address" action="" method="post">';
}
?>
<div style="background-color:#393939; padding:7px;"><?=$text_header?></div>
<h1 id="checkoutShippingHeading"><?php echo HEADING_TITLE; ?></h1>
<?php if ($messageStack->size('checkout_shipping') > 0) echo $messageStack->output('checkout_shipping'); ?>
<!-- bof Order Steps (tableless) -->
<div id="order_steps">
<div class="order_steps_text">
<span id="active_step_text"><?php echo zen_image($template->get_template_dir(ORDER_STEPS_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . ORDER_STEPS_IMAGE, ORDER_STEPS_IMAGE_ALT); ?><br /><?php echo TEXT_ORDER_STEPS_1; ?></span><span class="order_steps_text2"><?php echo TEXT_ORDER_STEPS_2; ?></span><span class="order_steps_text3"><?php echo TEXT_ORDER_STEPS_3; ?></span><span class="order_steps_text4"><?php echo TEXT_ORDER_STEPS_4; ?></span>
</div>
<div class="order_steps_line_2">
<span class="progressbar_active"> </span><span class="progressbar_inactive"> </span><span class="progressbar_inactive"> </span><span class="progressbar_inactive"> </span>
</div>
</div>
<!-- eof Order Steps (tableless) -->
<?php
if($ship_type == 1){ ?>
<h2 id="checkoutShippingHeadingAddress"><?php echo TITLE_SHIPPING_ADDRESS; ?></h2>
<div id="checkoutShipto" class="floatingBox back">
<?php if ($displayAddressEdit) { ?>
<div class="buttonRow forward"><?php echo '<a href="' . $editShippingButtonLink . '">' . zen_image_button(BUTTON_IMAGE_CHANGE_ADDRESS, BUTTON_CHANGE_ADDRESS_ALT) . '</a>'; ?></div>
<?php } ?>
<address class=""><?php echo zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], true, ' ', '<br />'); ?></address>
</div>
<div class="floatingBox important forward"><?php echo TEXT_CHOOSE_SHIPPING_DESTINATION; ?></div>
<br class="clearBoth" />
<?php
}
?>
<?php
if (zen_count_shipping_modules() > 0) {
?>
<h2 id="checkoutShippingHeadingMethod"><?php echo TABLE_HEADING_SHIPPING_METHOD; ?></h2>
<?php
if (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1) {
?>
<div id="checkoutShippingContentChoose" class="important"><?php echo TEXT_CHOOSE_SHIPPING_METHOD; ?></div>
<?php
} elseif ($free_shipping == false) {
?>
<div id="checkoutShippingContentChoose" class="important"><?php echo TEXT_ENTER_SHIPPING_INFORMATION; ?></div>
<?php
}
?>
<?php
if ($free_shipping == true) {
?>
<div id="freeShip" class="important" ><?php echo FREE_SHIPPING_TITLE; ?> <?php echo $quotes[$i]['icon']; ?></div>
<div id="defaultSelected"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . zen_draw_hidden_field('shipping', 'free_free'); ?></div>
<?php
} else {
$radio_buttons = 0; ?>
<fieldset>
<legend>Shipping</legend>
<?=$ship_text?><br />
Select Shipping Method: <select name="shipping_type" onchange="document.checkout_address.submit();">
<option value="">--Select--</option>
<option <?=$sel1?> value="1">Out Of Bond</option>
<option <?=$sel2?> value="2">En Primeur</option>
<option <?=$sel3?> value="3">Export</option>
<option <?=$sel4?> value="4">In Bond (Transfer)</option>
<option <?=$sel5?> value="5">In Bond (Collection)</option>
</select>
</fieldset>
<?php
//print_r($quotes);
for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
?>
<?
/***************** BOF Shipping type display***************************/
if ($quotes[$i]['module'] != '') {
Bookmarks