Last active
August 29, 2015 14:04
-
-
Save DivaVocals/8303bef759f9648cbf86 to your computer and use it in GitHub Desktop.
zenCart - Hide Available Shipping Methods table until Shipping Estimator runs ( /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_shipping_estimator.php)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//This is a replacement for the /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_shipping_estimator.php. | |
//There are two areas that were changed, just look for the //-bof and //-eof comments | |
// Use when you don't want the Available Shipping Methods table to display on the | |
//http://yoursite(dot)com/index(dot)php? main_page=shopping_cart page until you enter the location and postal code | |
//information. This way all the available shipping methods are displayed together. (flat rates as well as UPS) | |
} | |
} | |
if($_SESSION['cart']->get_content_type() == 'virtual'){ | |
?> | |
<?php echo CART_SHIPPING_METHOD_FREE_TEXT . ' ' . CART_SHIPPING_METHOD_ALL_DOWNLOADS; ?> | |
<?php | |
}elseif ($free_shipping==1) { | |
?> | |
<?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)); ?> | |
<?php | |
}else{ | |
//-bof-No display until country/state/zip are entered (1 of 2) | |
if (($selected_country == 0 || ($selectedState == '' && $state_zone_id == 0) || $zip_code == '') && (!$_SESSION['customer_id'])) { | |
if (!defined(TEXT_ENTER_ALL_VALUES)) define ('TEXT_ENTER_ALL_VALUES', 'Please select your country, state and zipcode so that we can can retrieve an accurate shipping estimate.'); | |
echo '<p>' . TEXT_ENTER_ALL_VALUES . '</p>'; | |
} else { | |
//-eof-No display until country/state/zip are entered (1 of 2) | |
?> | |
<table width="100%" border="1" cellpadding="2" cellspacing ="2"> | |
<?php if ($_SESSION['customer_id'] < 1 ){ ?> | |
<tr> | |
<td colspan="2" class="seDisplayedAddressLabel"> | |
<?php echo CART_SHIPPING_QUOTE_CRITERIA; ?><br /> | |
<?php echo '<span class="seDisplayedAddressInfo">' . zen_get_zone_name($selected_country, $state_zone_id, '') . ($selectedState != '' ? ' ' . $selectedState : '') . ' ' . $order->delivery['postcode'] . ' ' . zen_get_country_name($order->delivery['country_id']) . '</span>'; ?> | |
</td> | |
</tr> | |
<?php } ?> | |
<tr> | |
<th scope="col" id="seProductsHeading"><?php echo CART_SHIPPING_METHOD_TEXT; ?></th> | |
<th scope="col" id="seTotalHeading"><?php echo CART_SHIPPING_METHOD_RATES; ?></th> | |
</tr> | |
<?php | |
for ($i=0, $n=sizeof($quotes); $i<$n; $i++) { | |
if(sizeof($quotes[$i]['methods'])==1){ | |
// simple shipping method | |
$thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][0]['id']; | |
?> | |
<tr class="<?php echo $extra; ?>"> | |
<?php | |
if($quotes[$i]['error']){ | |
?> | |
<td colspan="2"><?php echo $quotes[$i]['module']; ?> (<?php echo $quotes[$i]['error']; ?>)</td> | |
</tr> | |
<?php | |
}else{ | |
if($selected_shipping['id'] == $thisquoteid){ | |
?> | |
<td class="bold"><?php echo $quotes[$i]['module']; ?> (<?php echo $quotes[$i]['methods'][0]['title']; ?>)</td> | |
<td class="cartTotalDisplay bold"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])); ?></td> | |
</tr> | |
<?php | |
}else{ | |
?> | |
<td><?php echo $quotes[$i]['module']; ?> (<?php echo $quotes[$i]['methods'][0]['title']; ?>)</td> | |
<td class="cartTotalDisplay"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])); ?></td> | |
</tr> | |
<?php | |
} | |
} | |
} else { | |
// shipping method with sub methods (multipickup) | |
for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) { | |
$thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id']; | |
?> | |
<tr class="<?php echo $extra; ?>"> | |
<?php | |
if($quotes[$i]['error']){ | |
?> | |
<td colspan="2"><?php echo $quotes[$i]['module']; ?> (<?php echo $quotes[$i]['error']; ?>)</td> | |
</tr> | |
<?php | |
}else{ | |
if($selected_shipping['id'] == $thisquoteid){ | |
?> | |
<td class="bold"><?php echo $quotes[$i]['module']; ?> (<?php echo $quotes[$i]['methods'][$j]['title']; ?>)</td> | |
<td class="cartTotalDisplay bold"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])); ?></td> | |
</tr> | |
<?php | |
}else{ | |
?> | |
<td><?php echo $quotes[$i]['module']; ?> (<?php echo $quotes[$i]['methods'][$j]['title']; ?>)</td> | |
<td class="cartTotalDisplay"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])); ?></td> | |
</tr> | |
<?php | |
} | |
} | |
} | |
} | |
} | |
?> | |
</table> | |
<?php | |
} | |
//-bof-No display until country/state/zip are entered (2 of 2) | |
} | |
//-eof-No display until country/state/zip are entered (2 of 2) | |
} | |
?> | |
</form> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use when you don't want the Available Shipping Methods table to display on the
http: // yoursite(dot)com/index(dot)php? main_page=shopping_cart page until you enter the location and postal code information. This way all the available shipping methods are displayed together. (flat rates as well as UPS)
See: http://www.zen-cart.com/showthread.php?198719-Hide-Available-Shipping-Methods-table-until-Shipping-Estimator-runs&p=1219655#post1219655