Completed
Push — master ( abfebb...4ac423 )
by Nicolaas
03:22
created
code/model/translations/CountryPrice_Translation.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             DropdownField::create(
76 76
                 'EcommerceCountryID',
77 77
                 $fields->dataFieldByName('EcommerceCountryID')->Title(),
78
-                array('' => '-- make sure to select a country --')+$countries
78
+                array('' => '-- make sure to select a country --') + $countries
79 79
             ),
80 80
             'Title'
81 81
         );
@@ -183,20 +183,20 @@  discard block
 block discarded – undo
183 183
     public function requireDefaultRecords()
184 184
     {
185 185
         parent::requireDefaultRecords();
186
-        if(Config::inst()->get('CountryPrice_Translation', 'automatically_create_dummy_translations_for_products_and_productgroups')) {
186
+        if (Config::inst()->get('CountryPrice_Translation', 'automatically_create_dummy_translations_for_products_and_productgroups')) {
187 187
             $prices = CountryPrice::get();
188 188
             $ecommerceCountries = array();
189
-            foreach($prices as $price) {
190
-                if($countryObject = $price->CountryObject()) {
191
-                    if($buyable = $price->Buyable()) {
192
-                        if($buyable instanceof Product) {
193
-                            if($buyable->ID && $countryObject->ID) {
189
+            foreach ($prices as $price) {
190
+                if ($countryObject = $price->CountryObject()) {
191
+                    if ($buyable = $price->Buyable()) {
192
+                        if ($buyable instanceof Product) {
193
+                            if ($buyable->ID && $countryObject->ID) {
194 194
                                 $filter = array(
195 195
                                     'EcommerceCountryID' => $countryObject->ID,
196 196
                                     'ParentID' => $buyable->ID
197 197
                                 );
198 198
                                 $ecommerceCountries[$countryObject->ID] = $countryObject;
199
-                                if(! CountryPrice_Translation::get()->filter($filter)->first()) {
199
+                                if (!CountryPrice_Translation::get()->filter($filter)->first()) {
200 200
                                     DB::alteration_message(
201 201
                                         'Creating fake translation for '.$buyable->Title.' for country '.$countryObject->Code,
202 202
                                         'created'
@@ -210,14 +210,14 @@  discard block
 block discarded – undo
210 210
                     }
211 211
                 }
212 212
             }
213
-            if(count($ecommerceCountries)) {
214
-                foreach(ProductGroup::get() as $productGroup) {
215
-                    foreach($ecommerceCountries as $countryID => $countryObject) {
213
+            if (count($ecommerceCountries)) {
214
+                foreach (ProductGroup::get() as $productGroup) {
215
+                    foreach ($ecommerceCountries as $countryID => $countryObject) {
216 216
                         $filter = array(
217 217
                             'EcommerceCountryID' => $countryObject->ID,
218 218
                             'ParentID' => $productGroup->ID
219 219
                         );
220
-                        if(! CountryPrice_Translation::get()->filter($filter)->first()) {
220
+                        if (!CountryPrice_Translation::get()->filter($filter)->first()) {
221 221
                             DB::alteration_message(
222 222
                                 'Creating fake translation for '.$productGroup->Title.' for country '.$countryObject->Code,
223 223
                                 'created'
Please login to merge, or discard this patch.