After clicking the print button, page should automatically redirect to another page. I attached the screenshot and code below:
javascript
<script>
myFunction();
function myFunction()
{
window.print();
// setTimeout(closePrintView(), 3000);
}
function closePrintView() {
window.location.href = 'purchase3.php';
}
</script>
in this code before printing page redirected