Here I come with one more new quick and little article and This is about xcart.Well, How dialog error message works in xCart and how you redirect to next page like header function in PHP.
The message is important to say which action done on the page and sometimes you are doing customization and you want to display error, warning or information, you need to display the message which inform user about action.
so,Let’s understand the code:
you can write error message like following code:
1 2 3 | $erroe_message = array('content' =>'<your_message>','type'=>'E'); |
Here,content
is the message you want to display and type
is the type of message and type can be:
1 2 3 4 5 | E - error W - warning I - Information |
Dialog message will display only one time on next page after the first redirect.
After displaying message, if you want to redirect the other page, you can write below line of code:
1 2 3 | func_header_location('<location_or_url>'); |
Further Read:
Enable Console in X-cart
To add Signup Bonus in X-Cart
That’s it.I hope this article is useful to someone.
Don’t hesitate to use this code in your xCart projects and post your comments if you need help. As always, thanks for reading. Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.