Jump to content

Digital Downloads: Download link; Server Root Path; Free Downloads?


Guest tars21

Recommended Posts

Guest tars21

Dear all,

I've been working with Cube Cart for just over a week now, and I must say it is a walk in the park compared to other alternatives like osCommerce. My compliments to the Cube Cart development team.

There were a few things I had some trouble with, however, and now that I've figured out a few of the answers I thought I'd share them with you.

First, I see in some of the discussion topics related to "downloads" that many ask how things look when the transaction is complete. I strongly recommend that you simulate a transaction and find out for yourself to confirm that all is working. To do this, just make the value of your product $00.01 (one penny) and then purchase it using a credit card.

When I did this, I discovered that the link that was being sent for the download didn't work. Why? Because before and after the text for the download, there is a string of "~" (tildes).

Example:

~~~~~~~~~~~~~~~~~~~~~~~~~~

Heaven Moon

DOWNLOAD LINK:

http://www.mystore.com/store/download.php?pid=2&oid=MDYwNzAyLTExMjk0Mi04MjI5&ak=URKXWNJK

~~~~~~~~~~~~~~~~~~~~~~~~~~

The last set of tildes were getting included in the link. So when it was clicked in the email (I'm on Mac OS 10.4.7, Powerbook G4), the link would open in Safari and Cube Cart would think that the link was expired.

I realized this was causing the problem when I decided to copy and paste the link WITHOUT the last row of "~"... and it worked!

I don't think this is how it's supposed to be (correct me if I am wrong!) but to fix this, here's what I did:

Each language has file called lang.inc.php. To fix this in English, go to:

store (directory that holds all your Cube Cart files) > language > en > lang.inc.php

If you're working in Dreamweaver, make sure that you have the line numbers visualized and scroll down to around line 2298 of code. You should see somethings that looks like this:

~~~~~~~~~~~~~~~~~~~~~~~~~~\n",

'digi_email_body2' => "%s

DOWNLOAD LINK:

%s/download.php?pid=%s&oid=%s&ak=%s

~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n",

What I did was this:

~~~~~~~~~~~~~~~~~~~~~~~~~~\n",

'digi_email_body2' => "%s

DOWNLOAD LINK:

%s/download.php?pid=%s&oid=%s&ak=%s\n\n",

(I deleted the last row of "~" and moved the \n\n up to the end of the code above it)

Now when the email is sent, the link looks like this:

~~~~~~~~~~~~~~~~~~~~~~~~~~

Heaven Moon

DOWNLOAD LINK:

http://www.mystore.com/store/download.php?pid=3&oid=MDYwNzAyLTE0MTEwMC02NDAz&ak=dMleJCyg

And it works brilliantly!!!

Note: If this is indeed a bug (and not a security measure, for example) then you would need to fix this in ALL of the lang.inc.php files.

The above is very important because if you, like me, are also trying to figure out/use the Server Root Path as the location of the download, then this bug in the code might make you think that the Server Root Path is wrong (when it may, in fact, be right!!!)

And speaking of Server Root Paths, mine looks like this:

home/username/www/www/store/digitaldownloads/indiepop/lunapark/06_Heaven_Moon.m4a.zip

I realize that sometimes people have a hard time determining what is "fixed" (meaning, should be written as is) and what should be personalized. In the above example the personalized parts are:

"username" and then "store/digitaldownloads/indiepop/lunapark/06_Heaven_Moon.m4a.zip". username is your username for your hosting account and the directories are obviously the path to where you have decided to store your downloads on the web.

The "home" and the "www/www" were necessary (i.e., "fixed") given my hosting environment. If you are having trouble figuring out the Server Root Path, contact your hosting tech support and ask them what the "system path" is to the directory where you have placed your downloads. Also, be sure to put an index file that is "fake" in the event you put your downloads in a public-accessable area of your website, as I have.

Why did I do this? Well, I suspected that the "private" area of my site wasn't accessible via the Cube Cart script. This may actually be wrong, since I realized the problem was another (what I described above), but for now I'm going to leave it as is. Also, by using the Server Root Path, the buyer does not see the URL address, so you are relatively protected.

After all of these answers, I do have one question:

Does anybody know what the best solution for offering FREE digital downloads? Meaning, still have the customer go through the checkout process (so that you get their information) but then the transaction is completed without them having to do a credit card or paypal transaction? That is my next step, but if someone already has this figured out, I'd be grateful to know your solution. Thank you.

Link to comment
Share on other sites

Guest Ian Ellery

Does anybody know what the best solution for offering FREE digital downloads? Meaning, still have the customer go through the checkout process (so that you get their information) but then the transaction is completed without them having to do a credit card or paypal transaction? That is my next step, but if someone already has this figured out, I'd be grateful to know your solution. Thank you.

This is exactly what I logged on today to find out!

Anyone have any idea?

Link to comment
Share on other sites

@tars21 This seems to be the email client issue - new line issue. There is a quick hack to prevent tildas to be in download link in email:

~~~~~~~~~~~~~~~~~~~~~~~~~~\n",

'digi_email_body2' => "%s

DOWNLOAD LINK:

%s/download.php?pid=%s&oid=%s&ak=%s\n

~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n",

Red marked is the "hack" */*

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...