Post by tingwing » Wed May 02, 2018 12:38 pm

hi
for opencart3,is it possible to make "address" require when register?

Thanks

my extension:https://www.opencart.com/index.php?rout ... estshop24h
email :support@bestshop24h.com
site:http://www.bestshop24h.com


Active Member

Posts

Joined
Tue Aug 02, 2016 9:01 pm

Post by ostechnologies » Wed May 02, 2018 5:27 pm

Yes,
Go to catalog > controller > checkout > register > save function, by following the same rule as given in address_1 field you can validate address_2 also.

Opencart Expert | sales[at]ost.agency
Skype - manish.osuniverse | Gtalk - manishmt

Extensions for Opencart @ https://www.ost.agency/product/product- ... extensions
ost.agency - ecommerce website design, development and digital company


User avatar
Active Member

Posts

Joined
Mon Apr 06, 2015 1:30 pm

Post by Johnathan » Thu May 03, 2018 1:38 am

I think tingwing is talking about the fact that OpenCart 3 doesn't require the customer address when registering, they only have to put it in once they start checking out. Generally I'd say this is preferable, but if you want to change it, unfortunately there's no option for that that I can see. You'll probably need to hire someone to write a custom modification for you, unless an extension exists on opencart.com that does this. (I can't find one that does.)

If you need to find a developer, you should post a request in the OpenCart "Commercial Support" forum, which is checked by a number of OpenCart developers. You can also try checking out the OpenCart "Partners" area.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by kab09412 » Fri May 29, 2020 6:07 pm

Hi @tingwing - it is possible and I just did it. I am happy to share with you.

Newbie

Posts

Joined
Wed Apr 29, 2020 4:44 pm

Post by straightlight » Fri May 29, 2020 7:10 pm

kab09412 wrote:
Fri May 29, 2020 6:07 pm
Hi @tingwing - it is possible and I just did it. I am happy to share with you.
Then, please share.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by xxvirusxx » Fri May 29, 2020 11:53 pm

tingwing wrote:
Wed May 02, 2018 12:38 pm
hi
for opencart3,is it possible to make "address" require when register?

Thanks
Make backup of register file from controller, language, template and upload files from attachment.
Or use an text editor to compare with yours and make changes.
You can search by: Start Address to see where I put the code.

LE. In catalog/model/account/customer.php add this line:

Code: Select all

$this->db->query("INSERT INTO " . DB_PREFIX . "address SET customer_id = '" . (int)$customer_id . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', company = '" . $this->db->escape($data['company']) . "', address_1 = '" . $this->db->escape($data['address_1']) . "', address_2 = '" . $this->db->escape($data['address_2']) . "', city = '" . $this->db->escape($data['city']) . "', postcode = '" . $this->db->escape($data['postcode']) . "', country_id = '" . (int)$data['country_id'] . "', zone_id = '" . (int)$data['zone_id'] . "', custom_field = '" . $this->db->escape(isset($data['custom_field']['address']) ? json_encode($data['custom_field']['address']) : '') . "'");
After:

Code: Select all

$customer_id = $this->db->getLastId();
Or you can make ocmod extension :)

Attachments


Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by partself » Thu Feb 11, 2021 6:07 am

Wow Great thank you for this xxvirusxx I see a lot of people downloaded and no one even offered a thanks. So thanks!

Newbie

Posts

Joined
Tue Feb 06, 2018 11:15 am

Post by erhangazi84 » Mon May 03, 2021 6:52 pm

First of all, thank you for such a support. I have tried to make it on Journal theme but couldn't succeed. I think it is because of register.twig
Then, i tried it on a new and clean OC to test, couldn't succeed again.

This problem is really annoying. Customer should select country and add address details while registering in order to see the products' price with tax. If do not enter any country info on register, customer see the products' price without any tax. Terrible.

User avatar
Newbie

Posts

Joined
Fri May 23, 2014 10:46 pm
Location - Gaziantep,Turkey

Post by xxvirusxx » Mon May 03, 2021 6:55 pm

Work just fine on Default theme and the instructions are clear.
Don't forget to refresh ocmod modifications, clear theme cache, sass cache.

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by erhangazi84 » Mon May 03, 2021 7:06 pm

can you pls give register.twig code separately? If someone else use a different theme, he should add necessary code manually.

User avatar
Newbie

Posts

Joined
Fri May 23, 2014 10:46 pm
Location - Gaziantep,Turkey

Post by straightlight » Mon May 03, 2021 7:13 pm

erhangazi84 wrote:
Mon May 03, 2021 7:06 pm
can you pls give register.twig code separately? If someone else use a different theme, he should add necessary code manually.
Different theme requests goes to extension theme developers.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by xxvirusxx » Mon May 03, 2021 7:15 pm

erhangazi84 wrote:
Mon May 03, 2021 7:06 pm
can you pls give register.twig code separately? If someone else use a different theme, he should add necessary code manually.
For Default theme you have above a zip file attached.

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by erhangazi84 » Mon May 03, 2021 9:00 pm

xxvirusxx wrote:
Mon May 03, 2021 7:15 pm
erhangazi84 wrote:
Mon May 03, 2021 7:06 pm
can you pls give register.twig code separately? If someone else use a different theme, he should add necessary code manually.
For Default theme you have above a zip file attached.
Yes, you are right. But we are not dealing with codes everyday. I could find, solved and want to share here.


I have just installed a new OC, tested this one, and worked fine. And then, installed a theme (Journal and something different), succeeded again. Here is the key issue.

Open your theme catalog/view/theme/your_theme/template/account/register.twig
Find:

Code: Select all

        <fieldset>
          <legend>{{ text_your_password }}</legend>


Add this code BEFORE the code above:

Code: Select all

        <!-- Start Adddress code -->
        <fieldset id="address">
          <legend>{{ text_your_address }}</legend>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-company">{{ entry_company }}</label>
            <div class="col-sm-10">
              <input type="text" name="company" value="{{ company }}" placeholder="{{ entry_company }}" id="input-company" class="form-control" />
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-address-1">{{ entry_address_1 }}</label>
            <div class="col-sm-10">
              <input type="text" name="address_1" value="{{ address_1 }}" placeholder="{{ entry_address_1 }}" id="input-address-1" class="form-control" />
              {% if error_address_1 %}
              <div class="text-danger">{{ error_address_1 }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-address-2">{{ entry_address_2 }}</label>
            <div class="col-sm-10">
              <input type="text" name="address_2" value="{{ address_2 }}" placeholder="{{ entry_address_2 }}" id="input-address-2" class="form-control" />
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-city">{{ entry_city }}</label>
            <div class="col-sm-10">
              <input type="text" name="city" value="{{ city }}" placeholder="{{ entry_city }}" id="input-city" class="form-control" />
              {% if error_city %}
              <div class="text-danger">{{ error_city }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-postcode">{{ entry_postcode }}</label>
            <div class="col-sm-10">
              <input type="text" name="postcode" value="{{ postcode }}" placeholder="{{ entry_postcode }}" id="input-postcode" class="form-control" />
              {% if error_postcode %}
              <div class="text-danger">{{ error_postcode }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-country">{{ entry_country }}</label>
            <div class="col-sm-10">
              <select name="country_id" id="input-country" class="form-control">
                <option value="">{{ text_select }}</option>
                {% for country in countries %}
                {% if country.country_id == country_id %}
                <option value="{{ country.country_id }}" selected="selected">{{ country.name }}</option>
                {% else %}
                <option value="{{ country.country_id }}">{{ country.name }}</option>
                {% endif %}
                {% endfor %}
              </select>
              {% if error_country %}
              <div class="text-danger">{{ error_country }}</div>
              {% endif %}
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-zone">{{ entry_zone }}</label>
            <div class="col-sm-10">
              <select name="zone_id" id="input-zone" class="form-control">
              </select>
              {% if error_zone %}
              <div class="text-danger">{{ error_zone }}</div>
              {% endif %}
            </div>
          </div>
          {% for custom_field in custom_fields %}
          {% if custom_field.location == 'address' %}
          {% if custom_field.type == 'select' %}
          <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
            <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
            <div class="col-sm-10">
              <select name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control">
                <option value="">{{ text_select }}</option>
                {% for custom_field_value in custom_field.custom_field_value %}
                {% if register_custom_field[custom_field.location][custom_field.custom_field_id] and custom_field_value.custom_field_value_id == register_custom_field[custom_field.custom_field_id] %}
                <option value="{{ custom_field_value.custom_field_value_id }}" selected="selected">{{ custom_field_value.name }}</option>
                {% else %}
                <option value="{{ custom_field_value.custom_field_value_id }}">{{ custom_field_value.name }}</option>
                {% endif %}
                {% endfor %}
              </select>
              {% if error_custom_field[custom_field.custom_field_id] %}
              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
              {% endif %}</div>
          </div>
          {% endif %}
          {% if custom_field.type == 'radio' %}
          <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
            <label class="col-sm-2 control-label">{{ custom_field.name }}</label>
            <div class="col-sm-10">
              <div> {% for custom_field_value in custom_field.custom_field_value %}
                <div class="radio">{% if register_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id == register_custom_field[custom_field.custom_field_id] %}
                  <label>
                    <input type="radio" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{{ custom_field_value.custom_field_value_id }}" checked="checked" />
                    {{ custom_field_value.name }}</label>
                  {% else %}
                  <label>
                    <input type="radio" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{{ custom_field_value.custom_field_value_id }}" />
                    {{ custom_field_value.name }}</label>
                  {% endif %} </div>
                {% endfor %}</div>
              {% if error_custom_field[custom_field.custom_field_id] %}
              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
              {% endif %}</div>
          </div>
          {% endif %}
          {% if custom_field.type == 'checkbox' %}
          <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
            <label class="col-sm-2 control-label">{{ custom_field.name }}</label>
            <div class="col-sm-10">
              <div> {% for custom_field_value in custom_field.custom_field_value %}
                <div class="checkbox">{% if register_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id in register_custom_field[custom_field.custom_field_id] %}
                  <label>
                    <input type="checkbox" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}][]" value="{{ custom_field_value.custom_field_value_id }}" checked="checked" />
                    {{ custom_field_value.name }}</label>
                  {% else %}
                  <label>
                    <input type="checkbox" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}][]" value="{{ custom_field_value.custom_field_value_id }}" />
                    {{ custom_field_value.name }}</label>
                  {% endif %} </div>
                {% endfor %} </div>
              {% if error_custom_field[custom_field.custom_field_id] %}
              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
              {% endif %} </div>
          </div>
          {% endif %}
          {% if custom_field.type == 'text' %}
          <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
            <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
            <div class="col-sm-10">
              <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}{{ register_custom_field[custom_field.custom_field_id] }}{% else %}{{ custom_field.value }}{% endif %}" placeholder="{{ custom_field.name }}" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control" />
              {% if error_custom_field[custom_field.custom_field_id] %}
              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
              {% endif %} </div>
          </div>
          {% endif %}
          {% if custom_field.type == 'textarea' %}
          <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
            <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
            <div class="col-sm-10">
              <textarea name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" rows="5" placeholder="{{ custom_field.name }}" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control">{% if register_custom_field[custom_field.custom_field_id] %}{{ register_custom_field[custom_field.custom_field_id] }}{% else %}{{ custom_field.value }}{% endif %}</textarea>
              {% if error_custom_field[custom_field.custom_field_id] %}
              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
              {% endif %} </div>
          </div>
          {% endif %}
          {% if custom_field.type == 'file' %}
          <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
            <label class="col-sm-2 control-label">{{ custom_field.name }}</label>
            <div class="col-sm-10">
              <button type="button" id="button-custom-field{{ custom_field.custom_field_id }}" data-loading-text="{{ text_loading }}" class="btn btn-default"><i class="fa fa-upload"></i> {{ button_upload }}</button>
              <input type="hidden" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}  {{ register_custom_field[custom_field.custom_field_id] }} {% endif %}" />
              {% if error_custom_field[custom_field.custom_field_id] %}
              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
              {% endif %}</div>
          </div>
          {% endif %}
          {% if custom_field.type == 'date' %}
          <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
            <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
            <div class="col-sm-10">
              <div class="input-group date">
                <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}{{ register_custom_field[custom_field.custom_field_id] }}{% else %}{{ custom_field.value }}{% endif %}" placeholder="{{ custom_field.name }}" data-date-format="YYYY-MM-DD" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control" />
                <span class="input-group-btn">
                <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                </span></div>
              {% if error_custom_field[custom_field.custom_field_id] %}
              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
              {% endif %} </div>
          </div>
          {% endif %}
          {% if custom_field.type == 'time' %}
          <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
            <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
            <div class="col-sm-10">
              <div class="input-group time">
                <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}{{ register_custom_field[custom_field.custom_field_id] }}{% else %}{{ custom_field.value }}{% endif %}" placeholder="{{ custom_field.name }}" data-date-format="HH:mm" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control" />
                <span class="input-group-btn">
                <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                </span></div>
              {% if error_custom_field[custom_field.custom_field_id] %}
              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
              {% endif %} </div>
          </div>
          {% endif %}
          {% if custom_field.type == 'datetime' %}
          <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
            <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
            <div class="col-sm-10">
              <div class="input-group datetime">
                <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}{{ register_custom_field[custom_field.custom_field_id] }}{% else %}{{ custom_field.value }}{% endif %}" placeholder="{{ custom_field.name }}" data-date-format="YYYY-MM-DD HH:mm" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control" />
                <span class="input-group-btn">
                <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                </span></div>
              {% if error_custom_field[custom_field.custom_field_id] %}
              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
              {% endif %}
              </div>
          </div>
          {% endif %}
          {% endif %}
          {% endfor %}
        </fieldset>
        <!-- End Adddress code -->
Thanks a lot xxvirusxx

The extension (or patch) works fine thanks to xxvirusxx

However, if you update your theme near future, pls do not forget to add this code to your updated register.twig file again!

User avatar
Newbie

Posts

Joined
Fri May 23, 2014 10:46 pm
Location - Gaziantep,Turkey

Post by xxvirusxx » Mon May 03, 2021 9:16 pm

A free tips for you.

You can check register.tpl from journal3 (2.3.0.2) because it use....

Code: Select all

<div class="form-group <?php if ($j3->settings->get('accountAddressAddress1Field') === 'required'): ?>required ...
And will become

Code: Select all

<div class="form-group {% if j3.settings.get('accountAddressAddress1Field') === 'required') == 'required' %}required ....
But using this way is more complex and you need more work to do, to have access show/hide these fields from journal 3 admin settings.

LE. Maybe someday I will make an ocmod for Default and Journal 3...

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by straightlight » Mon May 03, 2021 10:32 pm

Journal is not supported on the forum.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by erhangazi84 » Mon May 03, 2021 10:54 pm

hi
another issue: twig file has some javascript code. Need to add before {{ footer }} at the end of all codes.
Let me add here for beginners like me :)

Find:

Code: Select all

{{ footer }}
Add this code BEFORE the code above

Code: Select all

