Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Richard Webster

    (@rwebster85)

    Hi mate, here’s a custom snippet that makes paid items downloadable.

    add_filter('somdn_is_free', '__return_true', 99);

    Thread Starter carlofattori

    (@carlofattori)

    thanks Richard for the help but I did not solve (maybe I make some mistakes myself).
    I used the plugin code snippet to add and activate the snippet:
    add_filter(‘somdn_is_free’,’__return_true’,99);
    I also tried to insert the other 2 lines of code (remove_filter and remove_action) but the paid item still not to be downloaded for free.

    the plugin code snippet displays a message:
    “…ray offset on value of type null in C:\xampp\htdocs\progetti\wp_emmerre\wp-content\plugins\woocommerce\src\Admin\Features\Navigation\CoreMenu.php on line 231”

    probably has nothing to do with it but in any case I show below the contents of line 231 of the CoreMenu file.php

    array_merge( $product_items[‘new’], array( ‘order’ => 50 ) ),
    $coupon_items[‘default’], <— row 231
    // Marketplace category.
    array(

    question1
    ———
    wanting to manually enter the code (without plugin code snippet), in which file and in which position should I insert it ?

    question2
    ———
    in the email I received there were 3 lines of code:
    remove_filter(…
    remove_action(…
    add_filter(…

    in the answer on the web (the one I’m replying to) there is only one line
    add_filter(…

    do I have to enter 3 lines of code or 1 ?

    thanks in advance

    Plugin Author Richard Webster

    (@rwebster85)

    Hi mate. You want to add just the single line I posted above. I edited it after posting.

    Use the plugin called Code Snippets, create a new snippet and paste that line in there, then activate the snippet.

    This will allow paid products to be included. Bear in mind that other restrictions still apply, such as if you’ve set the options to restrict specific categories or individual products for free download.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘free downloadable products’ is closed to new replies.