我想在提交表格后去购物车。这是我的表格:
<form method="post" id="mymodule" action="" >
<input type="hidden" name="produit_id" value="{$produit->id}" />
<input type="hidden" name="ipa" value="{$ipa}" />
<a id="ajout_confection_panier" class="buttons_bottom_block no-print">
<button type="submit" name="submit" class="exclusive">
<span>Send</span>
</button>
</a>
</form>
我们怎么能这样做?
谢谢 :)
您可以向表单添加操作,如action="{$link->getPageLink('cart')}"
或use
$link = new Link();
Tools::redirect($link->getPageLink('cart'));
通过PHP
您可以使用Tools类中的重定向功能来执行重定向。处理完表单数据后,只需将下面的代码放在控制器中即可。
// Redirects users to cart page
Tools::redirect('index.php?controller=cart');