在Magento 1.8的购物车中简化估计运输表格

时间:2014-06-25 20:41:04

标签: php forms magento magento-1.8 shipping

在Magento购物车上,始终有一个默认表单用于估算购物车页面上的运费,并且始终需要这些字段,

Country
State/Province
Poscode

如何通过仅限国家/地区输入来简化此表单?

这是估算运费代码表单

<ul class="form-list">
                <li>
                    <label for="country" class="required"><?php echo $this->__('Country') ?><em>*</em></label>
                    <div class="box-input">
                        <?php echo Mage::getBlockSingleton('directory/data')->getCountryHtmlSelect($this->getEstimateCountryId()) ?>
                    </div>
                </li>
            <?php if($this->getStateActive()): ?>
                <li>
                    <label for="region_id"<?php if ($this->isStateProvinceRequired()) echo ' class="required"' ?>><?php if ($this->isStateProvinceRequired()) echo '<em>*</em>' ?><?php echo $this->__('State/Province') ?></label>
                    <div class="box-input">
                        <select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" style="display:none;"<?php echo ($this->isStateProvinceRequired() ? ' class="validate-select"' : '') ?>>
                            <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
                        </select>
                       <script type="text/javascript">
                       //<![CDATA[
                           $('region_id').setAttribute('defaultValue',  "<?php echo $this->getEstimateRegionId() ?>");
                       //]]>
                       </script>
                       <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getEstimateRegion()) ?>"  title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
                   </div>
                </li>
            <?php endif; ?>
            <?php if($this->getCityActive()): ?>
                <li>
                    <label for="city"<?php if ($this->isCityRequired()) echo ' class="required"' ?>><?php if ($this->isCityRequired()) echo '<em>*</em>' ?><?php echo $this->__('City') ?></label>
                    <div class="box-input">
                        <input class="input-text<?php if ($this->isCityRequired()):?> required-entry<?php endif;?>" id="city" type="text" name="estimate_city" value="<?php echo $this->escapeHtml($this->getEstimateCity()) ?>" />
                    </div>
                </li>
            <?php endif; ?>
                <li>
                    <label for="postcode"<?php if ($this->isZipCodeRequired()) echo ' class="required"' ?>><?php if ($this->isZipCodeRequired()) echo '<em>*</em>' ?><?php echo $this->__('Zip/Postal Code') ?></label>
                    <div class="box-input">
                        <input class="input-text validate-postcode<?php if ($this->isZipCodeRequired()):?> required-entry<?php endif;?>" type="text" id="postcode" name="estimate_postcode" value="<?php echo $this->escapeHtml($this->getEstimatePostcode()) ?>" />    
                    </div>
                </li>
            </ul>

如果我删除州/省和Poscode 手动的字段,则此表单将无效。

知道我可以做什么,只有 国家字段是必需的?

但我在我的结帐页面上需要州/省和Poscode 尽管......

CSV文件。

Country Region/State    Zip/Postal Code # of Items (and above)  Shipping Price
FRA *   *   1   12
FRA *   *   12  0
GBR *   *   1   25
GBR *   *   12  0

0 个答案:

没有答案