Your cart is currently empty!
Creating a coupon for one affiliate
—
by
Hey guys,
We’re using Affiliate Coupons and enjoy a lot the automatic coupon creation when a new affiliate is created.
We have a special affiliate that we would like to give a special coupon that is not available to any other affiliate.
Since Affiliate Coupons does not add a field in the WooCommerce Coupon edit page to pick an affiliate from, how can we achieve this?
Thank you!
Regards,
B
Posted in Affiliates Coupons
Comments
11 responses to “Creating a coupon for one affiliate”
You are welcome Bastien.
Hope it helps you. Have a nice day too.
Cheers
Hello George,
Thank you a lot for the follow up on this. I’ve downloaded the method and will make sure to take a look.
Have a wonderful day ahead!
Kind regards,
Bastien
Hi Bastien,
There is also a method already developed by Antonio which i think is suitable for your case. Please have a look here.
Cheers
Hi Bastien,
You should start with the action woocommerce_before_cart_table and check the applied coupons with the method get_applied_coupons( ) of WC_Cart class. Also, have a look at the WC_Cart class at the WooCommerce API.
If the special coupon is applied, then add a referral as described here.
Kind regards,
George
That’s correct, we have a default 10% commission as the normal routine but we would like to provide a special coupon to one of our affiliate that would give back a fixed amount, like 3$ for each product sold (let’s say someone orders 100 hats for a total of 1800$, instead of the affiliate earning 180$, he would be earning 100*3$, so 300$).
Thank you a lot for your help!
Sure Bastien, new ideas and suggestions are always welcome. 🙂
In your use case, when the coupon xyz is applied you want affiliateX to be granted with a referral and a flat amount. Otherwise, the normal routine should be applied.
Please correct me if i’m wrong.
Kind regards,
George
Hey George,
Thanks for the reply. Would you help us to get on the right path to achieve this feat with a custom function? You might want to put a note somewhere that it would be an interesting development for Affiliates Coupon as I believe other users would benefit from this feature.
Cheers!
Kind regards,
B
Hi Bastien,
I’m afraid not. Coupons are used by Affiliates plugin only for granting a referral to the coupon affiliate. Commission calculation is performed after that and has nothing to do with the coupon.
Kind regards,
George
Hello again George,
Another question for you. If we wanted this special coupon to give a fixed commission instead of the default rate commission, would that be something we can achieve?
Regards,
B
Hey George,
Fantastic, I didn’t think about the attributes setting, that’s exactly what I needed.
Have a wonderful day ahead!
Kind regards,
B
Hi Bastien,
The best solution for this would be to create the coupon manually and add the code to the specified affiliate as attribute. You can add as many coupons as you like, as affiliate attribute, seperating each coupon code by comma(,).
Kind regards,
George