no autoload for subzones of the states zones

  • Posts: 43
  • Thank you received: 0
8 years 6 months ago #239072

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.1.
-- PHP version -- : 5.5

Hello there,

I have setup my shop with Hika and I want to do the following bit I encounter problems.
In the Zones part of the extension I have created subzones for the countries with states:
Example:
The country is Netherlands with the default substates
For every substate I have created several substates with the type shipping zones

After that I have created matching shipping methods for the shipping zones and published it all.
But in the front-end the dropdown substates field (address_city) is not automatically loaded with the corresponding State. Although, the correct States dropdown is being loaded with its corresponding country.

This also means that the shipping methods are not shown as being linked to the dropdown substates field (address_city).

Am I doing something wrong?

Thank you in advance

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 6 months ago #239135

Hi,

The system only handle the address_state and address_country fields. And it only handles zones of the type state and country.
If you want shipping methods to be linked to substates there is only one option if you don't want to code: deactivate all the countries and modify the types of the states of your country to be countries and modify the type of the substates to be states.
That however will mean that you'll only be able to create addresses for your country in your checkout.
If you need to ship to other countries too, then you would have to code a new shipping plugin to handle the address_city field value and keep your zones setup like you did, and also modify the view files displaying the custom address fields to dynamically load the sub states for the address_city field. So it's possible but not easy.

Please Log in or Create an account to join the conversation.

  • Posts: 51
  • Thank you received: 1
8 years 5 months ago #243400

Wow, this is a totally different & long process entirely.
Isn't there an easier way to load the subzones of states in the city custom field by creating a City Zone in Hikashop zones? Would be great if this feature is implemented in your next update
I already started creating 774 state subzones manually before seeing this.
Also, is there a faster way to create the State subzones by uploading a .csv file containing the list of state capital/cities directly to the State subzone database table using phpmyadmin?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 5 months ago #243422

Hi,

1. It won't be in the next update as the features we're working on for the next release have already been decided. In fact, there is no plan in extending the zone autoload system for now. It wasn't meant to be used for other type of zones like cities and with all there already is to handle with addresses and custom fields, it would be quite a complex job to add that.

2. There is no interface to import zones in HikaShop. However, you can edit the tables hikashop_zone and hikashop_zone_link via your phpmyadmin and export them as CSV files.
Then, complete the CSVs with your new zones and links between these zones and their parent through Excel and import back the CSV to PHPMyAdmin and that should do it.

Please Log in or Create an account to join the conversation.

  • Posts: 51
  • Thank you received: 1
8 years 5 months ago #243468

Okay.
Wow, that was faster. I just saved myself 1 week of hard labour.
Thanks a lot

Please Log in or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 0
8 years 12 hours ago #255955

It would be very helpful if they did a tutorial on how to do what is indicated in this paragraph, since many want to create sub-sub zones, in my case is to activate the option of payment against delivery in my city and the rest of the country that Only show a payment with paypal. Another faster option would be to create a more linked address by default in the installation of hikashop as well as this address_country or addres_state that also put an address_citycity for example, to be able to use the latter for sub-sub zones that the administrator wants to add.



Hi,

The system only handle the address_state and address_country fields. And it only handles zones of the type state and country.
If you want shipping methods to be linked to substates there is only one option if you don't want to code: deactivate all the countries and modify the types of the states of your country to be countries and modify the type of the substates to be states.
That however will mean that you'll only be able to create addresses for your country in your checkout.
If you need to ship to other countries too, then you would have to code a new shipping plugin to handle the address_city field value and keep your zones setup like you did, and also modify the view files displaying the custom address fields to dynamically load the sub states for the address_city field. So it's possible but not easy.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 31 minutes ago #255975

Hi,

If you want to only allow a payment method for a city, I would recommend to use the post code restriction options of your payment methods.
That way, you don't need to change any zones on your HikaShop.
You can simply just create one payment method for each post code range.

Adding all the cities linked to the corresponding states during the installation would be impossible. First, I don't think that there is anywhere you can find a list of all the cities of the world that can be used for free and that has the links to the corresponding states, and even if there was, it would be too big to include in HikaShop.

Please Log in or Create an account to join the conversation.

Time to create page: 0.084 seconds
Powered by Kunena Forum