- Posts: 79
- Thank you received: 0
Custom Fiel display in checkout
9 years 8 months ago - 9 years 8 months ago #261699
by arveni
Custom Fiel display in checkout was created by arveni
-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.4
Hi,
I created a few custom fields in the "order" table to get more info about customer.
I added th block "Custom field" in the check out process and it works!!
But I would like to change the display (not just css). so change the code below by adding one by one my custom fields and add more html
ex
Is there any tag or else to custom this part please? I need to display the label ant the input
-- Joomla version -- : 3.6.4
Hi,
I created a few custom fields in the "order" table to get more info about customer.
I added th block "Custom field" in the check out process and it works!!
But I would like to change the display (not just css). so change the code below by adding one by one my custom fields and add more html
Code:
foreach($this->extraFields[$type] as $fieldName => $oneExtraField) {
if(isset($showfields[$fieldName]) && $this->step != $showfields[$fieldName]) {
echo '<tr style="display:none;"><td><input type="hidden" name="data['.$type.']['.$fieldName.']" value="'.$this->escape($this->$type->$fieldName).'"/></td></tr>';
continue;
}
?>
<tr class="hikashop_checkout_<?php echo $fieldName;?>_line" id="hikashop_<?php echo $type.'_'.$oneExtraField->field_namekey; ?>">
<td class="key">
<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
</td>
<td>
ex
Code:
<div>
custom_field_1
custom_field_2
</div>
<div>
custom_field_3
custom_field_4
</div>
Is there any tag or else to custom this part please? I need to display the label ant the input
Last edit: 9 years 8 months ago by arveni.
Please Log in or Create an account to join the conversation.
9 years 8 months ago #261744
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Custom Fiel display in checkout
Hi,
You will need to completely change the code in the view so the fields won't be displayed automatically in the loop but you will display yourself each field manually.
So you can put the HTML you want between the fields because nothing will be automatic and all will be customized like you want.
Please note that such kind of customization require some PHP skills.
www.hikashop.com/support/documentation/1...-display.html#layout
Regards,
You will need to completely change the code in the view so the fields won't be displayed automatically in the loop but you will display yourself each field manually.
So you can put the HTML you want between the fields because nothing will be automatic and all will be customized like you want.
Please note that such kind of customization require some PHP skills.
www.hikashop.com/support/documentation/1...-display.html#layout
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
9 years 8 months ago #261784
by arveni
Replied by arveni on topic Custom Fiel display in checkout
That is what I want. I would like the generic php code for insert a custom field. I guess is a mix between this to code
with my case custom field are in the "order" table so $type will be "order" and $fieldName will be "custom_field_1" by example
Code:
<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
Code:
name="data['.$type.']['.$fieldName.']" value="'.$this->escape($this->$type->$fieldName).
with my case custom field are in the "order" table so $type will be "order" and $fieldName will be "custom_field_1" by example
Please Log in or Create an account to join the conversation.
9 years 7 months ago #261808
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Custom Fiel display in checkout
Hi,
Best would to use the "display" function of the Field Class, like it is currently done in the view.
So you will support every type of custom field, input, radio, date picker, etc.
Regards,
Best would to use the "display" function of the Field Class, like it is currently done in the view.
So you will support every type of custom field, input, radio, date picker, etc.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Time to create page: 0.175 seconds