/**
  * returns filter form for filtering products on page
  * @return Form
  */
 function FilterForm()
 {
     //  =======================
     //  DROPDOWN
     //  =======================
     //city
     $cities = City::cities_for_category_and_merchant_page($this->categoryID, $this->merchantPageID);
     if ($cities) {
         $cities = $cities->map();
     } else {
         $cities = array();
     }
     $cities = array(0 => _t("Merchants.ALL_CITIES", "-- All Cities")) + $cities;
     //category
     $categories = Category::categories_for_city_and_merchant_page($this->cityID, $this->merchantPageID);
     if ($categories) {
         $categories = $categories->map('ID', 'Name');
     } else {
         $categories = array();
     }
     $categories = array(0 => _t("Merchants.ALL_CATEGORIES", "-- All Categories")) + $categories;
     //merchants
     $merchantPages = MerchantPage::merchant_pages_for_city_and_category_cache($this->cityID, $this->categoryID);
     if ($merchantPages) {
         $merchantPages = $merchantPages->map();
     } else {
         $merchantPages = array();
     }
     $merchantPages = array(0 => _t("Merchants.ALL_MERCHANTS", "-- All Merchants")) + $merchantPages;
     //priceOptionsFrom
     $priceOptionsFrom = DataObject::get('MerchantPriceOption', "ShowInFrom = 1", "DefaultFrom ASC, Price ASC");
     if ($priceOptionsFrom) {
         $priceOptionsFrom = $priceOptionsFrom->map("PriceInt", "PriceNice");
     } else {
         $priceOptionsFrom = array();
     }
     $priceOptionsFrom = array(0 => _t("Merchants.UNSELECTED_FROM_PRICE", "-- From")) + $priceOptionsFrom;
     //priceOptionsUpTo
     $priceOptionsUpTo = DataObject::get('MerchantPriceOption', "ShowInUpTo = 1", "DefaultUpTo ASC, Price ASC");
     if ($priceOptionsUpTo) {
         $priceOptionsUpTo = $priceOptionsUpTo->map("PriceInt", "PriceNice");
     } else {
         $priceOptionsUpTo = array();
     }
     $priceOptionsUpTo = array(0 => _t("Merchants.UNSELECTED_UPTO_PRICE", "-- Up To")) + $priceOptionsUpTo;
     //==============================
     // CREATE DROPDOWNS
     //==============================
     $cityID = isset($cities[$this->cityID]) ? $this->cityID : 0;
     $categoryID = isset($categories[$this->categoryID]) ? $this->categoryID : 0;
     $merchantPageID = isset($merchantPages[$this->merchantPageID]) ? $this->merchantPageID : 0;
     $priceFrom = isset($priceOptionsFrom[$this->priceFrom]) ? $this->priceFrom : 0;
     $priceUpTo = isset($priceOptionsUpTo[$this->priceUpTo]) ? $this->priceUpTo : 0;
     $fields = new FieldSet(new Dropdownfield(self::get_city_param(), _t("Merchants.SELECT_LOCATION", "Select Location"), $cities, $cityID), new Dropdownfield(self::get_category_param(), _t("Merchants.SELECT_CATEGORY", "Select Category"), $categories, $categoryID), new Dropdownfield(self::get_merchant_page_param(), _t("Merchants.SELECT_MERCHANT", "Select Merchant"), $merchantPages, $merchantPageID), new Dropdownfield(self::get_price_from_param(), _t("Merchants.PRICE_FROM", "Price From"), $priceOptionsFrom, $priceFrom), new Dropdownfield(self::get_price_upto_param(), _t("Merchants.PRICE_UNTIL", "Price Until"), $priceOptionsUpTo, $priceUpTo), new LiteralField("AllMerchantsPageLoadingHolder", "<div class=\"allMerchantsPageLoadingHolder\">&nbsp;</div>"));
     //reset City Form (needed to avoid discrepancies when using the Back Button)
     $actions = new FieldSet(new FormAction('filter', _t('AllMerchantsPage_Controller.FILTER', 'Filter')));
     return new Form($this, 'FilterForm', $fields, $actions);
 }