doumo6356 2010-01-04 14:39
浏览 39

自动化产品(详情)增加

Assume a simple order processing system. A Category is selected, which lists range of products, and when a product is selected, it allows for details about that product to be entered. The details differ for each product.

The admin user wants enable adding new products to this system, without the programmer getting involved. The challenging part is the details form is different for each product.

Consider the following work flow:

Add Service -> Add Genera Properties (Description, Price, BillType, AveActivationTime) -> Add Specific Properties (FieldName, ValueType, MandatorOrNot).

Currently, the system has a pop up for each product. But that has be desiged by a programmer. It seems the form generation has to be automatized. What is a good approach to dealing with this issue?

  • 写回答

1条回答 默认 最新

  • dongshiran7000 2010-01-04 15:07
    关注

    Perhaps have a customfields table, with the following fields:

    id (auto increment?)
    itemType (link to type of item that uses these fields)
    name
    type
    options
    default
    required
    

    Then, when you display the update form you can loop through all the custom fields attached to the current itemType. If the field is a string, display a string input; if it's an option, display a select box etc.

    Then store the actual values in a customdata table:

    id
    itemID
    fieldID
    value
    

    You may want to extend this to allow, for example, sharing custom fields across different itemTypes.

    Have you looked at existing e-commerce solutions? I would think most of them have this functionality built in. No point in reinventing the wheel.

    评论

报告相同问题?

悬赏问题

  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line