dszdiavv474681 2016-03-08 11:12 采纳率: 0%
浏览 134
已采纳

在opencart产品表单中添加一个字段

i would like to add an input field to opencart product form. the field should passed to the server and save like other fields. i added the field to the product form tpl file and passed it to the checkout/cart controller class and the 'add' method with:

data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea , #choosed_color'),

in the $('#button-cart').on('click' event.

i can access the field value in the 'add' method with:

$this->request->post['choosed_color']

how can i show it in the shopping cart and pre-factor? thanks...

  • 写回答

1条回答 默认 最新

  • 普通网友 2016-03-11 04:24
    关注

    You can define your own custom field in opencart for products. That is the precise and correct way of doing it. Or if you are a programmer, you can alter the code as well.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用