first commit
This commit is contained in:
36
class/payments/class.Dobirka.php
Normal file
36
class/payments/class.Dobirka.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use KupShop\OrderingBundle\Exception\PaymentException;
|
||||
|
||||
class Dobirka extends Payment
|
||||
{
|
||||
public static $name = 'Platba na dobírku';
|
||||
protected ?string $defaultIcon = '../../common/static/payments/dobirka.svg';
|
||||
|
||||
public $class = 'Dobirka';
|
||||
|
||||
public $method;
|
||||
|
||||
protected $pay_method = Payment::METHOD_COD;
|
||||
|
||||
public function requiresEET()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $cart \Cart
|
||||
*/
|
||||
public function check(CartBase $cart)
|
||||
{
|
||||
if ($cart->hasVirtualProducts()) {
|
||||
$this->exception = new PaymentException(translate_shop('errorDobirkaVirtualProducts', 'payment'), translate_shop('errorDobirkaVirtualProducts_short', 'payment'));
|
||||
}
|
||||
|
||||
if (!empty($this->exception) && $cart->max_step != 0) {
|
||||
throw $this->exception;
|
||||
}
|
||||
|
||||
return parent::check($cart);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user