Regarding my previous ticket of affiliate coupon by username

Hi,

I am creating new topic, coz I am unable to post a reply in my previous post: https://www.itthinx.com/topic/coupon-code-not-generated-as-i-expected/comment-page-1/#comment-820299

I have installed the plugin as you provided me in email. When I have tried to generate bulk coupons as well as automatic coupon of new affiliate account by username, it is still generating same as previous, i.e. b2{affiliates_by_username}5-1

But as I have mentioned, I want the coupons like prifix+username (i.e. B2Rakesh)?

Could you please take a look into this.


Comments

3 responses to “Regarding my previous ticket of affiliate coupon by username”

  1. antonio Avatar
    antonio

    Hi Rakesh,
    Please try with something like this: b2{username}
    Kind Regards,
    Antonio B.

    1. Rakesh Avatar

      Hi Antonio,

      Thanks for you help. I have bulk created the new coupons using this b2{username}, but it has also added its affiliate id and ‘1’ (b2+username+affiliate_id+1}) with the coupon i.e. b2rakesh3-1

      I have confirmed that the coupon code is working for affiliates, but could you please let me how can I remove the last numbers and can achieve this only – B2Rakesh

      1. antonio Avatar
        antonio

        Hi,
        {affiliate_id} is required, and the -xx is used because you can assign more than one coupon per affiliate.
        You can use the ‘woocommerce_coupon_code’ filter ( add_filter( 'woocommerce_coupon_code', 'my_woocommerce_coupon_code', 10, 1 ); the param is the coupon title )
        You could use e.x. the ‘#’ character, and get the first part, something like this:
        $string = substr($string, 0, strpos($string, '#'));
        Kind Regards,
        Antonio B.

Share