コード例 #1
0
ファイル: standard.php プロジェクト: sansandeep143/av
 /**
  * Returns if this method can be used with the current cart.
  *
  * @param EventgalleryLibraryLineitemcontainer $cart
  *
  * @return bool
  */
 public function isEligible($cart)
 {
     foreach ($cart->getLineItems() as $imagelineitem) {
         /**
          * @var EventgalleryLibraryImagelineitem $imagelineitem
          */
         // if at least one item in the cart is not digital return true;
         if (!$imagelineitem->getImageType()->isDigital()) {
             return true;
         }
     }
     return false;
 }
コード例 #2
0
ファイル: standard.php プロジェクト: sansandeep143/av
 /**
  * Returns if this method can be used with the current cart.
  *
  * @param EventgalleryLibraryLineitemcontainer $cart
  *
  * @return bool
  */
 public function isEligible($cart)
 {
     // if there is no rule, this method is valued
     if (!isset($this->getData()->rules)) {
         return true;
     }
     $itemCountBased = isset($this->getData()->rules->type) && $this->getData()->rules->type == 'itemcount';
     if ($itemCountBased) {
         // if the minimum amount is not defined skip this
         if (isset($this->getData()->rules->minAmount)) {
             // if the item count is not high enough
             if ($cart->getLineItemsTotalCount() < $this->getData()->rules->minAmount) {
                 return false;
             }
         }
         // if the maximum amount is not defined skip this
         if (isset($this->getData()->rules->maxAmount) && $this->getData()->rules->maxAmount > 0) {
             // if the item count is too high
             if ($cart->getLineItemsTotalCount() > $this->getData()->rules->maxAmount) {
                 return false;
             }
         }
     } else {
         // if the minimum amount is not defined skip this
         if (isset($this->getData()->rules->minAmount)) {
             // if the subtotal is not high enough
             if ($cart->getSubTotal()->getAmount() < $this->getData()->rules->minAmount) {
                 return false;
             }
         }
         // if the maximum amount is not defined skip this
         if (isset($this->getData()->rules->maxAmount) && $this->getData()->rules->maxAmount > 0) {
             // if the subtotal is too high
             if ($cart->getSubTotal()->getAmount() > $this->getData()->rules->maxAmount) {
                 return false;
             }
         }
     }
     return true;
 }
コード例 #3
0
ファイル: order.php プロジェクト: sansandeep143/av
 public function __construct($orderid)
 {
     $this->_lineitemcontainer_id = $orderid;
     $this->_loadLineItemContainer();
     parent::__construct();
 }
コード例 #4
0
ファイル: cart.php プロジェクト: sansandeep143/av
 public function __construct($user_id)
 {
     $this->_user_id = $user_id;
     $this->_loadLineItemContainer();
     parent::__construct();
 }