Get custom field title

  • Posts: 877
  • Thank you received: 67
  • Hikashop Business
1 year 3 months ago #275006

Hi,

We use custom field type of dropdown and table order to allow people during checkout select terminal address based on shipping method.
To show selected terminal from dropdown in the view show_block_status we use such code:

<?php $order = $cart->cart_fields; echo $order->lpexpress; ?>

This works fine and shows selected value from dropdown custom field. Value is set same as title....

However now we are exporting orders via csv export and each terminal must have unique ID. So we set unique id to each value...
How can we get/show selected title from dropdown custom field??
Attached some screenshot to be more clear what we need to get.

Kind Regards

Attachments:

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

  • Posts: 22972
  • Thank you received: 3562
  • MODERATOR
1 year 3 months ago #275055

Hello,

See : www.hikashop.com/forum/product-category-...ox-value.html#261008
In the cart object you will also find the fields objects that you can use for the fieldsClass.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: kyratn

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

  • Posts: 877
  • Thank you received: 67
  • Hikashop Business
1 year 3 months ago #275080

Hi,

It took time for me to understand but now it is working.

Thank you Jerome for help.

Have a great day

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

  • Posts: 877
  • Thank you received: 67
  • Hikashop Business
1 year 3 months ago #275082

Hi,

So it looks like I need another help here. How can I do same to order emails in preload file?

For status view I did this:

<?php $fieldsClass = hikashop_get('class.field');
    $myfield = $cart->cart_fields;
    $element=null;
    $fields = $fieldsClass->getFields('',$element,'order');
echo $fieldsClass->show($fields['lpexpress'], $myfield->lpexpress); ?>

But with emails its a little bit different... I get error with "$fieldsClass->show"

Thanks

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

  • Posts: 877
  • Thank you received: 67
  • Hikashop Business
1 year 3 months ago #275121

Hi,

Please ignore found it.

Thanks

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

Time to create page: 0.085 seconds
Powered by Kunena Forum