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

#   Custom fields in downloads section?

##

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

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 10 months ago [\#188093](#188093) by [Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")  *[Custom fields in downloads section?](/forum/27-checkout/874506-custom-fields-in-downloads-section#188093 "-- url of the page with the problem -- :   www.spinboom.com  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.34  Hey,  I'm trying for a while to add some custom fields from my products into the downloads section. I was successful in customizing the product tables with custom fields, see example below:   www.spinboom.com/index.php/en/categories/category/film  But I can't get the same result on the Downloads page through the downloads.php I have altered the section a little but I can't add new product fields successfully. (In order to view the downloads page, you have to sign up, so I included a screenshot.)  I would like to add Images and some of my custom product fields like &quot;Preview&quot; to the Downloads section. I'm having trouble echo-ing them through php from the downloads.php file.  Any help?")* was created by *[Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")*

-- url of the page with the problem -- : [ www.spinboom.com](https://www.spinboom.com)
-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.1
-- PHP version -- : 5.4.34

Hey,

I'm trying for a while to add some custom fields from my products into the downloads section.
I was successful in customizing the product tables with custom fields, see example below:
[ www.spinboom.com/index.php/en/categories/category/film](https://www.spinboom.com/index.php/en/categories/category/film)

But I can't get the same result on the Downloads page through the downloads.php I have altered the section a little but I can't add new product fields successfully. (In order to view the downloads page, you have to sign up, so I included a screenshot.)

I would like to add Images and some of my custom product fields like "Preview" to the Downloads section. I'm having trouble echo-ing them through php from the downloads.php file.

Any help?

- [ ![downloads.png](/forum/attachment/21903) ](/forum/attachment/21903 "downloads.png") [ ](/forum/attachment/21903?download=1 "downloads.png")

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

11 years 10 months ago [\#188095](#188095) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom fields in downloads section?](/forum/27-checkout/874506-custom-fields-in-downloads-section#188095 "-- url of the page with the problem -- :   www.spinboom.com  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.34  Hey,  I'm trying for a while to add some custom fields from my products into the downloads section. I was successful in customizing the product tables with custom fields, see example below:   www.spinboom.com/index.php/en/categories/category/film  But I can't get the same result on the Downloads page through the downloads.php I have altered the section a little but I can't add new product fields successfully. (In order to view the downloads page, you have to sign up, so I included a screenshot.)  I would like to add Images and some of my custom product fields like &quot;Preview&quot; to the Downloads section. I'm having trouble echo-ing them through php from the downloads.php file.  Any help?")*

Hi,

It's normal that you have a hard time since the product data is not loaded on the downloads listing.
Change the line:
$select = 'o.order_id, o.order_created, f.*, op.* ';
to:
$select = 'o.order_id, o.order_created, p.*, f.*, op.* ';

in the file components/com_hikashop/views/user/view.html.php and that will add the product data in the rows of data.
So you'll be able to display your custom product fields data easily with something like that:
&lt;?php echo $downloadFile-&gt;custom_field; ?&gt;
like on the products listing.

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

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

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 10 months ago [\#188159](#188159) by [Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")  Replied by *[Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")* on topic *[Custom fields in downloads section?](/forum/27-checkout/874506-custom-fields-in-downloads-section#188159 "-- url of the page with the problem -- :   www.spinboom.com  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.34  Hey,  I'm trying for a while to add some custom fields from my products into the downloads section. I was successful in customizing the product tables with custom fields, see example below:   www.spinboom.com/index.php/en/categories/category/film  But I can't get the same result on the Downloads page through the downloads.php I have altered the section a little but I can't add new product fields successfully. (In order to view the downloads page, you have to sign up, so I included a screenshot.)  I would like to add Images and some of my custom product fields like &quot;Preview&quot; to the Downloads section. I'm having trouble echo-ing them through php from the downloads.php file.  Any help?")*

Hey Nicolas!

Thank you for your quick response and for pointing me in the right direction.
My components/com_hikashop/views/user/view.html.php file looks like that before changing anything:
Code:

$select = 'o.order_id, o.order_created, f.*, p.* '; $selectSum = ', MIN(o.order_created) as min_order_created, MAX(o.order_created) as max_order_created, SUM(p.order_product_quantity) as file_quantity '; $selectUniq = ', IF( REPLACE(LEFT(f.file_path, 1) , \'#\', \'@\') = \'@\', CONCAT(f.file_id, \'@\', o.order_id), f.file_id ) as uniq_id'; $query = ' FROM '.hikashop_table('order').' AS o ' . ' INNER JOIN '.hikashop_table('order_product').' AS p ON p.order_id = o.order_id ' . ' INNER JOIN '.hikashop_table('file').' AS f ON p.product_id = f.file_ref_id ' . ' WHERE ' . $filters; $groupBy = ' GROUP BY uniq_id ';

Unfortunately your suggestion breaks the code and I get an error 1151:
Code:

Error: 1051 Unknown table 'op' SQL=SELECT o.order_id, o.order_created, p.*, f.*, op.* , MIN(o.order_created) as min_order_created, MAX(o.order_created) as max_order_created, SUM(p.order_product_quantity) as file_quantity , IF( REPLACE(LEFT(f.file_path, 1) , '#', '@') = '@', CONCAT(f.file_id, '@', o.order_id), f.file_id ) as uniq_id FROM dcbs1_hikashop_order AS o INNER JOIN dcbs1_hikashop_order_product AS p ON p.order_id = o.order_id INNER JOIN dcbs1_hikashop_file AS f ON p.product_id = f.file_ref_id WHERE o.order_type = 'sale' AND o.order_status IN ('shipped','confirmed') AND f.file_ref_id &gt; 0 AND f.file_type = 'file' AND o.order_user_id = 5 GROUP BY uniq_id ORDER BY max_order_created desc LIMIT 0, 20

Any suggestions?

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 9 months ago [\#188205](#188205) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Custom fields in downloads section?](/forum/27-checkout/874506-custom-fields-in-downloads-section#188205 "-- url of the page with the problem -- :   www.spinboom.com  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.34  Hey,  I'm trying for a while to add some custom fields from my products into the downloads section. I was successful in customizing the product tables with custom fields, see example below:   www.spinboom.com/index.php/en/categories/category/film  But I can't get the same result on the Downloads page through the downloads.php I have altered the section a little but I can't add new product fields successfully. (In order to view the downloads page, you have to sign up, so I included a screenshot.)  I would like to add Images and some of my custom product fields like &quot;Preview&quot; to the Downloads section. I'm having trouble echo-ing them through php from the downloads.php file.  Any help?")*

Hi,

Please try to just remove ", op.*"

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

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

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 9 months ago [\#188262](#188262) by [Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")  Replied by *[Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")* on topic *[Custom fields in downloads section?](/forum/27-checkout/874506-custom-fields-in-downloads-section#188262 "-- url of the page with the problem -- :   www.spinboom.com  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.34  Hey,  I'm trying for a while to add some custom fields from my products into the downloads section. I was successful in customizing the product tables with custom fields, see example below:   www.spinboom.com/index.php/en/categories/category/film  But I can't get the same result on the Downloads page through the downloads.php I have altered the section a little but I can't add new product fields successfully. (In order to view the downloads page, you have to sign up, so I included a screenshot.)  I would like to add Images and some of my custom product fields like &quot;Preview&quot; to the Downloads section. I'm having trouble echo-ing them through php from the downloads.php file.  Any help?")*

Hey,

There was no op in my file, just:

$select = 'o.order_id, o.order_created, f.*, p.* ';

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NDUwNi1jdXN0b20tZmllbGRzLWluLWRvd25sb2Fkcy1zZWN0aW9uP3RtcGw9bWFya2Rvd24=) 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: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

11 years 9 months ago [\#188270](#188270) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Custom fields in downloads section?](/forum/27-checkout/874506-custom-fields-in-downloads-section#188270 "-- url of the page with the problem -- :   www.spinboom.com  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.34  Hey,  I'm trying for a while to add some custom fields from my products into the downloads section. I was successful in customizing the product tables with custom fields, see example below:   www.spinboom.com/index.php/en/categories/category/film  But I can't get the same result on the Downloads page through the downloads.php I have altered the section a little but I can't add new product fields successfully. (In order to view the downloads page, you have to sign up, so I included a screenshot.)  I would like to add Images and some of my custom product fields like &quot;Preview&quot; to the Downloads section. I'm having trouble echo-ing them through php from the downloads.php file.  Any help?")*

Hi,

That's right, there wasn't ; but regarding the error you got, you added it

> Unknown table 'op' SQL=SELECT o.order\_id, o.order\_created, p.\*, f.\*, **op.\*** , MIN(o.order\_created) as min\_order\_created,

So please leave that line like it was before.

Nicolas gave you a line to replace ; and it was a line from HikaShop 2.3.5.
But you are not using HikaShop 2.3.5 so you don't have the same line to replace ; that's why it is introducing you an error.
So you have to add the "p.*" but not the "op.*" !

Regards,

---

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

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

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

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 9 months ago [\#188319](#188319) by [Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")  Replied by *[Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")* on topic *[Custom fields in downloads section?](/forum/27-checkout/874506-custom-fields-in-downloads-section#188319 "-- url of the page with the problem -- :   www.spinboom.com  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.34  Hey,  I'm trying for a while to add some custom fields from my products into the downloads section. I was successful in customizing the product tables with custom fields, see example below:   www.spinboom.com/index.php/en/categories/category/film  But I can't get the same result on the Downloads page through the downloads.php I have altered the section a little but I can't add new product fields successfully. (In order to view the downloads page, you have to sign up, so I included a screenshot.)  I would like to add Images and some of my custom product fields like &quot;Preview&quot; to the Downloads section. I'm having trouble echo-ing them through php from the downloads.php file.  Any help?")*

Hi Jerome,

As I stated in my first post I'm using -- HikaShop version -- : 2.3.2

The components/com_hikashop/views/user/view.html.php file **before** I changed anything suggested by Nicolas was:

$select = 'o.order_id, o.order_created, f.*, p.* ';

So "p.*" was already there. And still is. But it's not working. You can see the rest of the original code following $suggest here:
Code:

$select = 'o.order_id, o.order_created, f.*, p.* '; $selectSum = ', MIN(o.order_created) as min_order_created, MAX(o.order_created) as max_order_created, SUM(p.order_product_quantity) as file_quantity '; $selectUniq = ', IF( REPLACE(LEFT(f.file_path, 1) , \'#\', \'@\') = \'@\', CONCAT(f.file_id, \'@\', o.order_id), f.file_id ) as uniq_id'; $query = ' FROM '.hikashop_table('order').' AS o ' . ' INNER JOIN '.hikashop_table('order_product').' AS p ON p.order_id = o.order_id ' . ' INNER JOIN '.hikashop_table('file').' AS f ON p.product_id = f.file_ref_id ' . ' WHERE ' . $filters; $groupBy = ' GROUP BY uniq_id ';

Please help!

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 9 months ago [\#188344](#188344) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Custom fields in downloads section?](/forum/27-checkout/874506-custom-fields-in-downloads-section#188344 "-- url of the page with the problem -- :   www.spinboom.com  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.34  Hey,  I'm trying for a while to add some custom fields from my products into the downloads section. I was successful in customizing the product tables with custom fields, see example below:   www.spinboom.com/index.php/en/categories/category/film  But I can't get the same result on the Downloads page through the downloads.php I have altered the section a little but I can't add new product fields successfully. (In order to view the downloads page, you have to sign up, so I included a screenshot.)  I would like to add Images and some of my custom product fields like &quot;Preview&quot; to the Downloads section. I'm having trouble echo-ing them through php from the downloads.php file.  Any help?")*

Hi,

I think we were not clear enough, in the original file, there is no "op" present, but in the code given by Nicolas it is present and has to be removed. Because this "op" data has been added in a more recent version than yours.

So in your **current**  code, juste remove ", op.*" because it should not be there.

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

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

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 9 months ago [\#188434](#188434) by [Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")  Replied by *[Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")* on topic *[Custom fields in downloads section?](/forum/27-checkout/874506-custom-fields-in-downloads-section#188434 "-- url of the page with the problem -- :   www.spinboom.com  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.34  Hey,  I'm trying for a while to add some custom fields from my products into the downloads section. I was successful in customizing the product tables with custom fields, see example below:   www.spinboom.com/index.php/en/categories/category/film  But I can't get the same result on the Downloads page through the downloads.php I have altered the section a little but I can't add new product fields successfully. (In order to view the downloads page, you have to sign up, so I included a screenshot.)  I would like to add Images and some of my custom product fields like &quot;Preview&quot; to the Downloads section. I'm having trouble echo-ing them through php from the downloads.php file.  Any help?")*

If I remove the ", op.*" from my current code which I guess you mean the code Nicolas suggested I end up with the same thing I started with.

My original code was

$select = 'o.order_id, o.order_created, f.*, p.* ';

and you are telling me to remove op from NIcolas' suggestion so I get again

$select = 'o.order_id, o.order_created, f.*, p.* ';

You are asking me to not change anything in the code I already had and wasn't working anyway...

Could you please look into the question again from the beginning of the thread?
I am trying to load the product data on the downloads listing...

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

11 years 9 months ago [\#188459](#188459) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom fields in downloads section?](/forum/27-checkout/874506-custom-fields-in-downloads-section#188459 "-- url of the page with the problem -- :   www.spinboom.com  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.34  Hey,  I'm trying for a while to add some custom fields from my products into the downloads section. I was successful in customizing the product tables with custom fields, see example below:   www.spinboom.com/index.php/en/categories/category/film  But I can't get the same result on the Downloads page through the downloads.php I have altered the section a little but I can't add new product fields successfully. (In order to view the downloads page, you have to sign up, so I included a screenshot.)  I would like to add Images and some of my custom product fields like &quot;Preview&quot; to the Downloads section. I'm having trouble echo-ing them through php from the downloads.php file.  Any help?")*

Hi,

Sorry for that. I had assumed that you had the latest version.
With HikaShop 2.3.2, it's more complex to do that as the query to load the data is not made to catter for the loading of the product data.
The simplest would be to use such code in your downloads view file:
&lt;?php
$class = hikashop_get('class.product');
$prod = $class-&gt;get($downloadFile-&gt;product_id);
echo $prod-&gt;custom_field; ?&gt;

The following user(s) said Thank You: [Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")

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

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

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 9 months ago [\#188521](#188521) by [Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")  Replied by *[Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")* on topic *[Custom fields in downloads section?](/forum/27-checkout/874506-custom-fields-in-downloads-section#188521 "-- url of the page with the problem -- :   www.spinboom.com  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.34  Hey,  I'm trying for a while to add some custom fields from my products into the downloads section. I was successful in customizing the product tables with custom fields, see example below:   www.spinboom.com/index.php/en/categories/category/film  But I can't get the same result on the Downloads page through the downloads.php I have altered the section a little but I can't add new product fields successfully. (In order to view the downloads page, you have to sign up, so I included a screenshot.)  I would like to add Images and some of my custom product fields like &quot;Preview&quot; to the Downloads section. I'm having trouble echo-ing them through php from the downloads.php file.  Any help?")*

Hey!

Thank you Nicolas! We are getting there. That works but now my problem is that this now links to the characteristic variant product.

I use characteristic variants to link multiple files to each product (an mp3 and a wav file) so that users have the option to select what file they want to buy from a characteristic dropdown (Filetype Select) for example: [ www.spinboom.com/index.php/en/categories/product/clear](https://www.spinboom.com/index.php/en/categories/product/clear)

So the order product ID is linked to the characteristic variant and not the main product. All the custom fields have information in the main product unfortunately. Is there a way to point to the main product?

I tried searching through my sql database and find where the link is happening between the variant and the main product but no luck yet.

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

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

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 9 months ago [\#188531](#188531) by [Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")  Replied by *[Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")* on topic *[Custom fields in downloads section?](/forum/27-checkout/874506-custom-fields-in-downloads-section#188531 "-- url of the page with the problem -- :   www.spinboom.com  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.34  Hey,  I'm trying for a while to add some custom fields from my products into the downloads section. I was successful in customizing the product tables with custom fields, see example below:   www.spinboom.com/index.php/en/categories/category/film  But I can't get the same result on the Downloads page through the downloads.php I have altered the section a little but I can't add new product fields successfully. (In order to view the downloads page, you have to sign up, so I included a screenshot.)  I would like to add Images and some of my custom product fields like &quot;Preview&quot; to the Downloads section. I'm having trouble echo-ing them through php from the downloads.php file.  Any help?")*

Hey again,

All good. I managed to do it like that:
Code:

&lt;?php $class = hikashop_get('class.product'); $prod = $class-&gt;get($downloadFile-&gt;product_id); $class = hikashop_get('class.product'); $mainprod = $class-&gt;get($prod-&gt;product_parent_id); echo $mainprod-&gt;preview; ?&gt;

What do you think? Is there a better way?

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

11 years 9 months ago [\#188586](#188586) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom fields in downloads section?](/forum/27-checkout/874506-custom-fields-in-downloads-section#188586 "-- url of the page with the problem -- :   www.spinboom.com  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.1 -- PHP version -- : 5.4.34  Hey,  I'm trying for a while to add some custom fields from my products into the downloads section. I was successful in customizing the product tables with custom fields, see example below:   www.spinboom.com/index.php/en/categories/category/film  But I can't get the same result on the Downloads page through the downloads.php I have altered the section a little but I can't add new product fields successfully. (In order to view the downloads page, you have to sign up, so I included a screenshot.)  I would like to add Images and some of my custom product fields like &quot;Preview&quot; to the Downloads section. I'm having trouble echo-ing them through php from the downloads.php file.  Any help?")*

Hi,

The better way would be to update your HikaShop and that would allow you to load the product parent with the get function directly from the product_parent_id in $downloadFile. That would reduce the MySQL queries on the page.
Other than that, it's ok like that ![:)](/media/kunena/emoticons/3.png ":)")

The following user(s) said Thank You: [Superpsychics](/forum/user/31898-superpsychics "View Superpsychics's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NDUwNi1jdXN0b20tZmllbGRzLWluLWRvd25sb2Fkcy1zZWN0aW9uP3RtcGw9bWFya2Rvd24=) 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.083 seconds

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