Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter niranjan1729

    (@niranjan1729)

    I mean, I just want to add my website registered/logged in user id to affiliate/external URL

    Could you please help me to do?

    Nico

    (@nicolamustone)

    Automattic Happiness Engineer

    Hi,
    Are you creating External products on your website?

    If yes, you can define the URL where they should redirect, simply add your affiliate ID in that URL.

    Thread Starter niranjan1729

    (@niranjan1729)

    that’s already done and now I want to add logged in user’s user id to affiliate link
    For example, if you have registered to my site and logged in then your user id should be added automatically in external product link.

    Nico

    (@nicolamustone)

    Automattic Happiness Engineer

    In that case you can use the filter woocommerce_product_add_to_cart_url to customize the URL for your needs. It gets 2 arguments, the first is the current URL, the second is the product object.

    Thread Starter niranjan1729

    (@niranjan1729)

    thank you, could you please guide me the php template as well, In which template/file it should be modified?

    Nico

    (@nicolamustone)

    Automattic Happiness Engineer

    You can read here a tutorial about how and where to add custom PHP code in your website: https://nicolamustone.com/2016/03/03/tweak-wp-theme-add-custom-php/

    It’s not on a template in WooCommerce since it’s a filter.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add User id to external/affiliate’ is closed to new replies.