You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To be able to add a product "Subscription" to the cart, the visitor must be registered as a member and logged in.
Similar to #2269 I use addProductToCollection to check whether the product is a "Subscription" and the user is logged in. If not display a message and return $intQuantity = 0 to prevent the item being added to the cart/collection. This works fine so far:
But after closing the flash message and navigating to any other page of the site (e.g. to /login) the message reappears on the next page, one time.
Also if I remove the Message::reset() line in the __invoke-function and a different product is (successfully) being added to the cart, the message 'Must be logged in!' will still be displayed together with the success message.
Shouldn't closing a message also trigger Message::reset()?
The text was updated successfully, but these errors were encountered:
Shouldn't closing a message also trigger Message::reset()
Closing a message (in the front end) does not reset the message on the server. But generating the messages for the page should lead to cleared messages. It looks like the message is added after the messages of the current page are generated. Did you enable the "include messages" checkbox in any of your front end modules?
Contao v4.13.15
Isotope v2.8.9
To be able to add a product "Subscription" to the cart, the visitor must be registered as a member and logged in.
Similar to #2269 I use
addProductToCollection
to check whether the product is a "Subscription" and the user is logged in. If not display a message and return$intQuantity = 0
to prevent the item being added to the cart/collection. This works fine so far:But after closing the flash message and navigating to any other page of the site (e.g. to
/login
) the message reappears on the next page, one time.Also if I remove the
Message::reset()
line in the __invoke-function and a different product is (successfully) being added to the cart, the message 'Must be logged in!' will still be displayed together with the success message.Shouldn't closing a message also trigger
Message::reset()
?The text was updated successfully, but these errors were encountered: