opencart icon indicating copy to clipboard operation
opencart copied to clipboard

Add created_by and modified_by fields for core entities (e.g., product, article)

Open hieu-hn opened this issue 3 months ago • 2 comments

Description: Currently, OpenCart database tables for core entities such as product and article (and potentially others like category, information, etc.) do not store information about who created or last modified a record.

For auditability, collaboration, and integration with enterprise workflows, it would be very useful to have two additional fields:

  • created_by → stores the user ID who originally created the record
  • modified_by → stores the user ID who last updated the record

Benefits:

  • Improves accountability and traceability for admins and editors.
  • Useful for multi-user environments where many staff members manage catalog or content.
  • Helps in debugging, approvals, and content workflows.
  • Aligns OpenCart with modern CMS/e-commerce systems where tracking author/editor is standard.

Proposed implementation:

  • Add created_by and modified_by columns (nullable, INT) to main tables like:

    • product
    • article
    • (optional) category, information, etc.
  • Update admin controllers/models to automatically populate these fields using the currently logged-in admin user.

Would the maintainers be open to including this enhancement in a future release?

hieu-hn avatar Sep 17 '25 03:09 hieu-hn

This implementation is in Django, it's very convenient. We can implement a similar implementation.

mrfoggg avatar Oct 01 '25 09:10 mrfoggg

I guess there won't be much of a demand for this, but it might be useful as an extension.

mhcwebdesign avatar Oct 01 '25 12:10 mhcwebdesign