Support » Plugin: WooCommerce Cloak Affiliate Links » How to construct a link manually?

  • What is the exact code you need to manually construct a link for an external affiliate product so that this plugin will cloak it?

Viewing 1 replies (of 1 total)
  • Plugin Author datafeedr

    (@datafeedrcom)

    You first need a WC_Product_External object.

    Then you need to call the get_product_url() method on that object.

    <?php
    $product = wc_get_product(123);
    echo $product->get_product_url();
    
    • This reply was modified 1 year, 1 month ago by datafeedr.
    • This reply was modified 1 year, 1 month ago by datafeedr.
Viewing 1 replies (of 1 total)
  • The topic ‘How to construct a link manually?’ is closed to new replies.