<script type="text/javascript"><!--
// Sort the custom fields
$('#account .form-group[data-sort]').detach().each(function() {
	if ($(this).attr('data-sort') >= 0 && $(this).attr('data-sort') <= $('#account .form-group').length) {
		$('#account .form-group').eq($(this).attr('data-sort')).before(this);
	}

	if ($(this).attr('data-sort') > $('#account .form-group').length) {
		$('#account .form-group:last').after(this);
	}

	if ($(this).attr('data-sort') == $('#account .form-group').length) {
		$('#account .form-group:last').after(this);
	}

	if ($(this).attr('data-sort') < -$('#account .form-group').length) {
		$('#account .form-group:first').before(this);
	}
});

$('#address .form-group[data-sort]').detach().each(function() {
	if ($(this).attr('data-sort') >= 0 && $(this).attr('data-sort') <= $('#address .form-group').length) {
		$('#address .form-group').eq($(this).attr('data-sort')).before(this);
	}

	if ($(this).attr('data-sort') > $('#address .form-group').length) {
		$('#address .form-group:last').after(this);
	}

	if ($(this).attr('data-sort') == $('#address .form-group').length) {
		$('#address .form-group:last').after(this);
	}

	if ($(this).attr('data-sort') < -$('#address .form-group').length) {
		$('#address .form-group:first').before(this);
	}
});

