Targets : Show Locations (sub-districts & cities) on the customized shop page & on tab additional information - Show on line 5
I'm building a property site using wordpress and woocommerce.
In my country has 7 islands, 34 provinces, 514 Cities, 7041 Districts, 82194 Sub-districts.
Then I grouped the data and added it to :
On category
- Verified (parent)
- Sold (parent)
- Rent (parent)
- Island #1 (parent)
- province #1 (child)
- City #1(sub-child)
- City #1(sub-child)
- province #1 (child)
- Island #2 (parent)
- province #2 (child)
- City #2(sub-child)
- City #2(sub-child)
- province #2 (child)
- Island #7 (parent)
- province #34 (child)
- City #514(sub-child)
- City #514(sub-child)
- province #34 (child)
and on product attribute :
pa_area : city (514)
pa_kecamatan : districts (7041)
pa_lokasi : sub-districts (82194)
So, I can customize the shop page as desired/needed and looks like this.
In the Additional Information tab, I also added the sub-district and the city looks like this.
I also display links using permalinks, for example:
https://mydomain/product-categories/island1/provinces3/cities8 (categories)
https://mydomain/product-categories/island5/provinces1/cities12 (categories)
https://mydomain/districts1492 (pa_attributtes)
https://mydomain/districts5630 (pa_attributtes)
https://mydomain/subdistricts11596 (pa_attributtes)
https://mydomain/subdistricts52630 (pa_attributtes)
So far everything seems fine.
My mind changed when I created a demo site (with current product counts at 10k.)
Loading slowly on entering/selecting attributes is starting to feel.
(I know one of the causes is CPU, RAM/Hosting).
This made me think whether display the city only in one place.
(eg city in category or city in product attribute) can help reduce server load?
Please correct me if I misunderstood this.
But if it's true, i using the first way is to delete the city in the category and save the city in the product attribute.
However this will cut the scope, for example :
Previously :
https://mydomain/product-categories/island1/provinces3/cities8 (categories)
https://mydomain/product-categories/island5/provinces1/cities12 (categories)
will be :
https://mydomain/product-categories/island1/provinces3/ (categories)
https://mydomain/product-categories/island5/provinces1/ (categories)
To keep showing the same thing, i can just edit the permalink to:
https://mydomain/product-categories/island1/provinces3/&cities8 (categories & pa_area)
https://mydomain/product-categories/island5/provinces1/&cities12 (categories & pa_area)
But is that way I'm already on the right track?
Meanwhile, if I use the second method, namely removing the city from the product attribute, I have trouble displaying city information on the shop page and additional information tab.
The achievement so far is to add the code snippet below with a view like this.
When the product only has the category :
- Island (parent)
- Province (child)
- City (subChild)
- Province (child)
View works well (Rumah Cluster Pondok Aren).
However, when the product has the category :
- Verified (parent)
- Island (parent)
- Province (child)
- City (subChild)
- Province (child)
What is displayed is the Verified category, not cities (Townhouse Premium Daerah Cileungsi).
What have I missed?
Besides that, I also don't know how to display these subchild categories on the additional information tab.
I'm stuck here for days, so please help me out of this hassle...
Thanks a lot