0
我在發貨方式的模板文件中添加了一個下拉框。現在我想讓它成爲必需的領域。我嘗試了很多方法。但沒有奏效。任何幫助將不勝感激。Magento如何將一個必填字段添加到發運方法?
以下是模板文件。
<?php
$_code=$this->getMethodCode();
$carrier = $this->getMethodInstance();
$pickupData = $this->getQuote()->getPickupData();
$_rate = $this->getRate();
if(!isset($pickupData['store']))
{
$pickupData['store'] = -1;
}
if(!isset($pickupData['name']))
{
$pickupData['name'] = '';
}
?>
<ul class="form-list" id="shipping_form_<?php echo $_rate->getCode() ?>" style="display:none;">
<li>
<label for="shipping_pickup[store]" class="required"><em>*</em><?php echo $this->__('Choose Store Location:') ?></label>
<span class="input-box" style="float:left ;">
<select class="required-entry" name="shipping_pickup[store]" id="shipping_pickup[store]">
<option value='0'><?php echo $this->__('Select Store..');?></option>
<?php
$collection = $this->getAllLocations();
foreach($collection as $coll)
{
$data = $coll->getData();
?>
<option value='<?php echo $data['location_id']; ?>'><?php echo $this->__($data['location_name']);?></option>
<?php
}
?>
</select>
</span>
</li>
</ul>
釷謝謝你的回覆。這是行不通的。我想在用戶沒有選擇商店並點擊結賬按鈕時顯示javascript警報。與用戶未選擇送貨方式並試圖結帳時相同。 – Sukeshini 2013-03-21 04:02:58
嗨,我找到了解決方案 – Sukeshini 2013-03-21 11:06:42