cancel
Showing results for 
Search instead for 
Did you mean: 

Download “Samples” of downloadable products restricted by group

Download “Samples” of downloadable products restricted by group

Hello,

In my e-commerce web site there are many downloadable products like documents, images, videos but all of them are available for download for free.

I do not want the users have to go to the checkout process to download so i'm thinking to use the "Samples" section to let them download what they want.

Now i would like to ask you: Is it possible to restrict the "Samples" download only for particular group?

Thank you very much and any suggestion is really appreciated

1 REPLY 1

Re: Download “Samples” of downloadable products restricted by group

At the moment i found this solution that work for me. I know is not the best solution because i'm gonna to modify 1 core file.

I have modified the "public static function getBasePath()" that is responsable to retrieve sample files path inside the "Sample.php" inside this folder "app/code/core/Mage/Downloadable/Model/"

I have added an IF condition to check the groupID:

public static function getBasePath()
    {            $_groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();          

            if ($_groupId === '4') {
                return Mage::getBaseDir('media') . DS . 'downloadable' . DS . 'files' . DS . 'samples';
            }
    }

Any suggestion is really appreciated