Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TotalMinMax.php
Go to the documentation of this file.
1 <?php
7 
10 
18 {
22  const MIN_ORDER_TOTAL = 'min_order_total';
23 
27  const MAX_ORDER_TOTAL = 'max_order_total';
28 
36  public function isApplicable(MethodInterface $paymentMethod, Quote $quote)
37  {
38  $total = $quote->getBaseGrandTotal();
39  $minTotal = $paymentMethod->getConfigData(self::MIN_ORDER_TOTAL);
40  $maxTotal = $paymentMethod->getConfigData(self::MAX_ORDER_TOTAL);
41  if (!empty($minTotal) && $total < $minTotal || !empty($maxTotal) && $total > $maxTotal) {
42  return false;
43  }
44  return true;
45  }
46 }
isApplicable(MethodInterface $paymentMethod, Quote $quote)
Definition: TotalMinMax.php:36
$quote
getConfigData($field, $storeId=null)