• @mycholan,

    Happy New Year! I’m updating the WC_Fields_Factory plugin from 1.4.0 to 2.0.5. Before upgrading my production site, I tested the new plugin on my dev site and found that the new plugin “broke” my PHP functions that reference WC_Fields_Factory product attributes. It appears that the new $item structure for items in the shopping cart is an array which requires me to reference attribute values as
    $item['wccpf_slug']['user_val']
    while the old $item structure (in version 1.4.0) was not an array and the value was referenced as
    $item['wccpf_slug']

    Am I correct that I can simply change my attribute references to $item['wccpf_slug']['user_val'] to restore proper operation of my functions that need the values of WCCPF product attributes?

    Thank you and thanks again for a great plugin!

Viewing 1 replies (of 1 total)
  • Thread Starter deeveedee

    (@deeveedee)

    @mycholan,

    it also appears that $item attributes are no longer defined if the value is empty. $item attributes must now be checked with isset() before using.

    Is that correct?

    Thank you.

Viewing 1 replies (of 1 total)
  • The topic ‘New structure for $item attributes in version 2.0.x’ is closed to new replies.