【发布时间】:2016-07-29 12:36:31
【问题描述】:
我正在使用Opencart 2.0.1.1。我想在购物车页面上发布的产品页面上有隐藏的文本字段。我关注this tutorial,但收到Undefined index 问题。
<input type="hidden" name="design" value="12">
我已经完成了以下编码:
在目录/controller/checkout/cart.php 中
$option['design']=$this->request->post['design'];
$this->cart->add($this->request->post['product_id'],$quantity,$option);
然后在$data['products'][] = array( 中添加'design' => $product['design'],
然后在system/library/cart.php中
在$this->data[$key] = array( 中添加了'design' => $options['design'],
然后在cart.tpl in view\theme\template-name\template\checkout\cart.tpl
echo $product['design'];
谁能帮我解决这个问题?
【问题讨论】:
-
我认为,您需要在问题中指定代码以获得更好的问题。你试过什么?
-
@HarnishDesign 现在编辑了问题。
-
我们能看到实际代码吗,tpl 文件/生成的 html 将有助于确定页面和表单是否正确呈现。
-
伙计,不要编辑它......如果这是问题的原因,让我们找出并指出它
-
@CarlosCarucce 感谢您的指点,但这只是写作问题。在实际代码中是
design
标签: php product cart opencart2.x