sarga/packages/Webkul/Discount/src/Helpers/ValidatesDiscount.php

24 lines
525 B
PHP
Raw Normal View History

<?php
namespace Webkul\Discount\Helpers;
use Webkul\Discount\Helpers\Discount;
2019-06-17 10:52:18 +00:00
class ValidatesDiscount
{
/**
* Validates the currently applied cart rule on the current cart
*/
public function validate($cart)
{
$appliedRule = $this->cartRuleCart->findWhere([
'cart_id' => $cart->id
]);
if ($appliedRule->count()) {
$appliedRule = $appliedRule->first()->cart_rule;
$applicability = $this->checkApplicability($appliedRule);
}
}
}