@@ -148,7 +148,7 @@ |
||
148 | 148 | 'Root.Country', |
149 | 149 | DropdownField::create( |
150 | 150 | 'DistributorID', |
151 | - _t('Distributor.SINGULAR_NAME', 'Distributor'), |
|
151 | + _t('Distributor.SINGULAR_NAME', 'Distributor'), |
|
152 | 152 | array(''=> '--- Please select ---') + Distributor::get()->map()->toArray() |
153 | 153 | ) |
154 | 154 | ); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | if ($order->IsSubmitted()) { |
63 | 63 | return true; |
64 | 64 | } |
65 | - if (! $countryCode) { |
|
65 | + if (!$countryCode) { |
|
66 | 66 | $countryCode = $order->getCountry(); |
67 | 67 | } |
68 | 68 | $currencyObject = CountryPrice_EcommerceCurrency::get_currency_for_country($countryCode); |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | //check if the billing and shipping address have a country so that they will not be overridden by previous Orders |
77 | 77 | //we do this to make sure that the previous address can not change the region and thereby destroy the order in the cart |
78 | 78 | if ($billingAddress = $order->CreateOrReturnExistingAddress('BillingAddress')) { |
79 | - if (! $billingAddress->Country || $force) { |
|
79 | + if (!$billingAddress->Country || $force) { |
|
80 | 80 | $billingAddress->Country = $countryCode; |
81 | 81 | $billingAddress->write(); |
82 | 82 | } |
83 | 83 | } |
84 | 84 | if ($shippingAddress = $order->CreateOrReturnExistingAddress('ShippingAddress')) { |
85 | - if (! $shippingAddress->ShippingCountry || $force) { |
|
85 | + if (!$shippingAddress->ShippingCountry || $force) { |
|
86 | 86 | $shippingAddress->ShippingCountry = $countryCode; |
87 | 87 | $shippingAddress->write(); |
88 | 88 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | //if a country code and currency has been set then all is good |
92 | 92 | //from there we keep it this way |
93 | 93 | if ( |
94 | - $order->OriginatingCountryCode == $countryCode && |
|
94 | + $order->OriginatingCountryCode == $countryCode && |
|
95 | 95 | $order->CurrencyUsedID == $currencyObject->ID |
96 | 96 | ) { |
97 | 97 | return true; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | if ($items) { |
114 | 114 | foreach ($items as $item) { |
115 | 115 | $buyable = $item->Buyable(true); |
116 | - if (! $buyable->canPurchase()) { |
|
116 | + if (!$buyable->canPurchase()) { |
|
117 | 117 | $item->delete(); |
118 | 118 | } |
119 | 119 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | */ |
161 | 161 | public function onAfterWrite() |
162 | 162 | { |
163 | - if (! $this->owner->DistributorID) { |
|
163 | + if (!$this->owner->DistributorID) { |
|
164 | 164 | if ($defaultDistributor = Distributor::get_default_distributor()) { |
165 | 165 | if ($defaultDistributor->exists()) { |
166 | 166 | if ($defaultDistributor->ID) { |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | public function canEdit($member = null) |
181 | 181 | { |
182 | - if (! $member) { |
|
182 | + if (!$member) { |
|
183 | 183 | $member = Member::currentUser(); |
184 | 184 | } |
185 | 185 | if ($member) { |
@@ -102,6 +102,9 @@ |
||
102 | 102 | return []; |
103 | 103 | } |
104 | 104 | |
105 | + /** |
|
106 | + * @param string $action |
|
107 | + */ |
|
105 | 108 | public function Link($action = null) |
106 | 109 | { |
107 | 110 | $link = Controller::join_links( |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | //redirect now |
90 | 90 | if (isset($_GET['force']) && $_GET['force']) { |
91 | - return $this->redirect($this->Link($newCountryCode) . '?force-back-home'); |
|
91 | + return $this->redirect($this->Link($newCountryCode).'?force-back-home'); |
|
92 | 92 | } |
93 | 93 | if (isset($_GET['force-back-home']) && $_GET['force-back-home']) { |
94 | 94 | return $this->redirect(Director::baseURL('/')); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $action |
110 | 110 | ); |
111 | 111 | |
112 | - return $link . '/'; |
|
112 | + return $link.'/'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -163,10 +163,10 @@ discard block |
||
163 | 163 | |
164 | 164 | $path = isset($parsedUrl['path']) ? $parsedUrl['path'] : ''; |
165 | 165 | |
166 | - $query = !empty($query) ? '?'. http_build_query($query) : ''; |
|
166 | + $query = !empty($query) ? '?'.http_build_query($query) : ''; |
|
167 | 167 | $newURL = |
168 | - $parsedUrl['scheme'] . |
|
169 | - '://' . |
|
168 | + $parsedUrl['scheme']. |
|
169 | + '://'. |
|
170 | 170 | Controller::join_links( |
171 | 171 | $parsedUrl['host'], |
172 | 172 | $parsedUrl['path'] |
@@ -88,7 +88,7 @@ discard block |
||
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 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $originalCountry = $country; |
211 | 211 | |
212 | 212 | //no country provided |
213 | - if (! $country) { |
|
213 | + if (!$country) { |
|
214 | 214 | $urlCountryCode = CountryPrice_Translation::get_country_url_provider()->CurrentCountrySegment(); |
215 | 215 | |
216 | 216 | // 2. CHECK WHAT THE SYSTEM THINKS THE COUNTRY CHOULD BE |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } |
226 | 226 | |
227 | 227 | //if we still dont have a country then we use the standard e-commerce methods ... |
228 | - if (! $countryCode) { |
|
228 | + if (!$countryCode) { |
|
229 | 229 | $countryCode = EcommerceCountry::get_country(); |
230 | 230 | } |
231 | 231 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | if ( |
245 | 245 | ($country && $country->Code !== $urlCountryCode) |
246 | 246 | || |
247 | - ! $country |
|
247 | + !$country |
|
248 | 248 | |
249 | 249 | ) { |
250 | 250 | $country = DataObject::get_one('EcommerceCountry', ['Code' => $urlCountryCode]); |
@@ -314,9 +314,9 @@ discard block |
||
314 | 314 | public static function get_backup_country() |
315 | 315 | { |
316 | 316 | $obj = EcommerceCountry::get()->filter(array("IsBackupCountry" => true))->first(); |
317 | - if (! $obj) { |
|
317 | + if (!$obj) { |
|
318 | 318 | $obj = EcommerceCountry::get()->filter(array("Code" => EcommerceConfig::get('EcommerceCountry', 'default_country_code')))->first(); |
319 | - if (! $obj) { |
|
319 | + if (!$obj) { |
|
320 | 320 | $obj = EcommerceCountry::get()->first(); |
321 | 321 | } |
322 | 322 | } |
@@ -77,14 +77,14 @@ |
||
77 | 77 | } |
78 | 78 | $parsedUrl['path'] = implode('/', $pathParts); |
79 | 79 | $newURL = |
80 | - $parsedUrl['scheme'] . |
|
81 | - '://' . |
|
80 | + $parsedUrl['scheme']. |
|
81 | + '://'. |
|
82 | 82 | Controller::join_links( |
83 | 83 | $parsedUrl['host'], |
84 | 84 | $parsedUrl['path'] |
85 | 85 | ); |
86 | 86 | if (isset($parsedUrl['query'])) { |
87 | - $newURL = $newURL . '?' . $parsedUrl['query']; |
|
87 | + $newURL = $newURL.'?'.$parsedUrl['query']; |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | if ($oldURL !== $newURL) { |