Skip to content

Commit

Permalink
+ orderButton parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Dec 1, 2015
1 parent 578e0de commit 3435f56
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ public function createUrl($route = null)
*/
public $orderPage = ['order'];

protected $_orderButton;

public function setOrderButton($value)
{
$this->_orderButton = $value;
}

public function getOrderButton()
{
return $this->_orderButton instanceof Closure ? call_user_func($this->_orderButton, $this) : $this->_orderButton;
}

protected $_paymentMethods;

public function setPaymentMethods($value)
Expand All @@ -98,6 +110,6 @@ public function setPaymentMethods($value)

public function getPaymentMethods()
{
return $this->_paymentMethods instanceof Closure ? call_user_func($this->_paymentMethods) : $this->_paymentMethods;
return $this->_paymentMethods instanceof Closure ? call_user_func($this->_paymentMethods, $this) : $this->_paymentMethods;
}
}
6 changes: 5 additions & 1 deletion src/views/cart/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@
&nbsp;<?= Yii::t('cart', 'I have read and agree to the') ?> <?= Html::a(Yii::t('cart', 'terms of use'), $module->termsPage) ?>
</label> &nbsp; &nbsp;
<?php endif ?>
<?= Html::a('<i class="fa fa-credit-card"></i> ' . Yii::t('cart', 'Make order'), $module->orderPage, ['id' => 'make-order-button', 'class' => ($module->termsPage) ? 'btn btn-success disabled' : 'btn btn-success']); ?>
<?php if ($module->orderButton) : ?>
<?= $module->orderButton ?>
<?php else : ?>
<?= Html::a('<i class="fa fa-credit-card"></i> ' . Yii::t('cart', 'Make order'), $module->orderPage, ['id' => 'make-order-button', 'class' => ($module->termsPage) ? 'btn btn-success disabled' : 'btn btn-success']); ?>
<?php endif ?>
</span></div>
</div>
</section>

0 comments on commit 3435f56

Please sign in to comment.