Success and other messages not coming on product detail page only, While if we moving to another page it is visible, Anyone have suggestion then please share.
These messages are saved in the customer's session.
You can not easily set up it only at product pages.
It also used to show up messages on different pages and action. Eg while registering etc.
If you want to display specific messages only on the product page, modify add messages methods for example addSuccess.
Add parameter "displayRoute = false" - using for display messages at specific pages on call (or let empty if You want to display a message like default)
Inside check the current route and depends on value display message or not.