Adding a user friendly FREE download to LiteCommerce store
LiteCommerce is a great online storefront to work with. However, while the egoods module offers a great way to sell downloadable files, it really doesn't offer a good, user friendly way to create a product with a free downloadable file. This situation recently happened where a customer wanted to offer free PDF articles on their site along with for-pay downloads as well.
The default method to do this requires that the user have an account with the correct membership level. This would allow the download to show up on the product details page. However the Buy Now buttons and Add to Cart buttons still show up. This doesn't make any sense for a completely free product. If the user clicks one of those buttons, whether they are a member or not, the order still needs to be processed in the regular manner before the file can be downloaded. In other words, they have to enter payment information for a free product. This doesn't make sense and is not user friendly.
Here is how to do it so that a user gets a download link in the product details with no special membership required. In fact, the eGoods module isn't even required to do this.
- Disable Buy Now buttons via General settings.
- Change the code in classes/dialog/product.php from:
function isAvailableForSale() { return true; }
To
function isAvailableForSale() { if ($this->get("product.price") == 0) { return false; } else { return true; } }
This removes the Add to Cart button for items with a 0.00 price.
- Create a product with a 0.00 price, that is tax free with no shipping costs. In the product details simply add a link to the product you want to download. If you don't know how to write a link in HTML then you can find out here: http://www.w3schools.com/tags/tag_a.asp
That's it. I hope this helps some one else since I spent a few hours wrangling with this one.