I have this form:
<form action="/productcategories/foods/" method="GET">
<input type="hidden" name="add-to-cart" value="<?php echo htmlspecialchars($getid); ?>" />
<input type="number" name="quantity" min="1" value="1">
<br><input type="submit" value="Buy" />
</form>
If I hit submit it'll redirect me to a Wordpress plugin generated page, does the add-to-cart action but after I done this form I want to redirect back the user to the current page. Is there any method to do it from the page where the form stored? Like JavaScript or something like that?