Adding title field above al other fields

  • Karl Kaczmarczyk
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 10 months ago #20590 by Karl Kaczmarczyk
Adding title field above al other fields was created by Karl Kaczmarczyk
Hello - I have read other threads but no solution has been offered for this in joomdonation

Even if it is a core hack can you please supply the code and advise what files need to be edited to add the ability to have a title dropdown (Mr, Mrs, Miss etc) field before the persons firstname field please as it is quite a common field that is required for donations

regards Karl

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #20627 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Adding title field above al other fields
Hi Karl

Yes. It requires a core hack in this case. If you know PHP, Joomla programming (just basic skill), you should be able to do it using the instruction below :

1. Change database structure of #__jd_donors table, add a new field called title.

2. Change the file components/com_jdonation/views/donation/tmpl/default.php, add the field to allow users to choose Title.

Please do the first above two steps and let me know when it is done. Then I will guide you for the next step.

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Karl Kaczmarczyk
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 10 months ago #20636 by Karl Kaczmarczyk
Replied by Karl Kaczmarczyk on topic Re: Adding title field above al other fields
OK that's done
Next step please

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #20638 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Adding title field above al other fields
Great. Next step will be confirmation page. There are 3 files which need to be modified :

componnets/com_jdonation/views/confirmation/view.html.php
componnets/com_jdonation/views/confirmation/tmpl/default.php
componnets/com_jdonation/views/confirmation/tmpl/recurring.php

Basically, for this , you will have to do the two tasks :

1. Get the data which users entered on the form using JRequest::getVar method.

2. Did the data which users entered .

3. Add a hidden field so that the data will be passed to next step for storing in database.

You can simply see how other fields processed (First Name for example) and do the same for title field.

Please do that step and let me know the result !

Tuan

Please Log in or Create an account to join the conversation.

  • Karl Kaczmarczyk
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 10 months ago #20639 by Karl Kaczmarczyk
Replied by Karl Kaczmarczyk on topic Re: Adding title field above al other fields
Hi Again

OK - I had to change it in a few more places and I have got it working.

Just one thing - I can't get it to download the title in the csv file - I have tried using the same syntax as everywhere else but it seems it might be conflicting with some other code

So in admin/controller.php I added $results_arr[]=$r->title; but it seems this won't work in this area - I can get header to work fine $csv_output .= ', title '; - just not the other

also where can I add the new field to the emails being sent out to the admin and customer

Please Log in or Create an account to join the conversation.

  • Karl Kaczmarczyk
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 10 months ago #20641 by Karl Kaczmarczyk
Replied by Karl Kaczmarczyk on topic Re: Adding title field above al other fields
All fixed - I've managed to sort out my issues - thanks for your help

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #20870 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Adding title field above al other fields
Great, congratulations ! I will consider adding support for this field in the next release of Joom Donation.

Regards,

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Dang Thuc DamDang Dam