Formatting Custom fields frontend backend

  • Posts: 78
  • Thank you received: 4
  • Hikamarket Multivendor
8 years 6 months ago #257849

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.x

Hi,
The custom fields are listed with a </br> in the basket (during checkout) and in the backend.
Custom filed Name </br> : CustomField Value

Which view I need to adapt, so that the custom field value will be on the same line as the CustomFieldName ?

In earlier version of hikashop, it was listed on the same line.

Example:
CustomField1
: valueOfCustomField1

CustomField2
: valueOfCustomField2

CustomField3
: valueOfCustomField3

CustomField4
: valueOfCustomField4

Thanks
[/color]

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

  • Posts: 83993
  • Thank you received: 13605
  • MODERATOR
8 years 6 months ago #257850

Hi,

You'll find the code displaying the custom item fields in the checkout cart by edit the file "cart" of the view "checkout" via the menu Display>Views. Here is the code corresponding to that:

if(hikashop_level(2) && !empty($this->extraFields['item'])){
									foreach($this->extraFields['item'] as $field){
										$namekey = $field->field_namekey;
										if(empty($row->$namekey) || !strlen($row->$namekey)) continue;
										echo '<p class="hikashop_cart_item_'.$namekey.'">'.$this->fieldsClass->getFieldName($field).': '.$this->fieldsClass->show($field,$row->$namekey).'</p>';
									}
								}
As you can see, there is no br tag there.
So it's probably not coming from that but from some CSS of your website.

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

  • Posts: 78
  • Thank you received: 4
  • Hikamarket Multivendor
8 years 6 months ago #257890

The "problem" is, that with:

$this->fieldsClass->getFieldName($field) . ': ' . fieldsClass->show($field, $row->$namekey) .

it will be a label and therefore the value will not be on the same line.

I used now "strip_tags" and now it is on the same line:

strip_tags($this->fieldsClass->getFieldName($field).': '.$this->fieldsClass->show($field,$row->$namekey))

Maybe there is a better solution ?
BR

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

  • Posts: 83993
  • Thank you received: 13605
  • MODERATOR
8 years 6 months ago #257933

Hi,

Having a label tag around the field name doesn't make the value go to another line.
That's only the case if you have some CSS in your template to do that.
For example, such CSS would do that:
label{ display : block; }
So as expected, your problem really seems to be about a CSS issue.
But modifying the view is fine too if that's ok with you.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum