@@ -119,12 +119,13 @@ |
||
119 | 119 | return false; |
120 | 120 | } |
121 | 121 | } |
122 | - } |
|
123 | - elseif( ( $addresses = $basket->getAddress( $paymentType ) ) !== [] ) // use billing address if no delivery address is available |
|
122 | + } elseif( ( $addresses = $basket->getAddress( $paymentType ) ) !== [] ) { |
|
123 | + // use billing address if no delivery address is available |
|
124 | 124 | { |
125 | 125 | foreach( $addresses as $address ) |
126 | 126 | { |
127 | 127 | $code = $address->getPostal(); |
128 | + } |
|
128 | 129 | |
129 | 130 | if( $this->checkPostalCode( $code, 'postal.delivery-include' ) === false |
130 | 131 | || $this->checkPostalCode( $code, 'postal.delivery-exclude' ) === true |
@@ -119,12 +119,13 @@ |
||
119 | 119 | return false; |
120 | 120 | } |
121 | 121 | } |
122 | - } |
|
123 | - elseif( ( $addresses = $basket->getAddress( $paymentType ) ) !== [] ) // use billing address if no delivery address is available |
|
122 | + } elseif( ( $addresses = $basket->getAddress( $paymentType ) ) !== [] ) { |
|
123 | + // use billing address if no delivery address is available |
|
124 | 124 | { |
125 | 125 | foreach( $addresses as $address ) |
126 | 126 | { |
127 | 127 | $code = strtoupper( $address->getCountryId() ); |
128 | + } |
|
128 | 129 | |
129 | 130 | if( $this->checkCountryCode( $code, 'country.delivery-include' ) === false |
130 | 131 | || $this->checkCountryCode( $code, 'country.delivery-exclude' ) === true |
@@ -77,8 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | public function testRegisterItemFilter() |
79 | 79 | { |
80 | - $callback = function( \Aimeos\MShop\Common\Item\ListRef\Iface $item, $index ) |
|
81 | - { |
|
80 | + $callback = function( \Aimeos\MShop\Common\Item\ListRef\Iface $item, $index ) { |
|
82 | 81 | return true; |
83 | 82 | }; |
84 | 83 | |
@@ -290,8 +289,7 @@ discard block |
||
290 | 289 | { |
291 | 290 | $this->assertEquals( 2, count( $this->object->getTree()->getChildren() ) ); |
292 | 291 | |
293 | - $callback = function( \Aimeos\MShop\Common\Item\ListRef\Iface $item, $index ) |
|
294 | - { |
|
292 | + $callback = function( \Aimeos\MShop\Common\Item\ListRef\Iface $item, $index ) { |
|
295 | 293 | return (bool) $index % 2; |
296 | 294 | }; |
297 | 295 |
@@ -53,8 +53,7 @@ discard block |
||
53 | 53 | foreach( $value as $key => $product ) { |
54 | 54 | $value[$key] = $this->updatePrice( $product ); |
55 | 55 | } |
56 | - } |
|
57 | - else |
|
56 | + } else |
|
58 | 57 | { |
59 | 58 | $value = $this->updatePrice( $value ); |
60 | 59 | } |
@@ -130,8 +129,7 @@ discard block |
||
130 | 129 | { |
131 | 130 | $priceManager = \Aimeos\MShop::create( $this->getContext(), 'price' ); |
132 | 131 | |
133 | - $sortFcn = function( $a, $b ) use( $priceManager, $attrQtys ) |
|
134 | - { |
|
132 | + $sortFcn = function( $a, $b ) use( $priceManager, $attrQtys ) { |
|
135 | 133 | if( ( $pricesA = $a->getRefItems( 'price', 'default', 'default' ) ) === [] ) { |
136 | 134 | return 1; |
137 | 135 | } |
@@ -194,8 +192,7 @@ discard block |
||
194 | 192 | { |
195 | 193 | $list = $this->sortByPrice( $list, $attrQtys ); |
196 | 194 | $priceItem = $this->addPrices( $priceItem, $list, $attrQtys, (int) $prodConf[$type] ); |
197 | - } |
|
198 | - else |
|
195 | + } else |
|
199 | 196 | { |
200 | 197 | $priceItem = $this->addPrices( $priceItem, $list, $attrQtys, 0 ); |
201 | 198 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | 'table' => array( |
18 | 18 | |
19 | - 'mshop_order_base' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
19 | + 'mshop_order_base' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
20 | 20 | |
21 | 21 | $table = $schema->createTable( 'mshop_order_base' ); |
22 | 22 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $table->addColumn( 'status', 'smallint', [] ); |
36 | 36 | $table->addColumn( 'mtime', 'datetime', [] ); |
37 | 37 | $table->addColumn( 'ctime', 'datetime', [] ); |
38 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
38 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
39 | 39 | |
40 | 40 | $table->setPrimaryKey( array( 'id' ), 'pk_msordba_id' ); |
41 | 41 | $table->addIndex( array( 'sitecode', 'customerid' ), 'idx_msordba_scode_custid' ); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | return $schema; |
46 | 46 | }, |
47 | 47 | |
48 | - 'mshop_order_base_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
48 | + 'mshop_order_base_address' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
49 | 49 | |
50 | 50 | $table = $schema->createTable( 'mshop_order_base_address' ); |
51 | 51 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
77 | 77 | $table->addColumn( 'mtime', 'datetime', [] ); |
78 | 78 | $table->addColumn( 'ctime', 'datetime', [] ); |
79 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
79 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
80 | 80 | |
81 | 81 | $table->setPrimaryKey( array( 'id' ), 'pk_msordbaad_id' ); |
82 | 82 | $table->addUniqueIndex( array( 'baseid', 'type' ), 'unq_msordbaad_bid_type' ); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | return $schema; |
95 | 95 | }, |
96 | 96 | |
97 | - 'mshop_order_base_product' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
97 | + 'mshop_order_base_product' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
98 | 98 | |
99 | 99 | $table = $schema->createTable( 'mshop_order_base_product' ); |
100 | 100 | |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | $table->addColumn( 'ordaddrid', 'bigint', array( 'notnull' => false ) ); |
106 | 106 | $table->addColumn( 'type', 'string', array( 'length' => 32 ) ); |
107 | 107 | $table->addColumn( 'prodid', 'string', array( 'length' => 32 ) ); |
108 | - $table->addColumn( 'prodcode', 'string', array( 'length' => 32 ) ); |
|
109 | - $table->addColumn( 'suppliercode', 'string', array( 'length' => 32 ) ); |
|
108 | + $table->addColumn( 'prodcode', 'string', array( 'length' => 32 ) ); |
|
109 | + $table->addColumn( 'suppliercode', 'string', array( 'length' => 32 ) ); |
|
110 | 110 | $table->addColumn( 'stocktype', 'string', array( 'length' => 32 ) ); |
111 | 111 | $table->addColumn( 'name', 'text', array( 'length' => 0xffff ) ); |
112 | 112 | $table->addColumn( 'mediaurl', 'string', array( 'length' => 255 ) ); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $table->addColumn( 'status', 'smallint', array( 'default' => -1 ) ); |
125 | 125 | $table->addColumn( 'mtime', 'datetime', [] ); |
126 | 126 | $table->addColumn( 'ctime', 'datetime', [] ); |
127 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
127 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
128 | 128 | |
129 | 129 | $table->setPrimaryKey( array( 'id' ), 'pk_msordbapr_id' ); |
130 | 130 | $table->addUniqueIndex( array( 'baseid', 'pos' ), 'unq_msordbapr_bid_pos' ); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | return $schema; |
139 | 139 | }, |
140 | 140 | |
141 | - 'mshop_order_base_product_attr' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
141 | + 'mshop_order_base_product_attr' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
142 | 142 | |
143 | 143 | $table = $schema->createTable( 'mshop_order_base_product_attr' ); |
144 | 144 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $table->addColumn( 'quantity', 'integer', [] ); |
154 | 154 | $table->addColumn( 'mtime', 'datetime', [] ); |
155 | 155 | $table->addColumn( 'ctime', 'datetime', [] ); |
156 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
156 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
157 | 157 | |
158 | 158 | $table->setPrimaryKey( array( 'id' ), 'pk_msordbaprat_id' ); |
159 | 159 | $table->addUniqueIndex( array( 'ordprodid', 'attrid', 'type', 'code' ), 'unq_msordbaprat_oid_aid_ty_cd' ); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | return $schema; |
166 | 166 | }, |
167 | 167 | |
168 | - 'mshop_order_base_service' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
168 | + 'mshop_order_base_service' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
169 | 169 | |
170 | 170 | $table = $schema->createTable( 'mshop_order_base_service' ); |
171 | 171 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $table->addColumn( 'taxflag', 'smallint', [] ); |
187 | 187 | $table->addColumn( 'mtime', 'datetime', [] ); |
188 | 188 | $table->addColumn( 'ctime', 'datetime', [] ); |
189 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
189 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
190 | 190 | |
191 | 191 | $table->setPrimaryKey( array( 'id' ), 'pk_msordbase_id' ); |
192 | 192 | $table->addUniqueIndex( array( 'siteid', 'baseid', 'code', 'type' ), 'unq_msordbase_sid_bid_cd_typ' ); |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | return $schema; |
200 | 200 | }, |
201 | 201 | |
202 | - 'mshop_order_base_service_attr' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
202 | + 'mshop_order_base_service_attr' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
203 | 203 | |
204 | 204 | $table = $schema->createTable( 'mshop_order_base_service_attr' ); |
205 | 205 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $table->addColumn( 'quantity', 'integer', [] ); |
215 | 215 | $table->addColumn( 'mtime', 'datetime', [] ); |
216 | 216 | $table->addColumn( 'ctime', 'datetime', [] ); |
217 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
217 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
218 | 218 | |
219 | 219 | $table->setPrimaryKey( array( 'id' ), 'pk_msordbaseat_id' ); |
220 | 220 | $table->addUniqueIndex( array( 'ordservid', 'attrid', 'type', 'code' ), 'unq_msordbaseat_oid_aid_ty_cd' ); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | return $schema; |
227 | 227 | }, |
228 | 228 | |
229 | - 'mshop_order_base_coupon' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
229 | + 'mshop_order_base_coupon' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
230 | 230 | |
231 | 231 | $table = $schema->createTable( 'mshop_order_base_coupon' ); |
232 | 232 | |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
238 | 238 | $table->addColumn( 'mtime', 'datetime', [] ); |
239 | 239 | $table->addColumn( 'ctime', 'datetime', [] ); |
240 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
240 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
241 | 241 | |
242 | 242 | $table->setPrimaryKey( array( 'id' ), 'pk_msordbaco_id' ); |
243 | 243 | $table->addIndex( array( 'siteid', 'baseid', 'code' ), 'idx_msordbaco_sid_bid_code' ); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | return $schema; |
254 | 254 | }, |
255 | 255 | |
256 | - 'mshop_order' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
256 | + 'mshop_order' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
257 | 257 | |
258 | 258 | $table = $schema->createTable( 'mshop_order' ); |
259 | 259 | |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $table->addColumn( 'chour', 'string', array( 'length' => 2 ) ); |
274 | 274 | $table->addColumn( 'ctime', 'datetime', [] ); |
275 | 275 | $table->addColumn( 'mtime', 'datetime', [] ); |
276 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
276 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
277 | 277 | |
278 | 278 | $table->setPrimaryKey( array( 'id' ), 'pk_msord_id' ); |
279 | 279 | $table->addIndex( array( 'siteid', 'type' ), 'idx_msord_sid_type' ); |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | return $schema; |
298 | 298 | }, |
299 | 299 | |
300 | - 'mshop_order_status' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
300 | + 'mshop_order_status' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
301 | 301 | |
302 | 302 | $table = $schema->createTable( 'mshop_order_status' ); |
303 | 303 | |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | $table->addColumn( 'value', 'string', array( 'length' => 32 ) ); |
309 | 309 | $table->addColumn( 'mtime', 'datetime', [] ); |
310 | 310 | $table->addColumn( 'ctime', 'datetime', [] ); |
311 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
311 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
312 | 312 | |
313 | 313 | $table->setPrimaryKey( array( 'id' ), 'pk_msordst_id' ); |
314 | 314 | $table->addIndex( array( 'siteid', 'parentid', 'type', 'value' ), 'idx_msordstatus_val_sid' ); |
@@ -53,8 +53,7 @@ discard block |
||
53 | 53 | ) { |
54 | 54 | $this->execute( 'ALTER TABLE "mshop_locale" DROP FOREIGN KEY "fk_msloc_langid"', 'db-locale' ); |
55 | 55 | $this->status( 'done' ); |
56 | - } |
|
57 | - else |
|
56 | + } else |
|
58 | 57 | { |
59 | 58 | $this->status( 'OK' ); |
60 | 59 | } |
@@ -66,8 +65,7 @@ discard block |
||
66 | 65 | ) { |
67 | 66 | $this->execute( 'ALTER TABLE "mshop_locale" DROP FOREIGN KEY "fk_msloc_currid"', 'db-locale' ); |
68 | 67 | $this->status( 'done' ); |
69 | - } |
|
70 | - else |
|
68 | + } else |
|
71 | 69 | { |
72 | 70 | $this->status( 'OK' ); |
73 | 71 | } |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | * @copyright Aimeos (aimeos.org), 2015-2018 |
7 | 7 | */ |
8 | 8 | |
9 | -return array ( |
|
10 | - 'text/type' => array ( |
|
9 | +return array( |
|
10 | + 'text/type' => array( |
|
11 | 11 | 'attribute/name' => array( 'domain' => 'attribute', 'code' => 'name', 'label' => 'Name', 'status' => 1 ), |
12 | 12 | 'attribute/short' => array( 'domain' => 'attribute', 'code' => 'short', 'label' => 'Short description', 'status' => 1 ), |
13 | 13 | 'attribute/long' => array( 'domain' => 'attribute', 'code' => 'long', 'label' => 'Long description', 'status' => 1 ), |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | 'supplier/long' => array( 'domain' => 'supplier', 'code' => 'long', 'label' => 'Long description', 'status' => 1 ), |
49 | 49 | ), |
50 | 50 | |
51 | - 'text' => array ( |
|
51 | + 'text' => array( |
|
52 | 52 | |
53 | 53 | //supplier |
54 | - 'text/supplier/description' => array( 'langid' => null, 'type' => 'description', 'domain' => 'supplier', 'label' => 'supplier/description', 'content' => 'Supplier description', 'status' => 1), |
|
54 | + 'text/supplier/description' => array( 'langid' => null, 'type' => 'description', 'domain' => 'supplier', 'label' => 'supplier/description', 'content' => 'Supplier description', 'status' => 1 ), |
|
55 | 55 | //ATTR |
56 | 56 | //size |
57 | 57 | 'text/size/XS' => array( 'langid' => null, 'type' => 'name', 'domain' => 'attribute', 'label' => 'size/XS', 'content' => 'XS', 'status' => 1 ), |
@@ -80,7 +80,7 @@ |
||
80 | 80 | 'customer.address.telefax' => '055544332212', 'customer.address.website' => 'www.example.com', |
81 | 81 | 'customer.address.longitude' => '10.5', 'customer.address.latitude' => '51.0', |
82 | 82 | 'customer.address.position' => '0', |
83 | - ],[ |
|
83 | + ], [ |
|
84 | 84 | 'customer.address.company' => 'Example company LLC', 'customer.address.vatid' => 'DE999999999', |
85 | 85 | 'customer.address.salutation' => 'mr', 'customer.address.title' => 'Dr.', |
86 | 86 | 'customer.address.firstname' => 'Good', 'customer.address.lastname' => 'Unittest', |
@@ -142,9 +142,13 @@ |
||
142 | 142 | { |
143 | 143 | foreach( $data['customer/group'] as $entry ) |
144 | 144 | { |
145 | - try { |
|
145 | + try |
|
146 | + { |
|
146 | 147 | $groupManager->saveItem( $groupManager->createItem()->fromArray( $entry ), false ); |
147 | - } catch( \Exception $e ) { echo $e->getMessage(); } // ignore duplicates |
|
148 | + } |
|
149 | + catch( \Exception $e ) |
|
150 | + { |
|
151 | +echo $e->getMessage(); } // ignore duplicates |
|
148 | 152 | } |
149 | 153 | } |
150 | 154 | } |