modules/phyto_climate_zone/
Direct path in the repo โ all PHP, SQL, templates, and assets
Overview
Buyer enters their city or PIN code; the module shows which plants are suitable for their climate (outdoor vs indoor-only). Fully offline โ no external API calls. Covers all major Indian climate types from humid tropical Kerala to Rajasthan desert to Himalayan alpine.
Version History
v1.0 โ First Build
5 hardcoded climate zones, 26 PIN prefixes, basic “Suitable / Not Recommended” result. Proof-of-concept only.
v2.0 โ 15 PCC-IN Zones, 797 PIN Prefixes, Monthly Climate Chart (current)
Complete data-driven rewrite:
- 797 Indian 3-digit PIN prefixes mapped to 15 climate zones
- 15 PCC-IN climate zones โ from
IN-KL-TH(Kerala humid tropical) toIN-RJ-HD(Rajasthan hot desert) toIN-HP-AL(Himalayan alpine) - Monthly climate chart โ temperature + humidity bar chart, frost risk flags, monsoon month markers
- Zone detail panel โ example cities, outdoor/indoor suitability verdict, specific plant warnings
- Entire dataset ships as two JSON files โ zero HTTP calls at runtime
Source Layout
| Path | Purpose |
|---|---|
phyto_climate_zone.php | Module entry + hooks |
data/pin_to_zone.json | 797 PIN prefix โ zone mappings |
data/zone_climate.json | Monthly climate data per zone |
views/js/climate_widget.js | PIN lookup + chart rendering (Chart.js) |
views/templates/hook/widget.tpl | Product page climate widget |