Advertisement:

Author Topic: Digital Goods - Plugin not working properly  (Read 1481 times)

madee

  • Newbie
  • *
  • Posts: 8
Digital Goods - Plugin not working properly
« on: October 10, 2016, 01:42:05 pm »
Hey,

I have installed Digital Goods plugin.

It seems to upload and accept the attachments. But some files does not show on item page and the one that shows does not downloads.

Already checked other topics, could not find a solution. Please Help!

I would be glad if starts accepting (upload and download) properly even a zipped file.

nithinpattazhy

  • Newbie
  • *
  • Posts: 8
Re: Digital Goods - Plugin not working properly
« Reply #1 on: February 15, 2017, 01:44:32 pm »
Hi,

Check your upload folder in oc-content/uploads/digitalgoods/

if file exist in this folder, upload working. and it also shows with the advertisement published.

If you can't download. edit item_details.php in oc-content/plugins/digitalgoods like the below code

old code
  <label><?php echo $_r['s_name']; ?></label><a href="<?php echo osc_base_url()."oc-content/plugins/".osc_plugin_folder(__FILE__)."download.php?file=".$_r['s_code']."_".$_r['fk_i_item_id']."_".$_r['s_name'];?>" ><?php _e('Download', 'digitalgoods'); ?></a>

new code
<label><?php echo $_r['s_name']; ?></label><a href="<?php echo osc_base_url()."oc-content/uploads/".osc_plugin_folder(__FILE__)."".$_r['s_code']."_".$_r['fk_i_item_id']."_".$_r['s_name'];?>" ><?php _e('Download', 'digitalgoods'); ?></a>

Club4doG

  • Newbie
  • *
  • Posts: 10
Re: Digital Goods - Plugin not working properly
« Reply #2 on: December 29, 2017, 12:56:25 am »
Hi, I have the same problem too, initially I thought it was a problem of my theme "veronika", then I installed the basic theme of osclass and the same does not work. the plugin is installed but it does not happen to upload the file in any folder and consequently it is not possible to download it after the payment. I also tried the example below but it does not work

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Digital Goods - Plugin not working properly
« Reply #3 on: December 30, 2017, 02:32:18 pm »
Hi,

I've been reviewing the code of this plugin, found there's a problem when uploading with Firefox (Chrome seems to work all right). Also, when downloading found issues when the original file name contains underscores or/and spaces, two plugin files should be modified to address these problems:

1.- digital_goods/index.php

Replace:

Code: [Select]
                                $fileMime = $files['type'][$key] ;
With:

Code: [Select]
                                $finfo = finfo_open(FILEINFO_MIME_TYPE);
                                $fileMime = finfo_file($finfo, $files['tmp_name'][$key]);
        // $fileMime = $files['type'][$key] ;


2.- digital_goods/download.php (2 modifications)

2a:

Replace:

Code: [Select]
    $download = DGModel::newInstance()->getFileByItemNameCode(@$tmp[1], @$tmp[2], $tmp[0]);
With:

Code: [Select]
    $name = preg_replace('/^' . $tmp[0] . '_' . $tmp[1] . '_(.*)$/', '$1', $filename);
    $download = DGModel::newInstance()->getFileByItemNameCode(@$tmp[1], @$name, $tmp[0]);

2b:

Replace:

Code: [Select]
        header('Content-Disposition: attachment; filename='.basename($file));
With:

Code: [Select]
        header('Content-disposition: attachment; filename="'.basename($file).'"');
Regards

Club4doG

  • Newbie
  • *
  • Posts: 10
Re: Digital Goods - Plugin not working properly
« Reply #4 on: January 08, 2018, 07:26:20 pm »
so, a little at a time I try to solve the problems, the first I had was that it did not upload files, now it does, but it shows even if the user has not yet paid, but I imagine that to be able to download before I would have to pay, I did not make any changes, I only installed version 1.1.0. Thanks for the contributions.

abtech37

  • Newbie
  • *
  • Posts: 1
Re: Digital Goods - Plugin not working properly
« Reply #5 on: September 19, 2018, 08:53:57 am »
Am using osclaa payment plugin , pls how  can I hide download button until payment is made .