Автор дополнения
Version 1.1.5-pl
Release date 05.30.2018
Downloads 196
Views 532
Warning! This component requires PHP version 5.5 or higher! If your site uses PHP less than required, the installation of this package could break it.
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.

After you add the price for the city, and update the cache, you will see a new price, and if the output of the old prices is installed, you’ll see an old one next to it. Additionally, you do not need to fine-tune or display anything.

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.