2 836
Usually answers within a few days
Автор дополнения
2 836
Usually answers within a few days
Version 2.0.5-pl
Release date 12.04.2023
Downloads 1 348
Views 3 537
Warning! This component requires PHP version 7.2 or higher! If your site uses PHP less than required, the installation of this package could break it.
Warning! For MODX 2 and PHP 5.5+, the component version 1.3 is available. It will be supported as long as MODX 2 is supported.

A small useful component has the following features:
  1. Adding cities to the list.
  2. Definition of a city by domain.
  3. Determination of the city by IP-address.
  4. Adding unique information for each city.
  5. Management the prices of miniShop2 products for each city.

List of cities and its management

The component has a page on which you can manage the list of cities, add, edit and delete them, and also enable and disable cities.

To display a list of cities with the option of switching between them, simply call the snippet:

Unique information for each city

On the same page the «Data» tab is for managing information for each city. To display unique information in a component, several methods are used.

First, by default the fields that have a prefix are recorded in placeholders. And for the output of information it is enough to add the necessary placeholder to your chunks or templates, but the main thing is to call it not cached. For example, this:

Secondly, placeholders are recorded when the page loads, which can slow down the system in some cases. Therefore, I added the option to disable field entry in placeholders. In this case, to output information for each city, you need to call the cfField snippet with the desired key:
[[!cfField ?&key=`phone`]]

Goods prices management

To manage prices on the product editing page, we add a new tab «City — Price». In it you will find a table where you can indicate the price of the goods depending on the city.
If the price is not specified for a certain city, then its price will be taken by default.

In order for the price of the goods in each city to be displayed up-to-date, it is necessary to display it uncached, that is, in this way:
[[!+price]] or [[!*price]]

cityFields 2.0.5-pl / 1.3.5-pl

  • Fix page links in search
  • Updated Sypex Geo base (release 2023.11.30)

cityFields 2.0.4-pl / 1.3.4-pl

  • Fixed some bugs
  • Updated Sypex Geo base (release 2023.08.31)

cityFields 2.0.3-pl / 1.3.3-pl

  • Fixed setting cookie when disabled domains and subfolders
  • Fixed redirect when enabled subfolders
  • Fixed forward when resource is not published
  • Updated Sypex Geo base (release 2023.04.18)

cityFields 2.0.2-pl / 1.3.2-pl

  • Refactored function for get current city ID
  • Fixed geolocation
  • Fixed city selection when city is enabled in a subfolder
  • Plugin is disabled for the manager context
  • List of cities is returned when search query is empty
  • Fixed generate page link when search
  • Fixed some bugs
  • Updated Sypex Geo base (release 2023.03.31)

cityFields 2.0.1-pl / 1.3.1-pl

  • Support subfolders as city key
  • Support full domains as city key
  • Fixed generate page link
  • Added English lexicon
  • Updated Sypex Geo base (release 2023.02.28)

cityFields 2.0.0-pl / 1.3.0-pl

  • Refactored chunks
  • Refactored frontend CSS
  • Refactored frontend JavaScript
  • Not required Bootstrap 3
  • Not required jQuery
  • Updated Sypex Geo base (release 2022.10.19)

cityFields 2.0.0-beta

  • Refactored for MODX 3
  • Requires MODX 3
  • Requires PHP 7.2 and above

cityFields 1.2.11-pl

  • Fixed MySQL schemas
  • Updated Sypex Geo base (release 2022.09.30)

cityFields 1.2.10-pl

  • Fixed display of city name in table of prices in manager
  • Fixed errors with PHP 8
  • Updated Sypex Geo base (release 2022.02.19)

cityFields 1.2.9-pl

  • Change city's variable name in link
  • City search starts with 2 characters
  • Product price can be set as 0
  • Fixed redirects when use city in domain
  • Fixed redirect to default city for cyrillic domains
  • Fixed setting default city when use domain with www
  • Fixed setup cookies when use domain with www
  • Updated Sypex Geo base (release 2021.10.19)

cityFields 1.2.8-pl

  • Fixed support msOptionsPrice2
  • Fixed work for domains with www
  • Updated Sypex Geo base (release 2020.04.15)

cityFields 1.2.7-pl

  • YandexTurbo bot excluded from geolocation
  • Updated Sypex Geo base (release 2020.03.31)
  • Updated Sypex Geo info (release 2019.12.30)

cityFields 1.2.6-pl

  • Fixed redirect when use key of city in link
  • Updated Sypex Geo base (release 2019.11.19)

cityFields 1.2.5-pl

  • Fixed display of values in table of fields in manager
  • Updated Sypex Geo base (release 2019.09.30)

cityFields 1.2.4-pl

  • Fixed search cities from web for cyrillic domains
  • Fixed JS code for support old chunks
  • Updated Sypex Geo base (release 2019.06.18)

cityFields 1.2.3-pl

  • Fixed search cities from web
  • Removed logs from cfOrderHandler class

cityFields 1.2.2-pl

  • Disabled redirect for mgr context
  • Fixed opening modal window
  • Fixed closing popover message when cityindomain option disable

cityFields 1.2.1-pl

  • Updated search cities
  • Updated web javascript code

cityFields 1.2.0-pl

  • New bootstrap based chunks
  • Added system setting cityfields_frontend_css
  • Added cookie cfCity
  • Added city change via GET query
  • Set default city from extras page
  • Updated function for get chosen city ID
  • Updated installer
  • Updated Sypex Geo base
  • Fixed redirect on default host
  • Fixed find module php-intl in snippet

cityFields 1.1.7-pl

  • Chunks, snippets & plugin is no static now
  • Fix find module php-intl
  • Remove modAction

cityFields 1.1.6-pl

  • Module php-intl not required
  • Update Sypex Geo base
  • Fix redirect after detect city
  • Fix create tables via installer

cityFields 1.1.5-pl

  • Option for disable geolocation
  • Option for exclude agents
  • Fix support msOptionsPrice2
  • Fix manager lexicons

cityFields 1.1.4-pl

  • Support cyrillic domain
  • Add $limit for cfCities snippet
  • Fix init placeholders in "Page not found"

cityFields 1.1.3-beta

  • Add $where for cfCities snippet
  • Different manager's emails miniShop2 for cities
  • Support pdoTools
  • Escape html special chars for fields value in manager
  • Fields value have more text

cityFields 1.1.2-beta

  • Fix redirect to city domain

cityFields 1.1.1-beta

  • Add placeholder [[+cf.current_city.url]]

cityFields 1.1.0-beta

  • Init city from domain
  • Snippet cfField like modifier
  • Current city in placeholders
  • Filters for fields in manager
  • Combobox for placeholder's input in field's update window
  • Fix support with msOptionsPrice2
  • Fix styles on update product page
  • Fix duplicate cities and fields
  • Update snippet cfCities
  • Update chunk cfCities.row
  • Update models and tables
  • Update sxGeo database

cityFields 1.0.7-pl

  • Support msOptionsPrice2

cityFields 1.0.6-pl

  • Fix get product price

cityFields 1.0.5-pl

  • Fix get fields value

cityFields 1.0.4-pl

  • Fix for support miniShop2 2.4

cityFields 1.0.3-pl

  • Geolocation by IP

cityFields 1.0.2-pl

  • Fix miniShop2 prices processors
  • Fix show form on edit product page

cityFields 1.0.1-pl

  • Default city option
  • Frontend js file path option
  • Modify product prices for cities (required miniShop2)
  • Sort options in snippet cfCities
  • Could disable write fields to placeholders
  • New snippet cfField
  • Support AjaxManager

cityFields 1.0.0-pl

  • Release component.