Page 1 of 2
Extra Product Description Fields
Posted: Tue Dec 28, 2021 4:36 pm
by tessthepup
Good afternoon all,
I need to add extra fields to the admin product entry for additonal info to be shown in tabs on the product info page.
Now in the old days it was as simple as duplicating the products_description in admin/categories.php
What would be the correct process these days? I have had a look at the core code but do not want to drastically change anything if I dont need to.
I would appreciate a heads up from those who know the best practice for doing this
Many thanks
Mark
Re: Extra Product Description Fields
Posted: Tue Dec 28, 2021 6:05 pm
by LeeFoster
You create a module, copying one of the existing ones for product tabs will be the easiest way to do it.
Then you'll need a hook to allow you to amend the data and probably need to add the columns to the table too.
Re: Extra Product Description Fields
Posted: Tue Dec 28, 2021 6:08 pm
by tessthepup
LeeFoster wrote: ↑Tue Dec 28, 2021 6:05 pm
You create a module, copying one of the existing ones for product tabs will be the easiest way to do it.
Already got this part sorted
LeeFoster wrote: ↑Tue Dec 28, 2021 6:05 pm
Then you'll need a hook to allow you to amend the data and probably need to add the columns to the table too.
Its the admin side I have no idea where to start lol
Re: Extra Product Description Fields
Posted: Tue Dec 28, 2021 8:44 pm
by Kofod95
You could take a look at my
specials at products edit addon. It would look a little different if you are on a version later than 1.0.8.4, but the general idea would be the same. Feel free to ask.
The beauty here is, that you can make this happen without editing core, and once you get the rythm of it, you'll find that it is quite easy to make these kind of additions, with the added bonus that updating is easy!
//Daniel
Re: Extra Product Description Fields
Posted: Wed Dec 29, 2021 12:36 pm
by tessthepup
Kofod95 wrote: ↑Tue Dec 28, 2021 8:44 pm
You could take a look at my
specials at products edit addon. It would look a little different if you are on a version later than 1.0.8.4, but the general idea would be the same. Feel free to ask.
The beauty here is, that you can make this happen without editing core, and once you get the rythm of it, you'll find that it is quite easy to make these kind of additions, with the added bonus that updating is easy!
//Daniel
Hi Daniel,
Thank you for the advice. All I need to know now is where the heck is the code for product insertion lol
So different from the old day

Re: Extra Product Description Fields
Posted: Wed Dec 29, 2021 5:47 pm
by 14Steve14
I looked into trying to make something similar as I wanted to add in a products specification area, using the product tabs and could not get it to work on an individual product basis. I could get a tab to show but it contained the same information on every products.
I am sure there must be a way of creating an admin hook for the categories page that would allow the text to show on a particular product but have yet to get any further with it. May have to have a bit of a look later to see what can be done.
I was thinking of a hook that would allow an extra products description box to be added to the products table and show the data entered on products. Probable not that hard for a coder to do.
Re: Extra Product Description Fields
Posted: Wed Dec 29, 2021 6:19 pm
by Kofod95
tessthepup wrote: ↑Wed Dec 29, 2021 12:36 pm
All I need to know now is where the heck is the code for product insertion lol
>= 1.0.8.5
=< 1.0.8.4
Note line 308 on the second link:
Code: Select all
$OSCOM_Hooks->call('categories', 'productActionSave');
That allows you to inject code from a different file (which is what I do in the addon I linked in my previous post), meaning you can leave all core files as is.
You'll need a hook utilizing line 662 as well (as a function in the same file - as is done in the addon linked) :
Code: Select all
echo $OSCOM_Hooks->call('categories', 'injectLanguageForm');
Which will inject the form for you to enter data into.
In versions >= 1.0.8.5 the structure is a bit different, but most files that work the old way will work here as well with just a few naming-changes
tessthepup wrote: ↑Wed Dec 29, 2021 12:36 pm
So different from the old day
Luckily, yes!
//Daniel
Re: Extra Product Description Fields
Posted: Thu Dec 30, 2021 11:17 am
by tessthepup
Kofod95 wrote: ↑Wed Dec 29, 2021 6:19 pm
tessthepup wrote: ↑Wed Dec 29, 2021 12:36 pm
All I need to know now is where the heck is the code for product insertion lol
>= 1.0.8.5
=< 1.0.8.4
Note line 308 on the second link:
Code: Select all
$OSCOM_Hooks->call('categories', 'productActionSave');
That allows you to inject code from a different file (which is what I do in the addon I linked in my previous post), meaning you can leave all core files as is.
You'll need a hook utilizing line 662 as well (as a function in the same file - as is done in the addon linked) :
Code: Select all
echo $OSCOM_Hooks->call('categories', 'injectLanguageForm');
Which will inject the form for you to enter data into.
In versions >= 1.0.8.5 the structure is a bit different, but most files that work the old way will work here as well with just a few naming-changes
tessthepup wrote: ↑Wed Dec 29, 2021 12:36 pm
So different from the old day
Luckily, yes!
//Daniel
Thanks Daniel although none the wiser but will have a go lol
Re: Extra Product Description Fields
Posted: Thu Dec 30, 2021 5:23 pm
by Kofod95
tessthepup wrote: ↑Thu Dec 30, 2021 11:17 am
Thanks Daniel although none the wiser but will have a go lol
That is why I adviced looking at my addon that does something similar to what you want (adding an input on the product-edit) - you could take my addon and just change the form and input to do what you want it to. Of course, you would probably want to inderst the form in the language-tab, but all the info you need to do that should be provided in my two previous posts.
Good that you will give it a try! Feel free to ask if you get stuck!
//Daniel
Re: Extra Product Description Fields
Posted: Sun Jan 02, 2022 11:25 am
by tessthepup
Kofod95 wrote: ↑Thu Dec 30, 2021 5:23 pm
tessthepup wrote: ↑Thu Dec 30, 2021 11:17 am
Thanks Daniel although none the wiser but will have a go lol
That is why I adviced looking at my addon that does something similar to what you want (adding an input on the product-edit) - you could take my addon and just change the form and input to do what you want it to. Of course, you would probably want to inderst the form in the language-tab, but all the info you need to do that should be provided in my two previous posts.
Good that you will give it a try! Feel free to ask if you get stuck!
//Daniel
Hi Daniel,
Having a go at tackling this but just wondering if you can let me know if I am right in thinking the code I should be looking to put inside the hook is from admin/includes/actions/catalog/views/new_product.php ???