Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nguyen Hien 52 posts 133 karma points
    Feb 02, 2016 @ 14:10
    Nguyen Hien
    0

    Add custom field in merchInvoice table and index that field

    Hi Rusty,

    I added a field name orderStatus as int in merchInvoice table. Now, I want to this value is display in InvoiceDisplay. How can I add orderStatus to index examine?

    enter image description here

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Feb 02, 2016 @ 16:29
    Rusty Swayne
    0

    Hey Nguyen,

    I think you are going to create a maintainability problem if you go down that path as you will not easily be able to upgrade Merchello without contiguously needing to merge in your customized code. I suspect it will be really problematic when Umbraco does major releases (with breaking changes) and we have to adjust things in the Merchello core to keep the code base compatible.

    Also, there is an order status already on an order. The way it's setup is an invoice has one or more orders. Orders can have one or more shipments. You will see that there is already a merchInvoiceStatus and merchOrderStatus table.

    If your implementation requirements must have a status that cannot be accomplished by adding a record to either one of those tables, I would suggest mapping the relationship in a completely separate table using the invoice key and your "order status" with as a dual primary key to assert the one to one relationship.

    If you need to be able to edit this via the back office you would create a custom directive that you could put on the salesoverview Angular view - this way when you upgrade, you would only need to put in the reference to the directive. From the code, you would manage the relationship directly via PetaPoco, perhaps using one of the InvoiceService events.

    If you need it in the index, I'd consider using Examine's "GatheringNodeData" event to add the additional field to the index ...

Please Sign in or register to post replies

Write your reply to:

Draft