Forums / Addon Shipping Modules / Remove state & zipcode from Shipping Estimator?

Remove state & zipcode from Shipping Estimator?

Locked
Results 1 to 18 of 18
This thread is locked. New replies are disabled.
07 Oct 2007, 22:11
#1
kate_1 avatar

kate_1

New Zenner

Join Date:
Aug 2007
Posts:
47
Plugin Contributions:
0

Remove state & zipcode from Shipping Estimator?

I am using the shipping estimator & royal mail download to estimate shipping costs, but as I am in the UK the only information needed to accurately calculate the cost is the country.

Is there any way I can remove the state and zipcode fields?
29 Oct 2007, 15:35
#2
kate_1 avatar

kate_1

New Zenner

Join Date:
Aug 2007
Posts:
47
Plugin Contributions:
0

Re: Remove state & zipcode from Shipping Estimator?

Still looking for an answer to this if anyone can help??? :(
01 Dec 2007, 00:49
#3
poosk avatar

poosk

Totally Zenned

Join Date:
Mar 2005
Posts:
477
Plugin Contributions:
0

Re: Remove state & zipcode from Shipping Estimator?

I've been looking for a solution to this over an year now.. I would LOVE to know how to remove them as well..
01 Dec 2007, 18:18
#4
poosk avatar

poosk

Totally Zenned

Join Date:
Mar 2005
Posts:
477
Plugin Contributions:
0

Re: Remove state & zipcode from Shipping Estimator?

Actually in the newer versions at least (1.3.7) this is really easy to do apparently. I remember having problems whit 1.2... just open template modules_shipping_estimator and remove or set to false state and zip...
03 Dec 2007, 00:12
#5
zeb_macahan avatar

zeb_macahan

New Zenner

Join Date:
Dec 2007
Posts:
17
Plugin Contributions:
0

Re: Remove state & zipcode from Shipping Estimator?

Change in includes/modules/shipping_estimator.php ?

But how exactly? Im in sweden and dont need the state-choice either, unforunately im not skilled enough to figure it out myself either.
03 Dec 2007, 06:56
#6
ivum avatar

ivum

New Zenner

Join Date:
Mar 2007
Posts:
36
Plugin Contributions:
0

Re: Remove state & zipcode from Shipping Estimator?

Well as you all asked so nicely :smile:

Open the following file:
includes\templates\YOUR TEMPLATE\templates\tpl_modules_shipping_estimator.php

Find the and remove the following code:

<label class="inputLabel" for="stateZone" id="zoneLabel"><?php echo ENTRY_STATE; ?></label>
<?php echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $state_zone_id, 'id="stateZone"');?>
<br class="clearBoth" id="stBreak" />
<label class="inputLabel" for="state" id="stateLabel"><?php echo $state_field_label; ?></label>
<?php echo zen_draw_input_field('state', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_state', '40') . ' id="state"') .' <span class="alert" id="stText"> </span>'; ?>
<br class="clearBoth" />

<?php
if(CART_SHIPPING_METHOD_ZIP_REQUIRED == "true"){
?>
<label class="inputLabel"><?php echo ENTRY_POST_CODE; ?></label>
<?php echo zen_draw_input_field('zip_code', $zip_code, 'size="7"'); ?>
<br class="clearBoth" />
<?php
}
?>

Done :smile:
03 Dec 2007, 17:08
#7
zeb_macahan avatar

zeb_macahan

New Zenner

Join Date:
Dec 2007
Posts:
17
Plugin Contributions:
0

Re: Remove state &amp; zipcode from Shipping Estimator?

That did the trick

Thanks a lot Ivum! :cheers:
07 Dec 2007, 12:00
#8
ivum avatar

ivum

New Zenner

Join Date:
Mar 2007
Posts:
36
Plugin Contributions:
0

Re: Remove state &amp; zipcode from Shipping Estimator?

Forgot to tell you how to automatically update the Country so there is no need for the update button and will save your customers some time!

Open the following file:
includes\templates\YOUR TEMPLATE\templates\tpl_modules_shipping_estimator.php

Find the following code
<label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
<?php echo zen_get_country_list('zone_country_id', $selected_country, 'id="country" onchange="update_zone(this.form);"'); ?>
<br class="clearBoth" />


Replace that code with the following code
<label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
<?php echo zen_get_country_list('zone_country_id', $selected_country, 'id="country" onChange="this.form.submit();"'); ?>
<br class="clearBoth" />


Remove the following code
<div class="buttonRow forward"><a href="_" onclick="return shipincart_submit('');"><?php echo  zen_image_button(BUTTON_IMAGE_UPDATE, BUTTON_UPDATE_ALT); ?></a></div>
07 Dec 2007, 13:55
#9
azrahn avatar

azrahn

Zen Follower

Join Date:
Jun 2006
Posts:
120
Plugin Contributions:
0

Re: Remove state &amp; zipcode from Shipping Estimator?

Hi,

Great fix.
Thanx

Ronald.
17 Mar 2008, 00:04
#10
dscrossstitch avatar

dscrossstitch

New Zenner

Join Date:
Mar 2008
Posts:
29
Plugin Contributions:
0

Re: Remove state &amp; zipcode from Shipping Estimator?

Hello

when replacing the code above to remove the update button and refresh straight away my estimator stops working. when you choose a different country etc te postage doesn't change. anyone else had this?

it does refresh ok but doesn't change as it should. i would like to remove this button to make it easier so has anyone else had this?

thanks:cry:
17 Mar 2008, 05:44
#11
ivum avatar

ivum

New Zenner

Join Date:
Mar 2007
Posts:
36
Plugin Contributions:
0

Re: Remove state &amp; zipcode from Shipping Estimator?

Even without the button removed it doesn't seem to work. When I click on say the US and click update it refreshes but then switches back to the UK giving the UK postage costs as well.
20 Nov 2008, 11:49
#12
b_funtomas avatar

b_funtomas

New Zenner

Join Date:
Mar 2008
Posts:
18
Plugin Contributions:
0

Re: Remove state &amp; zipcode from Shipping Estimator?

Thank you ivum for your help.

I just accidentally landed at this post as I was looking for some bug fix for my shipping estimator side box.

However I could use this information to improve my shipping estimator module :-)

