Completed
Push — master ( 898373...fb0bef )
by Nicolaas
04:30
created
code/control/CountryPrice_Page_Controller_Extension.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         if ($countryObject) {
40 40
             $countryID = $countryObject->ID;
41 41
             $newURL = $this->addCountryCodeToUrlIfRequired($countryObject->Code);
42
-            if($newURL) {
42
+            if ($newURL) {
43 43
                 $this->owner->redirect($newURL);
44 44
             }
45 45
         }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         parse_str($urlParts['query'], $params);
96 96
 
97 97
         $param = Config::inst()->get('CountryPrice_Translation', 'locale_get_parameter');
98
-        $params[$param] = $countryCode;     // Overwrite if exists
98
+        $params[$param] = $countryCode; // Overwrite if exists
99 99
 
100 100
         // Note that this will url_encode all values
101 101
         $urlParts['query'] = http_build_query($params);
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         if (function_exists('http_build_url')) {
105 105
             $newURL = http_build_url($urlParts);
106 106
         } else {
107
-            $newURL =  $urlParts['scheme'] . '://' . $urlParts['host'] . $urlParts['path'] . '?' . $urlParts['query'];
107
+            $newURL = $urlParts['scheme'].'://'.$urlParts['host'].$urlParts['path'].'?'.$urlParts['query'];
108 108
         }
109 109
 
110 110
         if ($oldURL !== $newURL && self::$_redirection_count < 3) {
Please login to merge, or discard this patch.
code/model/address/CountryPrice_EcommerceCountry.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                     'Root.FAQPage',
89 89
                     new LiteralField(
90 90
                         "FAQPageExplanation",
91
-                        "<p class=\"message warning\">FAQ information can only be added to the main country for a ". _t('Distributor.SINGULAR_NAME', 'Distributor') ."</p>"
91
+                        "<p class=\"message warning\">FAQ information can only be added to the main country for a "._t('Distributor.SINGULAR_NAME', 'Distributor')."</p>"
92 92
                     )
93 93
                 );
94 94
             }
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      */
197 197
     public static function get_real_country($country = null)
198 198
     {
199
-        if ($country && (! is_object($country))) {
199
+        if ($country && (!is_object($country))) {
200 200
             if (isset(self::$_get_real_country_cache[$country])) {
201 201
                 return self::$_get_real_country_cache[$country];
202 202
             } else {
@@ -204,10 +204,10 @@  discard block
 block discarded – undo
204 204
             }
205 205
         }
206 206
         $order = ShoppingCart::current_order();
207
-        if (! $country) {
207
+        if (!$country) {
208 208
             $country = $order->getCountry();
209 209
         }
210
-        if (! $country) {
210
+        if (!$country) {
211 211
             $country = EcommerceCountry::get_country();
212 212
         }
213 213
         if ($country instanceof EcommerceCountry) {
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
                 }
230 230
             }
231 231
         }
232
-        if (! $country instanceof EcommerceCountry) {
232
+        if (!$country instanceof EcommerceCountry) {
233 233
             user_error('No country could be found');
234 234
         }
235 235
         if (!empty($originalCode)) {
@@ -244,9 +244,9 @@  discard block
 block discarded – undo
244 244
     public static function get_backup_country()
245 245
     {
246 246
         $obj = EcommerceCountry::get()->filter(array("IsBackupCountry" => true))->first();
247
-        if (! $obj) {
247
+        if (!$obj) {
248 248
             $obj = EcommerceCountry::get()->filter(array("Code" => EcommerceConfig::get('EcommerceCountry', 'default_country_code')))->first();
249
-            if (! $obj) {
249
+            if (!$obj) {
250 250
                 $obj = EcommerceCountry::get()->first();
251 251
             }
252 252
         }
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
      */
297 297
     public function ComputedLanguageAndCountryCode()
298 298
     {
299
-        if($this->owner->LanguageAndCountryCode) {
299
+        if ($this->owner->LanguageAndCountryCode) {
300 300
             return $this->owner->LanguageAndCountryCode;
301 301
         }
302 302
         return strtolower('en-'.$this->owner->Code);
Please login to merge, or discard this patch.
code/model/translations/CountryPrice_Translation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             DropdownField::create(
69 69
                 'EcommerceCountryID',
70 70
                 $fields->dataFieldByName('EcommerceCountryID')->Title(),
71
-                array('' => '-- make sure to select a country --')+$countries
71
+                array('' => '-- make sure to select a country --') + $countries
72 72
             ),
73 73
             'Title'
74 74
         );
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     function Link()
152 152
     {
153 153
         $link = $this->Parent()->Link();
154
-        if($this->EcommerceCountryID) {
154
+        if ($this->EcommerceCountryID) {
155 155
             $link .= '?'.$this->Config()->get('locale_get_parameter').'='.$this->EcommerceCountry()->Code;
156 156
         }
157 157
         return $link;
Please login to merge, or discard this patch.