@@ -28,17 +28,17 @@ discard block |
||
28 | 28 | //provided by stealth ... |
29 | 29 | $param = Config::inst()->get('CountryPrice_Translation', 'locale_get_parameter'); |
30 | 30 | $countryObject = CountryPrice_EcommerceCountry::get_real_country(); |
31 | - if($countryObject && $countryObject->Code) { |
|
31 | + if ($countryObject && $countryObject->Code) { |
|
32 | 32 | $oldCountryCode = strtoupper($countryObject->Code); |
33 | 33 | } else { |
34 | 34 | $oldCountryCode = 'XX'; |
35 | 35 | } |
36 | 36 | if (isset($_GET[$param])) { |
37 | 37 | $urlCountryCode = preg_replace("/[^A-Z]+/", "", strtoupper(Convert::raw2sql($_GET[$param]))); |
38 | - if($urlCountryCode) { |
|
38 | + if ($urlCountryCode) { |
|
39 | 39 | if ($oldCountryCode !== $urlCountryCode) { |
40 | 40 | $countryObject = DataObject::get_one('EcommerceCountry', ['Code' => $urlCountryCode]); |
41 | - if($countryObject) { |
|
41 | + if ($countryObject) { |
|
42 | 42 | //change country Object |
43 | 43 | //reset everything ... |
44 | 44 | CountryPrices_ChangeCountryController::set_new_country($urlCountryCode); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | } |
50 | 50 | } |
51 | - if($countryObject) { |
|
51 | + if ($countryObject) { |
|
52 | 52 | |
53 | 53 | //check if a redirect is required ... |
54 | 54 | $this->checkForOffsiteRedirects($countryObject); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $oldURL = $protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; |
115 | 115 | |
116 | 116 | $hasCountrySegment = CountryPrice_Translation::get_country_url_provider()->hasCountrySegment($oldURL); |
117 | - if($hasCountrySegment){ |
|
117 | + if ($hasCountrySegment) { |
|
118 | 118 | $newURL = CountryPrice_Translation::get_country_url_provider()->replaceCountryCodeInUrl($countryCode, $oldURL); |
119 | 119 | } |
120 | 120 | else { |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | public function AlternativeHrefLangLinksCachingKey() |
170 | 170 | { |
171 | 171 | $countryObject = CountryPrice_EcommerceCountry::get_real_country(); |
172 | - if($countryObject && $countryObject->Code) { |
|
172 | + if ($countryObject && $countryObject->Code) { |
|
173 | 173 | return 'AlternativeHrefLangLinksCachingKey-'.$countryObject->Code.'-'.$this->owner->dataRecord->ID.'-'.strtotime($this->owner->dataRecord->LastEdited); |
174 | 174 | } |
175 | 175 | return 'AlternativeHrefLangLinksCachingKey'.$this->owner->dataRecord->ID.'-'.$this->owner->dataRecord->ID.'-'.strtotime($this->owner->dataRecord->LastEdited); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | public function UpdateCanonicalLink(&$link) |
183 | 183 | { |
184 | 184 | $obj = $this->owner->dataRecord->CanonicalObject(); |
185 | - if($obj) { |
|
185 | + if ($obj) { |
|
186 | 186 | $link = $obj->Link(); |
187 | 187 | } else { |
188 | 188 | $link = $this->owner->dataRecord->AbsoluteLink(); |