简体   繁体   English

如果选中复选框在 Opencart 中不起作用

[英]If checkbox checked not working in Opencart

I need to add checkbox to order process in Opencart 1.5.6.4 and ask if checkbox is checked .我需要在Opencart 1.5.6.4的订单流程中添加复选框,并询问if checkbox is checked

I add this checkbox to template/checkout/confirm.tpl我将此复选框添加到template/checkout/confirm.tpl

<input type="checkbox" name="test">

When I use the condition in controller/checkout/confirm.php if (isset($_POST['test'])) this condition not working, it is always false even if checkbox is checked.当我在controller/checkout/confirm.php if (isset($_POST['test']))中使用条件时,此条件不起作用,即使选中了复选框,它也始终为 false。

Is it possible to use another way to create a condition if the checkbox is checked?如果复选框被选中,是否可以使用另一种方式来创建条件?

Incorrect input.输入错误。 must be:一定是:

<input type="checkbox" name="test" value="some_value" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM