Increase display time of exception message in magento 2exception 'Mage_Core_Exception' with message 'Invalid block type: Mage__Block_Catalog'exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Producttabs_Block_Producttabs'Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'Mage_Core_Model_Config_Element' is not allowed'Magento 2 - How to catch Exception when run batch file?Facing exception error while loading magentoHow to remove exception message automatically after it appears from magento site(Updated)Exception 'Mage_Core_Exception' with message 'Invalid block type' Magento 1Exception #0 (MagentoFrameworkExceptionLocalizedException): More than one node matching the query: /config/zip[@countryCode='US']/codes/codeException Not WorkingMagento 1.9 - exception 'Mage_Core_Exception' with message 'Invalid block type
What is the difference between `command a[bc]d` and `command `ab,cd`
Why does nature favour the Laplacian?
Any examples of headwear for races with animal ears?
how to sum variables from file in bash
How do I deal with a coworker that keeps asking to make small superficial changes to a report, and it is seriously triggering my anxiety?
Controversial area of mathematics
Critique of timeline aesthetic
Who is the Umpire in this picture?
With a Canadian student visa, can I spend a night at Vancouver before continuing to Toronto?
Can someone publish a story that happened to you?
Is there a way to get a compiler for the original B programming language?
Do I have an "anti-research" personality?
Why don't other Westeros houses use wildfire?
Why isn't the definition of absolute value applied when squaring a radical containing a variable?
What is the most expensive material in the world that could be used to create Pun-Pun's lute?
How to type a section sign (§) into the Minecraft client
Stop and Take a Breath!
What makes accurate emulation of old systems a difficult task?
Will a top journal at least read my introduction?
If a warlock with the Repelling Blast invocation casts Eldritch Blast and hits, must the targets always be pushed back?
Is there any limitation with Arduino Nano serial communication distance?
Mac Pro install disk keeps ejecting itself
Contradiction proof for inequality of P and NP?
Why does processed meat contain preservatives, while canned fish needs not?
Increase display time of exception message in magento 2
exception 'Mage_Core_Exception' with message 'Invalid block type: Mage__Block_Catalog'exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Producttabs_Block_Producttabs'Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'Mage_Core_Model_Config_Element' is not allowed'Magento 2 - How to catch Exception when run batch file?Facing exception error while loading magentoHow to remove exception message automatically after it appears from magento site(Updated)Exception 'Mage_Core_Exception' with message 'Invalid block type' Magento 1Exception #0 (MagentoFrameworkExceptionLocalizedException): More than one node matching the query: /config/zip[@countryCode='US']/codes/codeException Not WorkingMagento 1.9 - exception 'Mage_Core_Exception' with message 'Invalid block type
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am using Magento 2.1.3 and I need to display an error message in the shipping information page. Currently I'm using this code:
throw new StateException(__('Shipping is not available on the provided zipcode'));
but the issue is that the error message is just showing 2 or 3 seconds. I need to show this message up to refresh the page.
<?php
namespace SemShipmentPluginCheckoutModel;
use MagentoFrameworkExceptionStateException;
use MagentoCheckoutModelSession;
use MagentoFrameworkViewElementMessages;
use MagentoFrameworkMessageManagerInterface;
use MagentoFrameworkUrlInterface $urlInterface;
class ShippingInformationManagement
protected $_messageManager;
protected $jsonResultFactory;
protected $_checkout;
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkControllerResultJsonFactory $jsonResultFactory,
MagentoFrameworkMessageManagerInterface $messageManager,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoCheckoutModelSession $session,
MagentoFrameworkUrlInterface $urlInterface
)
$this->_messageManager = $messageManager;
$this->jsonResultFactory = $jsonResultFactory;
$this->_session = $session;
$this->_urlInterface = $urlInterface;
public function beforeSaveAddressInformation(
MagentoCheckoutModelShippingInformationManagement $subject,
$cartId,
MagentoCheckoutApiDataShippingInformationInterface $addressInformation
)
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$resource = $objectManager->get('MagentoFrameworkAppResourceConnection');
$connection = $resource->getConnection();
$items = $this->_session->getQuote()->getAllVisibleItems();
$address = $addressInformation->getShippingAddress();
$postcode = $address->getData('postcode');
$result = $this->jsonResultFactory->create();
$pid='';
if (count($items) > 0)
foreach ($items as $item)
$pname= $item->getName();
$pid=$item['product_id'];
$carttotal=$item['grand_total'];
$weight=$item['weight'];
$sql ="SELECT ca.postcode FROM
mgcb_marketplace_product mp
JOIN mgcb_marketplace_userdata mu ON mp.seller_id = mu.seller_id
JOIN mgcb_customer_entity ce ON mu.seller_id = ce.entity_id
JOIN mgcb_customer_address_entity ca ON ce.entity_id = ca.parent_id
WHERE(mp.mageproduct_id = '$pid')";
$qryresult = $connection->fetchAll($sql);
foreach ($qryresult as $qryresult)
$pikup=$qryresult['postcode'];
foreach($result as $object)
$stat = "NO SERVICE AVAILABLE";
//print_r($object);
if($stat=="NO SERVICE AVAILABLE")
$msg = "Shipping is not available on the provided zipcode For the following product: <em>" . $item->getName() . "</em>
Currently Added Product : " . $linkUrl;
$this->_messageManager->addError(__("errorr"));
throw new StateException(__($msg));
shipping magento-2.1.3 exception messages
|
show 2 more comments
I am using Magento 2.1.3 and I need to display an error message in the shipping information page. Currently I'm using this code:
throw new StateException(__('Shipping is not available on the provided zipcode'));
but the issue is that the error message is just showing 2 or 3 seconds. I need to show this message up to refresh the page.
<?php
namespace SemShipmentPluginCheckoutModel;
use MagentoFrameworkExceptionStateException;
use MagentoCheckoutModelSession;
use MagentoFrameworkViewElementMessages;
use MagentoFrameworkMessageManagerInterface;
use MagentoFrameworkUrlInterface $urlInterface;
class ShippingInformationManagement
protected $_messageManager;
protected $jsonResultFactory;
protected $_checkout;
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkControllerResultJsonFactory $jsonResultFactory,
MagentoFrameworkMessageManagerInterface $messageManager,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoCheckoutModelSession $session,
MagentoFrameworkUrlInterface $urlInterface
)
$this->_messageManager = $messageManager;
$this->jsonResultFactory = $jsonResultFactory;
$this->_session = $session;
$this->_urlInterface = $urlInterface;
public function beforeSaveAddressInformation(
MagentoCheckoutModelShippingInformationManagement $subject,
$cartId,
MagentoCheckoutApiDataShippingInformationInterface $addressInformation
)
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$resource = $objectManager->get('MagentoFrameworkAppResourceConnection');
$connection = $resource->getConnection();
$items = $this->_session->getQuote()->getAllVisibleItems();
$address = $addressInformation->getShippingAddress();
$postcode = $address->getData('postcode');
$result = $this->jsonResultFactory->create();
$pid='';
if (count($items) > 0)
foreach ($items as $item)
$pname= $item->getName();
$pid=$item['product_id'];
$carttotal=$item['grand_total'];
$weight=$item['weight'];
$sql ="SELECT ca.postcode FROM
mgcb_marketplace_product mp
JOIN mgcb_marketplace_userdata mu ON mp.seller_id = mu.seller_id
JOIN mgcb_customer_entity ce ON mu.seller_id = ce.entity_id
JOIN mgcb_customer_address_entity ca ON ce.entity_id = ca.parent_id
WHERE(mp.mageproduct_id = '$pid')";
$qryresult = $connection->fetchAll($sql);
foreach ($qryresult as $qryresult)
$pikup=$qryresult['postcode'];
foreach($result as $object)
$stat = "NO SERVICE AVAILABLE";
//print_r($object);
if($stat=="NO SERVICE AVAILABLE")
$msg = "Shipping is not available on the provided zipcode For the following product: <em>" . $item->getName() . "</em>
Currently Added Product : " . $linkUrl;
$this->_messageManager->addError(__("errorr"));
throw new StateException(__($msg));
shipping magento-2.1.3 exception messages
$this->messageManager->addError( __('Shipping is not available on the provided zipcode.') ); This injects the MagentoFrameworkMessageManagerInterface object in its __construct function using the MagentoFrameworkAppActionContext $context object
– Rama Chandran M
Jul 6 '17 at 8:18
@ Rama Chandran Please look at my code now it display in cosole not in the site
– Amith
Jul 6 '17 at 8:31
I understand. you are call from Ajax right? so return error message to ajax and dont set any duration for display error message :)
– Rama Chandran M
Jul 6 '17 at 8:38
@ Rama Chandran I'm using the plugin feature of magento 2 here i use the "beforeSaveAddressInformation" method not ajax call it just an event
– Amith
Jul 6 '17 at 8:40
i will check and tell
– Rama Chandran M
Jul 6 '17 at 8:47
|
show 2 more comments
I am using Magento 2.1.3 and I need to display an error message in the shipping information page. Currently I'm using this code:
throw new StateException(__('Shipping is not available on the provided zipcode'));
but the issue is that the error message is just showing 2 or 3 seconds. I need to show this message up to refresh the page.
<?php
namespace SemShipmentPluginCheckoutModel;
use MagentoFrameworkExceptionStateException;
use MagentoCheckoutModelSession;
use MagentoFrameworkViewElementMessages;
use MagentoFrameworkMessageManagerInterface;
use MagentoFrameworkUrlInterface $urlInterface;
class ShippingInformationManagement
protected $_messageManager;
protected $jsonResultFactory;
protected $_checkout;
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkControllerResultJsonFactory $jsonResultFactory,
MagentoFrameworkMessageManagerInterface $messageManager,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoCheckoutModelSession $session,
MagentoFrameworkUrlInterface $urlInterface
)
$this->_messageManager = $messageManager;
$this->jsonResultFactory = $jsonResultFactory;
$this->_session = $session;
$this->_urlInterface = $urlInterface;
public function beforeSaveAddressInformation(
MagentoCheckoutModelShippingInformationManagement $subject,
$cartId,
MagentoCheckoutApiDataShippingInformationInterface $addressInformation
)
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$resource = $objectManager->get('MagentoFrameworkAppResourceConnection');
$connection = $resource->getConnection();
$items = $this->_session->getQuote()->getAllVisibleItems();
$address = $addressInformation->getShippingAddress();
$postcode = $address->getData('postcode');
$result = $this->jsonResultFactory->create();
$pid='';
if (count($items) > 0)
foreach ($items as $item)
$pname= $item->getName();
$pid=$item['product_id'];
$carttotal=$item['grand_total'];
$weight=$item['weight'];
$sql ="SELECT ca.postcode FROM
mgcb_marketplace_product mp
JOIN mgcb_marketplace_userdata mu ON mp.seller_id = mu.seller_id
JOIN mgcb_customer_entity ce ON mu.seller_id = ce.entity_id
JOIN mgcb_customer_address_entity ca ON ce.entity_id = ca.parent_id
WHERE(mp.mageproduct_id = '$pid')";
$qryresult = $connection->fetchAll($sql);
foreach ($qryresult as $qryresult)
$pikup=$qryresult['postcode'];
foreach($result as $object)
$stat = "NO SERVICE AVAILABLE";
//print_r($object);
if($stat=="NO SERVICE AVAILABLE")
$msg = "Shipping is not available on the provided zipcode For the following product: <em>" . $item->getName() . "</em>
Currently Added Product : " . $linkUrl;
$this->_messageManager->addError(__("errorr"));
throw new StateException(__($msg));
shipping magento-2.1.3 exception messages
I am using Magento 2.1.3 and I need to display an error message in the shipping information page. Currently I'm using this code:
throw new StateException(__('Shipping is not available on the provided zipcode'));
but the issue is that the error message is just showing 2 or 3 seconds. I need to show this message up to refresh the page.
<?php
namespace SemShipmentPluginCheckoutModel;
use MagentoFrameworkExceptionStateException;
use MagentoCheckoutModelSession;
use MagentoFrameworkViewElementMessages;
use MagentoFrameworkMessageManagerInterface;
use MagentoFrameworkUrlInterface $urlInterface;
class ShippingInformationManagement
protected $_messageManager;
protected $jsonResultFactory;
protected $_checkout;
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkControllerResultJsonFactory $jsonResultFactory,
MagentoFrameworkMessageManagerInterface $messageManager,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoCheckoutModelSession $session,
MagentoFrameworkUrlInterface $urlInterface
)
$this->_messageManager = $messageManager;
$this->jsonResultFactory = $jsonResultFactory;
$this->_session = $session;
$this->_urlInterface = $urlInterface;
public function beforeSaveAddressInformation(
MagentoCheckoutModelShippingInformationManagement $subject,
$cartId,
MagentoCheckoutApiDataShippingInformationInterface $addressInformation
)
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$resource = $objectManager->get('MagentoFrameworkAppResourceConnection');
$connection = $resource->getConnection();
$items = $this->_session->getQuote()->getAllVisibleItems();
$address = $addressInformation->getShippingAddress();
$postcode = $address->getData('postcode');
$result = $this->jsonResultFactory->create();
$pid='';
if (count($items) > 0)
foreach ($items as $item)
$pname= $item->getName();
$pid=$item['product_id'];
$carttotal=$item['grand_total'];
$weight=$item['weight'];
$sql ="SELECT ca.postcode FROM
mgcb_marketplace_product mp
JOIN mgcb_marketplace_userdata mu ON mp.seller_id = mu.seller_id
JOIN mgcb_customer_entity ce ON mu.seller_id = ce.entity_id
JOIN mgcb_customer_address_entity ca ON ce.entity_id = ca.parent_id
WHERE(mp.mageproduct_id = '$pid')";
$qryresult = $connection->fetchAll($sql);
foreach ($qryresult as $qryresult)
$pikup=$qryresult['postcode'];
foreach($result as $object)
$stat = "NO SERVICE AVAILABLE";
//print_r($object);
if($stat=="NO SERVICE AVAILABLE")
$msg = "Shipping is not available on the provided zipcode For the following product: <em>" . $item->getName() . "</em>
Currently Added Product : " . $linkUrl;
$this->_messageManager->addError(__("errorr"));
throw new StateException(__($msg));
shipping magento-2.1.3 exception messages
shipping magento-2.1.3 exception messages
edited Oct 31 '17 at 0:56
Nisse Engström
42555
42555
asked Jul 6 '17 at 7:24
AmithAmith
374415
374415
$this->messageManager->addError( __('Shipping is not available on the provided zipcode.') ); This injects the MagentoFrameworkMessageManagerInterface object in its __construct function using the MagentoFrameworkAppActionContext $context object
– Rama Chandran M
Jul 6 '17 at 8:18
@ Rama Chandran Please look at my code now it display in cosole not in the site
– Amith
Jul 6 '17 at 8:31
I understand. you are call from Ajax right? so return error message to ajax and dont set any duration for display error message :)
– Rama Chandran M
Jul 6 '17 at 8:38
@ Rama Chandran I'm using the plugin feature of magento 2 here i use the "beforeSaveAddressInformation" method not ajax call it just an event
– Amith
Jul 6 '17 at 8:40
i will check and tell
– Rama Chandran M
Jul 6 '17 at 8:47
|
show 2 more comments
$this->messageManager->addError( __('Shipping is not available on the provided zipcode.') ); This injects the MagentoFrameworkMessageManagerInterface object in its __construct function using the MagentoFrameworkAppActionContext $context object
– Rama Chandran M
Jul 6 '17 at 8:18
@ Rama Chandran Please look at my code now it display in cosole not in the site
– Amith
Jul 6 '17 at 8:31
I understand. you are call from Ajax right? so return error message to ajax and dont set any duration for display error message :)
– Rama Chandran M
Jul 6 '17 at 8:38
@ Rama Chandran I'm using the plugin feature of magento 2 here i use the "beforeSaveAddressInformation" method not ajax call it just an event
– Amith
Jul 6 '17 at 8:40
i will check and tell
– Rama Chandran M
Jul 6 '17 at 8:47
$this->messageManager->addError( __('Shipping is not available on the provided zipcode.') ); This injects the MagentoFrameworkMessageManagerInterface object in its __construct function using the MagentoFrameworkAppActionContext $context object
– Rama Chandran M
Jul 6 '17 at 8:18
$this->messageManager->addError( __('Shipping is not available on the provided zipcode.') ); This injects the MagentoFrameworkMessageManagerInterface object in its __construct function using the MagentoFrameworkAppActionContext $context object
– Rama Chandran M
Jul 6 '17 at 8:18
@ Rama Chandran Please look at my code now it display in cosole not in the site
– Amith
Jul 6 '17 at 8:31
@ Rama Chandran Please look at my code now it display in cosole not in the site
– Amith
Jul 6 '17 at 8:31
I understand. you are call from Ajax right? so return error message to ajax and dont set any duration for display error message :)
– Rama Chandran M
Jul 6 '17 at 8:38
I understand. you are call from Ajax right? so return error message to ajax and dont set any duration for display error message :)
– Rama Chandran M
Jul 6 '17 at 8:38
@ Rama Chandran I'm using the plugin feature of magento 2 here i use the "beforeSaveAddressInformation" method not ajax call it just an event
– Amith
Jul 6 '17 at 8:40
@ Rama Chandran I'm using the plugin feature of magento 2 here i use the "beforeSaveAddressInformation" method not ajax call it just an event
– Amith
Jul 6 '17 at 8:40
i will check and tell
– Rama Chandran M
Jul 6 '17 at 8:47
i will check and tell
– Rama Chandran M
Jul 6 '17 at 8:47
|
show 2 more comments
1 Answer
1
active
oldest
votes
I know it's three months down the line, but am sure this will help someone.
You can do this by adjusting the timeout period on the file.
vendor/magento/module-ui/view/frontend/web/js/view/messages.js
It is around lines 70/71. you can set the time out to be a figure of your choice (in milliseconds)
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f182313%2fincrease-display-time-of-exception-message-in-magento-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I know it's three months down the line, but am sure this will help someone.
You can do this by adjusting the timeout period on the file.
vendor/magento/module-ui/view/frontend/web/js/view/messages.js
It is around lines 70/71. you can set the time out to be a figure of your choice (in milliseconds)
add a comment |
I know it's three months down the line, but am sure this will help someone.
You can do this by adjusting the timeout period on the file.
vendor/magento/module-ui/view/frontend/web/js/view/messages.js
It is around lines 70/71. you can set the time out to be a figure of your choice (in milliseconds)
add a comment |
I know it's three months down the line, but am sure this will help someone.
You can do this by adjusting the timeout period on the file.
vendor/magento/module-ui/view/frontend/web/js/view/messages.js
It is around lines 70/71. you can set the time out to be a figure of your choice (in milliseconds)
I know it's three months down the line, but am sure this will help someone.
You can do this by adjusting the timeout period on the file.
vendor/magento/module-ui/view/frontend/web/js/view/messages.js
It is around lines 70/71. you can set the time out to be a figure of your choice (in milliseconds)
edited Mar 13 at 10:44
magefms
2,8582529
2,8582529
answered Oct 30 '17 at 7:00
Moses N. NjengaMoses N. Njenga
206312
206312
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f182313%2fincrease-display-time-of-exception-message-in-magento-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$this->messageManager->addError( __('Shipping is not available on the provided zipcode.') ); This injects the MagentoFrameworkMessageManagerInterface object in its __construct function using the MagentoFrameworkAppActionContext $context object
– Rama Chandran M
Jul 6 '17 at 8:18
@ Rama Chandran Please look at my code now it display in cosole not in the site
– Amith
Jul 6 '17 at 8:31
I understand. you are call from Ajax right? so return error message to ajax and dont set any duration for display error message :)
– Rama Chandran M
Jul 6 '17 at 8:38
@ Rama Chandran I'm using the plugin feature of magento 2 here i use the "beforeSaveAddressInformation" method not ajax call it just an event
– Amith
Jul 6 '17 at 8:40
i will check and tell
– Rama Chandran M
Jul 6 '17 at 8:47