$('input[name=\'customer_group_id\']').on('change', function() {
	$.ajax({
		url: 'index.php?route=account/register/customfield&customer_group_id=' + this.value,
		dataType: 'json',
		success: function(json) {
			$('.custom-field').hide();
			$('.custom-field').removeClass('required');

			for (i = 0; i < json.length; i++) {
				custom_field = json[i];

				$('#custom-field' + custom_field['custom_field_id']).show();

				if (custom_field['required']) {
					$('#custom-field' + custom_field['custom_field_id']).addClass('required');
				}
			}
		},
		error: function(xhr, ajaxOptions, thrownError) {
			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
		}
	});
});

$('input[name=\'customer_group_id\']:checked').trigger('change');
//--></script>
<script type="text/javascript"><!--
$('button[id^=\'button-custom-field\']').on('click', function() {
	var element = this;

	$('#form-upload').remove();

	$('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>');

	$('#form-upload input[name=\'file\']').trigger('click');

	if (typeof timer != 'undefined') {
    	clearInterval(timer);
	}

	timer = setInterval(function() {
		if ($('#form-upload input[name=\'file\']').val() != '') {
			clearInterval(timer);

			$.ajax({
				url: 'index.php?route=tool/upload',
				type: 'post',
				dataType: 'json',
				data: new FormData($('#form-upload')[0]),
				cache: false,
				contentType: false,
				processData: false,
				beforeSend: function() {
					$(element).button('loading');
				},
				complete: function() {
					$(element).button('reset');
				},
				success: function(json) {
					$(element).parent().find('.text-danger').remove();

					if (json['error']) {
						$(node).parent().find('input').after('<div class="text-danger">' + json['error'] + '</div>');
					}

					if (json['success']) {
						alert(json['success']);

						$(element).parent().find('input').val(json['code']);
					}
				},
				error: function(xhr, ajaxOptions, thrownError) {
					alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
				}
			});
		}
	}, 500);
});
//--></script>
<script type="text/javascript"><!--
$('.date').datetimepicker({
	language: '{{ datepicker }}',
	pickTime: false
});

$('.time').datetimepicker({
	language: '{{ datepicker }}',
	pickDate: false
});

$('.datetime').datetimepicker({
	language: '{{ datepicker }}',
	pickDate: true,
	pickTime: true
});
//--></script>
<script type="text/javascript"><!--
$('select[name=\'country_id\']').on('change', function() {
	$.ajax({
		url: 'index.php?route=account/account/country&country_id=' + this.value,
		dataType: 'json',
		beforeSend: function() {
			$('select[name=\'country_id\']').prop('disabled', true);
		},
		complete: function() {
			$('select[name=\'country_id\']').prop('disabled', false);
		},
		success: function(json) {
			if (json['postcode_required'] == '1') {
				$('input[name=\'postcode\']').parent().addClass('required');
			} else {
				$('input[name=\'postcode\']').parent().removeClass('required');
			}

			html = '<option value="">{{ text_select }}</option>';

			if (json['zone'] && json['zone'] != '') {
				for (i = 0; i < json['zone'].length; i++) {
					html += '<option value="' + json['zone'][i]['zone_id'] + '"';

					if (json['zone'][i]['zone_id'] == '{{ zone_id }}') {
						html += ' selected="selected"';
					}

					html += '>' + json['zone'][i]['name'] + '</option>';
				}
			} else {
				html += '<option value="0" selected="selected">{{ text_none }}</option>';
			}

			$('select[name=\'zone_id\']').html(html);
		},
		error: function(xhr, ajaxOptions, thrownError) {
			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
		}
	});
});

$('select[name=\'country_id\']').trigger('change');
//--></script>

User avatar
Newbie

Posts

Joined
Fri May 23, 2014 10:46 pm
Location - Gaziantep,Turkey

Post by CJC » Thu Sep 23, 2021 4:12 am

xxvirusxx wrote:
Fri May 29, 2020 11:53 pm
Make backup of register file from controller, language, template and upload files from attachment.
I replaced the 3 files in the attachment and although the address information was requested during registration, it didn't store it anywhere. When I edit the customer in the backend, there is no address information in their record.

CJC
Active Member

Posts

Joined
Wed Jun 03, 2020 5:51 am

Post by straightlight » Thu Sep 23, 2021 4:22 am

CJC wrote:
Thu Sep 23, 2021 4:12 am
xxvirusxx wrote:
Fri May 29, 2020 11:53 pm
Make backup of register file from controller, language, template and upload files from attachment.
I replaced the 3 files in the attachment and although the address information was requested during registration, it didn't store it anywhere. When I edit the customer in the backend, there is no address information in their record.
Ensure MOD security is disabled.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by CJC » Thu Sep 23, 2021 7:00 am

That would be set at the server level and not something I would have access to.
straightlight wrote:
Thu Sep 23, 2021 4:22 am
CJC wrote:
Thu Sep 23, 2021 4:12 am
xxvirusxx wrote:
Fri May 29, 2020 11:53 pm
Make backup of register file from controller, language, template and upload files from attachment.
I replaced the 3 files in the attachment and although the address information was requested during registration, it didn't store it anywhere. When I edit the customer in the backend, there is no address information in their record.
Ensure MOD security is disabled.

CJC
Active Member

Posts

Joined
Wed Jun 03, 2020 5:51 am

Post by straightlight » Thu Sep 23, 2021 9:03 am

CJC wrote:
Thu Sep 23, 2021 7:00 am
That would be set at the server level and not something I would have access to.
straightlight wrote:
Thu Sep 23, 2021 4:22 am
CJC wrote:
Thu Sep 23, 2021 4:12 am


I replaced the 3 files in the attachment and although the address information was requested during registration, it didn't store it anywhere. When I edit the customer in the backend, there is no address information in their record.
Ensure MOD security is disabled.
Contact your host so that their support staff can do it for you.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 265 guests