2013-06-30 52 views
2

我知道這個問題已經提出過,而解決方案是由shadyyx提供的,但由於某種原因,該解決方案對我無效。Opencart地區/國家下拉列表丟失

我使用Opencart的最新版本(1.5.5.1)與自定義主題(oskar)。當客戶嘗試註冊賬戶或者通過結賬過程並決定在那裏創建賬戶時,區域/狀態下拉菜單缺失或者沒有任何值。該網站是wafflepantry.com,你可以檢查你是否喜歡。

以下是我的模板/帳號/ register.tpl文件代碼...

<?php echo $header; ?> 
<?php if ($error_warning) { ?> 
<div class="warning"><?php echo $error_warning; ?></div> 
<?php } ?> 
<?php echo $column_left; ?><?php echo $column_right; ?> 
<div id="content"><?php echo $content_top; ?> 
    <div class="breadcrumb"> 
    <?php foreach ($breadcrumbs as $breadcrumb) { ?> 
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a> 
    <?php } ?> 
    </div> 
    <h1><?php echo $heading_title; ?></h1> 
    <p><?php echo $text_account_already; ?></p> 
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data"> 
    <h2><?php echo $text_your_details; ?></h2> 
    <div class="content"> 
     <table class="form"> 
     <tr> 
      <td><span class="required">*</span> <?php echo $entry_firstname; ?></td> 
      <td><input type="text" name="firstname" value="<?php echo $firstname; ?>" /> 
      <?php if ($error_firstname) { ?> 
      <span class="error"><?php echo $error_firstname; ?></span> 
      <?php } ?></td> 
     </tr> 
     <tr> 
      <td><span class="required">*</span> <?php echo $entry_lastname; ?></td> 
      <td><input type="text" name="lastname" value="<?php echo $lastname; ?>" /> 
      <?php if ($error_lastname) { ?> 
      <span class="error"><?php echo $error_lastname; ?></span> 
      <?php } ?></td> 
     </tr> 
     <tr> 
      <td><span class="required">*</span> <?php echo $entry_email; ?></td> 
      <td><input type="text" name="email" value="<?php echo $email; ?>" /> 
      <?php if ($error_email) { ?> 
      <span class="error"><?php echo $error_email; ?></span> 
      <?php } ?></td> 
     </tr> 
     <tr> 
      <td><span class="required">*</span> <?php echo $entry_telephone; ?></td> 
      <td><input type="text" name="telephone" value="<?php echo $telephone; ?>" /> 
      <?php if ($error_telephone) { ?> 
      <span class="error"><?php echo $error_telephone; ?></span> 
      <?php } ?></td> 
     </tr> 
     <tr> 
      <td><?php echo $entry_fax; ?></td> 
      <td><input type="text" name="fax" value="<?php echo $fax; ?>" /></td> 
     </tr> 
     </table> 
    </div> 
    <h2><?php echo $text_your_address; ?> </h2> 
    <div class="content"> 
     <table class="form"> 
     <tr> 
      <td><?php echo $entry_company; ?></td> 
      <td><input type="text" name="company" value="<?php echo $company; ?>" /></td> 
     </tr> 
     <tr> 
      <td><span class="required">*</span> <?php echo $entry_address_1; ?></td> 
      <td><input type="text" name="address_1" value="<?php echo $address_1; ?>" /> 
      <?php if ($error_address_1) { ?> 
      <span class="error"><?php echo $error_address_1; ?></span> 
      <?php } ?></td> 
     </tr> 
     <tr> 
      <td><?php echo $entry_address_2; ?></td> 
      <td><input type="text" name="address_2" value="<?php echo $address_2; ?>" /></td> 
     </tr> 
     <tr> 
      <td><span class="required">*</span> <?php echo $entry_city; ?></td> 
      <td><input type="text" name="city" value="<?php echo $city; ?>" /> 
      <?php if ($error_city) { ?> 
      <span class="error"><?php echo $error_city; ?></span> 
      <?php } ?></td> 
     </tr> 
     <tr> 
      <td><span class="required">*</span> <?php echo $entry_postcode; ?></td> 
      <td><input type="text" name="postcode" value="<?php echo $postcode; ?>" /> 
      <?php if ($error_postcode) { ?> 
      <span class="error"><?php echo $error_postcode; ?></span> 
      <?php } ?></td> 
     </tr> 
     <tr> 
      <td><span class="required">*</span> <?php echo $entry_country; ?></td> 
      <td><select name="country_id" onchange="$('select[name=\'zone_id\']').load('index.php?route=account/register/zone&country_id=' + this.value + '&zone_id=<?php echo $zone_id; ?>');"> 
       <option value=""><?php echo $text_select; ?></option> 
       <?php foreach ($countries as $country) { ?> 
       <?php if ($country['country_id'] == $country_id) { ?> 
       <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option> 
       <?php } else { ?> 
       <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option> 
       <?php } ?> 
       <?php } ?> 
      </select> 
      <?php if ($error_country) { ?> 
      <span class="error"><?php echo $error_country; ?></span> 
      <?php } ?></td> 
     </tr> 
     <tr> 
      <td><span class="required">*</span> <?php echo $entry_zone; ?></td> 
      <td><select name="zone_id"> 
      </select> 
      <?php if ($error_zone) { ?> 
      <span class="error"><?php echo $error_zone; ?></span> 
      <?php } ?></td> 
     </tr> 
     </table> 
    </div> 
    <h2><?php echo $text_your_password; ?></h2> 
    <div class="content"> 
     <table class="form"> 
     <tr> 
      <td><span class="required">*</span> <?php echo $entry_password; ?></td> 
      <td><input type="password" name="password" value="<?php echo $password; ?>" /> 
      <?php if ($error_password) { ?> 
      <span class="error"><?php echo $error_password; ?></span> 
      <?php } ?></td> 
     </tr> 
     <tr> 
      <td><span class="required">*</span> <?php echo $entry_confirm; ?></td> 
      <td><input type="password" name="confirm" value="<?php echo $confirm; ?>" /> 
      <?php if ($error_confirm) { ?> 
      <span class="error"><?php echo $error_confirm; ?></span> 
      <?php } ?></td> 
     </tr> 
     </table> 
    </div> 
    <h2><?php echo $text_newsletter; ?></h2> 
    <div class="content"> 
     <table class="form"> 
     <tr> 
      <td><?php echo $entry_newsletter; ?></td> 
      <td><?php if ($newsletter == 1) { ?> 
      <input type="radio" name="newsletter" value="1" checked="checked" /> 
      <?php echo $text_yes; ?> 
      <input type="radio" name="newsletter" value="0" /> 
      <?php echo $text_no; ?> 
      <?php } else { ?> 
      <input type="radio" name="newsletter" value="1" /> 
      <?php echo $text_yes; ?> 
      <input type="radio" name="newsletter" value="0" checked="checked" /> 
      <?php echo $text_no; ?> 
      <?php } ?></td> 
     </tr> 
     </table> 
    </div> 
    <?php if ($text_agree) { ?> 
    <div class="buttons"> 
     <div class="right"><?php echo $text_agree; ?> 
     <?php if ($agree) { ?> 
     <input type="checkbox" name="agree" value="1" checked="checked" /> 
     <?php } else { ?> 
     <input type="checkbox" name="agree" value="1" /> 
     <?php } ?> 
     <input type="submit" value="<?php echo $button_continue; ?>" class="button" /> 
     </div> 
    </div> 
    <?php } else { ?> 
    <div class="buttons"> 
     <div class="right"> 
     <input type="submit" value="<?php echo $button_continue; ?>" class="button" /> 
     </div> 
    </div> 
    <?php } ?> 
    </form> 
    <?php echo $content_bottom; ?></div> 
