Skip to content

Commit 2bdd36a

Browse files
authored
Reduced multiple dispatch events in login form for other themes. (OpenMage#1407)
1 parent ca98fed commit 2bdd36a

File tree

2 files changed

+14
-12
lines changed
  • app/design/frontend
    • base/default/template/persistent/checkout/onepage
    • default/iphone/template/persistent/checkout/onepage

2 files changed

+14
-12
lines changed

app/design/frontend/base/default/template/persistent/checkout/onepage/login.phtml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@
3232
*/
3333
/** @var $this Mage_Checkout_Block_Onepage_Login */
3434
?>
35+
<?php $isAllowedGuestCheckout = $this->getQuote()->isAllowedGuestCheckout() ?>
3536
<div class="col2-set">
3637
<?php echo $this->getChildHtml('login_before')?>
3738
<div class="col-1">
38-
<h3><?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?><?php echo $this->__('Checkout as a Guest or Register') ?><?php else: ?><?php echo $this->__('Register to Create an Account') ?><?php endif; ?></h3>
39-
<?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
39+
<h3><?php if($isAllowedGuestCheckout): ?><?php echo $this->__('Checkout as a Guest or Register') ?><?php else: ?><?php echo $this->__('Register to Create an Account') ?><?php endif; ?></h3>
40+
<?php if($isAllowedGuestCheckout): ?>
4041
<p><?php echo $this->__('Register with us for future convenience:') ?></p>
4142
<?php else: ?>
4243
<p><strong><?php echo $this->__('Register and save time!') ?></strong><br />
@@ -46,15 +47,15 @@
4647
<li><?php echo $this->__('Easy access to your order history and status') ?></li>
4748
</ul>
4849
<?php endif; ?>
49-
<?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
50+
<?php if($isAllowedGuestCheckout): ?>
5051
<ul class="form-list">
51-
<?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
52+
<?php if($isAllowedGuestCheckout): ?>
5253
<li class="control">
5354
<input type="radio" name="checkout_method" id="login:guest" value="guest"<?php if($this->getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_GUEST): ?> checked="checked"<?php endif; ?> class="radio" /><label for="login:guest"><?php echo $this->__('Checkout as Guest') ?></label>
5455
</li>
5556
<?php endif; ?>
5657
<li class="control">
57-
<input type="radio" name="checkout_method" id="login:register" value="register"<?php if($this->getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER || !$this->getQuote()->isAllowedGuestCheckout()): ?> checked="checked"<?php endif ?> class="radio" /><label for="login:register"><?php echo $this->__('Register') ?></label>
58+
<input type="radio" name="checkout_method" id="login:register" value="register"<?php if($this->getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER || !$isAllowedGuestCheckout): ?> checked="checked"<?php endif ?> class="radio" /><label for="login:register"><?php echo $this->__('Register') ?></label>
5859
</li>
5960
</ul>
6061
<h4><?php echo $this->__('Register and save time!') ?></h4>
@@ -100,7 +101,7 @@
100101
<div class="col-1">
101102
<div class="buttons-set">
102103
<p class="required">&nbsp;</p>
103-
<?php if ($this->getQuote()->isAllowedGuestCheckout()): ?>
104+
<?php if ($isAllowedGuestCheckout): ?>
104105
<button id="onepage-guest-register-button" type="button" class="button" onclick="checkout.setMethod();"><span><span><?php echo $this->__('Continue') ?></span></span></button>
105106
<?php elseif ($this->helper('checkout')->isCustomerMustBeLogged()): ?>
106107
<button id="onepage-guest-register-button" type="button" class="button" onclick="window.location='<?php echo $this->helper('checkout/url')->getRegistrationUrl();?>'"><span><span><?php echo $this->__('Register') ?></span></span></button>

app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
*/
3333
/** @var $this Mage_Checkout_Block_Onepage_Login */
3434
?>
35+
<?php $isAllowedGuestCheckout = $this->getQuote()->isAllowedGuestCheckout() ?>
3536
<div class="col2-set">
3637
<div class="col-1">
3738
<h4><?php echo $this->__('Login') ?></h4>
@@ -68,8 +69,8 @@
6869
</div>
6970
<?php echo $this->getChildHtml('login_before')?>
7071
<div class="col-2">
71-
<h4><?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?><?php echo $this->__('Checkout as a Guest or Register') ?><?php else: ?><?php echo $this->__('Register to Create an Account') ?><?php endif; ?></h4>
72-
<?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
72+
<h4><?php if($isAllowedGuestCheckout): ?><?php echo $this->__('Checkout as a Guest or Register') ?><?php else: ?><?php echo $this->__('Register to Create an Account') ?><?php endif; ?></h4>
73+
<?php if($isAllowedGuestCheckout): ?>
7374
<p><?php echo $this->__('Register with us for future convenience:') ?></p>
7475
<?php else: ?>
7576
<p><strong><?php echo $this->__('Register and save time!') ?></strong><br />
@@ -79,18 +80,18 @@
7980
<li><?php echo $this->__('Easy access to your order history and status') ?></li>
8081
</ul>
8182
<?php endif; ?>
82-
<?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
83+
<?php if($isAllowedGuestCheckout): ?>
8384
<ul class="form-list">
84-
<?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>
85+
<?php if($isAllowedGuestCheckout): ?>
8586
<li class="control">
8687
<input type="radio" name="checkout_method" id="login:guest" value="guest"<?php if($this->getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_GUEST): ?> checked="checked"<?php endif; ?> class="radio" /><label for="login:guest"><?php echo $this->__('Checkout as Guest') ?></label>
8788
</li>
8889
<?php endif; ?>
8990
<li class="control">
90-
<input type="radio" name="checkout_method" id="login:register" value="register"<?php if($this->getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER || !$this->getQuote()->isAllowedGuestCheckout()): ?> checked="checked"<?php endif ?> class="radio" /><label for="login:register"><?php echo $this->__('Register') ?></label>
91+
<input type="radio" name="checkout_method" id="login:register" value="register"<?php if($this->getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER || !$isAllowedGuestCheckout): ?> checked="checked"<?php endif ?> class="radio" /><label for="login:register"><?php echo $this->__('Register') ?></label>
9192
</li>
9293
<li class="buttons-set">
93-
<?php if ($this->getQuote()->isAllowedGuestCheckout()): ?>
94+
<?php if ($isAllowedGuestCheckout): ?>
9495
<button id="onepage-guest-register-button" type="button" class="button" onclick="checkout.setMethod();"><span><span><?php echo $this->__('Continue') ?></span></span></button>
9596
<?php elseif ($this->helper('checkout')->isCustomerMustBeLogged()): ?>
9697
<button id="onepage-guest-register-button" type="button" class="button" onclick="window.location='<?php echo $this->helper('checkout/url')->getRegistrationUrl();?>'"><span><span><?php echo $this->__('Register') ?></span></span></button>

0 commit comments

Comments
 (0)