Search code examples
wordpressurlwoocommercepermalinkscontact-form-7

woocommerce: get the permalink of the product in quotelist plugin


I'm using request a quote plugin and Contact form 7 in woocommerce, I made a form with CF7 with some fields (Name, Surname, Address, etc.) but I'd also like to add in the form the link of the product, I tried to add this in functions.php:

function cf7_add_url() {

$url = get_permalink( $product_id );

return $url;

}

add_shortcode('CF7_ADD_URL', 'cf7_add_url');

and this field in the CF module:

[dynamictext Url "CF7_ADD_URL"]

But what returns in the quotelist page is not the link of the product selected but the link of quotelist.

Which code I should put on there to see the permalink of the product for quote? Thank you for any advice


Solution

  • I solved putting:

    [quotelist]
    

    in the CF module mail tab