• I just updated to version 7 and am seeing critical errors when trying to print invoices. The issue appears to be the way that you used do_action_deprecated. You kept the hook name the same but changed how the arguments are passed. For instance, I am using the “wcdn_order_item_before” hook. Here’s what it looks like in the base.php template file.

    https://cleanshot.com/share/t55z3Js8

    The same hook is running twice but with different arguments. The function I used previously treated the first argument as an object, not an array. So I switched it to treat it as an array. However, it still throws an error because the first instance of the hook that runs in do_action_deprecated expects it to be an object. The new hook needs to have a completely different name or users will have to write some kind of conditional to detect if the passed variable is an object or an array.

    • This topic was modified 1 day, 12 hours ago by 3yq9nfgnvh.
    • This topic was modified 1 day, 12 hours ago by 3yq9nfgnvh.
Viewing 1 replies (of 1 total)
  • Thread Starter 3yq9nfgnvh

    (@3yq9nfgnvh)

    In general, the new version is incredibly confusing in regards to the hooks. Some passed variables are objects, some are arrays. Not sure why you changed it, but it was nicer before when all the hook variables were the regular WooCommerce objects.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.