- Posts: 82
- Thank you received: 5
Formatting Custom fields frontend backend
9 years 9 months ago #257849
by tgdkere2
Formatting Custom fields frontend backend was created by tgdkere2
-- 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]
-- 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.
9 years 9 months ago #257850
by nicolas
Replied by nicolas on topic Formatting Custom fields frontend backend
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:
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.
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:
Code:
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>';
}
}
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.
9 years 9 months ago #257890
by tgdkere2
Replied by tgdkere2 on topic Formatting Custom fields frontend backend
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
$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.
9 years 9 months ago #257933
by nicolas
Replied by nicolas on topic Formatting Custom fields frontend backend
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.
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.229 seconds