Post by xxvirusxx » Sat Jul 21, 2018 10:52 pm

I made drop down city on register for one country, work just fine for that country, but I want when select another country to display original code for region and city

I tried something like this

Code: Select all

<?php if ($country['country_id'] == 100) { ?>
          <div class="form-group required">
          custom_zone_code
          custom_city_code
     <?php } else { ?>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-zone"><?php echo $entry_zone; ?></label>
            <div class="col-sm-10">
              <select name="zone_id" id="input-zone" class="form-control">
              </select>
              <?php if ($error_zone) { ?>
              <div class="text-danger"><?php echo $error_zone; ?></div>
              <?php } ?>
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-city"><?php echo $entry_city; ?></label>
            <div class="col-sm-10">
              <input type="text" name="city" value="<?php echo $city; ?>" placeholder="<?php echo $entry_city; ?>" id="input-city" class="form-control" />
              <?php if ($error_city) { ?>
              <div class="text-danger"><?php echo $error_city; ?></div>
              <?php } ?>
            </div>
          </div>
<?php } ?>
But doesn`t work.

Any ideea? Tks

Free converted extensions


Active Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm

Post by D3MO » Sat Jul 28, 2018 3:37 am

on country change ajax call is made you cant simply add it on your tpl file and expect it to work

Custom OpenCart Extension Development. Opencart Modification and third party Exetension debugging. Just PM me... or you can browse ready made extensions to boost your opencart website instantly


Active Member

Posts

Joined
Mon Apr 04, 2011 6:57 am

Who is online

Users browsing this forum: No registered users and 13 guests