Backend Product page

  • Posts: 79
  • Thank you received: 2
5 years 9 months ago #307109

-- HikaShop version -- : 4.1.0
-- Joomla version -- : 3.9.6.
-- PHP version -- : 7.2

Hi,
I have created several custom fields in hikashop.
No when i goto a product in the backend, they are all listed at Custom Fields.
My question is, is there a way to create your own block in the backend product view and put some of the custom fields in there. The reason i wanted to do this is so i can organize the fields better for the client.
Any help is appreciated.
Thank you.

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

  • Posts: 83412
  • Thank you received: 13503
  • MODERATOR
5 years 9 months ago #307121

Hi,

There is no option to do that.
But you can create a view override of the view displaying them in the backend, like you would do to customize a view in the frontend.
www.hikashop.com/support/documentation/1...-display.html#layout
So with custom HTML / PHP in the correct view file, it is possible.

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

  • Posts: 79
  • Thank you received: 2
5 years 5 months ago #311754

Hi Nicolas,
Im sorry for my late response. I wasnt able to work on, but have some time again.
I managed to get a seperate block for my cusom fields.
The text fields work great. I have to uncheck the back-end view on the field for it not to show in the custom fields, but they are working correctly.
I have one problem and that is with a input="radio" field.
I created a custom field "inbraak" which is a boolean field type..
I cant seem to get that one working.
This is what i have:

<dl id="hikashop_product_inbraak" class="hika_options">
<dt class="hikashop_product_inbraak"><label>Inbraak</label></dt>
<dd>
<input type="radio" name="data[product][inbraak]" value="1" id="inbraak_1" <?php if($this->product->inbraak == 1){echo 'checked="checked"';} ?> onchange="window.hikashop.toggleField(this.value,'inbraak','product',0);"><span>Ja</span>
<input type="radio" name="data[product][inbraak]" value="0" id="inbraak_0" <?php if($this->product->inbraak == 0){echo 'checked="checked"';} ?> onchange="window.hikashop.toggleField(this.value,'inbraak','product',0);"><span>Nee</span>
</dd>
</dt>
</dl>

When i turn the backend view to "on" in the field settings it works. But then it also shows in the custom fields area. Once i turn it to "off" it doesnt seem to want to work.
Do you have any suggestions for me?

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

  • Posts: 83412
  • Thank you received: 13503
  • MODERATOR
5 years 5 months ago #311769

Hi,

You should keep the display option activated.
Then, in your view file override, you should skip the display of the custom field in the foreach displaying the custom fields:

foreach($this->fields as $fieldName => $oneExtraField) {
That way, when the data is submitted, the custom field will properly be taken into account by the system.

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

  • Posts: 79
  • Thank you received: 2
5 years 5 months ago #311846

Hi Nicolas,
Ok i get what you are saying. I played around with it and got it to work.
Thank you.

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

Time to create page: 0.063 seconds
Powered by Kunena Forum