0

i'm building an e-commerce web site with different types of products.

I have 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.

But now i want that only some Particular group can download this material.

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

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.