• Resolved esia168

    (@esia168)


    Hi, I have a custom attribute at variation level that store the original cost of product, so that I know the profit, I need this attribute to be generated with the feed. So I added that attribute in the feed setting. However, the value for the variable products will give me a string called ‘Array’, for simple product it works, it generated a number that I entered. Is this because of your plugin or their ? Is there a way I can make the feed take the first value of the array ?

    My setting :
    Only include default product variation: On
    Include product variations: On

    This is the plugin.
    https://www.ads-software.com/plugins/profit-reports-for-woocommerce/

    • This topic was modified 5 years, 10 months ago by esia168.
    • This topic was modified 5 years, 10 months ago by esia168.
Viewing 2 replies - 1 through 2 (of 2 total)
  • This is because of the way attributes work in WooCommerce. Attributes for variable products are saved in array’s whereas simple products are saved in normal PHP strings.

    That is exactly why our plugin, the Elite version, add’s its own custom attributes to be used for feeds to overcome this WooCommerce “issue”.

    Unfortunately, we would not know how to solve this for your set-up.

    Thread Starter esia168

    (@esia168)

    Hi, i only need this to be solved so does not need Elite version at the moment, would you be kind to point out to me which php file and function that generate the value of the custom attribute ? I will make a IF statement, if the value is array, just return the first element, that’s good enough for me.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom attribute value generated ‘Array’ string’ is closed to new replies.