追加功能 #454
v4.0: Product - Step 1
Start date:
02/14/2025
Due date:
03/31/2025
% Done:
100%
Estimated time:
100.00 h
Description
Background
- New requirement for v4.0 OTS
See: OneDrive\赤蓝商贸(上海)有限公司\Shanghai Group - IT\开发相关\OTS V4\开发需求
- 1. SBX:调查产品模块相关的功能和Database Table,比如
- Product(可能需要扩展,比如添加OTS<->SBX对应产品的映射关系,报关用:产品名+价格等)
- Category (可能需要简化)
- Manufacturer (可能需要修改:添加中文,地址等报关用信息)
- Option (可能需要扩展, 需要添加OTS->SBX的option的映射关系)
- tax (可能需要简化)
- geo_zone ?
- 2. OTS:开发相关模块根据以上的调查(包括设计修改Database Table)
Module Function Database Other Product 1.SBX的部分功能
2.OTS->SBX的映射关系
3.报关信息:品名 + HS code等,
manufacture + 产地 + 报关价格product
product_description
product_to_category
product_group
product_group_description
product_option
product_option_description
product_option_value
product_option_value_description
product_extra_option
product_extra_option_value
product_discount
product_option_value_discount
product_image
product_image_description
product_option_value_hover_description
product_option_value_layer_image
product_square_meter_discount
product_to_manufacturer(new)
product_to_manufacturer_description(new)option&price参考SBX
product->manufacturer 一对多的关系Category category
category_description
catageory_path添加功能 Manufacture name, country, zone, city
address 1, address 2manufacture 添加功能 Option 1.SBX的部分功能
2.OTS->SBX的映射关系option
option_description
option_value
option_value_description
branding_group
branding_group_description添加功能(参考SBX) tax tax_class
tax_rate
tax_rate_to_customer_group
tax_rule修改数据 currency - currency
currency_round修改数据 length classes - length_class
length_class_description修改数据 weight classes - weight_class
weight_class_description修改数据 unit classes - unit_class
unit_class_description添加功能(参考SBX) geo_zone - geo_zone
zone_to_geo_zone修改数据 country - country 维持原样
- 3. OTS:开发Import product module,可以多次导入SBX相关产品数据(SQL格式)
Bruce: #462
- 4. OTS:开发Restful API (Server端),接受来自SBX的订单产品数据(参考:https://docs.opencart.com/en-gb/system/users/api/)
- 5. SBX:开发Restful API (Client端),传输OTS可接受的订单产品数据(想定:Admin order edit form中添加传输功能)
Note: 可能需要优先回答Order模块,处理手动Order(Order Product)的Add / Edit / Remove功能
Questions:
- 关于以上【SBX:开发Restful API (Client端)】功能,认证机制(OAuth)是必须的,但是怎么匹配SBX:admin user和OTS:user呢?
Van: 比如我们通过email(OTS4.0 可能需要完善email这个字段,比如必须输入),关联这2个系统的user关系。 - 关于OTS与SBX的映射关系:
- Product
- Option
- Option value
Van: 我们规定从ET导入的id完全匹配(比如:Option value id),OTS4.0自己添加的Product,Option,Option value的id起始值会足够大(和导入的完全区分) - Color option我们决定使用泛用Text Option替代(只有一个option value),意味着Color Option自带的价格不能自动导入,没问题嘛?
Van: 不使用text type, 继续使用color type的option,因为color option可能会存在自己的价格,不用使用一个统一的color option来代替所有的情况。
- Git提交
#xxx(redmine number): xxx(redmine title) - xxx(任意:补充内容)
- 代码规范
2.1: 结构:Public -> Protected -> Private
2.2: 其他代码规范同SBX
- 数据层规范(Model)
3.1: 数据库操作只应出现在model或者system中。
3.2: v3/v4的model分为两个文件,比如: order.php, order_v3.php
- 前台代码
twig, js, css (js, css尽量写在单独的css文件中)
- 后台代码
MVCL (L:en,cn)
- 注释
- 类名:
/** * xxx * * @copyright RedBlue-OTS 2024 * @version v4 * */
- 函数名:参数类型 + 返回值类型
/** * xxx * * @param xxx $xxx * @param xxx $xxx * @return xxx */
- 类名:
- Report and Solution
Others
Related issues
Updated by Junyi Zhang 10 months ago
- Description updated (diff)
- Status changed from 新建 to 进行中
- Start date changed from 02/17/2025 to 02/12/2025
Updated by Junyi Zhang 10 months ago
- File ots_product.xlsx added
Output(2025/02/23 - 2025/3/07),(2025/02/17 - 2025/02/21)
- Functions:
- Admin: Prepare auxiliary modules around the product module in advance
- Unit class
- Length class
- Weight class
- Tax
- Currency
- Country
- Zone
- Geo zone - Admin: Modify the manufacturer and category module.
- Admin: Add option module.
- Special options: color, size, branding, design method. Important: These special options need to be created first, then set to special in the setting.
- Limit the option types: select, checkbox, radio, text
- Redundant fields: Some unused fields still be added, because it will make the date transfer from ET4.0 more convenient. - Admin setting:
- Add fields for special options:config_color_option,config_extra_color_option, config_size_option, config_design_method_option, config_branding_option
- Remove config_color_option, config_extra_color_option: About color option, we still use SBX's color options instead of using 'text' option to represent all color options in front because the color option might have their own price, and we can not use one single option to cover all situation. - Prduct module
- According to SBX product module, design OTS's product module
- Remain tab: General, Data, Link, Price&Option, Image
- Modify Price&Option tab to multiple manufacturers mode, which means each manufacturer has their own prices and options.
- Brand(Declaration):Use {brand}, {dimension} and {capacity} as replacement. And we need add tool/smarty in front.
- Admin: Prepare auxiliary modules around the product module in advance
- Optimizations:
- Admin: easyDingZhi.common
- Create easyDingZhi namespace in view/javascript/easydingzhi/common.js
- The common.js should gradually replace OC's own common.js. - Common: Ensuring data integrity:
- Add 'transaction' in pdo.php for database rollback when one of the database operations is wrong in a set of database operations.
- 'end_of_data': Add 'end_of_data' in every admin form as a flag. The database operation can succeed if 'end_of_data' exists. - Common: 参考SBX,修改admin style
- Admin: easyDingZhi.common
- 参考 #440
- Functions :
- OTS V4 开发restful API, 用于接收来自ET V4的订单数据。
- ET V4 开发restful API, 用于发送订单数据。
Updated by Junyi Zhang 10 months ago
- Subject changed from v4.0: Product to v4.0: Product - 1
- Description updated (diff)
- Status changed from 进行中 to 已关闭
- % Done changed from 60 to 100