Jump to content

Customising the admin area add new order page


Recommended Posts

I am looking for options to mod the admin UI.

As an example, I have created an addon module which adds a contract types and contracts table. My goal is to modify the add new order page, /admin/ordersadd.php such that based on the product/service table selected introduce a drop down menu of possible contract types to choose from (e.g. 1month contract, 1 year contract). I have managed to this part by using the AdminAreaFooterOutput and inject javascript in the add new order page. Example screenshot:

image.png.dfa267ed99cf2c802ea87ab8d95f07bb.png

The problem is what comes after which is posting this data and creating a contract from the contract type and specified service. So far I've looked into two options:

1) Send an ajax request before submit order post request is sent, and we can post to our own module controller which contract type was chosen. The problem with this is we cannot link the contract created with a service as it has not been created yet and we only have information on the contract type selected and the product.

2) Make every product have a custom field to store extra information on what contract type was chosen. After the order is created, we can possibly use a hook like PendingOrder and look at all the services in the order and based on that custom field we can create a contract and link it with the order/service.

Since what I've tried is a bit bothersome, are there any better options for modifying the add order page?

Additionally, I've have problems with attempting to modify orders to allow a custom registration date for a service so that services do not get activated until that scheduled registration date is reached. Although I can add registration date field, I don't seem to be able to post it or affect the pro rata price for the invoice to be generated.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated