Skip to content

Commit

Permalink
added parametrization of payment methods
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Nov 30, 2015
1 parent 28dca07 commit 0561eda
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
13 changes: 13 additions & 0 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace hiqdev\yii2\cart;

use Closure;
use Yii;

/**
Expand Down Expand Up @@ -79,4 +80,16 @@ public function buildUrl($route = null)
* Link to the terms of use page.
*/
public $termsPage;

protected $_paymentMethods;

public function setPaymentMethods($value)
{
$this->_paymentMethods = $value;
}

public function getPaymentMethods()
{
return $this->_paymentMethods instanceof Closure ? call_user_func($this->_paymentMethods) : $this->_paymentMethods;
}
}
12 changes: 1 addition & 11 deletions src/views/cart/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,7 @@
<div class="row">
<!-- accepted payments column -->
<div class="col-xs-6">
<p class="lead">Payment Methods:</p>
<img src="https://almsaeedstudio.com/themes/AdminLTE/dist/img/credit/visa.png" alt="Visa">
<img src="https://almsaeedstudio.com/themes/AdminLTE/dist/img/credit/mastercard.png" alt="Mastercard">
<img src="https://almsaeedstudio.com/themes/AdminLTE/dist/img/credit/american-express.png"
alt="American Express">
<img src="https://almsaeedstudio.com/themes/AdminLTE/dist/img/credit/paypal2.png" alt="Paypal">

<p class="text-muted well well-sm no-shadow" style="margin-top: 10px;">
Etsy doostang zoodles disqus groupon greplin oooj voxy zoodles, weebly ning heekya handango imeem plugg
dopplr jibjab, movity jajah plickers sifteo edmodo ifttt zimbra.
</p>
<?= $module->paymentMethods ?>
</div>
<!-- /.col -->
<div class="col-xs-6">
Expand Down

0 comments on commit 0561eda

Please sign in to comment.