Show & be able to edit custom fields on order page

  • Posts: 54
  • Thank you received: 0
8 years 6 months ago #240615

-- HikaShop version -- : HikaShop Business 2.6.3 [1605112330]
-- Joomla version -- : Joomla! 3.4.8 Stable [ Ember ] 24-December-2015 19:30 GMT
-- PHP version -- : 5.4

Please could you tell me how to add custom fields that I have created in the user table in the Customer area of the orders page and ideally be able to edit them there

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 6 months ago #240617

Hi,

For the display of the values, you'll have to edit the file "show" of the view "order" via the menu Display>Views and you can add such code at the beginning:

<?php
if(empty($this->extra_data))
 $this->extra_data = array();
if(empty($this->extra_data['user']))
 $this->extra_data['user'] = array();
$this->extra_data['user']['column_name_field_1'] = array('title' => 'Title for field 1', 'content' => $this->order->customer->column_name_field_1);
$this->extra_data['user']['column_name_field_2'] = array('title' => 'Title for field 2', 'content' => $this->order->customer->column_name_field_2);
?>
Of course, you need to replace column_name_field_1 and column_name_field_2 by the actually column names of your custom fields.

For the edition it's more complex as there is no system in place to handle that at all. You would have to hire a developer to work on that for you.

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

  • Posts: 54
  • Thank you received: 0
8 years 5 months ago #241243

Thanks that worked perfectly once I remembered to edit the correct template version of the file!

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

Time to create page: 0.058 seconds
Powered by Kunena Forum