Only thing is, that the pop up window is still the same size as before, but now it shows less information and it looks a bit empty ;-)

Someone got an idea where to define the size of this pop up window ?
25 Nov 2008, 22:20
#13
ivum avatar

ivum

New Zenner

Join Date:
Mar 2007
Posts:
36
Plugin Contributions:
0

Re: Remove state &amp; zipcode from Shipping Estimator?

Open the following file:
includes\modules\pages\shopping_cart\jscript_main.php

Find the following code:
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=550,height=550,screenX=150,screenY=100,top=100,left=150')

Change the height and the width numbers to what you need them set at :)
04 Dec 2008, 12:36
#14
brez avatar

brez

New Zenner

Join Date:
Nov 2008
Posts:
25
Plugin Contributions:
0

Re: Remove state &amp; zipcode from Shipping Estimator?

I dont want to be posting the same question in 2 separate forums, Re: my post in http://www.zen-cart.com/forum/showthread.php?t=114780

but as a State is a zone, does removing state & zip not prevent you from using zone rates in payment modules?
15 Dec 2009, 18:43
#15
davowave avatar

davowave

New Zenner

Join Date:
Mar 2009
Posts:
90
Plugin Contributions:
0

Re: Remove state &amp; zipcode from Shipping Estimator?

Ivum:

Even without the button removed it doesn't seem to work. When I click on say the US and click update it refreshes but then switches back to the UK giving the UK postage costs as well.


I don't suppose anyone managed to figure this out?

I'm having the same problem, when you do what we're told above it works on my 1.3.8 site but not on my 1.3.7. When you change the country from UK to USA for example, it does try to refresh but the country that is selected changes back to UK and still shows the UK Postage.

Anyone know what the problem is?

Thanks
16 Dec 2009, 15:17
#16
davowave avatar

davowave

New Zenner

Join Date:
Mar 2009
Posts:
90
Plugin Contributions:
0

Re: Remove state &amp; zipcode from Shipping Estimator?

Here is my tpl_modules_shipping_estimator.php file in case anyone knows what the problem is and is generous enough to help.

The relevant bit for the country drop down and the update button start at line 51.

Thanks


<?php
/**
 * Module Template - for shipping-estimator display
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_modules_shipping_estimator.php 4313 2006-08-28 00:25:40Z drbyte $
 */
?>

<?php echo zen_draw_form('estimator', zen_href_link($show_in, '', 'NONSSL'), 'post'); ?>
<?php echo zen_draw_hidden_field('scid', $selected_shipping['id']); ?>


<h2><?php echo CART_SHIPPING_OPTIONS; ?></h2>

<?php
    if ($_SESSION['customer_id']) {
?>

<?php if (!empty($totalsDisplay)) { ?>
<div class="cartTotalsDisplay important"><?php echo $totalsDisplay; ?></div>
<?php } ?>

<?php
    // only display addresses if more than 1
      if (isset($addresses) && $addresses->RecordCount() > 1){ /* big_royalmail mod added that address object must be defined first */
?>
<label class="inputLabel"><?php echo CART_SHIPPING_METHOD_ADDRESS; ?></label>
<?php echo zen_draw_pull_down_menu('address_id', $addresses_array, $selected_address, 'onchange="return shipincart_submit(\'\');"'); ?>
<?php
      }
?>

<div class="bold back"><?php echo CART_SHIPPING_METHOD_TO; ?></div>
<address class="back"><?php echo zen_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br />'); ?></address>
<br class="clearBoth" />
<?php
    } else {
?>

<?php if (!empty($totalsDisplay)) { ?>
<div class="cartTotalsDisplay important"><?php echo $totalsDisplay; ?></div>
<?php } ?>
<?php
      if($_SESSION['cart']->get_content_type() != 'virtual'){
?>

<label class="inputLabel"><?php echo ENTRY_COUNTRY; ?></label>
<?php echo zen_get_country_list('country_id', $selected_country,'style="width=200"'); ?>
<br class="clearBoth" />


<div class="buttonRow forward"><a href="_" onclick="return shipincart_submit('');"><?php echo  zen_image_button(BUTTON_IMAGE_UPDATE, BUTTON_UPDATE_ALT); ?></a></div>
<br class="clearBoth" />
<?php
      }
    }

?>

<?php
  if(sizeof($quotes)) { /* big_royalmail.php mod else statement moved under estimator form */
?>

<?php

    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{
?>
<table cellspacing="0" cellpadding="4" id="cartContentsDisplay" style="width:100%; padding-bottom: 1em">
     <tr class="tableHeading">
       <th scope="col" id="scQuantityHeading"><?php echo CART_SHIPPING_METHOD_TEXT; ?></th>
       <th scope="col" id="scQuantityHeading"><?php echo CART_SHIPPING_METHOD_RATES; ?></th>
     </tr>
<?php
      $rowClassSwitch = 'Even';
      for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {

          if($rowClassSwitch == 'Even'){
            $rowClassSwitch = 'Odd';
          }else{
            $rowClassSwitch = 'Even';
          }
        if(sizeof($quotes[$i]['methods'])==1){
          // simple shipping method
          $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][0]['id'];
?>
     <tr class="row<?php echo $rowClassSwitch; ?>">
<?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
   }
  }else{ // big_royalmail mod else statement added
?>
<table cellspacing="0" cellpadding="4" id="cartContentsDisplay" style="width:100%; padding-bottom: 1em">
     <tr class="tableHeading">
       <th scope="col" id="scQuantityHeading"><?php echo CART_SHIPPING_METHOD_TEXT; ?></th>
       <th scope="col" id="scQuantityHeading"><?php echo CART_SHIPPING_METHOD_RATES; ?></th>
     </tr>
     <tr>
        <td colspan="2" class="rowOdd" style="text-align: center"><?php echo TITLE_NO_SHIPPING_AVAILABLE; ?>
        <div class="important"><?php echo str_replace('__COUNTRY__', (isset($order->delivery['country']['title']) ? ' to '. $order->delivery['country']['title'] : ''), TEXT_NO_SHIPPING_AVAILABLE ); ?>
        </td>
     </tr>
</table>
<?php
  } // big_royalmail mod else statement added
?>
</form>
11 Jan 2010, 15:57
#17
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Remove state &amp; zipcode from Shipping Estimator?

hi, i'm also experiencing this problem, any one found a solution?
20 Aug 2010, 12:36
#18
gunni avatar

gunni

Zen Follower

Join Date:
Aug 2010
Posts:
287
Plugin Contributions:
0

Re: Remove state &amp; zipcode from Shipping Estimator?

I have the same 'Country' not changed after the "update" button.