Forums / Templates, Stylesheets, Page Layout / Remove country from Shipping Estimate

Remove country from Shipping Estimate

Locked

Views: 2,037

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
16 Sep 2007, 5:33 AM
#1
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

Remove country from Shipping Estimate

The site I will be opening soon only ships to the US via USPS. So in my case all the shipping estimator needs to know is the zip code.

I have deleted all other zones and countries, so only United states appears in the drop box.

In the \current\includes\templates\mytemplate\templates\tpl_modules_shipping_estimator.php file I deleted the code: ```php
<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" /> ``` to get rid of the state dropdown.

If I delete the code: ```php
<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" /> ``` to get rid of the country drop down the shipping estimate fails. I presume we need to feed the country code to the USPS API.

So my question is, how can I modify that code not to display anything, but to shove in the United States country code?

2 + 2 = 5 for extremely large values of 2

Pez Collectors Store •••••••• My Plugins List

16 Sep 2007, 5:45 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Remove country from Shipping Estimate

This might work:```

<?php zen_draw_hidden_field('zone_country_id', 223); ?>

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

16 Sep 2007, 6:15 AM
#3
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

Re: Remove country from Shipping Estimate

Thanks! Thats pretty much what I was looking for, but having tried several variations on it, I can't get it to work. I did find something that works:```php
<input type="hidden" name="zone_country_id" value="223" selected="Selected"/>

2 + 2 = 5 for extremely large values of 2

Pez Collectors Store •••••••• My Plugins List

16 Sep 2007, 7:41 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Remove country from Shipping Estimate

This would add the "Selected" parameter:```

<?php zen_draw_hidden_field('zone_country_id', 223, 'selected="Selected"'); ?>

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

22 Jul 2010, 4:03 PM
#5
nineve avatar

nineve

New Zenner

Join Date:
Jun 2010
Posts:
53
Plugin Contributions:
1

Re: Remove country from Shipping Estimate

I want to remove the Country and State pull down menus from the shipping estimate page and leave just the Post/Zip Code entry field as the customer will have to make special arrangements to ship overseas and the state pull down does not alter the totals. :P

While initially everything looked great after following the instructions above I noticed that now when different zip codes are entered there is no change with the shipping amounts. :shocking:

What went wrong???

I even tried it by removing

<?php zen_draw_hidden_field('zone_country_id', 223, 'selected="Selected"'); ?>

There does not seem to be a way to comment them out via CSS because they are not specific enough.

26 Jul 2010, 10:12 PM
#6
nineve avatar

nineve

New Zenner

Join Date:
Jun 2010
Posts:
53
Plugin Contributions:
1

Re: Remove country from Shipping Estimate

Have to redo this post, see next post. :P

26 Jul 2010, 10:19 PM
#7
nineve avatar

nineve

New Zenner

Join Date:
Jun 2010
Posts:
53
Plugin Contributions:
1

Re: Remove country from Shipping Estimate

Do I need both of these snippets of code?

<input##type="hidden"##name="zone_country_id"##value="223"##selected="Selected"/>##

grrrrrr minus all the # symbols.

and

<?php zen_draw_hidden_field('zone_country_id', 223, 'selected="Selected"'); ?>
26 Jul 2010, 10:28 PM
#8
nineve avatar

nineve

New Zenner

Join Date:
Jun 2010
Posts:
53
Plugin Contributions:
1

Re: Remove country from Shipping Estimate

OK no that does not work either. Anyone know how to remove the country and state pull downs without breaking the estimator? I just want the zip code left.

:yuck: