Can’t pass affiliate ID through Woocomerce external product URL

Hi, I would like to pass a shortcode [affiliates_id] as a referrer for woocommerce external (affiliate) products. Unfortunately a shortcode is not properly translated into affiliate ID for products URLs (only when you add it into product URL field, of course it works fine with excerpt and content/product description). Could you please advise how to solve that problem?
Best, Slawek


Comments

3 responses to “Can’t pass affiliate ID through Woocomerce external product URL”

  1. Unfortunately woocommerce (my is 2.0.20) do not use external.php template at all (neither from template directory nor from main plugin directory). I have tried to modify class-wc-product-external.php accordingly, but without any success.

    1. Sorry, then you should ask in the WooCommerce support.
      cheers

  2. Hi,
    you could use do_shortcode on woocommerce template. By example on wp-content/woocommerce/templates/single-product/add-to-cart/external.php you can use:
    do_shortcode($product_url)
    and use “www.domain.com/external-product-page.php?affiliates=[affiliates_id]” as external url.
    cheers

Share