WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] WooCommerce allow free download without Checkout? (10 posts)

  1. vangillmedia
    Member
    Posted 1 year ago #

    Hello there,

    I'm setting up a download store with WooCommerce (for PDF sheet music), and would love to know if there's a way for some products (that are free) to also have a 'download now' button that does not add them to the cart?

    I currently have the products set at £0.00 and customers can certainly go to checkout and get them no problem, but it would be great to cut out the process of customers filling in unnecessary billing details, if they only want to download the free stuff.
    (Let's face it, that's probably most of them... ;o))

    Thanks in advance.

    http://wordpress.org/extend/plugins/woocommerce/

  2. Roy
    Member
    Posted 1 year ago #

    If you want others to download and do not need them to proceed to checkout, simply put a download link directly in the product description.

  3. vangillmedia
    Member
    Posted 1 year ago #

    Thanks splashingpixels - that's a good solution.
    One thing I was hoping for, is for the "Add to Cart" button not to be visible - both on the All products page, and on the single product page. Is there a way of enabling that?

  4. Roy
    Member
    Posted 1 year ago #

    For that you can just comment it out in the template files. Copy the template file in question from the WooCommerce plugin and put them inside a folder "woocommerce" and within your theme folder. Of course keep the same folder structure as where you copied it from. Then modify the template to comment the add to cart button out.

    The template files should be in the single-product/add-to-cart folder.

  5. vangillmedia
    Member
    Posted 1 year ago #

    Thanks so much for the advice - I'm afraid I'm somewhat of a novice with php, and this solution falls a couple feet beyond of my knowledge boundary. So rather than ask you (or anyone) to explain in simpler terms, I'll just live with it until I find some time to figure it out. Thanks again, very much appreciated.

    VGM

  6. candeed
    Member
    Posted 1 year ago #

    @VanGill Media

    When adding a free product, treat your free product as 'external product'..
    Then 'add to cart' button will dissapear,
    and there will be an option to rename the button to any name as you like..
    E.G. You can name it 'download' and then link the button to the free file.

    ======================================

    Anyway, if you want to change ALL 'add to cart' buttons on entire site..
    just open function.php in your theme folder.. add this text:

    add_filter('single_add_to_cart_text', 'woo_custom_cart_button_text');
    
    function woo_custom_cart_button_text() {
    return __('My Custom Button Text', 'woocommerce');
    }

    before this line :

    /*-----------------------------------------------------------------------------------*/
    /* Don't add any code below here or the sky will fall down */

    Hope it help..

  7. vangillmedia
    Member
    Posted 1 year ago #

    Wooooohooooo!
    Brilliant @candeed, that's just what I was looking for!
    Many thanks.

  8. candeed
    Member
    Posted 1 year ago #

    My pleasure, @VanGillMedia.. :)

    (by the way, please consider to mark this thread as 'resolved')

  9. vangillmedia
    Member
    Posted 1 year ago #

    ;o)

  10. subhashkhatri
    Member
    Posted 3 months ago #

    Hi,

    if i want to keep some products FREE and some PREMIUM, which php code i should use? please!

    Thanks in advance !!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic