Project

General

Profile

追加功能 #462

v4.0: Product - Import option & product data from SBX

Added by Xihua Fan 10 months ago. Updated 10 months ago.

Status:
已关闭
Priority:
普通
Assignee:
Target version:
IT: Easytryck (Sweden) - v4.0
Start date:
02/28/2025
Due date:
03/03/2025
% Done:

100%

Estimated time:
100.00 h

Description

Background
  1. New requirement for v4.0 OTS
    See: OneDrive\赤蓝商贸(上海)有限公司\Shanghai Group - IT\开发相关\OTS V4\开发需求
Task Details
  • 1. OTS:开发Import product module,可以多次导入SBX相关产品数据(CSV格式?)
v4 coding standard:
  1. Git提交
    #xxx(redmine number): xxx(redmine title) - xxx(任意:补充内容)
      
  2. 代码规范
    2.1: 结构:Public -> Protected -> Private
    2.2: 其他代码规范同SBX
      
  3. 数据层规范(Model)
    3.1: 数据库操作只应出现在model或者system中。
    3.2: v3/v4的model分为两个文件,比如: order.php, order_v3.php
     
  4. 前台代码
    twig, js, css (js, css尽量写在单独的css文件中)
     
  5. 后台代码
    MVCL (L:en,cn)
     
  6. 注释
    1. 类名:
      /**
       * xxx
       *
       * @copyright RedBlue-OTS 2024
       * @version v4
       *
       */
      
    2. 函数名:参数类型 + 返回值类型
          /**
           * xxx
           *
           * @param  xxx $xxx
           * @param  xxx $xxx
           * @return xxx
           */
      
Output
  • Report and Solution

Others


Files

Export Configuration.png (153 KB) Export Configuration.png Zhongbao Ye, 03/02/2025 09:09 PM
SBX-20250304.7z (4.19 MB) SBX-20250304.7z Option & Product data Zhongbao Ye, 03/04/2025 07:54 PM

Related issues

Copied from 追加功能 #454: v4.0: Product - Step 1已关闭Junyi Zhang02/14/202503/31/2025

Actions
#1

Updated by Xihua Fan 10 months ago

#2

Updated by Xihua Fan 10 months ago

  • File SBX-20250301.7z added
#3

Updated by Zhongbao Ye 10 months ago

  • Status changed from 进行中 to 已关闭
  • % Done changed from 30 to 100

Output(2025/02/27 ~ 2025/02/28) 居家

  1. Create a Module (Product Import) to transfer product and options data in SBX to OTS.
  2. Only enable products (status = 1) are transferred, and disabled product data is not inserted into all related data tables.
  3. Color option is excluded from option-related data during import.
  4. In OTS: color option in product_option, product_option_value, product_extra_option, product_extra_option_value are replaced with color_option/color_extra_option (only one) and color_option_value/extra_color_option_value (only one) created in OTS.
  5. In the data tables of some language packages, use English as Chinese to insert into the data table.
  6. This time we jointly synchronize SBX 23 data tables:
    1. ots_option
    2. ots_option_description
    3. ots_option_value
    4. ots_option_value_description
    5. ots_branding_group
    6. ots_branding_group_description
    7. ots_product_group
    8. ots_product_group_description
    9. ots_product
    10. ots_product_description
    11. ots_product_option
    12. ots_product_option_description
    13. ots_product_option_value
    14. ots_product_option_value_description
    15. ots_product_discount
    16. ots_product_option_value_discount
    17. ots_product_extra_option
    18. ots_product_extra_option_value
    19. ots_product_image
    20. ots_product_image_description
    21. ots_product_option_value_hover_description
    22. ots_product_option_value_layer_image
    23. ots_product_square_meter_discount
  7. After synchronization to OTS, 25 tables are actually affected, adding 2 tables to No.6
    1. ots_product_to_manufacturer
    2. ots_product_to_manufacturer_description
    3. After the import is completed, the product data added by OTS itself will not be affected.
  • Note:
    1. Tools used: Navicat Premium (https://www.navicat.com/en/products/navicat-premium)
    2. There is a necessary condition that the exported SQL must be insert statements line by line, otherwise the program will not be able to parse it. Reference Export Configuration: https://redmine.easydingzhi.com/attachments/229
    3. The general workflow is as follows:
      1. Read a line of string
      2. Obtain the table name + fields name + field values through regular matching.
        $data = array(
          'table_name' = > 'eazy_9455product',
          'values' => array(
            'field1' => value1,
            'field2' => value2,
            'field3' => value
          )
        );
        
      3. Match the result of No.2 with the OTS data table structure and assemble the data required by OTS
        $data = array(
          'table_name' = > 'ots_product',
          'values' => array(
            'field1' => value1,
            'field2' => value2,
            'field3' => value,
            'field4' => value
          )
        );
        
        • Note: In some scenarios, you must assemble an array of the same structure. For example, when synchronizing the English language package, generate a Chinese language package.
      4. Arrange the data of No.3 into an insert statement and insert it directly into the data table.
        • Note: Delete the data in the associated table based on the primary key id before inserting.
#5

Updated by Zhongbao Ye 10 months ago

  • File SBX-20250304.7z added
#6

Updated by Zhongbao Ye 10 months ago

  • File deleted (SBX-20250304.7z)
#8

Updated by Zhongbao Ye 10 months ago

  • File deleted (SBX-20250301.7z)

Also available in: Atom PDF