-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from craigchristenson/onepagecheckout
Adding support for onestepcheckout and refactoring standard and IWD checkout
- Loading branch information
Showing
8 changed files
with
2,666 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
<layout version="0.1.0"> | ||
<checkout_onepage_index> | ||
<reference name="head"> | ||
<block type="core/template" name="twocheckout.script" template="twocheckout/script.phtml"/> | ||
<action method="addJs"><file>twocheckout/paymentForm.js</file></action> | ||
<block type="core/template" name="twocheckout.script" template="twocheckout/script.phtml"/> | ||
<action method="addJs"><file>twocheckout/2co.js</file></action> | ||
<action method="addJs"><file>twocheckout/paymentForm.js</file></action> | ||
</reference> | ||
</checkout_onepage_index> | ||
|
||
<opc_index_index> | ||
<reference name="head"> | ||
<block type="core/template" name="twocheckout.script" template="twocheckout/script.phtml"/> | ||
<action method="addJs"><file>twocheckout/2co.js</file></action> | ||
<action method="addJs"><file>twocheckout/paymentFormIWD.js</file></action> | ||
</reference> | ||
</opc_index_index> | ||
<onestepcheckout_index_index> | ||
<reference name="head"> | ||
<block type="core/template" name="twocheckout.script" template="twocheckout/script.phtml"/> | ||
<action method="addJs"><file>twocheckout/2co.js</file></action> | ||
<action method="addJs"><file>twocheckout/paymentFormOneStep.js</file></action> | ||
</reference> | ||
</onestepcheckout_index_index> | ||
</layout> |
97 changes: 50 additions & 47 deletions
97
app/design/frontend/base/default/template/twocheckout/form.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,50 @@ | ||
<?php $_code = $this->getMethodCode() ?> | ||
<div> | ||
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;"> | ||
<li> | ||
<label for="<?php echo $_code ?>_number" class="required"><em>*</em><?php echo $this->__("Card Number") ?></label> | ||
<div class="input-box"> | ||
<table> | ||
<tr> | ||
<td><input value="" type="text" id="ccNo" class="required-entry input-text"/></td> | ||
<td><div id="<?php echo $_code ?>_card_icon"></div></td> | ||
</tr> | ||
</table> | ||
</div> | ||
</li> | ||
<li> | ||
<label for="<?php echo $_code ?>_cvc" class="required"><em>*</em><?php echo $this->__("CVC") ?></label> | ||
<div class="input-box"> | ||
<input value="" type="text" id="cvv" class="required-entry"/> | ||
</div> | ||
</li> | ||
<li> | ||
<label for="<?php echo $_code ?>_expiry_month" class="required"><em>*</em><?php echo $this->__("Expiration Date") ?></label> | ||
<div class="input-box"> | ||
<div class="v-fix"> | ||
<select id="expMonth" class="month"> | ||
<?php foreach ($this->getTwocheckoutCcMonths() as $k => $v): ?> | ||
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $this->getInfoData($_code . '_expiry_month')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option> | ||
<?php endforeach ?> | ||
</select> | ||
</div> | ||
<div class="v-fix"> | ||
<select id="expYear" class="year"> | ||
<?php foreach ($this->getTwocheckoutCcYears() as $k => $v): ?> | ||
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $this->getInfoData($_code . '_expiry_year')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option> | ||
<?php endforeach ?> | ||
</select> | ||
</div> | ||
</div> | ||
</li> | ||
<li> | ||
<input id="twocheckout_token" name="token" type="hidden" value="" /> | ||
<input id="publishableKey" type="hidden" value="<?php echo $this->getPublicKey(); ?>" /> | ||
<input id="sellerId" type="hidden" maxlength="16" width="20" value="<?php echo $this->getSellerId(); ?>" /> | ||
</li> | ||
</ul> | ||
</div> | ||
<div id="infoArea"></div> | ||
<?php $_code = $this->getMethodCode() ?> | ||
<div> | ||
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;"> | ||
<li> | ||
<label for="<?php echo $_code ?>_number" class="required"><em>*</em><?php echo $this->__("Card Number") ?></label> | ||
<div class="input-box"> | ||
<table> | ||
<tr> | ||
<td><input value="" type="text" pattern="\d*" id="ccNo" class="required-entry input-text validate-cc-number" autocomplete="off"/></td> | ||
</tr> | ||
</table> | ||
</div> | ||
</li> | ||
<li> | ||
<label for="<?php echo $_code ?>_cvc" class="required"><em>*</em><?php echo $this->__("CVC") ?></label> | ||
<div class="cvv tco-input-cvv"> | ||
<input value="" type="text" pattern="\d*" id="cvv" class="required-entry input-text" autocomplete="off" /> | ||
</div> | ||
</li> | ||
<li> | ||
<label for="<?php echo $_code ?>_expiry_month" class="required"><em>*</em><?php echo $this->__("Expiration Date") ?></label> | ||
<div class="input-box"> | ||
<div class="v-fix"> | ||
<select id="expMonth" class="month required-entry"> | ||
<?php foreach ($this->getTwocheckoutCcMonths() as $k => $v): ?> | ||
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $this->getInfoData($_code . '_expiry_month')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option> | ||
<?php endforeach ?> | ||
</select> | ||
</div> | ||
<div class="v-fix"> | ||
<select id="expYear" class="year required-entry"> | ||
<?php foreach ($this->getTwocheckoutCcYears() as $k => $v): ?> | ||
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $this->getInfoData($_code . '_expiry_year')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option> | ||
<?php endforeach ?> | ||
</select> | ||
</div> | ||
</div> | ||
</li> | ||
<li><div id="<?php echo $_code ?>_card_icon"></div></li> | ||
<li> | ||
<input id="twocheckout_token" name="token" type="hidden" value="" /> | ||
<input id="publishableKey" type="hidden" value="<?php echo $this->getPublicKey(); ?>" /> | ||
<input id="sellerId" type="hidden" maxlength="16" width="20" value="<?php echo $this->getSellerId(); ?>" /> | ||
</li> | ||
</ul> | ||
</div> | ||
<div id="infoArea"></div> | ||
<style> | ||
.tco-input-cvv {width:100px;} | ||
</style> |
2 changes: 1 addition & 1 deletion
2
app/design/frontend/base/default/template/twocheckout/script.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<?php $twocheckout = Mage::getModel('twocheckout/payment'); ?> | ||
<?php echo $twocheckout->getApiUrl(); ?> | ||
<?php echo $twocheckout->getEnvJS(); ?> |
Oops, something went wrong.