Product relationship with 'transactions' and 'users'

Support MB Relationships Product relationship with 'transactions' and 'users'Resolved

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32170
    Nicholas CoxNicholas Cox
    Participant

    Hi

    I have been reading about but just struggling on the best approach to achieve a relationship between multiple forms and database storage.

    So I basically want a 'Product' to store a 'transaction' and relate this to a 'user'. I assume I need to make a one to many relationship for a product to store multiple transactions. I have read the docs and think I can do this part.

    Currently I have 2 separate forms ('Product' and 'Transaction') and both save to a custom table. What is the best approach to combine these forms into one? so the user on the front end can fill in a 2 part form essentially and have this store all the data into 2 separate tables but linked by the product id?

    Is there a way to extend the 'register_meta_boxes' method to add in extra form field programmatically? or can i combine the forms using the shortcode?

    I hope that I am making sense.

    Thanks

    #32171
    Nicholas CoxNicholas Cox
    Participant

    forgot to mention that the 'product' is basically a form which just confirms the item quantity and asks a customer for their personal information.

    #32175
    Long NguyenLong Nguyen
    Moderator

    Hi Nicholas,

    You can add more meta boxes to the frontend submission shortcode by separating the meta box IDs with commas. Like this

    [mb_frontend_form id='metabox-id-1,metabox-id-2' post_fields='title,content']

    Refer to these topics
    https://support.metabox.io/topic/relationship-content-submission/
    https://support.metabox.io/topic/mb-relationships-mb-frontend-submission/

    #32181
    Nicholas CoxNicholas Cox
    Participant

    ok thanks for this, I will take a look now.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.