/** * Remove entity * * @param \XLite\Model\AEntity $entity Entity * * @return boolean */ protected function removeEntity(\XLite\Model\AEntity $entity) { $product = $entity->getProduct(); if ($this->isNeedUpdateStock() && !$entity->isDeleted()) { // Return items to stock $entity->changeAmount($entity->getAmount()); } $attributes = $this->getAttributeValuesAsString($entity); \XLite\Controller\Admin\Order::setOrderChanges('Removed items:' . $entity->getItemId(), sprintf('[%s] %s (%s x %d%s)', $product->getSku(), $product->getName(), static::formatPrice($entity->getPrice(), $entity->getOrder()->getCurrency(), true), $entity->getAmount(), $attributes ? ', ' . $attributes : '')); return parent::removeEntity($entity); }