【发布时间】:2018-10-19 19:45:55
【问题描述】:
在产品表 sn-p 中已经有很多变量,例如价格、总计、小计、税收等。
我想使用插件或钩子添加一个新变量。如果有人知道,我们将不胜感激。
【问题讨论】:
-
你知道吗?
标签: cs-cart
在产品表 sn-p 中已经有很多变量,例如价格、总计、小计、税收等。
我想使用插件或钩子添加一个新变量。如果有人知道,我们将不胜感激。
【问题讨论】:
标签: cs-cart
这是控制器的路径(mode="details"):
/var/www/html/cs/app/controllers/frontend/orders.php
这是模板部分:
/var/www/html/cs/design/themes/your_theme_name/templates/views/orders/details.tpl
您可以创建新函数添加新变量。
在/var/www/html/cs/app/functions/fn.cart.php中创建新函数
【讨论】:
一般文档在这里 https://docs.cs-cart.com/latest/developer_guide/core/documents/snippets.html
作为实际示例,您可以检查 2 个方案: 1. app/addons/reward_points/schemas/documents/order.post.php - 它扩展了 Order 变量 2. app/addons/suppliers/schemas/sn-ps/order_products_table.post.php - 它扩展了发票中产品表的sn-p
【讨论】: