Jump to content

Custom Fields (Admin Order)


Acidburns

Recommended Posts

Hi,

 

I would like to add custom field in admin "add new order" page. (admin/ordersadd.php)

I would like to add new field where i can insert the contract # that i have with client for current order.

 

Is that possible and how can i do that?

Or maybe i can manually generate order # or order id ? (but i don't know how)

 

 

Thanks in advance! :)

Link to comment
Share on other sites

I would like to add custom field in admin "add new order" page. (admin/ordersadd.php)

I would like to add new field where i can insert the contract # that i have with client for current order.

Is that possible and how can i do that?

Or maybe i can manually generate order # or order id ? (but i don't know how)

this sounds to me as though you're going to need to post in Marketplace and pay someone to write this for you.

 

you can't add a new field by editing the template (as there isn't one), and i'm not sure you could do it using an action hook - you'd probably need to use the API.

 

depending on your exact need, what you might be able to do is use a Client Custom Field (if each client only has one contract number), make it admin only and then modify your email/invoice templates to add it to the output... if the contract number is different for each order, then this probably isn't viable.

Link to comment
Share on other sites

depending on your exact need, what you might be able to do is use a Client Custom Field (if each client only has one contract number), make it admin only and then modify your email/invoice templates to add it to the output... if the contract number is different for each order, then this probably isn't viable.

 

The thing is i use only admin area from whmcs (don't let my clients log in , at least not yet, maybe in few years)

And suggestion is fine, but for every order on same client i have different contract # .

But i guess since there isn't a template available ill try to stick to same contract number or visit that marketplace and pay someone to do that for me. (even though i dont know what marketplace is that and if is legal ?)

 

Thanks anyway :)

Link to comment
Share on other sites

The thing is i use only admin area from whmcs (don't let my clients log in , at least not yet, maybe in few years)

I find that WHMCS tends to work better without the hassle of customers using it! :)

 

And suggestion is fine, but for every order on same client i have different contract # .

ok, I was afraid that might be the case.

 

here's another suggestion - can you add a Product Custom Field to these products ?

 

http://docs.whmcs.com/Custom_Fields#Product_Custom_Fields

 

Products you create can also have custom fields added to them which are then shown to the user during the order process. This allows you to collect further information specific to an individual product. These are set when configuring a product in Setup > Products/Services > Products/Services > Edit > Custom Fields tab . Some modules require specific fields are setup and will be explained in the documentation for that module.

if you can (you should be able to), then each order can have it's own unique contract # and your problem should be solved! :idea:

 

But i guess since there isn't a template available ill try to stick to same contract number or visit that marketplace and pay someone to do that for me. (even though i don't know what marketplace is that and if is legal ?)

apologies, I probably should have mentioned that Marketplace is another sub-forum here and it's where you can post for paid help.

 

http://forum.whmcs.com/forumdisplay.php?49-Marketplace

 

members can't reply to this thread and offer to provide you with a paid solution to your issue - whereas, if you were to post in Marketplace, they can.

 

anyway, give the Product Custom Field idea a go and it hopefully solve your issue... or at least get you closer to the solution.

Link to comment
Share on other sites

Yea i realize y-day that Custom fields in Products are different from those in Setup > Client custom fields :)

So using those fields i can now setup the contract # number, but now i have another question :)

 

How those product custom fields to show in invoice-pdf ? I try to use the guide from whmcs documentation but didnt work for me.

Also i would like to show order date in invoice-pdf?

 

 

Thanks for all help!

Link to comment
Share on other sites

I know that product custom fields have option to show on invoice, but that way it show in same line @ product description

prntscr.com/8tmxdj

Договор # <- means Contract #

 

My question is i want to put Contract # (custom field) + Order # - in 2 lines

something like prntscr.com/8tmxs4

Link to comment
Share on other sites

How those product custom fields to show in invoice-pdf ? I try to use the guide from whmcs documentation but didnt work for me.

do you mean the documentation below ?

 

http://docs.whmcs.com/Custom_Fields#Displaying_Custom_Fields_on_Invoices

 

So how do you do it? Well it's really simple. Both the client & product field types support this, and to enable it all you need to do is tick the checkbox labelled Show on Invoice where you configure the custom fields (either in Setup > Client Custom Fields or the Custom Fields tab of the product config).

 

In the case of client custom fields, they will then be shown under the name & address information on the invoice, and in the case of product custom fields they show as part of the line item descriptions for those products.

if you follow the above instructions, it should work.

 

Also i would like to show order date in invoice-pdf?

in this instance, order date is different from invoice date ?

Link to comment
Share on other sites

I post 1 more reply but it contains some screenshot (links) and i guess moderators didn't approve it.

 

Anyway the thing is...

I added product custom field: Contract #

but when i create the invoice, it shows in product description - under 1st line.

 

So i want to somehow customize it, lets say to show the contract # at another place (top right corner, or anywhere around) together with order date.

And yes, order date is different from invoice date (because i make contract today, i put in the system and later on in a few days/week i created the invoice)

Link to comment
Share on other sites

I added product custom field: Contract #

but when i create the invoice, it shows in product description - under 1st line.

as per the documentation above, that's how it's supposed to work.

 

So i want to somehow customize it, lets say to show the contract # at another place (top right corner, or anywhere around) together with order date.

that is easier said than done because product custom fields are not passed to the invoice as separate variables - client custom fields are, so it would have been easier if you could have used them.

 

however, if you want to use product custom fields elsewhere in the invoice, you'll need to query the database to get the required information... usually that would be a hook, but you could add the necessary php code directly to the pdf template.

 

additionally, you'd need to remove the product custom field from the item description.

 

for something like this, you should probably consider posting in Marketplace and seeing how much developers would charge for a solution - it's not technically difficult, but a little too lengthy to explain how to do it here.

 

And yes, order date is different from invoice date (because i make contract today, i put in the system and later on in a few days/week i created the invoice)

perhaps you should use a second product custom field for this.

Link to comment
Share on other sites

however, if you want to use product custom fields elsewhere in the invoice, you'll need to query the database to get the required information... usually that would be a hook, but you could add the necessary php code directly to the pdf template.

 

additionally, you'd need to remove the product custom field from the item description.

 

Got ya, ill definitely need to use marketplace or some good php developer to code that for me :) i mean about the product custom fields to get visible on the invoice, as well as the order date!

Even if i need to use 2nd product custom filed for the date, i still need someone ... :)

 

Thanks for the info! :)

Link to comment
Share on other sites

however, if you want to use product custom fields elsewhere in the invoice, you'll need to query the database to get the required information... usually that would be a hook, but you could add the necessary php code directly to the pdf template.

 

it's not technically difficult, but a little too lengthy to explain how to do it here.

 

 

I guess the code is something similar to this , i found it @ email template documentation

 

Product Custom Fields

 

- The same applies to Product custom fields, however they are referenced by {$service_custom_field_fieldnamehere}.

- To loop through and display all the custom fields that apply to a product, you can use a foreach loop like this:

{foreach from=$service_custom_fields item=customfield}

{$customfield.name}: {$customfield.value}

{/foreach}

 

But to be honest i don't even know how to exactly format and ask my request for this.

Something like... i have 2 product-custom-fields and want to show em on invoice pdf, but not in description (as it is by default) but at another place in the invoice template, and also those fields are always different values for every order.

Link to comment
Share on other sites

I guess the code is something similar to this , i found it @ email template documentation

that code is really only of use in the email templates, you couldn't use it in the pdf invoice template or the main site.

 

But to be honest i don't even know how to exactly format and ask my request for this.

you don't really need to give more than the basics of the problem - any interested developers will reply in the thread and either ask you to contact them, or if you have private messaging enabled, they might contact you that way.

 

the above example posting is a good start, but will you need other things too? e.g do you need help modifying the email templates? do you need the html invoice changing? also, mention which WHMCS version its for - i'm assuming it's v6.1.1

 

try to have it clear in your own mind what you need - that way, there'll be no confusion for you or the developers.

 

as I see it, there are two solutions to this...

 

either, you create an action hook that modifies the invoice description to remove these product fields... though you would still need to modify the pdf invoice template to add the new product fields where you want them..

 

or you do it all in the templates, e.g modify the pdf invoice to query the db, edit the description and add the fields - and do it in such a way that it doesn't affect invoicing products that don't have these custom fields.

 

there are pro & cons to both. :)

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