We have a problem with orders not completing when the following settings are in place.
Affiliates > Settings
– Default referral calculation : Referral Amount Method
– Default referral calculation value : Affiliates_WC_Method
Affiliates > WooCommerce Integration
– [x] Enable product referral rates
– Default rate : .20
Products > edit a product > Product Data > Affiliates :
– Referral rate : Varies or is not set
Upon checkout, and only when a user has the wc_affiliates cookie, the WooCommerce waiting icon just spins forever.
The order completes on the back end, but not on the front end. The cart is not emptied. No referral is generated.
The following error is caught by the browser:
Status Code:500 Internal Server Error
We didn’t see any error messages in the server logs, but one of my devs eventually tracked it down to this:
The problem ended up being here:
The Affiliates plugin was running this query:
SELECT * FROM gsgWPaff_affiliates_attributes WHERE affiliate_id = 497 AND attr_key IN ('referral.rate','referral.rate.method','referral.amount','referral.amount.method')
which returned nothing because that table is empty. It doesn’t have any error handling in place to catch these, so the script just dies with that query and produces the 500 error.
He added an attribute to the affiliate record via the link above, and it allowed him to complete the checkout.
But, my understanding is User attributes are for overriding other settings. Correct? So, we don’t want to set a user attribute for every affiliate in the system.
Please advise. We’d love to be able to use the Product Rates method. Thanks!