<script type="text/javascript"><!-- 
$('select[name=\'zone_id\']').load('index.php?route=account/register/zone&country_id=<?php echo $country_id; ?>&zone_id=<?php echo $zone_id; ?>'); 
//--></script> 
<script type="text/javascript"><!-- 
$('.colorbox').colorbox({ 
    width: 560, 
    height: 560 
}); 
//--></script> 
<?php echo $footer; ?> 

任何幫助將不勝感激。

謝謝。

最佳 西弗

回答

0

我敢肯定,問題是在底部的路線。它是account/register/zone它應該是checkout/checkout/country。你應該爲你的商店獲得這個主題的更新版本,因爲這是過時的

+0

謝謝Jay!我有同樣的想法,並聯繫了主題的開發人員。不幸的是,我沒有得到任何迴應,也沒有看到將會有更新。任何方式我可以解決這個代碼我自己?再次感謝您的幫助。 –

+0

我已經走了,用原來的O​​penCart register.tpl替換了目錄'catalog/view/theme/oskar/template/account'中的主題特定的register.tpl。當您嘗試通過點擊我的賬戶 - >繼續而不影響主題來註冊賬戶時,這已經解決了這個問題。但是,當您嘗試在結帳時註冊帳戶時,問題仍然存在。任何想法修改或替換哪個文件? 再次感謝! –

+0

'catalog/view/theme/your-theme-folder/template/checkout/register.tpl' –

1

我已經提前在目錄'catalog/view/theme/YOUR_THEME/template/account'中替換主題特定的register.tpl '與原來的OpenCart register.tpl。我還用原來的O​​penCart register.tpl替換了目錄「catalog/view/theme/YOUR_THEME/template/checkout」中的主題特定的register.tpl。

這已解決了問題,而不會影響我的主題。希望這有助於我們其他人。

+0

請注意,您可以刪除主題文件夾中將使用默認主題文件的那兩個文件。這對於升級時很有用,因爲如果它們已被修改,則不必再次複製這些文件 –