Direct Free Download


preview

  1. Introduction
  2. Requirements
    • Install WordPress
    • Install Woocommerce
    • Configure downloadeable products in Woocommerce
  3. Installing “direct free download” plugin.
  4. Configure woocommerce products to virtual, downloadable and free.
  5. Understand the Code.
  6. Credits.

Direct Free Download speeds up the download process of the products are listed as virtual, downloadable and price 0.

When the admin configure a product as “virtual”, “downloadable” and "price 0", the “add cart button” is replaced by a “Download” button to direct download without having to bring the product to the cart and make the purchase process.

Also the url is encrypted so no one can know exactly where the file is hosted downloading.

Compatible with the option "Downloads require login" so that only registered users can into your download these products.

Highly recommended for the user to save time when downloading free files.

Install WordPress:

Here's the quick version of the instructions for those who are already comfortable with performing such installations. More detailed instructions follow.

If you are not comfortable with renaming files, step 3 is optional and you can skip it as the install program will create the wp-config.php file for you.

  1. Download and unzip the WordPress package if you haven't already.
  2. Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and modifying it.
  3. (Optional) Find and rename wp-config-sample.php to wp-config.php, then edit the file (see editing wp-config.php) and add your database information.
  4. Upload the WordPress files to the desired location on your web server:
    • If you want to integrate WordPress into the root of your domain (e.g. http://example.com/), move or upload all contents of the unzipped WordPress directory (excluding the WordPress directory itself) into the root directory of your web server.
    • If you want to have your WordPress installation in its own subdirectory on your web site (e.g. http://example.com/blog/), create the blog directory on your server and upload the contents of the unzipped WordPress package to the directory via FTP.
    • Note: If your FTP client has an option to convert file names to lower case, make sure it's disabled.
  5. Run the WordPress installation script by accessing the URL in a web browser. This should be the URL where you uploaded the WordPress files.

That's it! WordPress should now be installed.

 

Install Woocommerce:
  1. Automatic installation:
  2. Automatic installation is the easiest option as WordPress handles the file transfers itself and you don’t even need to leave your web browser. To do an automatic install of WooCommerce log in to your WordPress admin panel and go to: Plugins > Add New.

    In the search field type “WooCommerce” and click Search Plugins. Once you’ve found the plugin you can view details about it such as the the point release, rating and description. Most importantly of course, you can install it by simply clicking Install Now. After clicking that link you will be asked if you’re sure you want to install the plugin. Click “yes” and WordPress will automatically complete the installation.

    It’s possible at this stage that you will be taken to a page requesting the FTP details of your webserver. This will be the case if you’ve not installed a plugin on this particular installation of WordPress before. If so, simply fill in your details to complete the installation.

  3. Manual installation:

The manual installation involves downloading the plugin and uploading it to your webserver via your favourite FTP application.

  1. Download the plugin to your computer.
  2. Unzip the file.
  3. Using an FTP program, or your hosting control panel, upload the unzipped plugin folder to your WordPress installation’s wp-content/plugins directory.
  4. Activate the plugin from the Plugins menu within the WordPress admin.

After you’ve installed and activated the plugin, be sure to select ‘Install WooCommerce Pages‘ to get started.

More details 

Configure downloadeable products in Woocommerce:

Once the plugin is installed correctly you must set either the products where you can directly download the files attached to this product.

To do this, you must choose an item and mark it as "virtual", "downloadable" and price 0.

preview

Once configured this way the article, the user can now download the files of this product directly with the download button that is successfully generated.

Before beginning the installation and configuring of your new plugin, you must first have WordPress already installed on a server.

Once you hace setup a copy of WordPress, there are two ways you can go about installing the plugin:

FTP Upload

Unzip the download and upload the plugin directory /woocommerce-direct-free-download/ into your WordPress plugins directory /wp-content/plugins/

WordPress Upload

This is definitely the easier route for most. Simply navigate to Plugins › Add New › Upload. Click the “browse” button and locate the still zipped plugin folder. The plugin will be uploaded and installed in a matter of seconds.

After you have installed the plugin successfully, is necessary activate the plugin.

If the box "Downloads require login" is marked and the user is not identified when he go to download the product, will be created a button indicating that the user must be logged in to download the contents of the product. Clicking on the button will redirect you to the page "My Account".

settings redirect

We created a new submenu into the Woocommerce menu with the option to change the download button text and the introduction text.

Set the checkbox to true to display the download button on product lists.

settings

The plugin consists of a single file with 3 basic functions.

Function 1: dfd_hide_add_to_card

This function hidden the “add to cart” button.
The function has an "if" condition in which shall be entered only if the product is priced 0. If we hide the "add to cart" button.

 

Function 2: dfd_is_virtual_free_download_product

This function returns true if the selected product is virtual, downloadable and its price is 0.

 

Function 3: dfd_display_direct_free_download_button

This function calls the above function and if it returns a true answer as many inserts download buttons to downloadable product has it.

Wordpress official web page: http://wordpress.org

Woocommerce official web page: http://www.woothemes.com/woocommerce/

Kamalyon web page: http://kamalyon.com/

kamalyon