Post by imran basha » Fri Oct 09, 2020 2:54 am

Hi, we have disabled some of our zones but the customer have registered with the disabled zones earlier are still having the same zone. how to make a prompt to the specified customer to update their zone with the available zone. thanks in advance.

New member

Posts

Joined
Thu Dec 05, 2019 3:40 pm

Post by IP_CAM » Fri Oct 09, 2020 6:51 am

You could try one of those, to get rid of your problem:

Remove “Zone” Field OC v.3.0.0.0, 3.0.1.1, 3.0.1.2, 3.0.2.0
The module simply removes this field, so it would not bother your customers.
https://www.opencart.com/index.php?rout ... n_id=36141
---
Disable / Remove zone field
VQMod to disable the zone field in edit address and edit profile.
https://www.opencart.com/index.php?rout ... n_id=36454
---
Remove Region / State / Zone v 2.x and 3.x paid
https://www.opencart.com/index.php?rout ... n_id=18848
---
Remove Fields From Register-Checkout-Billing-Delivery paid
https://www.opencart.com/index.php?rout ... n_id=22795
---
Remove State / Region Zone From ALL paid
https://www.opencart.com/index.php?rout ... n_id=35212

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by letxobnav » Fri Oct 09, 2020 7:57 am

You want your customers to move?

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by Burt65 » Fri Oct 09, 2020 8:40 am

letxobnav wrote:
Fri Oct 09, 2020 7:57 am
You want your customers to move?
:laugh: :laugh: :laugh:

Thanks for making my day..

Over 95% of all computer problems can be traced back to the interface between the keyboard and the chair...


User avatar
Active Member

Posts

Joined
Mon Nov 18, 2013 3:23 pm
Location - Oz

Post by paulfeakins » Fri Oct 09, 2020 6:17 pm

imran basha wrote:
Fri Oct 09, 2020 2:54 am
Hi, we have disabled some of our zones but the customer have registered with the disabled zones earlier are still having the same zone. how to make a prompt to the specified customer to update their zone with the available zone. thanks in advance.
Try this: https://www.opencart.com/index.php?rout ... n_id=18848

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by straightlight » Sat Oct 10, 2020 7:25 am

imran basha wrote:
Fri Oct 09, 2020 2:54 am
Hi, we have disabled some of our zones but the customer have registered with the disabled zones earlier are still having the same zone. how to make a prompt to the specified customer to update their zone with the available zone. thanks in advance.
Interesting ...

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 straightlight » Sat Oct 10, 2020 7:55 am

The best and simplest location to show a zone change restriction without the need to remove the zone field to a customer would be during checkout. Unfortunately, at this time, neither with an extension module nor events can this be accomplished. However, it could be accomplished with VQMod / OCMod.

In catalog/controller/checkout/login.php file,

find:

Code: Select all

if (!isset($json['error'])) {
				if (!$this->customer->login($this->request->post['email'], $this->request->post['password'])) {
					$json['error']['warning'] = $this->language->get('error_login');

					$this->model_account_customer->addLoginAttempt($this->request->post['email']);
				} else {
					$this->model_account_customer->deleteLoginAttempts($this->request->post['email']);
				}
			}
replace with:

Code: Select all

if (!isset($json['error'])) {
	if (!$this->customer->login($this->request->post['email'], $this->request->post['password'])) {
		$json['error']['warning'] = $this->language->get('error_login');

		$this->model_account_customer->addLoginAttempt($this->request->post['email']);
	} else {
		// COVID-19 situations.
		$this->load->model('localisation/country');
		$this->load->model('localisation/zone');
		$this->load->model('account/address');
		
		$country_info = $this->model_localisation_country->getCountry($customer_info['country_id']);
		
		$zone_info = $this->model_localisation_zone->getZone($customer_info['zone_id']);
		
		$addresses = $this->model_account_address->getAddresses();
		
		$country_addresses = array();
		
		$zone_addresses = array();
		
		foreach ($addresses as $key => $address) {
			$country_addresses[] = $address['country_id'];
		
			$zone_addresses[] = $address['zone_id'];
		}
		
		if ((!$country_info) || (!$zone_info) || ($addresses && ((!in_array($country_info['country_id'], $country_addresses)) || (!in_array($zone_info['zone_id'], $zone_addresses))))) {
			$json['error']['warning'] = $this->language->get('error_zone_status');
			
			$this->model_account_customer->addLoginAttempt($this->request->post['email']);
		}
		
		if (!$json) {
		    $this->model_account_customer->deleteLoginAttempts($this->request->post['email']);
		} else {
		    $this->customer->logout();
		}
	}
}
Then, in catalog/language/en-gb/checkout/checkout.php file,

at the bottom of the file, add:

Code: Select all

$_['error_zone_status'] = 'Warning: The zone that has been configured on your profile is no longer provided by our store. Please select another zone from your profile!';
This should resolved the issue.
Last edited by straightlight on Tue Oct 13, 2020 6:11 am, edited 3 times in total.

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 straightlight » Sat Oct 10, 2020 8:08 am

I may have to expand this idea a bit as a pull request for the master branch, since store settings may depend on which country a Business might be located in order to, either, restrict its zone or whenever a country does have a zone for registered customers to complete their checkout process.

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 imran basha » Sun Oct 11, 2020 4:54 pm

Thank you so much for all your replies.
sorry I think i don't explain my problem properly.
example: assume we were delivering products in London(zone) but later we stopped delivering to London so we disable the london(zone) but the problem is the customer who have saved the address in their account the zone london is there even when we have disable it so when they make a order the address in the order cames as london(zone). any help will be greatly appreciated.

New member

Posts

Joined
Thu Dec 05, 2019 3:40 pm

Post by JNeuhoff » Sun Oct 11, 2020 6:30 pm

I think you are going about it the wrong way.

If for example you don't want to ship to customers from London, why not just exclude the 'Greater London' from the shipping method's geo_zone? This way when a customer from London tries to do a checkout, he won't be offered a shipping method. All you might possibly have to do is to modify the error message to something like 'Sorry, we are not shipping to your area'.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by khnaz35 » Sun Oct 11, 2020 6:39 pm

OP user issue is
Thank you so much for all your replies.
sorry I think i don't explain my problem properly.
example: assume we were delivering products in London(zone) but later we stopped delivering to London so we disable the london(zone) but the problem is the customer who have saved the address in their account the zone london is there even when we have disable it so when they make a order the address in the order cames as london(zone). any help will be greatly appreciated.
Basically his issue is for existing customers not the new customers.

1)Just an idea remove the manual save address for effected customers
2) Send email to the customers to notify about new change and encourage them to change the address before order.

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by imran basha » Sun Oct 11, 2020 6:51 pm

JNeuhoff wrote:
Sun Oct 11, 2020 6:30 pm
I think you are going about it the wrong way.

If for example you don't want to ship to customers from London, why not just exclude the 'Greater London' from the shipping method's geo_zone? This way when a customer from London tries to do a checkout, he won't be offered a shipping method. All you might possibly have to do is to modify the error message to something like 'Sorry, we are not shipping to your area'.
thank you sir for your suggestion.

New member

Posts

Joined
Thu Dec 05, 2019 3:40 pm

Post by imran basha » Sun Oct 11, 2020 6:52 pm

khnaz35 wrote:
Sun Oct 11, 2020 6:39 pm
OP user issue is
Thank you so much for all your replies.
sorry I think i don't explain my problem properly.
example: assume we were delivering products in London(zone) but later we stopped delivering to London so we disable the london(zone) but the problem is the customer who have saved the address in their account the zone london is there even when we have disable it so when they make a order the address in the order cames as london(zone). any help will be greatly appreciated.
Basically his issue is for existing customers not the new customers.

1)Just an idea remove the manual save address for effected customers
2) Send email to the customers to notify about new change and encourage them to change the address before order.
thank you sir i appricate you help.

New member

Posts

Joined
Thu Dec 05, 2019 3:40 pm

Post by straightlight » Sun Oct 11, 2020 8:57 pm

imran basha wrote:
Sun Oct 11, 2020 4:54 pm
Thank you so much for all your replies.
sorry I think i don't explain my problem properly.
example: assume we were delivering products in London(zone) but later we stopped delivering to London so we disable the london(zone) but the problem is the customer who have saved the address in their account the zone london is there even when we have disable it so when they make a order the address in the order cames as london(zone). any help will be greatly appreciated.
I have improved the solution on the codes above. See if that, now, fits your request based on the customers' addresses and your store's zone's geographic settings.

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 imran basha » Sun Oct 11, 2020 9:46 pm

straightlight wrote:
Sun Oct 11, 2020 8:57 pm
imran basha wrote:
Sun Oct 11, 2020 4:54 pm
Thank you so much for all your replies.
sorry I think i don't explain my problem properly.
example: assume we were delivering products in London(zone) but later we stopped delivering to London so we disable the london(zone) but the problem is the customer who have saved the address in their account the zone london is there even when we have disable it so when they make a order the address in the order cames as london(zone). any help will be greatly appreciated.
I have improved the solution on the codes above. See if that, now, fits your request based on the customers' addresses and your store's zone's geographic settings.
thank you so much for your help sir.

New member

Posts

Joined
Thu Dec 05, 2019 3:40 pm

Post by straightlight » Tue Oct 13, 2020 6:12 am

I have expanded the codes furthermore above in order to be more opted with the COVID-19 situations, covered on this topic: viewtopic.php?f=2&t=217130 , where not only zones can be restricted by shipping providers but also on Countries where no zones are involved exceptionally.

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 521 guests