I have a CRED User form. This has Commerce enabled (via the check box). It is linked to a product in Woocommerce.
The user fills out the user form, then completes the related purchase.
The problem I have is that WordPress is ignoring the User Role defined in the form and on checkout is assigning the new user as "Customer" rather than "Custom Role".
I need a solution that will allow different user roles to be assigned depending on which form they use.
This creates the folowing error. Is this a BUG with CRED Commerce?
[16-Sep-2019 15:34:50 UTC] PHP Notice: Object of class WP_Error could not be converted to int in /home/silicondsdemo/public_html/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/models/UserForms.php on line 487
[16-Sep-2019 15:34:50 UTC] PHP Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /home/silicondsdemo/public_html/wp-content/plugins/cred-commerce/classes/CRED_Commerce_Forms_Meta_Handler.php:52
Stack trace:
#0 /home/silicondsdemo/public_html/wp-content/plugins/cred-commerce/classes/event/base.php(36): CRED_Commerce_Forms_Meta_Handler->get_forms_meta_data('cred_meta')
#1 /home/silicondsdemo/public_html/wp-content/plugins/cred-commerce/classes/event/onorderchange.php(11): CRED_Commerce_Event_Base->execute()
#2 /home/silicondsdemo/public_html/wp-content/plugins/cred-commerce/classes/Form_Handler.php(213): CRED_Commerce_Event_OnOrderChange->execute()
#3 /home/silicondsdemo/public_html/wp-content/plugins/cred-commerce/classes/Plugin_Base.php(47): CRED_Commerce_Form_Handler->onOrderChange(Array)
#4 /home/silicondsdemo/public_html/wp-content/plugins/cred-commerce/plugins/woocommerce/CRED_Woocommerce.php(195): CRED_Commerce_Plugin_Base->dispatch('_cred_order_sta...', Array)
#5 /home/silicondsdemo/public_html/wp-includes/class-wp-hook. in /home/silicondsdemo/public_html/wp-content/plugins/cred-commerce/classes/CRED_Commerce_Forms_Meta_Handler.php on line 52