[Skip to main content](#vessel-content)

#   Extend HS with own table fields on productpage

##

- **[squareweb](/forum/user/29471-squareweb "View squareweb's Profile")**
- [![squareweb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/29471-squareweb "View squareweb's Profile") Topic Author
- [ Offline](/forum/user/29471-squareweb)

Less More

- Posts: 68
- Thank you received: 2
-
-

12 years 2 months ago [\#167222](#167222) by [squareweb](/forum/user/29471-squareweb "View squareweb's Profile")  *[Extend HS with own table fields on productpage](/forum/31-development/870329-extend-hs-with-own-table-fields-on-productpage#167222 "-- HikaShop version -- : latest  Hi,  I'd like some directions on how to extend Hikashop.  Case:  I've created my own DB-table containing &quot;color-records&quot;. I'd like to display this colors on my product-page. I'd like to customise HS in this way that I do not lose customisations after updating to newer release. I do know how to customise display by HS-overriding-system, I've done this and this works fine.  I'd like to know how to &quot;fetch&quot; the table-data (colors-table), what kind of php-file do I have to create and in which directory and how to pass it to the product-display-view?  In short:  1. read DB-table 2. create colors-dataset 3. pass colours-dataset to the product-display-view  I know how to code this in PHP andI could do this with AJAX by jQuery but that is no what I want, I'd like to fix this the Joomla / Hikashop-way  Any info is appreciated.  Thanks in advance.  Mark")* was created by *[squareweb](/forum/user/29471-squareweb "View squareweb's Profile")*

-- HikaShop version -- : latest

Hi,

I'd like some directions on how to extend Hikashop.

Case:

I've created my own DB-table containing "color-records".
I'd like to display this colors on my product-page.
I'd like to customise HS in this way that I do not lose customisations after updating to newer release.
I do know how to customise display by HS-overriding-system, I've done this and this works fine.

I'd like to know how to "fetch" the table-data (colors-table), what kind of php-file do I have to create and in which directory and how to pass it to the product-display-view?

In short:

1. read DB-table
2. create colors-dataset
3. pass colours-dataset to the product-display-view

I know how to code this in PHP andI could do this with AJAX by jQuery but that is no what I want, I'd like to fix this the Joomla / Hikashop-way

Any info is appreciated.

Thanks in advance.

Mark

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2RldmVsb3BtZW50Lzg3MDMyOS1leHRlbmQtaHMtd2l0aC1vd24tdGFibGUtZmllbGRzLW9uLXByb2R1Y3RwYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

12 years 2 months ago [\#167282](#167282) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Extend HS with own table fields on productpage](/forum/31-development/870329-extend-hs-with-own-table-fields-on-productpage#167282 "-- HikaShop version -- : latest  Hi,  I'd like some directions on how to extend Hikashop.  Case:  I've created my own DB-table containing &quot;color-records&quot;. I'd like to display this colors on my product-page. I'd like to customise HS in this way that I do not lose customisations after updating to newer release. I do know how to customise display by HS-overriding-system, I've done this and this works fine.  I'd like to know how to &quot;fetch&quot; the table-data (colors-table), what kind of php-file do I have to create and in which directory and how to pass it to the product-display-view?  In short:  1. read DB-table 2. create colors-dataset 3. pass colours-dataset to the product-display-view  I know how to code this in PHP andI could do this with AJAX by jQuery but that is no what I want, I'd like to fix this the Joomla / Hikashop-way  Any info is appreciated.  Thanks in advance.  Mark")*

Hi,

I am not sure that I understand why you want to use an external table for your "color-records" regarding the HikaShop custom field system.

There are too many ways to do that.
The two main solutions are :

- You can just put your php code in the "product &#124; show_default" view, using the Joomla database system to make your query and display the information.
[ docs.joomla.org/Selecting\_data\_using\_JDatabase](http://docs.joomla.org/Selecting_data_using_JDatabase)
I don't see any requirements to create extra php files to just fetch the database in the product page.

- You can create your own custom field, like we did for the plugin "date picker".
[ www.hikashop.com/support/support/documen...r-documentation.html](http://www.hikashop.com/support/support/documentation/62-hikashop-developer-documentation.html)
The best is to read the content of the plugin itself ; it's a different finality but it is a good example for "how create a new kind of custom field".

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2RldmVsb3BtZW50Lzg3MDMyOS1leHRlbmQtaHMtd2l0aC1vd24tdGFibGUtZmllbGRzLW9uLXByb2R1Y3RwYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[squareweb](/forum/user/29471-squareweb "View squareweb's Profile")**
- [![squareweb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/29471-squareweb "View squareweb's Profile") Topic Author
- [ Offline](/forum/user/29471-squareweb)

Less More

- Posts: 68
- Thank you received: 2
-
-

12 years 2 months ago [\#167339](#167339) by [squareweb](/forum/user/29471-squareweb "View squareweb's Profile")  Replied by *[squareweb](/forum/user/29471-squareweb "View squareweb's Profile")* on topic *[Extend HS with own table fields on productpage](/forum/31-development/870329-extend-hs-with-own-table-fields-on-productpage#167339 "-- HikaShop version -- : latest  Hi,  I'd like some directions on how to extend Hikashop.  Case:  I've created my own DB-table containing &quot;color-records&quot;. I'd like to display this colors on my product-page. I'd like to customise HS in this way that I do not lose customisations after updating to newer release. I do know how to customise display by HS-overriding-system, I've done this and this works fine.  I'd like to know how to &quot;fetch&quot; the table-data (colors-table), what kind of php-file do I have to create and in which directory and how to pass it to the product-display-view?  In short:  1. read DB-table 2. create colors-dataset 3. pass colours-dataset to the product-display-view  I know how to code this in PHP andI could do this with AJAX by jQuery but that is no what I want, I'd like to fix this the Joomla / Hikashop-way  Any info is appreciated.  Thanks in advance.  Mark")*

Jerome thanks for quick response.

I thought so but I thought it's bad practice to put DB-actions within views? In this case probably its OK because it's a small imprint but it's not adhering coding-best-practices I guess. On the other hand: why "over coding" for such small functionality.

The case is this:

My color-record consists of:
-color-active
-colorname
-color-image
-colortype
-colorversion

In the frontend (productpage) I build a color-matrix from which the customer can select one color.
Sometimes color are inactive so I only show active colours of that moment.

I've created my own component (with component-creator) for the color-crud function.

Thats why I'd like to integrate my own component (solution) in the frontend of Hikashop.

Anyway thanks for responding.

Mark

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2RldmVsb3BtZW50Lzg3MDMyOS1leHRlbmQtaHMtd2l0aC1vd24tdGFibGUtZmllbGRzLW9uLXByb2R1Y3RwYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

12 years 2 months ago [\#167359](#167359) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Extend HS with own table fields on productpage](/forum/31-development/870329-extend-hs-with-own-table-fields-on-productpage#167359 "-- HikaShop version -- : latest  Hi,  I'd like some directions on how to extend Hikashop.  Case:  I've created my own DB-table containing &quot;color-records&quot;. I'd like to display this colors on my product-page. I'd like to customise HS in this way that I do not lose customisations after updating to newer release. I do know how to customise display by HS-overriding-system, I've done this and this works fine.  I'd like to know how to &quot;fetch&quot; the table-data (colors-table), what kind of php-file do I have to create and in which directory and how to pass it to the product-display-view?  In short:  1. read DB-table 2. create colors-dataset 3. pass colours-dataset to the product-display-view  I know how to code this in PHP andI could do this with AJAX by jQuery but that is no what I want, I'd like to fix this the Joomla / Hikashop-way  Any info is appreciated.  Thanks in advance.  Mark")*

Hi,

If you want to organize the code in order to have something "code-best-practice", I will suggest you to use a plugin and some triggers like "onHikashopBeforeDisplayView" in order to call a special custom class and modify the $view content.
HikaMarket uses this trigger to modify some view elements which are displayed in the view afterwards (extraData-&gt;topEnd &amp; others).

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2RldmVsb3BtZW50Lzg3MDMyOS1leHRlbmQtaHMtd2l0aC1vd24tdGFibGUtZmllbGRzLW9uLXByb2R1Y3RwYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.076 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
