@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 68 | 68 | * @return string HTML code |
| 69 | 69 | */ |
| 70 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 70 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 71 | 71 | { |
| 72 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 72 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 73 | 73 | |
| 74 | 74 | $html = ''; |
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 75 | + foreach ($this->getSubClients() as $subclient) { |
|
| 76 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 77 | 77 | } |
| 78 | 78 | $view->optionBody = $html; |
| 79 | 79 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $tplconf = 'client/html/checkout/standard/summary/option/terms/standard/template-body'; |
| 101 | 101 | $default = 'checkout/standard/summary-option-terms-body-default.php'; |
| 102 | 102 | |
| 103 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 103 | + return $view->render($view->config($tplconf, $default)); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
@@ -112,13 +112,13 @@ discard block |
||
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | 113 | * @return string|null String including HTML tags for the header on error |
| 114 | 114 | */ |
| 115 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 115 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 116 | 116 | { |
| 117 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 117 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 118 | 118 | |
| 119 | 119 | $html = ''; |
| 120 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 120 | + foreach ($this->getSubClients() as $subclient) { |
|
| 121 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 122 | 122 | } |
| 123 | 123 | $view->optionHeader = $html; |
| 124 | 124 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $tplconf = 'client/html/checkout/standard/summary/option/terms/standard/template-header'; |
| 147 | 147 | $default = 'checkout/standard/summary-option-terms-header-default.php'; |
| 148 | 148 | |
| 149 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 149 | + return $view->render($view->config($tplconf, $default)); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @param string|null $name Name of the sub-client (Default if null) |
| 158 | 158 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 159 | 159 | */ |
| 160 | - public function getSubClient( $type, $name = null ) |
|
| 160 | + public function getSubClient($type, $name = null) |
|
| 161 | 161 | { |
| 162 | 162 | /** client/html/checkout/standard/summary/option/terms/decorators/excludes |
| 163 | 163 | * Excludes decorators added by the "common" option from the checkout standard summary option terms html client |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @see client/html/checkout/standard/summary/option/terms/decorators/global |
| 234 | 234 | */ |
| 235 | 235 | |
| 236 | - return $this->createSubClient( 'checkout/standard/summary/option/terms/' . $type, $name ); |
|
| 236 | + return $this->createSubClient('checkout/standard/summary/option/terms/'.$type, $name); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
@@ -247,17 +247,17 @@ discard block |
||
| 247 | 247 | $view = $this->getView(); |
| 248 | 248 | |
| 249 | 249 | // only start if there's something to do |
| 250 | - if( ( $option = $view->param( 'cs_option_terms', null ) ) === null ) { |
|
| 250 | + if (($option = $view->param('cs_option_terms', null)) === null) { |
|
| 251 | 251 | return; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | - if( ( $option = $view->param( 'cs_option_terms_value', 0 ) ) != 1 ) |
|
| 254 | + if (($option = $view->param('cs_option_terms_value', 0)) != 1) |
|
| 255 | 255 | { |
| 256 | 256 | $view->standardStepActive = 'summary'; |
| 257 | 257 | $view->termsError = true; |
| 258 | 258 | |
| 259 | - $error = array( $view->translate( 'client', 'Please accept the terms and conditions' ) ); |
|
| 260 | - $view->standardErrorList = $error + $view->get( 'standardErrorList', array() ); |
|
| 259 | + $error = array($view->translate('client', 'Please accept the terms and conditions')); |
|
| 260 | + $view->standardErrorList = $error + $view->get('standardErrorList', array()); |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | parent::process(); |
@@ -271,6 +271,6 @@ discard block |
||
| 271 | 271 | */ |
| 272 | 272 | protected function getSubClientNames() |
| 273 | 273 | { |
| 274 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 274 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | \ No newline at end of file |
@@ -68,13 +68,13 @@ discard block |
||
| 68 | 68 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 69 | 69 | * @return string HTML code |
| 70 | 70 | */ |
| 71 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 71 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 72 | 72 | { |
| 73 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 73 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 74 | 74 | |
| 75 | 75 | $html = ''; |
| 76 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 77 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 76 | + foreach ($this->getSubClients() as $subclient) { |
|
| 77 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 78 | 78 | } |
| 79 | 79 | $view->couponBody = $html; |
| 80 | 80 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $tplconf = 'client/html/checkout/standard/summary/coupon/standard/template-body'; |
| 103 | 103 | $default = 'common/summary/coupon-body-default.php'; |
| 104 | 104 | |
| 105 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 105 | + return $view->render($view->config($tplconf, $default)); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
@@ -114,13 +114,13 @@ discard block |
||
| 114 | 114 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 115 | 115 | * @return string|null String including HTML tags for the header on error |
| 116 | 116 | */ |
| 117 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 117 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 118 | 118 | { |
| 119 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 119 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 120 | 120 | |
| 121 | 121 | $html = ''; |
| 122 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 123 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 122 | + foreach ($this->getSubClients() as $subclient) { |
|
| 123 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 124 | 124 | } |
| 125 | 125 | $view->couponHeader = $html; |
| 126 | 126 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $tplconf = 'client/html/checkout/standard/summary/coupon/standard/template-header'; |
| 150 | 150 | $default = 'common/summary/coupon-header-default.php'; |
| 151 | 151 | |
| 152 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 152 | + return $view->render($view->config($tplconf, $default)); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * @param string|null $name Name of the sub-client (Default if null) |
| 161 | 161 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 162 | 162 | */ |
| 163 | - public function getSubClient( $type, $name = null ) |
|
| 163 | + public function getSubClient($type, $name = null) |
|
| 164 | 164 | { |
| 165 | 165 | /** client/html/checkout/standard/summary/coupon/decorators/excludes |
| 166 | 166 | * Excludes decorators added by the "common" option from the checkout standard summary coupon html client |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * @see client/html/checkout/standard/summary/coupon/decorators/global |
| 237 | 237 | */ |
| 238 | 238 | |
| 239 | - return $this->createSubClient( 'checkout/standard/summary/coupon/' . $type, $name ); |
|
| 239 | + return $this->createSubClient('checkout/standard/summary/coupon/'.$type, $name); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | */ |
| 248 | 248 | protected function getSubClientNames() |
| 249 | 249 | { |
| 250 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 250 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | |
@@ -259,18 +259,18 @@ discard block |
||
| 259 | 259 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 260 | 260 | * @return \Aimeos\MW\View\Iface Modified view object |
| 261 | 261 | */ |
| 262 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 262 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 263 | 263 | { |
| 264 | - $view = parent::setViewParams( $view, $tags, $expire ); |
|
| 264 | + $view = parent::setViewParams($view, $tags, $expire); |
|
| 265 | 265 | |
| 266 | - if( !isset( $this->cache ) ) |
|
| 266 | + if (!isset($this->cache)) |
|
| 267 | 267 | { |
| 268 | - $target = $view->config( 'client/html/basket/standard/url/target' ); |
|
| 269 | - $cntl = $view->config( 'client/html/basket/standard/url/controller', 'basket' ); |
|
| 270 | - $action = $view->config( 'client/html/basket/standard/url/action', 'index' ); |
|
| 271 | - $config = $view->config( 'client/html/basket/standard/url/config', array() ); |
|
| 268 | + $target = $view->config('client/html/basket/standard/url/target'); |
|
| 269 | + $cntl = $view->config('client/html/basket/standard/url/controller', 'basket'); |
|
| 270 | + $action = $view->config('client/html/basket/standard/url/action', 'index'); |
|
| 271 | + $config = $view->config('client/html/basket/standard/url/config', array()); |
|
| 272 | 272 | |
| 273 | - $view->summaryUrlCoupon = $view->url( $target, $cntl, $action, array(), array(), $config ); |
|
| 273 | + $view->summaryUrlCoupon = $view->url($target, $cntl, $action, array(), array(), $config); |
|
| 274 | 274 | $view->summaryBasket = $view->standardBasket; |
| 275 | 275 | |
| 276 | 276 | $this->cache = $view; |
@@ -68,13 +68,13 @@ discard block |
||
| 68 | 68 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 69 | 69 | * @return string HTML code |
| 70 | 70 | */ |
| 71 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 71 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 72 | 72 | { |
| 73 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 73 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 74 | 74 | |
| 75 | 75 | $html = ''; |
| 76 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 77 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 76 | + foreach ($this->getSubClients() as $subclient) { |
|
| 77 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 78 | 78 | } |
| 79 | 79 | $view->detailBody = $html; |
| 80 | 80 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $tplconf = 'client/html/checkout/standard/summary/detail/standard/template-body'; |
| 103 | 103 | $default = 'common/summary/detail-body-default.php'; |
| 104 | 104 | |
| 105 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 105 | + return $view->render($view->config($tplconf, $default)); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
@@ -114,13 +114,13 @@ discard block |
||
| 114 | 114 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 115 | 115 | * @return string|null String including HTML tags for the header on error |
| 116 | 116 | */ |
| 117 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 117 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 118 | 118 | { |
| 119 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 119 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 120 | 120 | |
| 121 | 121 | $html = ''; |
| 122 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 123 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 122 | + foreach ($this->getSubClients() as $subclient) { |
|
| 123 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 124 | 124 | } |
| 125 | 125 | $view->detailHeader = $html; |
| 126 | 126 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $tplconf = 'client/html/checkout/standard/summary/detail/standard/template-header'; |
| 150 | 150 | $default = 'common/summary/detail-header-default.php'; |
| 151 | 151 | |
| 152 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 152 | + return $view->render($view->config($tplconf, $default)); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * @param string|null $name Name of the sub-client (Default if null) |
| 161 | 161 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 162 | 162 | */ |
| 163 | - public function getSubClient( $type, $name = null ) |
|
| 163 | + public function getSubClient($type, $name = null) |
|
| 164 | 164 | { |
| 165 | 165 | /** client/html/checkout/standard/summary/detail/decorators/excludes |
| 166 | 166 | * Excludes decorators added by the "common" option from the checkout standard summary detail html client |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * @see client/html/checkout/standard/summary/detail/decorators/global |
| 237 | 237 | */ |
| 238 | 238 | |
| 239 | - return $this->createSubClient( 'checkout/standard/summary/detail/' . $type, $name ); |
|
| 239 | + return $this->createSubClient('checkout/standard/summary/detail/'.$type, $name); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | */ |
| 248 | 248 | protected function getSubClientNames() |
| 249 | 249 | { |
| 250 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 250 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | |
@@ -259,28 +259,28 @@ discard block |
||
| 259 | 259 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 260 | 260 | * @return \Aimeos\MW\View\Iface Modified view object |
| 261 | 261 | */ |
| 262 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 262 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 263 | 263 | { |
| 264 | - $view = parent::setViewParams( $view, $tags, $expire ); |
|
| 264 | + $view = parent::setViewParams($view, $tags, $expire); |
|
| 265 | 265 | |
| 266 | - if( !isset( $this->cache ) ) |
|
| 266 | + if (!isset($this->cache)) |
|
| 267 | 267 | { |
| 268 | 268 | $basket = $view->standardBasket; |
| 269 | 269 | |
| 270 | - $bTarget = $view->config( 'client/html/basket/standard/url/target' ); |
|
| 271 | - $bCntl = $view->config( 'client/html/basket/standard/url/controller', 'basket' ); |
|
| 272 | - $bAction = $view->config( 'client/html/basket/standard/url/action', 'index' ); |
|
| 273 | - $bConfig = $view->config( 'client/html/basket/standard/url/config', array() ); |
|
| 270 | + $bTarget = $view->config('client/html/basket/standard/url/target'); |
|
| 271 | + $bCntl = $view->config('client/html/basket/standard/url/controller', 'basket'); |
|
| 272 | + $bAction = $view->config('client/html/basket/standard/url/action', 'index'); |
|
| 273 | + $bConfig = $view->config('client/html/basket/standard/url/config', array()); |
|
| 274 | 274 | |
| 275 | - $target = $view->config( 'client/html/checkout/standard/url/target' ); |
|
| 276 | - $cntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' ); |
|
| 277 | - $action = $view->config( 'client/html/checkout/standard/url/action', 'index' ); |
|
| 278 | - $config = $view->config( 'client/html/checkout/standard/url/config', array() ); |
|
| 275 | + $target = $view->config('client/html/checkout/standard/url/target'); |
|
| 276 | + $cntl = $view->config('client/html/checkout/standard/url/controller', 'checkout'); |
|
| 277 | + $action = $view->config('client/html/checkout/standard/url/action', 'index'); |
|
| 278 | + $config = $view->config('client/html/checkout/standard/url/config', array()); |
|
| 279 | 279 | |
| 280 | - $view->summaryUrlServicePayment = $view->url( $target, $cntl, $action, array( 'c_step' => 'payment' ), array(), $config ); |
|
| 281 | - $view->summaryUrlServiceDelivery = $view->url( $target, $cntl, $action, array( 'c_step' => 'delivery' ), array(), $config ); |
|
| 282 | - $view->summaryUrlBasket = $view->url( $bTarget, $bCntl, $bAction, array(), array(), $bConfig ); |
|
| 283 | - $view->summaryTaxRates = $this->getTaxRates( $basket ); |
|
| 280 | + $view->summaryUrlServicePayment = $view->url($target, $cntl, $action, array('c_step' => 'payment'), array(), $config); |
|
| 281 | + $view->summaryUrlServiceDelivery = $view->url($target, $cntl, $action, array('c_step' => 'delivery'), array(), $config); |
|
| 282 | + $view->summaryUrlBasket = $view->url($bTarget, $bCntl, $bAction, array(), array(), $bConfig); |
|
| 283 | + $view->summaryTaxRates = $this->getTaxRates($basket); |
|
| 284 | 284 | $view->summaryBasket = $basket; |
| 285 | 285 | |
| 286 | 286 | $this->cache = $view; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | // Strings for translation |
| 16 | -sprintf( 'summary' ); |
|
| 16 | +sprintf('summary'); |
|
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | /** |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * @since 2014.03 |
| 116 | 116 | * @category Developer |
| 117 | 117 | */ |
| 118 | - private $subPartNames = array( 'address', 'service', 'coupon', 'option', 'detail' ); |
|
| 118 | + private $subPartNames = array('address', 'service', 'coupon', 'option', 'detail'); |
|
| 119 | 119 | |
| 120 | 120 | |
| 121 | 121 | /** |
@@ -126,21 +126,21 @@ discard block |
||
| 126 | 126 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 127 | 127 | * @return string HTML code |
| 128 | 128 | */ |
| 129 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 129 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 130 | 130 | { |
| 131 | 131 | $view = $this->getView(); |
| 132 | - $step = $view->get( 'standardStepActive' ); |
|
| 133 | - $onepage = $view->config( 'client/html/checkout/standard/onepage', array() ); |
|
| 132 | + $step = $view->get('standardStepActive'); |
|
| 133 | + $onepage = $view->config('client/html/checkout/standard/onepage', array()); |
|
| 134 | 134 | |
| 135 | - if( $step != 'summary' && !( in_array( 'summary', $onepage ) && in_array( $step, $onepage ) ) ) { |
|
| 135 | + if ($step != 'summary' && !(in_array('summary', $onepage) && in_array($step, $onepage))) { |
|
| 136 | 136 | return ''; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - $view = $this->setViewParams( $view, $tags, $expire ); |
|
| 139 | + $view = $this->setViewParams($view, $tags, $expire); |
|
| 140 | 140 | |
| 141 | 141 | $html = ''; |
| 142 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 143 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 142 | + foreach ($this->getSubClients() as $subclient) { |
|
| 143 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 144 | 144 | } |
| 145 | 145 | $view->summaryBody = $html; |
| 146 | 146 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $tplconf = 'client/html/checkout/standard/summary/standard/template-body'; |
| 168 | 168 | $default = 'checkout/standard/summary-body-default.php'; |
| 169 | 169 | |
| 170 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 170 | + return $view->render($view->config($tplconf, $default)); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | |
@@ -179,21 +179,21 @@ discard block |
||
| 179 | 179 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 180 | 180 | * @return string|null String including HTML tags for the header on error |
| 181 | 181 | */ |
| 182 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 182 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 183 | 183 | { |
| 184 | 184 | $view = $this->getView(); |
| 185 | - $step = $view->get( 'standardStepActive' ); |
|
| 186 | - $onepage = $view->config( 'client/html/checkout/standard/onepage', array() ); |
|
| 185 | + $step = $view->get('standardStepActive'); |
|
| 186 | + $onepage = $view->config('client/html/checkout/standard/onepage', array()); |
|
| 187 | 187 | |
| 188 | - if( $step != 'summary' && !( in_array( 'summary', $onepage ) && in_array( $step, $onepage ) ) ) { |
|
| 188 | + if ($step != 'summary' && !(in_array('summary', $onepage) && in_array($step, $onepage))) { |
|
| 189 | 189 | return ''; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - $view = $this->setViewParams( $view, $tags, $expire ); |
|
| 192 | + $view = $this->setViewParams($view, $tags, $expire); |
|
| 193 | 193 | |
| 194 | 194 | $html = ''; |
| 195 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 196 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 195 | + foreach ($this->getSubClients() as $subclient) { |
|
| 196 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 197 | 197 | } |
| 198 | 198 | $view->summaryHeader = $html; |
| 199 | 199 | |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | $tplconf = 'client/html/checkout/standard/summary/standard/template-header'; |
| 222 | 222 | $default = 'checkout/standard/summary-header-default.php'; |
| 223 | 223 | |
| 224 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 224 | + return $view->render($view->config($tplconf, $default)); |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | * @param string|null $name Name of the sub-client (Default if null) |
| 233 | 233 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 234 | 234 | */ |
| 235 | - public function getSubClient( $type, $name = null ) |
|
| 235 | + public function getSubClient($type, $name = null) |
|
| 236 | 236 | { |
| 237 | 237 | /** client/html/checkout/standard/summary/decorators/excludes |
| 238 | 238 | * Excludes decorators added by the "common" option from the checkout standard summary html client |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | * @see client/html/checkout/standard/summary/decorators/global |
| 309 | 309 | */ |
| 310 | 310 | |
| 311 | - return $this->createSubClient( 'checkout/standard/summary/' . $type, $name ); |
|
| 311 | + return $this->createSubClient('checkout/standard/summary/'.$type, $name); |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | |
@@ -321,18 +321,18 @@ discard block |
||
| 321 | 321 | { |
| 322 | 322 | $view = $this->getView(); |
| 323 | 323 | |
| 324 | - if( $view->param( 'cs_order', null ) === null ) { |
|
| 324 | + if ($view->param('cs_order', null) === null) { |
|
| 325 | 325 | return; |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | try |
| 329 | 329 | { |
| 330 | - $controller = \Aimeos\Controller\Frontend\Factory::createController( $this->getContext(), 'basket' ); |
|
| 331 | - $controller->get()->check( \Aimeos\MShop\Order\Item\Base\Base::PARTS_ALL ); |
|
| 330 | + $controller = \Aimeos\Controller\Frontend\Factory::createController($this->getContext(), 'basket'); |
|
| 331 | + $controller->get()->check(\Aimeos\MShop\Order\Item\Base\Base::PARTS_ALL); |
|
| 332 | 332 | |
| 333 | 333 | parent::process(); |
| 334 | 334 | } |
| 335 | - catch( \Exception $e ) |
|
| 335 | + catch (\Exception $e) |
|
| 336 | 336 | { |
| 337 | 337 | $view->standardStepActive = 'summary'; |
| 338 | 338 | throw $e; |
@@ -347,6 +347,6 @@ discard block |
||
| 347 | 347 | */ |
| 348 | 348 | protected function getSubClientNames() |
| 349 | 349 | { |
| 350 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 350 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 351 | 351 | } |
| 352 | 352 | } |
| 353 | 353 | \ No newline at end of file |
@@ -68,13 +68,13 @@ discard block |
||
| 68 | 68 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 69 | 69 | * @return string HTML code |
| 70 | 70 | */ |
| 71 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 71 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 72 | 72 | { |
| 73 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 73 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 74 | 74 | |
| 75 | 75 | $html = ''; |
| 76 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 77 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 76 | + foreach ($this->getSubClients() as $subclient) { |
|
| 77 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 78 | 78 | } |
| 79 | 79 | $view->addressBody = $html; |
| 80 | 80 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $tplconf = 'client/html/checkout/standard/summary/address/standard/template-body'; |
| 103 | 103 | $default = 'common/summary/address-body-default.php'; |
| 104 | 104 | |
| 105 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 105 | + return $view->render($view->config($tplconf, $default)); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
@@ -114,13 +114,13 @@ discard block |
||
| 114 | 114 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 115 | 115 | * @return string|null String including HTML tags for the header on error |
| 116 | 116 | */ |
| 117 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 117 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 118 | 118 | { |
| 119 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 119 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 120 | 120 | |
| 121 | 121 | $html = ''; |
| 122 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 123 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 122 | + foreach ($this->getSubClients() as $subclient) { |
|
| 123 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 124 | 124 | } |
| 125 | 125 | $view->addressHeader = $html; |
| 126 | 126 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $tplconf = 'client/html/checkout/standard/summary/address/standard/template-header'; |
| 150 | 150 | $default = 'common/summary/address-header-default.php'; |
| 151 | 151 | |
| 152 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 152 | + return $view->render($view->config($tplconf, $default)); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * @param string|null $name Name of the sub-client (Default if null) |
| 161 | 161 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 162 | 162 | */ |
| 163 | - public function getSubClient( $type, $name = null ) |
|
| 163 | + public function getSubClient($type, $name = null) |
|
| 164 | 164 | { |
| 165 | 165 | /** client/html/checkout/standard/summary/address/decorators/excludes |
| 166 | 166 | * Excludes decorators added by the "common" option from the checkout standard summary address html client |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * @see client/html/checkout/standard/summary/address/decorators/global |
| 237 | 237 | */ |
| 238 | 238 | |
| 239 | - return $this->createSubClient( 'checkout/standard/summary/address/' . $type, $name ); |
|
| 239 | + return $this->createSubClient('checkout/standard/summary/address/'.$type, $name); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | */ |
| 248 | 248 | protected function getSubClientNames() |
| 249 | 249 | { |
| 250 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 250 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | |
@@ -259,18 +259,18 @@ discard block |
||
| 259 | 259 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 260 | 260 | * @return \Aimeos\MW\View\Iface Modified view object |
| 261 | 261 | */ |
| 262 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 262 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 263 | 263 | { |
| 264 | - $view = parent::setViewParams( $view, $tags, $expire ); |
|
| 264 | + $view = parent::setViewParams($view, $tags, $expire); |
|
| 265 | 265 | |
| 266 | - if( !isset( $this->cache ) ) |
|
| 266 | + if (!isset($this->cache)) |
|
| 267 | 267 | { |
| 268 | - $target = $view->config( 'client/html/checkout/standard/url/target' ); |
|
| 269 | - $cntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' ); |
|
| 270 | - $action = $view->config( 'client/html/checkout/standard/url/action', 'index' ); |
|
| 271 | - $config = $view->config( 'client/html/checkout/standard/url/config', array() ); |
|
| 268 | + $target = $view->config('client/html/checkout/standard/url/target'); |
|
| 269 | + $cntl = $view->config('client/html/checkout/standard/url/controller', 'checkout'); |
|
| 270 | + $action = $view->config('client/html/checkout/standard/url/action', 'index'); |
|
| 271 | + $config = $view->config('client/html/checkout/standard/url/config', array()); |
|
| 272 | 272 | |
| 273 | - $url = $view->url( $target, $cntl, $action, array( 'c_step' => 'address' ), array(), $config ); |
|
| 273 | + $url = $view->url($target, $cntl, $action, array('c_step' => 'address'), array(), $config); |
|
| 274 | 274 | |
| 275 | 275 | $view->summaryUrlAddressBilling = $url; |
| 276 | 276 | $view->summaryUrlAddressDelivery = $url; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * @return \Aimeos\Client\Html\Iface Filter part implementing \Aimeos\Client\Html\Iface |
| 32 | 32 | * @throws \Aimeos\Client\Html\Exception If requested client implementation couldn't be found or initialisation fails |
| 33 | 33 | */ |
| 34 | - public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null ) |
|
| 34 | + public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null) |
|
| 35 | 35 | { |
| 36 | 36 | /** client/html/checkout/standard/name |
| 37 | 37 | * Class name of the used checkout standard client implementation |
@@ -66,22 +66,22 @@ discard block |
||
| 66 | 66 | * @since 2014.03 |
| 67 | 67 | * @category Developer |
| 68 | 68 | */ |
| 69 | - if( $name === null ) { |
|
| 70 | - $name = $context->getConfig()->get( 'client/html/checkout/standard/name', 'Standard' ); |
|
| 69 | + if ($name === null) { |
|
| 70 | + $name = $context->getConfig()->get('client/html/checkout/standard/name', 'Standard'); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if( ctype_alnum( $name ) === false ) |
|
| 73 | + if (ctype_alnum($name) === false) |
|
| 74 | 74 | { |
| 75 | - $classname = is_string( $name ) ? '\\Aimeos\\Client\\Html\\Checkout\\Standard\\' . $name : '<not a string>'; |
|
| 76 | - throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
| 75 | + $classname = is_string($name) ? '\\Aimeos\\Client\\Html\\Checkout\\Standard\\'.$name : '<not a string>'; |
|
| 76 | + throw new \Aimeos\Client\Html\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | $iface = '\\Aimeos\\Client\\Html\\Iface'; |
| 80 | - $classname = '\\Aimeos\\Client\\Html\\Checkout\\Standard\\' . $name; |
|
| 80 | + $classname = '\\Aimeos\\Client\\Html\\Checkout\\Standard\\'.$name; |
|
| 81 | 81 | |
| 82 | - $client = self::createClientBase( $context, $classname, $iface, $templatePaths ); |
|
| 82 | + $client = self::createClientBase($context, $classname, $iface, $templatePaths); |
|
| 83 | 83 | |
| 84 | - return self::addClientDecorators( $context, $client, $templatePaths, 'checkout/standard' ); |
|
| 84 | + return self::addClientDecorators($context, $client, $templatePaths, 'checkout/standard'); |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @since 2015.07 |
| 123 | 123 | * @category Developer |
| 124 | 124 | */ |
| 125 | - private $subPartNames = array( 'address', 'delivery', 'payment', 'summary', 'order', 'process' ); |
|
| 125 | + private $subPartNames = array('address', 'delivery', 'payment', 'summary', 'order', 'process'); |
|
| 126 | 126 | private $cache; |
| 127 | 127 | |
| 128 | 128 | |
@@ -134,42 +134,42 @@ discard block |
||
| 134 | 134 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 135 | 135 | * @return string HTML code |
| 136 | 136 | */ |
| 137 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 137 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 138 | 138 | { |
| 139 | 139 | $context = $this->getContext(); |
| 140 | 140 | $view = $this->getView(); |
| 141 | 141 | |
| 142 | 142 | try |
| 143 | 143 | { |
| 144 | - $view = $this->setViewParams( $view, $tags, $expire ); |
|
| 144 | + $view = $this->setViewParams($view, $tags, $expire); |
|
| 145 | 145 | |
| 146 | 146 | $html = ''; |
| 147 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 148 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 147 | + foreach ($this->getSubClients() as $subclient) { |
|
| 148 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 149 | 149 | } |
| 150 | 150 | $view->standardBody = $html; |
| 151 | 151 | } |
| 152 | - catch( \Aimeos\Client\Html\Exception $e ) |
|
| 152 | + catch (\Aimeos\Client\Html\Exception $e) |
|
| 153 | 153 | { |
| 154 | - $error = array( $this->getContext()->getI18n()->dt( 'client', $e->getMessage() ) ); |
|
| 155 | - $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error; |
|
| 154 | + $error = array($this->getContext()->getI18n()->dt('client', $e->getMessage())); |
|
| 155 | + $view->standardErrorList = $view->get('standardErrorList', array()) + $error; |
|
| 156 | 156 | } |
| 157 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 157 | + catch (\Aimeos\Controller\Frontend\Exception $e) |
|
| 158 | 158 | { |
| 159 | - $error = array( $this->getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) ); |
|
| 160 | - $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error; |
|
| 159 | + $error = array($this->getContext()->getI18n()->dt('controller/frontend', $e->getMessage())); |
|
| 160 | + $view->standardErrorList = $view->get('standardErrorList', array()) + $error; |
|
| 161 | 161 | } |
| 162 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 162 | + catch (\Aimeos\MShop\Exception $e) |
|
| 163 | 163 | { |
| 164 | - $error = array( $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 165 | - $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error; |
|
| 164 | + $error = array($this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
| 165 | + $view->standardErrorList = $view->get('standardErrorList', array()) + $error; |
|
| 166 | 166 | } |
| 167 | - catch( \Exception $e ) |
|
| 167 | + catch (\Exception $e) |
|
| 168 | 168 | { |
| 169 | - $context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
|
| 169 | + $context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
|
| 170 | 170 | |
| 171 | - $error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) ); |
|
| 172 | - $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error; |
|
| 171 | + $error = array($context->getI18n()->dt('client', 'A non-recoverable error occured')); |
|
| 172 | + $view->standardErrorList = $view->get('standardErrorList', array()) + $error; |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | /** client/html/checkout/standard/standard/template-body |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | $tplconf = 'client/html/checkout/standard/standard/template-body'; |
| 196 | 196 | $default = 'checkout/standard/body-default.php'; |
| 197 | 197 | |
| 198 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 198 | + return $view->render($view->config($tplconf, $default)); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | |
@@ -207,15 +207,15 @@ discard block |
||
| 207 | 207 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 208 | 208 | * @return string|null String including HTML tags for the header on error |
| 209 | 209 | */ |
| 210 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 210 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 211 | 211 | { |
| 212 | 212 | try |
| 213 | 213 | { |
| 214 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 214 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 215 | 215 | |
| 216 | 216 | $html = ''; |
| 217 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 218 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 217 | + foreach ($this->getSubClients() as $subclient) { |
|
| 218 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 219 | 219 | } |
| 220 | 220 | $view->standardHeader = $html; |
| 221 | 221 | |
@@ -243,11 +243,11 @@ discard block |
||
| 243 | 243 | $tplconf = 'client/html/checkout/standard/standard/template-header'; |
| 244 | 244 | $default = 'checkout/standard/header-default.php'; |
| 245 | 245 | |
| 246 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 246 | + return $view->render($view->config($tplconf, $default)); |
|
| 247 | 247 | } |
| 248 | - catch( \Exception $e ) |
|
| 248 | + catch (\Exception $e) |
|
| 249 | 249 | { |
| 250 | - $this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
|
| 250 | + $this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
|
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | 253 | |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | * @param string|null $name Name of the sub-client (Default if null) |
| 260 | 260 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 261 | 261 | */ |
| 262 | - public function getSubClient( $type, $name = null ) |
|
| 262 | + public function getSubClient($type, $name = null) |
|
| 263 | 263 | { |
| 264 | 264 | /** client/html/checkout/standard/decorators/excludes |
| 265 | 265 | * Excludes decorators added by the "common" option from the checkout standard html client |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | * @see client/html/checkout/standard/decorators/global |
| 336 | 336 | */ |
| 337 | 337 | |
| 338 | - return $this->createSubClient( 'checkout/standard/' . $type, $name ); |
|
| 338 | + return $this->createSubClient('checkout/standard/'.$type, $name); |
|
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | |
@@ -353,35 +353,35 @@ discard block |
||
| 353 | 353 | { |
| 354 | 354 | parent::process(); |
| 355 | 355 | } |
| 356 | - catch( \Aimeos\Client\Html\Exception $e ) |
|
| 356 | + catch (\Aimeos\Client\Html\Exception $e) |
|
| 357 | 357 | { |
| 358 | - $error = array( $this->getContext()->getI18n()->dt( 'client', $e->getMessage() ) ); |
|
| 359 | - $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error; |
|
| 358 | + $error = array($this->getContext()->getI18n()->dt('client', $e->getMessage())); |
|
| 359 | + $view->standardErrorList = $view->get('standardErrorList', array()) + $error; |
|
| 360 | 360 | } |
| 361 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 361 | + catch (\Aimeos\Controller\Frontend\Exception $e) |
|
| 362 | 362 | { |
| 363 | - $error = array( $this->getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) ); |
|
| 364 | - $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error; |
|
| 363 | + $error = array($this->getContext()->getI18n()->dt('controller/frontend', $e->getMessage())); |
|
| 364 | + $view->standardErrorList = $view->get('standardErrorList', array()) + $error; |
|
| 365 | 365 | } |
| 366 | - catch( \Aimeos\MShop\Plugin\Provider\Exception $e ) |
|
| 366 | + catch (\Aimeos\MShop\Plugin\Provider\Exception $e) |
|
| 367 | 367 | { |
| 368 | - $errors = array( $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 369 | - $errors = array_merge( $errors, $this->translatePluginErrorCodes( $e->getErrorCodes() ) ); |
|
| 368 | + $errors = array($this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
| 369 | + $errors = array_merge($errors, $this->translatePluginErrorCodes($e->getErrorCodes())); |
|
| 370 | 370 | |
| 371 | 371 | $view->summaryErrorCodes = $e->getErrorCodes(); |
| 372 | - $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $errors; |
|
| 372 | + $view->standardErrorList = $view->get('standardErrorList', array()) + $errors; |
|
| 373 | 373 | } |
| 374 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 374 | + catch (\Aimeos\MShop\Exception $e) |
|
| 375 | 375 | { |
| 376 | - $error = array( $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 377 | - $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error; |
|
| 376 | + $error = array($this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
| 377 | + $view->standardErrorList = $view->get('standardErrorList', array()) + $error; |
|
| 378 | 378 | } |
| 379 | - catch( \Exception $e ) |
|
| 379 | + catch (\Exception $e) |
|
| 380 | 380 | { |
| 381 | - $context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
|
| 381 | + $context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
|
| 382 | 382 | |
| 383 | - $error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) ); |
|
| 384 | - $view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error; |
|
| 383 | + $error = array($context->getI18n()->dt('client', 'A non-recoverable error occured')); |
|
| 384 | + $view->standardErrorList = $view->get('standardErrorList', array()) + $error; |
|
| 385 | 385 | } |
| 386 | 386 | } |
| 387 | 387 | |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | */ |
| 394 | 394 | protected function getSubClientNames() |
| 395 | 395 | { |
| 396 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 396 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | |
@@ -405,19 +405,19 @@ discard block |
||
| 405 | 405 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 406 | 406 | * @return \Aimeos\MW\View\Iface Modified view object |
| 407 | 407 | */ |
| 408 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 408 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 409 | 409 | { |
| 410 | - if( !isset( $this->cache ) ) |
|
| 410 | + if (!isset($this->cache)) |
|
| 411 | 411 | { |
| 412 | 412 | $context = $this->getContext(); |
| 413 | 413 | |
| 414 | - $basketCntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' ); |
|
| 414 | + $basketCntl = \Aimeos\Controller\Frontend\Factory::createController($context, 'basket'); |
|
| 415 | 415 | $view->standardBasket = $basketCntl->get(); |
| 416 | 416 | |
| 417 | - $bTarget = $view->config( 'client/html/basket/standard/url/target' ); |
|
| 418 | - $bCntl = $view->config( 'client/html/basket/standard/url/controller', 'basket' ); |
|
| 419 | - $bAction = $view->config( 'client/html/basket/standard/url/action', 'index' ); |
|
| 420 | - $bConfig = $view->config( 'client/html/basket/standard/url/config', array() ); |
|
| 417 | + $bTarget = $view->config('client/html/basket/standard/url/target'); |
|
| 418 | + $bCntl = $view->config('client/html/basket/standard/url/controller', 'basket'); |
|
| 419 | + $bAction = $view->config('client/html/basket/standard/url/action', 'index'); |
|
| 420 | + $bConfig = $view->config('client/html/basket/standard/url/config', array()); |
|
| 421 | 421 | |
| 422 | 422 | |
| 423 | 423 | /** client/html/checkout/standard/url/target |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | * @see client/html/checkout/standard/url/action |
| 435 | 435 | * @see client/html/checkout/standard/url/config |
| 436 | 436 | */ |
| 437 | - $cTarget = $view->config( 'client/html/checkout/standard/url/target' ); |
|
| 437 | + $cTarget = $view->config('client/html/checkout/standard/url/target'); |
|
| 438 | 438 | |
| 439 | 439 | /** client/html/checkout/standard/url/controller |
| 440 | 440 | * Name of the controller whose action should be called |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | * @see client/html/checkout/standard/url/action |
| 451 | 451 | * @see client/html/checkout/standard/url/config |
| 452 | 452 | */ |
| 453 | - $cCntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' ); |
|
| 453 | + $cCntl = $view->config('client/html/checkout/standard/url/controller', 'checkout'); |
|
| 454 | 454 | |
| 455 | 455 | /** client/html/checkout/standard/url/action |
| 456 | 456 | * Name of the action that should create the output |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | * @see client/html/checkout/standard/url/controller |
| 467 | 467 | * @see client/html/checkout/standard/url/config |
| 468 | 468 | */ |
| 469 | - $cAction = $view->config( 'client/html/checkout/standard/url/action', 'index' ); |
|
| 469 | + $cAction = $view->config('client/html/checkout/standard/url/action', 'index'); |
|
| 470 | 470 | |
| 471 | 471 | /** client/html/checkout/standard/url/config |
| 472 | 472 | * Associative list of configuration options used for generating the URL |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | * @see client/html/checkout/standard/url/action |
| 490 | 490 | * @see client/html/url/config |
| 491 | 491 | */ |
| 492 | - $cConfig = $view->config( 'client/html/checkout/standard/url/config', array() ); |
|
| 492 | + $cConfig = $view->config('client/html/checkout/standard/url/config', array()); |
|
| 493 | 493 | |
| 494 | 494 | |
| 495 | 495 | /** client/html/checkout/standard/url/step-active |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | * @category User |
| 516 | 516 | * @see client/html/checkout/standard/standard/subparts |
| 517 | 517 | */ |
| 518 | - $default = $view->config( 'client/html/checkout/standard/url/step-active', 'summary' ); |
|
| 518 | + $default = $view->config('client/html/checkout/standard/url/step-active', 'summary'); |
|
| 519 | 519 | |
| 520 | 520 | /** client/html/checkout/standard/onepage |
| 521 | 521 | * Shows all named checkout subparts at once for a one page checkout |
@@ -547,24 +547,24 @@ discard block |
||
| 547 | 547 | * @since 2015.05 |
| 548 | 548 | * @category Developer |
| 549 | 549 | */ |
| 550 | - $onepage = $view->config( 'client/html/checkout/standard/onepage', array() ); |
|
| 551 | - $onestep = array_shift( $onepage ); // keep the first one page step |
|
| 550 | + $onepage = $view->config('client/html/checkout/standard/onepage', array()); |
|
| 551 | + $onestep = array_shift($onepage); // keep the first one page step |
|
| 552 | 552 | |
| 553 | - $steps = (array) $context->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 554 | - $steps = array_diff( $steps, $onepage ); // remove all remaining steps in $onepage |
|
| 553 | + $steps = (array) $context->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 554 | + $steps = array_diff($steps, $onepage); // remove all remaining steps in $onepage |
|
| 555 | 555 | |
| 556 | 556 | // use first step if default step isn't available |
| 557 | - $default = ( !in_array( $default, $steps ) ? reset( $steps ) : $default ); |
|
| 557 | + $default = (!in_array($default, $steps) ? reset($steps) : $default); |
|
| 558 | 558 | |
| 559 | - $current = $view->param( 'c_step', $default ); |
|
| 559 | + $current = $view->param('c_step', $default); |
|
| 560 | 560 | // use $onestep if current step isn't available due to one page layout |
| 561 | - $current = ( !in_array( $current, $steps ) ? $onestep : $current ); |
|
| 561 | + $current = (!in_array($current, $steps) ? $onestep : $current); |
|
| 562 | 562 | |
| 563 | - $cpos = $cpos = array_search( $current, $steps ); |
|
| 563 | + $cpos = $cpos = array_search($current, $steps); |
|
| 564 | 564 | |
| 565 | - if( !isset( $view->standardStepActive ) |
|
| 566 | - || ( ( $apos = array_search( $view->standardStepActive, $steps ) ) !== false |
|
| 567 | - && $cpos !== false && $cpos < $apos ) |
|
| 565 | + if (!isset($view->standardStepActive) |
|
| 566 | + || (($apos = array_search($view->standardStepActive, $steps)) !== false |
|
| 567 | + && $cpos !== false && $cpos < $apos) |
|
| 568 | 568 | ) { |
| 569 | 569 | $view->standardStepActive = $current; |
| 570 | 570 | } |
@@ -577,19 +577,19 @@ discard block |
||
| 577 | 577 | do { |
| 578 | 578 | $lastStep = $step; |
| 579 | 579 | } |
| 580 | - while( ( $step = array_shift( $steps ) ) !== null && $step !== $activeStep ); |
|
| 580 | + while (($step = array_shift($steps)) !== null && $step !== $activeStep); |
|
| 581 | 581 | |
| 582 | 582 | |
| 583 | - if( $lastStep !== null ) { |
|
| 584 | - $param = array( 'c_step' => $lastStep ); |
|
| 585 | - $view->standardUrlBack = $view->url( $cTarget, $cCntl, $cAction, $param, array(), $cConfig ); |
|
| 583 | + if ($lastStep !== null) { |
|
| 584 | + $param = array('c_step' => $lastStep); |
|
| 585 | + $view->standardUrlBack = $view->url($cTarget, $cCntl, $cAction, $param, array(), $cConfig); |
|
| 586 | 586 | } else { |
| 587 | - $view->standardUrlBack = $view->url( $bTarget, $bCntl, $bAction, array(), array(), $bConfig ); |
|
| 587 | + $view->standardUrlBack = $view->url($bTarget, $bCntl, $bAction, array(), array(), $bConfig); |
|
| 588 | 588 | } |
| 589 | 589 | |
| 590 | - if( !isset( $view->standardUrlNext ) && ( $nextStep = array_shift( $steps ) ) !== null ) { |
|
| 591 | - $param = array( 'c_step' => $nextStep ); |
|
| 592 | - $view->standardUrlNext = $view->url( $cTarget, $cCntl, $cAction, $param, array(), $cConfig ); |
|
| 590 | + if (!isset($view->standardUrlNext) && ($nextStep = array_shift($steps)) !== null) { |
|
| 591 | + $param = array('c_step' => $nextStep); |
|
| 592 | + $view->standardUrlNext = $view->url($cTarget, $cCntl, $cAction, $param, array(), $cConfig); |
|
| 593 | 593 | } |
| 594 | 594 | // don't overwrite $view->standardUrlNext so order step URL is used |
| 595 | 595 | |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | // Strings for translation |
| 16 | -sprintf( 'delivery' ); |
|
| 16 | +sprintf('delivery'); |
|
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | /** |
@@ -72,21 +72,21 @@ discard block |
||
| 72 | 72 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 73 | 73 | * @return string HTML code |
| 74 | 74 | */ |
| 75 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 75 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 76 | 76 | { |
| 77 | 77 | $view = $this->getView(); |
| 78 | - $step = $view->get( 'standardStepActive' ); |
|
| 79 | - $onepage = $view->config( 'client/html/checkout/standard/onepage', array() ); |
|
| 78 | + $step = $view->get('standardStepActive'); |
|
| 79 | + $onepage = $view->config('client/html/checkout/standard/onepage', array()); |
|
| 80 | 80 | |
| 81 | - if( $step != 'delivery' && !( in_array( 'delivery', $onepage ) && in_array( $step, $onepage ) ) ) { |
|
| 81 | + if ($step != 'delivery' && !(in_array('delivery', $onepage) && in_array($step, $onepage))) { |
|
| 82 | 82 | return ''; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - $view = $this->setViewParams( $view, $tags, $expire ); |
|
| 85 | + $view = $this->setViewParams($view, $tags, $expire); |
|
| 86 | 86 | |
| 87 | 87 | $html = ''; |
| 88 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 89 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 88 | + foreach ($this->getSubClients() as $subclient) { |
|
| 89 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 90 | 90 | } |
| 91 | 91 | $view->deliveryBody = $html; |
| 92 | 92 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $tplconf = 'client/html/checkout/standard/delivery/standard/template-body'; |
| 114 | 114 | $default = 'checkout/standard/delivery-body-default.php'; |
| 115 | 115 | |
| 116 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 116 | + return $view->render($view->config($tplconf, $default)); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
@@ -125,21 +125,21 @@ discard block |
||
| 125 | 125 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 126 | 126 | * @return string|null String including HTML tags for the header on error |
| 127 | 127 | */ |
| 128 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 128 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 129 | 129 | { |
| 130 | 130 | $view = $this->getView(); |
| 131 | - $step = $view->get( 'standardStepActive' ); |
|
| 132 | - $onepage = $view->config( 'client/html/checkout/standard/onepage', array() ); |
|
| 131 | + $step = $view->get('standardStepActive'); |
|
| 132 | + $onepage = $view->config('client/html/checkout/standard/onepage', array()); |
|
| 133 | 133 | |
| 134 | - if( $step != 'delivery' && !( in_array( 'delivery', $onepage ) && in_array( $step, $onepage ) ) ) { |
|
| 134 | + if ($step != 'delivery' && !(in_array('delivery', $onepage) && in_array($step, $onepage))) { |
|
| 135 | 135 | return ''; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - $view = $this->setViewParams( $view, $tags, $expire ); |
|
| 138 | + $view = $this->setViewParams($view, $tags, $expire); |
|
| 139 | 139 | |
| 140 | 140 | $html = ''; |
| 141 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 142 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 141 | + foreach ($this->getSubClients() as $subclient) { |
|
| 142 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 143 | 143 | } |
| 144 | 144 | $view->deliveryHeader = $html; |
| 145 | 145 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $tplconf = 'client/html/checkout/standard/delivery/standard/template-header'; |
| 168 | 168 | $default = 'checkout/standard/delivery-header-default.php'; |
| 169 | 169 | |
| 170 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 170 | + return $view->render($view->config($tplconf, $default)); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | * @param string|null $name Name of the sub-client (Default if null) |
| 179 | 179 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 180 | 180 | */ |
| 181 | - public function getSubClient( $type, $name = null ) |
|
| 181 | + public function getSubClient($type, $name = null) |
|
| 182 | 182 | { |
| 183 | 183 | /** client/html/checkout/standard/delivery/decorators/excludes |
| 184 | 184 | * Excludes decorators added by the "common" option from the checkout standard delivery html client |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | * @see client/html/checkout/standard/delivery/decorators/global |
| 255 | 255 | */ |
| 256 | 256 | |
| 257 | - return $this->createSubClient( 'checkout/standard/delivery/' . $type, $name ); |
|
| 257 | + return $this->createSubClient('checkout/standard/delivery/'.$type, $name); |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | |
@@ -270,25 +270,25 @@ discard block |
||
| 270 | 270 | try |
| 271 | 271 | { |
| 272 | 272 | $context = $this->getContext(); |
| 273 | - $basketCtrl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' ); |
|
| 273 | + $basketCtrl = \Aimeos\Controller\Frontend\Factory::createController($context, 'basket'); |
|
| 274 | 274 | |
| 275 | 275 | // only start if there's something to do |
| 276 | - if( ( $serviceId = $view->param( 'c_deliveryoption', null ) ) !== null ) |
|
| 276 | + if (($serviceId = $view->param('c_deliveryoption', null)) !== null) |
|
| 277 | 277 | { |
| 278 | - $serviceCtrl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'service' ); |
|
| 278 | + $serviceCtrl = \Aimeos\Controller\Frontend\Factory::createController($context, 'service'); |
|
| 279 | 279 | |
| 280 | - $attributes = $view->param( 'c_delivery/' . $serviceId, array() ); |
|
| 281 | - $errors = $serviceCtrl->checkServiceAttributes( 'delivery', $serviceId, $attributes ); |
|
| 280 | + $attributes = $view->param('c_delivery/'.$serviceId, array()); |
|
| 281 | + $errors = $serviceCtrl->checkServiceAttributes('delivery', $serviceId, $attributes); |
|
| 282 | 282 | |
| 283 | - foreach( $errors as $key => $msg ) |
|
| 283 | + foreach ($errors as $key => $msg) |
|
| 284 | 284 | { |
| 285 | - if( $msg === null ) { |
|
| 286 | - unset( $errors[$key] ); |
|
| 285 | + if ($msg === null) { |
|
| 286 | + unset($errors[$key]); |
|
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | - if( count( $errors ) === 0 ) { |
|
| 291 | - $basketCtrl->setService( 'delivery', $serviceId, $attributes ); |
|
| 290 | + if (count($errors) === 0) { |
|
| 291 | + $basketCtrl->setService('delivery', $serviceId, $attributes); |
|
| 292 | 292 | } else { |
| 293 | 293 | $view->standardStepActive = 'delivery'; |
| 294 | 294 | } |
@@ -302,13 +302,13 @@ discard block |
||
| 302 | 302 | |
| 303 | 303 | // Test if delivery service is available |
| 304 | 304 | $services = $basketCtrl->get()->getServices(); |
| 305 | - if( !isset( $view->standardStepActive ) && !array_key_exists( 'delivery', $services ) ) |
|
| 305 | + if (!isset($view->standardStepActive) && !array_key_exists('delivery', $services)) |
|
| 306 | 306 | { |
| 307 | 307 | $view->standardStepActive = 'delivery'; |
| 308 | 308 | return false; |
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | - catch( \Exception $e ) |
|
| 311 | + catch (\Exception $e) |
|
| 312 | 312 | { |
| 313 | 313 | $view->standardStepActive = 'delivery'; |
| 314 | 314 | throw $e; |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | */ |
| 324 | 324 | protected function getSubClientNames() |
| 325 | 325 | { |
| 326 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 326 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | |
@@ -335,24 +335,24 @@ discard block |
||
| 335 | 335 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 336 | 336 | * @return \Aimeos\MW\View\Iface Modified view object |
| 337 | 337 | */ |
| 338 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 338 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 339 | 339 | { |
| 340 | - if( !isset( $this->cache ) ) |
|
| 340 | + if (!isset($this->cache)) |
|
| 341 | 341 | { |
| 342 | 342 | $context = $this->getContext(); |
| 343 | 343 | |
| 344 | - $basketCntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' ); |
|
| 345 | - $serviceCntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'service' ); |
|
| 344 | + $basketCntl = \Aimeos\Controller\Frontend\Factory::createController($context, 'basket'); |
|
| 345 | + $serviceCntl = \Aimeos\Controller\Frontend\Factory::createController($context, 'service'); |
|
| 346 | 346 | |
| 347 | 347 | $basket = $basketCntl->get(); |
| 348 | 348 | |
| 349 | - $services = $serviceCntl->getServices( 'delivery', $basket ); |
|
| 349 | + $services = $serviceCntl->getServices('delivery', $basket); |
|
| 350 | 350 | $serviceAttributes = $servicePrices = array(); |
| 351 | 351 | |
| 352 | - foreach( $services as $id => $service ) |
|
| 352 | + foreach ($services as $id => $service) |
|
| 353 | 353 | { |
| 354 | - $serviceAttributes[$id] = $serviceCntl->getServiceAttributes( 'delivery', $id, $basket ); |
|
| 355 | - $servicePrices[$id] = $serviceCntl->getServicePrice( 'delivery', $id, $basket ); |
|
| 354 | + $serviceAttributes[$id] = $serviceCntl->getServiceAttributes('delivery', $id, $basket); |
|
| 355 | + $servicePrices[$id] = $serviceCntl->getServicePrice('delivery', $id, $basket); |
|
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | $view->deliveryServices = $services; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | // Strings for translation |
| 16 | -sprintf( 'payment' ); |
|
| 16 | +sprintf('payment'); |
|
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | /** |
@@ -72,21 +72,21 @@ discard block |
||
| 72 | 72 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 73 | 73 | * @return string HTML code |
| 74 | 74 | */ |
| 75 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 75 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 76 | 76 | { |
| 77 | 77 | $view = $this->getView(); |
| 78 | - $step = $view->get( 'standardStepActive' ); |
|
| 79 | - $onepage = $view->config( 'client/html/checkout/standard/onepage', array() ); |
|
| 78 | + $step = $view->get('standardStepActive'); |
|
| 79 | + $onepage = $view->config('client/html/checkout/standard/onepage', array()); |
|
| 80 | 80 | |
| 81 | - if( $step != 'payment' && !( in_array( 'payment', $onepage ) && in_array( $step, $onepage ) ) ) { |
|
| 81 | + if ($step != 'payment' && !(in_array('payment', $onepage) && in_array($step, $onepage))) { |
|
| 82 | 82 | return ''; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - $view = $this->setViewParams( $view, $tags, $expire ); |
|
| 85 | + $view = $this->setViewParams($view, $tags, $expire); |
|
| 86 | 86 | |
| 87 | 87 | $html = ''; |
| 88 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 89 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 88 | + foreach ($this->getSubClients() as $subclient) { |
|
| 89 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 90 | 90 | } |
| 91 | 91 | $view->paymentBody = $html; |
| 92 | 92 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $tplconf = 'client/html/checkout/standard/payment/standard/template-body'; |
| 114 | 114 | $default = 'checkout/standard/payment-body-default.php'; |
| 115 | 115 | |
| 116 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 116 | + return $view->render($view->config($tplconf, $default)); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
@@ -125,21 +125,21 @@ discard block |
||
| 125 | 125 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 126 | 126 | * @return string|null String including HTML tags for the header on error |
| 127 | 127 | */ |
| 128 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 128 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 129 | 129 | { |
| 130 | 130 | $view = $this->getView(); |
| 131 | - $step = $view->get( 'standardStepActive' ); |
|
| 132 | - $onepage = $view->config( 'client/html/checkout/standard/onepage', array() ); |
|
| 131 | + $step = $view->get('standardStepActive'); |
|
| 132 | + $onepage = $view->config('client/html/checkout/standard/onepage', array()); |
|
| 133 | 133 | |
| 134 | - if( $step != 'payment' && !( in_array( 'payment', $onepage ) && in_array( $step, $onepage ) ) ) { |
|
| 134 | + if ($step != 'payment' && !(in_array('payment', $onepage) && in_array($step, $onepage))) { |
|
| 135 | 135 | return ''; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - $view = $this->setViewParams( $view, $tags, $expire ); |
|
| 138 | + $view = $this->setViewParams($view, $tags, $expire); |
|
| 139 | 139 | |
| 140 | 140 | $html = ''; |
| 141 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 142 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 141 | + foreach ($this->getSubClients() as $subclient) { |
|
| 142 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 143 | 143 | } |
| 144 | 144 | $view->paymentHeader = $html; |
| 145 | 145 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $tplconf = 'client/html/checkout/standard/payment/standard/template-header'; |
| 168 | 168 | $default = 'checkout/standard/payment-header-default.php'; |
| 169 | 169 | |
| 170 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 170 | + return $view->render($view->config($tplconf, $default)); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | * @param string|null $name Name of the sub-client (Default if null) |
| 179 | 179 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 180 | 180 | */ |
| 181 | - public function getSubClient( $type, $name = null ) |
|
| 181 | + public function getSubClient($type, $name = null) |
|
| 182 | 182 | { |
| 183 | 183 | /** client/html/checkout/standard/payment/decorators/excludes |
| 184 | 184 | * Excludes decorators added by the "common" option from the checkout standard payment html client |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | * @see client/html/checkout/standard/payment/decorators/global |
| 255 | 255 | */ |
| 256 | 256 | |
| 257 | - return $this->createSubClient( 'checkout/standard/payment/' . $type, $name ); |
|
| 257 | + return $this->createSubClient('checkout/standard/payment/'.$type, $name); |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | |
@@ -270,25 +270,25 @@ discard block |
||
| 270 | 270 | try |
| 271 | 271 | { |
| 272 | 272 | $context = $this->getContext(); |
| 273 | - $basketCtrl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' ); |
|
| 273 | + $basketCtrl = \Aimeos\Controller\Frontend\Factory::createController($context, 'basket'); |
|
| 274 | 274 | |
| 275 | 275 | // only start if there's something to do |
| 276 | - if( ( $serviceId = $view->param( 'c_paymentoption', null ) ) !== null ) |
|
| 276 | + if (($serviceId = $view->param('c_paymentoption', null)) !== null) |
|
| 277 | 277 | { |
| 278 | - $serviceCtrl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'service' ); |
|
| 278 | + $serviceCtrl = \Aimeos\Controller\Frontend\Factory::createController($context, 'service'); |
|
| 279 | 279 | |
| 280 | - $attributes = $view->param( 'c_payment/' . $serviceId, array() ); |
|
| 281 | - $errors = $serviceCtrl->checkServiceAttributes( 'payment', $serviceId, $attributes ); |
|
| 280 | + $attributes = $view->param('c_payment/'.$serviceId, array()); |
|
| 281 | + $errors = $serviceCtrl->checkServiceAttributes('payment', $serviceId, $attributes); |
|
| 282 | 282 | |
| 283 | - foreach( $errors as $key => $msg ) |
|
| 283 | + foreach ($errors as $key => $msg) |
|
| 284 | 284 | { |
| 285 | - if( $msg === null ) { |
|
| 286 | - unset( $errors[$key] ); |
|
| 285 | + if ($msg === null) { |
|
| 286 | + unset($errors[$key]); |
|
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | - if( count( $errors ) === 0 ) { |
|
| 291 | - $basketCtrl->setService( 'payment', $serviceId, $attributes ); |
|
| 290 | + if (count($errors) === 0) { |
|
| 291 | + $basketCtrl->setService('payment', $serviceId, $attributes); |
|
| 292 | 292 | } else { |
| 293 | 293 | $view->standardStepActive = 'payment'; |
| 294 | 294 | } |
@@ -302,13 +302,13 @@ discard block |
||
| 302 | 302 | |
| 303 | 303 | // Test if payment service is available |
| 304 | 304 | $services = $basketCtrl->get()->getServices(); |
| 305 | - if( !isset( $view->standardStepActive ) && !array_key_exists( 'payment', $services ) ) |
|
| 305 | + if (!isset($view->standardStepActive) && !array_key_exists('payment', $services)) |
|
| 306 | 306 | { |
| 307 | 307 | $view->standardStepActive = 'payment'; |
| 308 | 308 | return false; |
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | - catch( \Exception $e ) |
|
| 311 | + catch (\Exception $e) |
|
| 312 | 312 | { |
| 313 | 313 | $view->standardStepActive = 'payment'; |
| 314 | 314 | throw $e; |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | */ |
| 324 | 324 | protected function getSubClientNames() |
| 325 | 325 | { |
| 326 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 326 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | |
@@ -335,24 +335,24 @@ discard block |
||
| 335 | 335 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 336 | 336 | * @return \Aimeos\MW\View\Iface Modified view object |
| 337 | 337 | */ |
| 338 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 338 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 339 | 339 | { |
| 340 | - if( !isset( $this->cache ) ) |
|
| 340 | + if (!isset($this->cache)) |
|
| 341 | 341 | { |
| 342 | 342 | $context = $this->getContext(); |
| 343 | 343 | |
| 344 | - $basketCntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' ); |
|
| 345 | - $serviceCntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'service' ); |
|
| 344 | + $basketCntl = \Aimeos\Controller\Frontend\Factory::createController($context, 'basket'); |
|
| 345 | + $serviceCntl = \Aimeos\Controller\Frontend\Factory::createController($context, 'service'); |
|
| 346 | 346 | |
| 347 | 347 | $basket = $basketCntl->get(); |
| 348 | 348 | |
| 349 | - $services = $serviceCntl->getServices( 'payment', $basket ); |
|
| 349 | + $services = $serviceCntl->getServices('payment', $basket); |
|
| 350 | 350 | $serviceAttributes = $servicePrices = array(); |
| 351 | 351 | |
| 352 | - foreach( $services as $id => $service ) |
|
| 352 | + foreach ($services as $id => $service) |
|
| 353 | 353 | { |
| 354 | - $serviceAttributes[$id] = $serviceCntl->getServiceAttributes( 'payment', $id, $basket ); |
|
| 355 | - $servicePrices[$id] = $serviceCntl->getServicePrice( 'payment', $id, $basket ); |
|
| 354 | + $serviceAttributes[$id] = $serviceCntl->getServiceAttributes('payment', $id, $basket); |
|
| 355 | + $servicePrices[$id] = $serviceCntl->getServicePrice('payment', $id, $basket); |
|
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | $view->paymentServices = $services; |