@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | return null; |
224 | 224 | } |
225 | 225 | $key = $this->owner->ClassName."___".$this->owner->ID.'____'.$countryCode; |
226 | - if (! isset(self::$_buyable_price[$key])) { |
|
226 | + if (!isset(self::$_buyable_price[$key])) { |
|
227 | 227 | //basics |
228 | 228 | $currency = null; |
229 | 229 | $currencyCode = null; |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | } |
312 | 312 | } |
313 | 313 | //order must have a country and a currency |
314 | - if (! $currencyCode || ! $countryCode) { |
|
314 | + if (!$currencyCode || !$countryCode) { |
|
315 | 315 | if ($this->debug) { |
316 | 316 | debug::log('No currency ('.$currencyCode.') or no country code ('.$countryCode.') for order: '); |
317 | 317 | } |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | */ |
409 | 409 | public function canEdit($member = null) |
410 | 410 | { |
411 | - if (! $member) { |
|
411 | + if (!$member) { |
|
412 | 412 | $member = Member::currentUser(); |
413 | 413 | } |
414 | 414 | if ($member) { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function loadTranslatedValues($countryID = 0, $variableOrMethod = '') |
57 | 57 | { |
58 | 58 | $translation = null; |
59 | - if (! $countryID) { |
|
59 | + if (!$countryID) { |
|
60 | 60 | $countryObject = CountryPrice_EcommerceCountry::get_real_country(); |
61 | 61 | if ($countryObject) { |
62 | 62 | $countryID = $countryObject->ID; |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | $fieldsToReplace = $translation->FieldsToReplace(); |
76 | 76 | foreach ($fieldsToReplace as $replaceFields) { |
77 | 77 | $pageField = $replaceFields->PageField; |
78 | - $pageFieldTranslated = $pageField . 'Translated'; |
|
78 | + $pageFieldTranslated = $pageField.'Translated'; |
|
79 | 79 | $translationField = $replaceFields->TranslationField; |
80 | - if (! $variableOrMethod || $variableOrMethod === $pageField) { |
|
80 | + if (!$variableOrMethod || $variableOrMethod === $pageField) { |
|
81 | 81 | if ($translation->hasMethod($translationField)) { |
82 | 82 | $this->owner->$pageField = $translation->$translationField(); |
83 | 83 | $this->owner->$pageFieldTranslated = $translation->$translationField(); |
@@ -3,14 +3,17 @@ |
||
3 | 3 | interface CountryURLProviderInterface |
4 | 4 | { |
5 | 5 | /** |
6 | + * @return boolean |
|
6 | 7 | */ |
7 | 8 | public function hasCountrySegment($url = ''); |
8 | 9 | |
9 | 10 | /** |
11 | + * @return string |
|
10 | 12 | */ |
11 | 13 | public function replaceCountryCodeInUrl($countryCode, $url = ''); |
12 | 14 | |
13 | 15 | /** |
16 | + * @return string |
|
14 | 17 | */ |
15 | 18 | public function addCountryCodeToUrl($countryCode, $url = ''); |
16 | 19 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $countryDropdownField = DropdownField::create( |
99 | 99 | 'EcommerceCountryID', |
100 | 100 | $fields->dataFieldByName('EcommerceCountryID')->Title(), |
101 | - array('' => '-- make sure to select a country --')+$countries |
|
101 | + array('' => '-- make sure to select a country --') + $countries |
|
102 | 102 | ); |
103 | 103 | |
104 | 104 | // //$fields->removeFieldFromTab("Root.Main", 'ParentID'); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | ); |
132 | 132 | } |
133 | 133 | if ($fields->dataFieldByName($useField)) { |
134 | - $fields->dataFieldByName($useField)->setDescription(_t('CountryPrice_Translation.IGNORE', 'Use untranslated value for ') . $dbField); |
|
134 | + $fields->dataFieldByName($useField)->setDescription(_t('CountryPrice_Translation.IGNORE', 'Use untranslated value for ').$dbField); |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 | if ($this->exists() && $this->ParentID) { |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | ); |
211 | 211 | $this->extend('updateFieldsToReplace', $al); |
212 | 212 | foreach ($al as $fieldToReplace) { |
213 | - $ignoreField = 'UseOriginal' . $fieldToReplace->PageField; |
|
213 | + $ignoreField = 'UseOriginal'.$fieldToReplace->PageField; |
|
214 | 214 | if (!empty($this->owner->$ignoreField)) { |
215 | 215 | $al->remove($fieldToReplace); |
216 | 216 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | 'ParentID' => $buyable->ID |
262 | 262 | ); |
263 | 263 | $ecommerceCountries[$countryObject->ID] = $countryObject; |
264 | - if (! CountryPrice_Translation::get()->filter($filter)->first()) { |
|
264 | + if (!CountryPrice_Translation::get()->filter($filter)->first()) { |
|
265 | 265 | DB::alteration_message( |
266 | 266 | 'Creating fake translation for '.$buyable->Title.' for country '.$countryObject->Code, |
267 | 267 | 'created' |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | 'EcommerceCountryID' => $countryObject->ID, |
283 | 283 | 'ParentID' => $productGroup->ID |
284 | 284 | ); |
285 | - if (! CountryPrice_Translation::get()->filter($filter)->first()) { |
|
285 | + if (!CountryPrice_Translation::get()->filter($filter)->first()) { |
|
286 | 286 | DB::alteration_message( |
287 | 287 | 'Creating fake translation for '.$productGroup->Title.' for country '.$countryObject->Code, |
288 | 288 | 'created' |
@@ -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) { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function Buyable() |
67 | 67 | { |
68 | - if (! $this->_myBuyable) { |
|
68 | + if (!$this->_myBuyable) { |
|
69 | 69 | $className = $this->ObjectClass; |
70 | 70 | if (class_exists($this->ObjectClass)) { |
71 | 71 | $this->_myBuyable = $className::get()->byID($this->ObjectID); |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function CountryObject() |
89 | 89 | { |
90 | - if (! $this->_myCountryObject) { |
|
90 | + if (!$this->_myCountryObject) { |
|
91 | 91 | if ($this->Country) { |
92 | - $this->_myCountryObject = EcommerceCountry::get() |
|
92 | + $this->_myCountryObject = EcommerceCountry::get() |
|
93 | 93 | ->filter(array("Code" => $this->Country)) |
94 | 94 | ->First(); |
95 | 95 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function getFullPrice() |
148 | 148 | { |
149 | - return "$this->Price $this->Currency" . ($this->isObsolete() ? ' (obsolete!)' : ''); |
|
149 | + return "$this->Price $this->Currency".($this->isObsolete() ? ' (obsolete!)' : ''); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | public function getCMSFields() |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | public function canEdit($member = null) |
219 | 219 | { |
220 | 220 | $canEdit = parent::canEdit(); |
221 | - if (! $canEdit) { |
|
221 | + if (!$canEdit) { |
|
222 | 222 | $member = Member::currentUser(); |
223 | 223 | $distributor = $member->Distributor(); |
224 | 224 | if ($distributor->exists()) { |
@@ -236,16 +236,16 @@ discard block |
||
236 | 236 | protected function validate() |
237 | 237 | { |
238 | 238 | $result = parent::validate(); |
239 | - if (! $this->ObjectClass && isset($_REQUEST["MyObjectClass"])) { |
|
239 | + if (!$this->ObjectClass && isset($_REQUEST["MyObjectClass"])) { |
|
240 | 240 | if (class_exists($_REQUEST["MyObjectClass"])) { |
241 | 241 | $this->ObjectClass = Convert::raw2sql($_REQUEST["MyObjectClass"]); |
242 | 242 | } |
243 | 243 | } |
244 | - if (! $this->ObjectID && isset($_REQUEST["MyObjectID"])) { |
|
244 | + if (!$this->ObjectID && isset($_REQUEST["MyObjectID"])) { |
|
245 | 245 | $this->ObjectID = intval($_REQUEST["MyObjectID"]); |
246 | 246 | } |
247 | 247 | //check for duplicates in case it has not been created yet... |
248 | - if (! $this->ObjectClass || ! $this->ObjectID) { |
|
248 | + if (!$this->ObjectClass || !$this->ObjectID) { |
|
249 | 249 | $result->error('Object could not be created. Please contact your developer.'); |
250 | 250 | return $result; |
251 | 251 | } |
@@ -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 | $param = Config::inst()->get('CountryPrice_Translation', 'locale_get_parameter'); |
215 | 215 | |
216 | 216 | // 1. CHECK FROM URL |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | } |
232 | 232 | |
233 | 233 | //if we still dont have a country then we use the standard e-commerce methods ... |
234 | - if (! $countryCode) { |
|
234 | + if (!$countryCode) { |
|
235 | 235 | $countryCode = EcommerceCountry::get_country(); |
236 | 236 | } |
237 | 237 | |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | if ( |
251 | 251 | ($country && $country->Code !== $urlCountryCode) |
252 | 252 | || |
253 | - ! $country |
|
253 | + !$country |
|
254 | 254 | |
255 | 255 | ) { |
256 | 256 | $country = DataObject::get_one('EcommerceCountry', ['Code' => $urlCountryCode]); |
@@ -321,9 +321,9 @@ discard block |
||
321 | 321 | public static function get_backup_country() |
322 | 322 | { |
323 | 323 | $obj = EcommerceCountry::get()->filter(array("IsBackupCountry" => true))->first(); |
324 | - if (! $obj) { |
|
324 | + if (!$obj) { |
|
325 | 325 | $obj = EcommerceCountry::get()->filter(array("Code" => EcommerceConfig::get('EcommerceCountry', 'default_country_code')))->first(); |
326 | - if (! $obj) { |
|
326 | + if (!$obj) { |
|
327 | 327 | $obj = EcommerceCountry::get()->first(); |
328 | 328 | } |
329 | 329 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | class CountryURLProvider extends Object implements CountryURLProviderInterface |
12 | 12 | { |
13 | - private static $country_segments = array('nz', 'au', 'gb', 'eu', 'jp', 'us', 'zz'); |
|
13 | + private static $country_segments = array('nz', 'au', 'gb', 'eu', 'jp', 'us', 'zz'); |
|
14 | 14 | |
15 | 15 | public function hasCountrySegment($url = '') |
16 | 16 | { |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $parsedUrl = parse_url($url); |
19 | 19 | $pathSegments = explode("/", $parsedUrl['path']); |
20 | 20 | $firstSegment = ''; |
21 | - $countries = Config::inst()->get('CountryURLProvider', 'country_segments'); |
|
21 | + $countries = Config::inst()->get('CountryURLProvider', 'country_segments'); |
|
22 | 22 | foreach ($pathSegments as $position => $segment) { |
23 | 23 | if ($segment) { |
24 | 24 | $firstSegment = $segment; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $url = $this->getDefaultURL($url); |
37 | 37 | $parsedUrl = parse_url($url); |
38 | 38 | $pathParts = explode('/', $parsedUrl['path']); |
39 | - $countries = Config::inst()->get('CountryURLProvider', 'country_segments'); |
|
39 | + $countries = Config::inst()->get('CountryURLProvider', 'country_segments'); |
|
40 | 40 | foreach ($pathParts as $pathPartsKey => $pathPart) { |
41 | 41 | //check for first match |
42 | 42 | if (in_array($pathPart, $countries)) { |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | } |
46 | 46 | } |
47 | 47 | $parsedUrl['path'] = implode('/', $pathParts); |
48 | - $url = $parsedUrl['scheme']. '://'. $parsedUrl['host']. $parsedUrl['path']; |
|
48 | + $url = $parsedUrl['scheme'].'://'.$parsedUrl['host'].$parsedUrl['path']; |
|
49 | 49 | if (isset($parsedUrl['query'])) { |
50 | - $url = $url . $parsedUrl['query']; |
|
50 | + $url = $url.$parsedUrl['query']; |
|
51 | 51 | } |
52 | 52 | return $url; |
53 | 53 | } |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | { |
57 | 57 | $url = $this->getDefaultURL($url); |
58 | 58 | $parsedUrl = parse_url($url); |
59 | - $url = $parsedUrl['scheme']. '://'. $parsedUrl['host']. '/'. strtolower($countryCode) . $parsedUrl['path']; |
|
59 | + $url = $parsedUrl['scheme'].'://'.$parsedUrl['host'].'/'.strtolower($countryCode).$parsedUrl['path']; |
|
60 | 60 | if (isset($parsedUrl['query'])) { |
61 | - $url = $url . $parsedUrl['query']; |
|
61 | + $url = $url.$parsedUrl['query']; |
|
62 | 62 | } |
63 | 63 | return $url; |
64 | 64 | } |
@@ -68,6 +68,6 @@ discard block |
||
68 | 68 | if ($url) { |
69 | 69 | return Director::absoluteURL($url); |
70 | 70 | } |
71 | - return (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; |
|
71 | + return (isset($_SERVER['HTTPS']) ? "https" : "http")."://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; |
|
72 | 72 | } |
73 | 73 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | return $this->redirect(CountryPrices_ChangeCountryController::new_country_link($distributorPrimaryCountryCode)); |
70 | 70 | } |
71 | 71 | } else { |
72 | - die("ERROR: No primary country has been set for this ". _t('Distributor.SINGULAR_NAME', 'Distributor') ."."); |
|
72 | + die("ERROR: No primary country has been set for this "._t('Distributor.SINGULAR_NAME', 'Distributor')."."); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | if ($countries && $countries->count()) { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | } |
78 | 78 | } |
79 | 79 | if (!$canViewAndEdit) { |
80 | - Security::permissionFailure($this, 'Please log in first or log in as a '. _t('Distributor.SINGULAR_NAME', 'Distributor'). '.'); |
|
80 | + Security::permissionFailure($this, 'Please log in first or log in as a '._t('Distributor.SINGULAR_NAME', 'Distributor').'.'); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $fields['Price'] = 'Price'; |
107 | 107 | |
108 | 108 | foreach ($fields as $field) { |
109 | - if (! isset($_REQUEST[$field])) { |
|
109 | + if (!isset($_REQUEST[$field])) { |
|
110 | 110 | return "$field value missing"; |
111 | 111 | } |
112 | 112 | } |
@@ -121,13 +121,13 @@ discard block |
||
121 | 121 | $valid = true; |
122 | 122 | } |
123 | 123 | } |
124 | - if (! $valid) { |
|
124 | + if (!$valid) { |
|
125 | 125 | return 'ObjectClass value incorrect'; |
126 | 126 | } |
127 | 127 | |
128 | 128 | $objectID = intval($_REQUEST['ObjectID']); |
129 | 129 | $object = $objectClass::get()->byID($objectID); |
130 | - if (! $object) { |
|
130 | + if (!$object) { |
|
131 | 131 | return 'ObjectID value incorrect'; |
132 | 132 | } |
133 | 133 | |
@@ -143,12 +143,12 @@ discard block |
||
143 | 143 | $valid = true; |
144 | 144 | if ($this->distributor) { |
145 | 145 | $countries = $this->distributor->Countries()->map('Code', 'Code')->toArray(); |
146 | - if (! in_array($countryCode, $countries)) { |
|
146 | + if (!in_array($countryCode, $countries)) { |
|
147 | 147 | $valid = false; |
148 | 148 | } |
149 | 149 | } |
150 | 150 | } |
151 | - if (! $valid) { |
|
151 | + if (!$valid) { |
|
152 | 152 | return 'Country value incorrect'; |
153 | 153 | } |
154 | 154 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | $price = $_REQUEST['Price']; |
161 | - if (! is_numeric($price)) { |
|
161 | + if (!is_numeric($price)) { |
|
162 | 162 | return 'Price value incorrect'; |
163 | 163 | } |
164 | 164 | |
@@ -179,13 +179,13 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public function setobjectfield() |
181 | 181 | { |
182 | - if (isset($_REQUEST["F"]) && $_REQUEST["F"]== "TESTONLY") { |
|
182 | + if (isset($_REQUEST["F"]) && $_REQUEST["F"] == "TESTONLY") { |
|
183 | 183 | return "THIS IS FOR TESTING ONLY"; |
184 | 184 | } |
185 | 185 | // 1) Check that all parameters have been specified |
186 | 186 | |
187 | 187 | foreach (array('T', 'I', 'F', 'V') as $field) { |
188 | - if (! isset($_REQUEST[$field])) { |
|
188 | + if (!isset($_REQUEST[$field])) { |
|
189 | 189 | return "$field value missing"; |
190 | 190 | } |
191 | 191 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $result = 1; // Updated |
196 | 196 | |
197 | 197 | $objectClass = $_REQUEST['T']; |
198 | - if (! class_exists($objectClass)) { |
|
198 | + if (!class_exists($objectClass)) { |
|
199 | 199 | return 'ObjectClass value incorrect'; |
200 | 200 | } |
201 | 201 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | } elseif (intval($objectID)) { |
208 | 208 | $objectID = intval($objectID); |
209 | 209 | $object = $objectClass::get()->byID($objectID); |
210 | - if (! $object) { |
|
210 | + if (!$object) { |
|
211 | 211 | return 'ObjectID (ID: $objectID, Class Name: $objectClass) value incorrect'; |
212 | 212 | } |
213 | 213 | } else { |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $fieldName = Convert::raw2sql($_REQUEST['F']); |
222 | 222 | $value = $_REQUEST['V']; |
223 | 223 | |
224 | - if ($fieldName == 'Price' && (! is_numeric($value) || $value < 0)) { |
|
224 | + if ($fieldName == 'Price' && (!is_numeric($value) || $value < 0)) { |
|
225 | 225 | return 'Price value incorrect'; |
226 | 226 | } |
227 | 227 | if ($value == '0') { |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | } |
334 | 334 | if (Permission::check("ADMIN")) { |
335 | 335 | $html .= $this->createEditNode( |
336 | - "Default " . _t('Distributor.SINGULAR_NAME', 'Distributor'), |
|
336 | + "Default "._t('Distributor.SINGULAR_NAME', 'Distributor'), |
|
337 | 337 | $distributor->IsDefault ? "YES" : "NO" |
338 | 338 | ); |
339 | 339 | } |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $countryList = array(); |
343 | 343 | $countries = $distributor->Countries(); |
344 | 344 | foreach ($countries as $country) { |
345 | - $countryList[] = $country->Name . ($country->DoNotAllowSales ? ' (Sales not allowed)' : ''); |
|
345 | + $countryList[] = $country->Name.($country->DoNotAllowSales ? ' (Sales not allowed)' : ''); |
|
346 | 346 | } |
347 | 347 | $html .= $this->createEditNode( |
348 | 348 | 'Countries', |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | $data = array('T' => 'EcommerceCountry', 'I' => $country->ID); |
425 | 425 | $distributorName = $country->Distributor()->Name; |
426 | 426 | if (!$distributorName) { |
427 | - $distributorName = "<p class=\"message bad\">No ". _t('Distributor.SINGULAR_NAME', 'Distributor') ." has been assigned to this country.</p>"; |
|
427 | + $distributorName = "<p class=\"message bad\">No "._t('Distributor.SINGULAR_NAME', 'Distributor')." has been assigned to this country.</p>"; |
|
428 | 428 | } |
429 | 429 | $html .= $this->createTreeNode($country->Code." - ".$country->Name, $country->Code, array($country)); |
430 | 430 | $distributorTitlePlural = _t('Distributor.PLURAL_NAME', 'Distributor'); |
@@ -441,15 +441,15 @@ discard block |
||
441 | 441 | $html .= $this->closeTreeNode(); |
442 | 442 | } |
443 | 443 | } |
444 | - $countries = EcommerceCountry::get()->filter(array("DistributorID" => 0, "DoNotAllowSales" => 0)); |
|
444 | + $countries = EcommerceCountry::get()->filter(array("DistributorID" => 0, "DoNotAllowSales" => 0)); |
|
445 | 445 | if ($countries && $countries->count()) { |
446 | 446 | $list = implode(", ", $countries->map("ID", "Code")->toArray()); |
447 | - $html .= $this->createEditNode("Countries without a ". _t('Distributor.SINGULAR_NAME', 'Distributor') ." that allow sales", $list); |
|
447 | + $html .= $this->createEditNode("Countries without a "._t('Distributor.SINGULAR_NAME', 'Distributor')." that allow sales", $list); |
|
448 | 448 | } |
449 | - $countries = EcommerceCountry::get()->filter(array("DistributorID" => 0, "DoNotAllowSales" => 1)); |
|
449 | + $countries = EcommerceCountry::get()->filter(array("DistributorID" => 0, "DoNotAllowSales" => 1)); |
|
450 | 450 | if ($countries && $countries->count()) { |
451 | 451 | $list = implode(", ", $countries->map("ID", "Code")->toArray()); |
452 | - $html .= $this->createEditNode("Countries without a ". _t('Distributor.SINGULAR_NAME', 'Distributor') ." that do not allow sales", $list); |
|
452 | + $html .= $this->createEditNode("Countries without a "._t('Distributor.SINGULAR_NAME', 'Distributor')." that do not allow sales", $list); |
|
453 | 453 | } |
454 | 454 | return $html; |
455 | 455 | } |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | $defaultPriceText = ' (N.B. This is default for new variations ONLY - set actual prices under variations)'; |
471 | 471 | if ($products && $products->count()) { |
472 | 472 | foreach ($products as $product) { |
473 | - $withDefaultPrices = Permission::check('ADMIN') || (! $product->hasVariations()); |
|
473 | + $withDefaultPrices = Permission::check('ADMIN') || (!$product->hasVariations()); |
|
474 | 474 | $html .= $this->createTreeNode($product->FullName, "pricing", array($product)); |
475 | 475 | |
476 | 476 | //country exceptions |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | //only show default price for ShopAdmin |
493 | 493 | if ($withDefaultPrices) { |
494 | 494 | $html .= $this->createEditNode( |
495 | - 'Default Price' . ($product->hasVariations() ? $defaultPriceText : ''), |
|
495 | + 'Default Price'.($product->hasVariations() ? $defaultPriceText : ''), |
|
496 | 496 | EcommercePayment::site_currency(), |
497 | 497 | $product->Price, |
498 | 498 | array( |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | $outstandingCountries = $this->countryArray; |
509 | 509 | if ($withDefaultPrices) { |
510 | 510 | $html .= $this->createTreeNode( |
511 | - 'Country Prices' . ($product->hasVariations() ? $defaultPriceText : ''), |
|
511 | + 'Country Prices'.($product->hasVariations() ? $defaultPriceText : ''), |
|
512 | 512 | " pricing countryPrices" |
513 | 513 | ); |
514 | 514 | } |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | $countryName = EcommerceCountry::find_title($countryPricesObject->Country); |
533 | 533 | if ($withDefaultPrices) { |
534 | 534 | $html .= $this->createEditNode( |
535 | - $countryPricesObject->Country . ' - '. $countryName, |
|
535 | + $countryPricesObject->Country.' - '.$countryName, |
|
536 | 536 | $countryPricesObject->Currency, |
537 | 537 | $countryPricesObject->Price, |
538 | 538 | $data, |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | $countryName = EcommerceCountry::find_title($countryCode); |
567 | 567 | if ($withDefaultPrices) { |
568 | 568 | $html .= $this->createEditNode( |
569 | - $countryCode . ' - '. $countryName, |
|
569 | + $countryCode.' - '.$countryName, |
|
570 | 570 | $currencyObject->Code, |
571 | 571 | $addText, |
572 | 572 | $data, |
@@ -619,8 +619,8 @@ discard block |
||
619 | 619 | "F" => "Price" |
620 | 620 | ); |
621 | 621 | $countryName = EcommerceCountry::find_title($countryPricesObject->Country); |
622 | - $html .= $this->createEditNode( |
|
623 | - $countryPricesObject->Country . ' - '. $countryName, |
|
622 | + $html .= $this->createEditNode( |
|
623 | + $countryPricesObject->Country.' - '.$countryName, |
|
624 | 624 | $countryPricesObject->Currency, |
625 | 625 | $countryPricesObject->Price, |
626 | 626 | $data, |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | ); |
667 | 667 | $countryName = EcommerceCountry::find_title($countryCode); |
668 | 668 | $html .= $this->createEditNode( |
669 | - $countryCode . ' - '. $countryName, |
|
669 | + $countryCode.' - '.$countryName, |
|
670 | 670 | $currency->Code, |
671 | 671 | $addText, |
672 | 672 | $data, |