I need to add an affiliate automatically when I buy a product in Woocommerce.
Could you tell me what is the function in charge of performing this action?
Affiliate a user when buying a product
Posted in Affiliates Enterprise
I need to add an affiliate automatically when I buy a product in Woocommerce.
Could you tell me what is the function in charge of performing this action?
Follow us! We post news and tutorials related to our tools, WordPress and WooCommerce on these platforms:
Hi Jeff,
Welcome to our support forum and many thanks for using our plugin as your affiliate marketing tool.
Assuming that you will hook into the order placed/submitted and once the customer record is created, you need to check the product bought and if it matches the one you have chosen, then you need to get the customer data and use something similar to this Affiliates_Registration::render_form() down to line 281.
Kind regards,
George