Answer the question
In order to leave comments, you need to log in
How to make a redirect after emptying the trash in minishop2?
Greetings gentlemen. Tell me, how can I redirect to the main page after clicking on the "empty basket" button?
Googled the ways, the only thing I found:
//данный способ мне не подходит (это условие "если корзина пуста")
{if !count($products)}
<script>
document.location.href="/index.html";
</script>
{else}
Answer the question
In order to leave comments, you need to log in
I asked the question myself, and I will answer it myself)))) Helped on third-party forums.
SOLUTION:
find the empty cart button in the msCart chunk, in my case it will be
<form method="post">
<button type="submit" name="ms2_action" value="cart/clean" class="btn btn-danger">Очистить</button>
</form>
<form method="post" action="/">
<button type="submit" name="ms2_action" value="cart/clean" class="btn btn-danger">Очистить</button>
</form>
The minishop script looks at the form action of the empty cart button, if it is not there, it substitutes it from its settings. This applies specifically to the clear button. If the products are deleted one by one, then there is either a plugin or editing the js file, as described above.
You can catch the cart.clean.response.success callback .
It seems like this should work, you need to check:
miniShop2.Callbacks.Cart.clean.response.success = function () {
location.href = "stranica.html";
return false;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question