S2 member Pro130221 upgrade issue Not resolved yet

Hi, I have a site I am trying to get live, it is a complete upgrade from Woo 1.6.6 to current. It has downloadable products and uses the CVS suite. I have the old customized woo files that were in the theme folder and I have the functions that were in the old site to. Right now the only issue I can see is that the “download now” button that is on the “single product page” does not work, this is from an edited WOO file. I compared the button link from live to dev and the dev is not correct. It is a membership site where s2member controls how many downloads they get each month/year.

The one part that I know is not working is this code, as the URL is not correct. It is a function from S2Member. they have the pro version.

<p><a id="bb20" class="bigbutton" href="<?php echo s2member_file_download_url(array("file_download" => $sku_name.".doc", file_download_key => true)); ?>">Download NOW</a></p>

it should produce this link

http://content.dev.checkpointmarketing.net/?s2member_file_download_key=4f5f325b20a8b30eca1e381cbb9ddfd4&s2member_file_download=/ADVjf111.doc

but it is not, it is producing this https://content-dev.checkpointmarketing.net/product/be-reasonable-how-business-compensation-can-affect-divorce-cases/

I think it has something to do with the upgrade to WOO that the input field “file_path” does not exit anymore, that there is now a “downloadable_files” field in the new WOO. Those “field names” came from inspecting the wordpress backend product edit page, it is the field name & ID.

I do not have a lot of PHP or JavaScript skills, but know wordpress well. It is like the “file_download” part of that button code above is not correct, I am guessing it used to get the “file_path” field, with it now not existing it is then defaulting to whatever the current URL is. It seems I have to figure out how to add back in “file_path” and get it to work or that I need to make “file_download” get the “downloadable_files” field.

so I read this… "file_download" => "file.zip" Location of the file, relative to the /s2member-files/ directory; or, relative to the root of your Amazon® S3 Bucket, when applicable.

This is on the local server the site is on. Where/how do i set “file_download” to be the correct folder? It seems to have been getting it previously from Woocommerce as they did the products with a CSV upload and that CSV contained a column “file_path” that contained it, the whole path with the file name. And even as I type that it makes me think that maybe it was not even getting the path from that field as the button code it adding “sku.doc” to it and the “sku.doc” is the file name.

So how does S2 get the path in “file_download” => “file.zip”`

Hi, have new question. I do not see the function s2member_file_download_url in the plugin, has this function been removed? if so what replaced it?

Hi Mike.

I do not see the function s2member_file_download_url in the plugin, has this function been removed?

https://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_s2member_file_download_url()

Do you have the file in the dev installation? /wp-content/plugins/s2member-files/ or an Amazon S3 bucket if you configured that integration.

Can you get a working link using s2File for it? WP Admin > s2Member > Download

[s2File download="ADVjf111.doc" download_key="true" /]

I look forward to your update. :slight_smile:

Hello thank you for you reply. I have this now on a temp server of my own http://d9n.2cf.myftpupload.com/product/news-for-nonprofits/

The button used that code and it simple sends you back to the current URL. On that page where you see “link” is an echo of <?php echo 'the link'.s2member_file_download_url(array("file_download" => $sku_name.".doc", file_download_key => true)); ?>

The “NPAye194” upi see is a simple echo of @sku_name

The file is here in a folder in the root not under the s@plugin
http://d9n.2cf.myftpupload.com/files/articles/NPAye194.doc

Hi, well one of the questions you asked make me get some info from my client. I did not have ftp or server access to the site and it was so old that I was afraid to try to add a file manage plugin to it. Well so I asked for the S2 file folder on the server and all the files are there, eventhough they are all in the root and I assumed that was where they were supposed to be because the manual process they showed me showed them uploading to that folder. If you look at the product page link again http://d9n.2cf.myftpupload.com/product/news-for-nonprofits/ you will see it is displaying the link in my echo, and it downloads. So this issue is resolved. But I am guessing there could be an issue related to the woocommerce CVS upload not getting to the S2 folder. IDK if that is some code/setting with S2 or WOO. But they both went from very old versions to current.

Thanks for the update, Mike. I’m very glad you sorted that out.

About uploaders, s2 doesn’t have one, but if you use a 3rd party, like Woo, it needs to upload to /wp-content/plugins/s2member-files/ for the files to be protected by s2.

I hope that makes sense. :slight_smile: