Beispiel #1
0
 /**
  * Check order item and return true if this is valid
  *
  * @param \XLite\Model\OrderItem $entity Order item entity
  *
  * @return boolean
  */
 protected function isValidEntity($entity)
 {
     $result = parent::isValidEntity($entity);
     if ($result && ($entity->getProduct()->mustHaveVariants() || $entity->getVariant())) {
         $variant = $entity->getProduct()->getVariantByAttributeValuesIds($entity->getAttributeValuesIds());
         $result = $variant && $entity->getVariant() && $variant->getId() == $entity->getVariant()->getId();
     }
     return $result;
 }