Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Storefront: skipping of payment checkout page for orders with zero to…
…tal amount added.
- Loading branch information
abolabo@gmail.com
committed
Mar 1, 2013
1 parent
6a5d84d
commit e1521a6
Showing
8 changed files
with
150 additions
and
19 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
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
74 changes: 74 additions & 0 deletions
74
public_html/storefront/controller/responses/checkout/no_payment.php
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
/*------------------------------------------------------------------------------ | ||
$Id$ | ||
AbanteCart, Ideal OpenSource Ecommerce Solution | ||
http://www.AbanteCart.com | ||
Copyright © 2011 Belavier Commerce LLC | ||
This source file is subject to Open Software License (OSL 3.0) | ||
License details is bundled with this package in the file LICENSE.txt. | ||
It is also available at this URL: | ||
<http://www.opensource.org/licenses/OSL-3.0> | ||
UPGRADE NOTE: | ||
Do not edit or add to this file if you wish to upgrade AbanteCart to newer | ||
versions in the future. If you wish to customize AbanteCart for your | ||
needs please refer to http://www.AbanteCart.com for more information. | ||
------------------------------------------------------------------------------*/ | ||
|
||
class ControllerResponsesCheckoutNoPayment extends AController { | ||
public function main() { | ||
|
||
$item = HtmlElementFactory::create( array( 'type' => 'button', | ||
'name' => 'back', | ||
'style' => 'button', | ||
'text' => $this->language->get('button_back') )); | ||
$item = $item->getHtml(); | ||
$this->view->assign('button_back', $item); | ||
|
||
$item = HtmlElementFactory::create( array( 'type' => 'button', | ||
'name' => 'checkout', | ||
'style' => 'button', | ||
'text' => $this->language->get('button_confirm') )); | ||
$item = $item->getHtml(); | ||
$this->view->assign('button_confirm', $item); | ||
|
||
$this->view->assign('continue', $this->html->getSecureURL('checkout/success')); | ||
|
||
if ($this->request->get['rt'] != 'checkout/guest_step_3') { | ||
$this->view->assign('back', $this->html->getSecureURL('checkout/cart')); | ||
} else { | ||
$this->view->assign('back', $this->html->getSecureURL('checkout/guest_step_2')); | ||
} | ||
|
||
$this->processTemplate('responses/checkout/no_payment.tpl' ); | ||
} | ||
|
||
public function api() { | ||
$data = array(); | ||
|
||
$data['text_note'] = $this->language->get('text_note'); | ||
$data['process_rt'] = 'checkout/no_payment/api_confirm'; | ||
|
||
$this->load->library('json'); | ||
$this->response->setOutput(AJson::encode($data)); | ||
} | ||
|
||
|
||
public function api_confirm() { | ||
$data = array(); | ||
|
||
$this->confirm(); | ||
$data[ 'success' ] = 'completed'; | ||
|
||
$this->load->library('json'); | ||
$this->response->setOutput(AJson::encode($data)); | ||
} | ||
|
||
public function confirm() { | ||
$this->load->model('checkout/order'); | ||
$this->model_checkout_order->confirm($this->session->data['order_id'], $this->config->get('config_order_status_id')); | ||
} | ||
} |
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
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
25 changes: 25 additions & 0 deletions
25
public_html/storefront/view/default/template/responses/checkout/no_payment.tpl
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="buttons"> | ||
<table> | ||
<tr> | ||
<td align="left"><?php echo $button_back; ?></td> | ||
<td align="right"><?php echo $button_confirm; ?></td> | ||
</tr> | ||
</table> | ||
</div> | ||
<script type="text/javascript"><!-- | ||
$('#back').click(function() { | ||
location = '<?php echo $back; ?>'; | ||
}); | ||
$('body').append('<div id="blocker" style="display: none; width: 1667px; height: 1200px; z-index: 1001; background: none repeat scroll 0 0 white; opacity: 0; left: 0; position: absolute; top: 0;"></div>'); | ||
$('#checkout').click(function() { | ||
$('#blocker').show(); | ||
$.ajax({ | ||
type: 'GET', | ||
url: 'index.php?rt=r/checkout/no_payment/confirm', | ||
success: function() { | ||
location = '<?php echo $continue; ?>'; | ||
} | ||
}); | ||
}); | ||
//--></script> |