How do I change the add to cart button to external URL affiliate link?

  • Unknown's avatar

    Hello! :-)

    I am creating an affiliate webshop in Woocommerce and have troubles changing the add to cart (go to store) button to an external URL link. As it is now when pressing the button, I come to a detailed information page of the product on my site and there you could find a second add to cart (go to store) button and it is firstly when you press this second button that the external URL link works. In other words – I want skip the unnecessary steps and be linked to an external URL the first time I press the button.

    Worth mentioning is that in “Product data” I have selected “external/affiliate product”, added the product URL and changed name of the Add to cart button to Go to store. As stated above, it works on the second button but not on the first.

    Does anyone have any ideas of how to solve this issue?

  • Hi @pavlinaarsova1!

    Are you attempting to link your “Add to Cart” buttons on a specific page? We visited the site https://peplumshop.com/ and could not see much content on the frontpage. Are you asking about https://peplumshop.com/shop? Based on our testing on that page, clicking on “Gå till butik” seems to redirect to the affiliate links.

  • Unknown's avatar

    Hello @staff-danywpress and thank you for your quick reply! :-)

    I am new to WordPress and have had several technical problems, as you noticed, and am grateful for all the help I could get!

    I have recorded three videos over the issues that visually explains the problems.

    VIDEO 1: https://youtu.be/IMUOV0fWGow

    VIDEO 2: https://youtu.be/3W3p8jc1rBs

    One odd thing is that it seems that you can see an old version of the site. In the older version, I selected the block “Woocommerce – Product collection” and there the external URL link worked perfectly with only one click on the button, as you noticed. The problem is that this block did not work together with the filter function in my sidebar (made in theme Astra). It simply did not want to filter the products. Since I find this function important for my website, I had to change to the block “Woocommerce – All products” instead. There, the filter function in the sidebar works but you have to click twice to come to the affiliate site and I want it to work with only one click!

    VIDEO 3: https://youtu.be/MZLgbrumfiA

    Another issue that you mentioned is the empty page you saw. When I activate “startsida” as my homepage in “Settings – Reading settings”, an empty page appears when activating the filters in the sidebar. Therefore, I have had “default” active instead.

    Do you have any ideas of how to solve these issues?

  • Hello @staff-danywpress and thank you for your quick reply! :-)

    I am new to WordPress and have had several technical problems, as you noticed, and am grateful for all the help I could get!

    We’re happy you here through our support forums! Also wanted to remind you that you have different ways to reach out: https://wordpress.com/support/help-support-options/#access-to-support

    Since I find this function important for my website, I had to change to the block “Woocommerce – All products” instead. There, the filter function in the sidebar works but you have to click twice to come to the affiliate site and I want it to work with only one click!

    At the moment, our latest tests show that the filter works as expected on the page https://peplumshop.com/startsida but that the buttons are still showing the single product pages.

    Can you try the code suggestion from this forum thread: https://wordpress.org/support/topic/skip-external-affiliate-product-page/

    Another issue that you mentioned is the empty page you saw. When I
    activate “startsida” as my homepage in “Settings – Reading settings”, an
    empty page appears when activating the filters in the sidebar.
    Therefore, I have had “default” active instead.

    In order for us to run some tests on our end, is it possible for you to set the “Startsida” page as the homepage? We will be able test and confirm if blank page also happens on our end and guide you from there.

  • Unknown's avatar

    @staff-danywpress I did not know that one could get individual support from WordPress so thank you for that information.

    I have now set “Startsida” as the homepage.

    Best regards,

  • Yes, we can confirm that the same thing is happening on our end. Attempting to set a filter leads to blank content, with the header and footer still being present.

    If we compare the current homepage and the page in the editor, we can see that the filter is not part of the page itself. Have you tried adding the filter component to the actual page and disabling the current way it’s added to the homepage?

    From here, since our support for third-party plugins and themes is limited we recommend that you look into the theme developer’s guides and documentation to make sure you homepage shop is working as expected with the sidebar filters.

    You can start by looking into the options under the “Astra” dashboard page and sub-menu pages like Dashboard, Customize and Site Builder. Additionally, these resources specific to Astra should be helpful:

    https://wpastra.com/docs/how-to-create-a-sticky-sidebar-in-astra/

    https://wpastra.com/docs/off-canvas-sidebar-for-woocommerce-shop-page/

    https://wpastra.com/docs/shop-woocommerce/

  • The topic ‘How do I change the add to cart button to external URL affiliate link?’ is closed to new replies.