PHPurchase makes it easy to sell your digital products. You can supercharge your sales by adding your own affiliate program as well. Affiliate programs are the #1 way to increase your e-commerce sales and by far the most profitable form of advertising. PHPurchase is already seamlessly integrated with the WordPress Affiliate Platform. Simply install both plugins and you have your own affiliate program without paying any monthly fees to affiliate program services. We highly recommend setting up an affiliate program – especially if you are selling digital products. Whether you choose to set up an affiliate program or not, PHPurchase makes it easy to sell your digital products. Here is how you set up a digital product with the PHPurchase WordPress shopping cart.

Setting Up Your Digital Product

Log into you WordPress Admin and navigate to the PHPurchase Products page. When entering the information for your product, select Shipped => No to tell PHPurchase that this is a digital product and does not require a shipping method.

When you specify the location of your digital file, it is best to provide the absolute path to the digital product (like: /var/www/mysite.com/products/myfile.pdf) rather than a URL (not like: http://www.mysite.com/products/myfile.pdf).  This way you can store your digital product in a folder that is not accessible via a web browsers. This prevents people from directly linking to your digital file and bypassing PHPurchase. If you keep your digital products in a folder that can’t be accessed via a web browser, the PHPurchase can completely control who downloads your product and how many times they download it.

You can control the number of times a customer is allowed to download your product by specifying a max downloads value. If you set this value to zero, there is no limit to the number of times the product can be downloaded by your customer.

How To Figure Out The Correct Path

To provide security to your digital product, it is best to use an absolute filesystem path to your product rather than a URL. That way you can store your digital product in a folder that is not accessible via a direct link in a web browser. To figure out the path to your digital product, create a PHP file with the following contents and upload it to the root directory of your website – this will be a folder named something like public_html, httpdocs, or web/content. It is the directory that also probably includes the index.php file for your WordPress installation.

File Name:  path.php

Once you have the path.php file created and uploaded to your website, access the file in your browser by going to http://www.YourSite.com/path.php The script will print out a path that will look something like this:

/var/www/yoursite.com/httpdocs

Where httpdocs is the document root for your website. Then log into your web server via FTP (SFTP or however you connect to your website) and create your products directory and upload your digital product. The path to your digital product will be something like this: /var/www/yoursite.com/products/myFile.pdf

Then take this path and enter it into the product’s download path on the Products page in the PHPurchase admin panel. Save you changes and your product is ready for sale.