How can I export custom field titles vs. values?

  • Posts: 69
  • Thank you received: 1
9 years 11 months ago #182819

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6

Hi,

I have a radio button custom field with values and titles.

My custom field values are a, b, c... x, y, z, aa, ab, ac etc.
My custom field titles are "cotton", "cotton terrycloth", "

I use these fields as filters, and match them to inventory items.

When I export an inventory item, I get values like a,b,c etc. for my custom field values, but I would like to see the custom field titles and not the values.

How can I export the custom field titles instead of the value?

Thanks,

Dennis


______________
Dennis Kmetz

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

  • Posts: 13201
  • Thank you received: 2322
9 years 11 months ago #183024

Hi,

Why not change the values directly in the custom fields in order to have more explicit values ?

For the product which already have the value, we don't have exports like that, it will require some modifications in the code.

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

  • Posts: 69
  • Thank you received: 1
9 years 11 months ago #183038

Hi Xavier,

The issue is that I have existing products... as you indicated. Can you give me a little help on how I would alter the export.php view?

Thanks,

Dennis


______________
Dennis Kmetz

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

  • Posts: 13201
  • Thank you received: 2322
9 years 11 months ago #183068

Hi,

If you use the mass actions to export the product data, so you can edit the file "plugins/hikashop/massaction_product/massaction_product.php" and at the top of the function "onProcessProductMassActionexportCsv()" add code like:

        // In this example the custom field is "textil" and its id is "20", so just replace it by your values.
        $fieldClass = hikashop_get('class.field');
        $textil = $fieldClass->getField('20');
        foreach($elements as $k => $element){
            $elements[$k]->textil= $textil->field_value[$element->textil]->value;
        }

This way, in the csv file you will have the title and not the value exported.

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

Time to create page: 0.067 seconds
Powered by Kunena Forum