Hello @cyberespia,
This is server specific issue so, we need to debug in details.
Create support ticket from here so, our technical team contact you soon.
Thanks,
I have already solved it, with this I get the complete url of the file:
$wcpoa_file_url_btn = '<a class="wcpoa_attachmentbtn" href="' . wp_get_attachment_url(esc_attr($attachment_id)) . '" rel="nofollow">' . __("Download", 'woocommerce-product-attachment') . '</a>';
Hello @cyberespia,
Thanks for the update and congrats for resolved the issue.
Let us know in future if any help need from us we are happy to help!
Thanks,
I did what @cyberespia said or I understood:
Hello @pirata87,
Thanks for reaching out to us.
I have notice that, you have copy only one line of the code from the file so, that’s why you are unable to get the attachment URL.
Please read below steps how you can get attachment file URL or download link.
You need to copy the code of the function name is “wcpoa_new_product_tab_content” at Line no: 223 and the file path is: “plugins\woo-product-attachment\public\class-woocommerce-product-attachment-public.php”.
After copy the code please make sure that you are getting the Product ID in $post->ID this variable other wise this code will not work.
If you are getting trouble during the code integration as per your requirement please create support ticket so we can help you for the same.
Create support ticket.
OR you can just copy this shared code.
Click here to copy shared code in which you just need to change the product ID and you will get all the attachment links.
Let me know still you have any query on this.
Thanks,
-
This reply was modified 7 years ago by
Dotstore.
meta.php add code url button tab delete ? $wcpoa_file_url_btn = ‘‘ . __(“Download”, ‘woocommerce-product-attachment’) . ‘‘;
Hello @webcihakan,
Thanks for sharing the code snippet.
You can also review our previous message for how to get attachment url.
Let us know still you have any query.
Thanks,