本文整理汇总了PHP中Magento\Framework\Message\ManagerInterface::addSuccessMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP ManagerInterface::addSuccessMessage方法的具体用法?PHP ManagerInterface::addSuccessMessage怎么用?PHP ManagerInterface::addSuccessMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Message\ManagerInterface
的用法示例。
在下文中一共展示了ManagerInterface::addSuccessMessage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Refresh suppressed contacts.
*/
public function execute()
{
$result = $this->cronFactory->create()->orderSync();
$this->messageManager->addSuccessMessage($result['message']);
$redirectUrl = $this->getUrl('adminhtml/system_config/edit', ['section' => 'connector_developer_settings']);
$this->_redirect($redirectUrl);
}
示例2: execute
/**
* Refresh suppressed contacts.
*/
public function execute()
{
$result = $this->importerFactory->create()->processQueue();
$this->messageManager->addSuccessMessage($result['message']);
$redirectBack = $this->_redirect->getRefererUrl();
$this->_redirect($redirectBack);
}
示例3: execute
/**
* Refresh suppressed contacts.
*/
public function execute()
{
$this->catalogFactory->create()->resetCatalog();
$this->messageManager->addSuccessMessage(__('Done.'));
$redirectUrl = $this->getUrl('adminhtml/system_config/edit', ['section' => 'connector_developer_settings']);
$this->_redirect($redirectUrl);
}
示例4: execute
/**
* Refresh suppressed contacts.
*/
public function execute()
{
$result = $this->cronFactory->create()->contactSync();
$this->messageManager->addSuccessMessage($result['message']);
$redirectBack = $this->_redirect->getRefererUrl();
$this->_redirect($redirectBack);
}
示例5: execute
/**
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function execute()
{
$redirectUrl = $this->getUrl('adminhtml/system_config/edit', ['section' => 'connector_developer_settings']);
$result = $this->contactFactory->create()->deleteContactIds();
$this->messageManager->addSuccessMessage('Contact id\'s reseted ' . $result);
$this->_redirect($redirectUrl);
}
示例6: execute
/**
* Execute method.
*
* @param \Magento\Framework\Event\Observer $observer
*
* @return $this
* @codingStandardsIgnoreStart
*/
public function execute(\Magento\Framework\Event\Observer $observer)
{
//@codingStandardsIgnoreEnd
$groups = $this->context->getRequest()->getPost('groups');
if (isset($groups['api']['fields']['username']['inherit']) || isset($groups['api']['fields']['password']['inherit'])) {
return $this;
}
$apiUsername = isset($groups['api']['fields']['username']['value']) ? $groups['api']['fields']['username']['value'] : false;
$apiPassword = isset($groups['api']['fields']['password']['value']) ? $groups['api']['fields']['password']['value'] : false;
//skip if the inherit option is selected
if ($apiUsername && $apiPassword) {
$this->helper->log('----VALIDATING ACCOUNT---');
$isValid = $this->test->validate($apiUsername, $apiPassword);
if ($isValid) {
//save endpoint for account
foreach ($isValid->properties as $property) {
if ($property->name == 'ApiEndpoint' && !empty($property->value)) {
$this->saveApiEndpoint($property->value);
break;
}
}
$this->messageManager->addSuccessMessage(__('API Credentials Valid.'));
} else {
$this->messageManager->addWarningMessage(__('Authorization has been denied for this request.'));
}
}
return $this;
}
示例7: execute
/**
* Execute method.
*/
public function execute()
{
$datafield = $this->getRequest()->getParam('name');
$type = $this->getRequest()->getParam('type');
$default = $this->getRequest()->getParam('default');
$visibility = $this->getRequest()->getParam('visibility');
$website = $this->getRequest()->getParam('website', 0);
$client = $this->dataHelper->getWebsiteApiClient($website);
if (!empty($datafield)) {
$response = $client->postDataFields($datafield, $type, $visibility, $default);
if (isset($response->message)) {
$this->messageManager->addErrorMessage($response->message);
} else {
$this->messageManager->addSuccessMessage('Datafield : ' . $datafield . ' created.');
}
}
}
示例8: execute
/**
* Execute method.
*/
public function execute()
{
$result = ['errors' => false, 'message' => ''];
$website = $this->getRequest()->getParam('website', 0);
$client = false;
if ($this->data->isEnabled()) {
$client = $this->data->getWebsiteApiClient($website);
}
$redirectUrl = $this->getUrl('adminhtml/system_config/edit', ['section' => 'connector_developer_settings']);
if (!$client) {
$this->messageManager->addNoticeMessage('Please enable api first.');
} else {
// get all possible datatifileds
$datafields = $this->datafield->getContactDatafields();
foreach ($datafields as $key => $datafield) {
$response = $client->postDataFields($datafield);
//ignore existing datafields message
if (isset($response->message) && $response->message != \Dotdigitalgroup\Email\Model\Apiconnector\Client::API_ERROR_DATAFIELD_EXISTS) {
$result['errors'] = true;
$result['message'] .= ' Datafield ' . $datafield['name'] . ' - ' . $response->message . '</br>';
} else {
if ($website) {
$scope = 'websites';
$scopeId = $website;
} else {
$scope = 'default';
$scopeId = '0';
}
/*
* map the succesful created datafield
*/
$this->data->saveConfigData('connector_data_mapping/customer_data/' . $key, strtoupper($datafield['name']), $scope, $scopeId);
$this->data->log('successfully connected : ' . $datafield['name']);
}
}
if ($result['errors']) {
$this->messageManager->addNoticeMessage($result['message']);
} else {
$this->messageManager->addSuccessMessage('All Datafields Created And Mapped.');
}
}
$this->_redirect($redirectUrl);
}
示例9: addRedirectMessage
/**
* Append message to the customer session to inform he has been redirected
*
* @param \Magento\Catalog\Api\Data\ProductInterface $product The product being redirected to.
*/
private function addRedirectMessage(ProductInterface $product)
{
$message = __("%1 is the only product matching your '%2' research.", $product->getName(), $this->helper->getEscapedQueryText());
$this->messageManager->addSuccessMessage($message);
}