Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2005
    Posts
    356
    Plugin Contributions
    0

    Default 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 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"') .'&nbsp;<span class="alert" id="stText">&nbsp;</span>'?>
    <br class="clearBoth" />
    to get rid of the state dropdown.

    If I delete the code:
    PHP 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" />
    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

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Remove country from Shipping Estimate

    This might work:
    Code:
    <?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.

  3. #3
    Join Date
    Jun 2005
    Posts
    356
    Plugin Contributions
    0

    Default 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 Code:
    <input type="hidden" name="zone_country_id" value="223" selected="Selected"/> 
    but thats really ugly/non-zen. How can I input that through zen_draw_hidden_field?
    2 + 2 = 5 for extremely large values of 2

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

  4. #4
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Remove country from Shipping Estimate

    This would add the "Selected" parameter:
    Code:
    <?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.

  5. #5
    Join Date
    Jun 2010
    Posts
    53
    Plugin Contributions
    2

    help question 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.

    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.


    What went wrong???


    I even tried it by removing
    Code:
    <?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.

  6. #6
    Join Date
    Jun 2010
    Posts
    53
    Plugin Contributions
    2

    help question Re: Remove country from Shipping Estimate

    Have to redo this post, see next post.
    Last edited by Nineve; 26 Jul 2010 at 11:18 PM.

  7. #7
    Join Date
    Jun 2010
    Posts
    53
    Plugin Contributions
    2

    Default Re: Remove country from Shipping Estimate

    Do I need both of these snippets of code?

    Code:
    <input##type="hidden"##name="zone_country_id"##value="223"##selected="Selected"/>##
    grrrrrr minus all the # symbols.

    and


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

  8. #8
    Join Date
    Jun 2010
    Posts
    53
    Plugin Contributions
    2

    Default 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.



 

 

Similar Threads

  1. remove County dropdown from estimate shipping
    By Sushigal in forum General Questions
    Replies: 6
    Last Post: 4 Feb 2011, 01:21 AM
  2. remove County/State/Province estimate shipping
    By tbrides in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 3 Feb 2011, 12:00 PM
  3. Shipping only to one country, but Billing from any country
    By mask2011 in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 21 Aug 2010, 07:29 AM
  4. Flat rate shipping still asking for country/state/zip to estimate shipping
    By mjinxed in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 9 May 2010, 05:01 AM
  5. Removing background image from Estimate Shipping
    By monkeytastic in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 7 Apr 2010, 03:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg