opencart/opencart-3

Zone should be required for store config

MarvinKlein1508 opened this issue · 3 comments

When switching the country within the store settings, the zone becomes reset to please select a zone.
grafik

However, you can save the settings without setting any zone at all. This results in the admin and store crashing completely. Everytime you visit the store then you'll get this error message:

Fatal error: Uncaught TypeError: Cart\Tax::setShippingAddress(): Argument #2 ($zone_id) must be of type int, string given, called in C:\xampp\htdocs\github\admin\controller\startup\startup.php on line 48 and defined in C:\xampp\htdocs\github\system\library\cart\tax.php:13 Stack trace: #0 C:\xampp\htdocs\github\admin\controller\startup\startup.php(48): Cart\Tax->setShippingAddress(81, '') #1 C:\xampp\htdocs\github\system\engine\action.php(75): ControllerStartupStartup->index() #2 C:\xampp\htdocs\github\system\engine\router.php(61): Action->execute(Object(Registry)) #3 C:\xampp\htdocs\github\system\engine\router.php(42): Router->execute(Object(Action)) #4 C:\xampp\htdocs\github\system\framework.php(184): Router->dispatch(Object(Action), Object(Action)) #5 C:\xampp\htdocs\github\system\startup.php(107): require_once('C:\\xampp\\htdocs...') #6 C:\xampp\htdocs\github\admin\index.php(19): start('admin') #7 {main} thrown in C:\xampp\htdocs\github\system\library\cart\tax.php on line 13

To fix this a manual edit in the database is necessary. The zone for the key config_zone_id needs to be defined in order for the shop to work.

In my opinion it should be possible to save a store config without a zone when it results in an entire crash.

This was debated before on the MB. The problem is that not all countries have zones. Therefore, users won't be able to manage their countries with restrictions if no zones applies politically.

Do you have any country without a zone in mind? I just wanna know what happens when I set my store to one of these countries.

If that question could ever be resolved on the MB, it would ease the answer at this point.