22 private $agreementRepository;
34 $this->agreementRepository = $agreementRepository ?:
35 ObjectManager::getInstance()->get(CheckoutAgreementsRepositoryInterface::class);
36 parent::__construct($context, $coreRegistry);
46 $this->messageManager->addError(
__(
'This condition no longer exists.'));
52 $this->agreementRepository->delete(
$agreement);
53 $this->messageManager->addSuccess(
__(
'You deleted the condition.'));
57 $this->messageManager->addError($e->getMessage());
58 }
catch (\Exception $e) {
59 $this->messageManager->addError(
__(
'Something went wrong while deleting this condition.'));
_redirect($path, $arguments=[])
__construct(Context $context, Registry $coreRegistry, CheckoutAgreementsRepositoryInterface $agreementRepository=null)