• Resolved eWallz

    (@archonic08)


    Hi, the default affiliate url will land on the shop page. i.e: website.com/shop/?aff=1
    How can i change this so that the default landing page is the homepage?
    I checked your other support comments, but the Affiliate Endpoint is for Woocommerce My Account page menu.

    I know that I can manually remove the /shop/ and it is still work. But it is too many works to copy paste & edit all the links manually..

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author pimwick

    (@pimwick)

    By default, the URL is filled in with whatever you have configured as your “Shop Page” inside WooCommerce settings.

    There is a hook available to change the landing URL to something other than the Shop page. Follow these instructions:

    1. Download the free Code Snippets plugin: https://www.ads-software.com/plugins/code-snippets/
    2. Create a Snippet with the following code (or you can put this in your functions.php if you prefer):

    function custom_pw_affiliates_shop_page_url( $url ) {
        // Change this to suit your needs:
        return 'https://www.yoursite.com';
    }
    add_filter( 'pw_affiliates_shop_page_url', 'custom_pw_affiliates_shop_page_url' );

    Let me know if you have any questions!

    Thread Starter eWallz

    (@archonic08)

    Works great! I set it to site url like this:

    function custom_pw_affiliates_shop_page_url( $url ) {
        // Change this to suit your needs:
        return get_site_url();
    }
    add_filter( 'pw_affiliates_shop_page_url', 'custom_pw_affiliates_shop_page_url' );
    Plugin Author pimwick

    (@pimwick)

    Great, glad to hear it. Let us know if you have any other questions. Best of luck with your store!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to change the default affiliate url?’ is closed to new replies.