J2Store4 / j2store4

J2Store 4 - Open Source eCommerce extension for Joomla
https://www.j2store.org
GNU General Public License v3.0
15 stars 7 forks source link

Update orderdownloads.php #7

Closed coolcat-creations closed 1 year ago

coolcat-creations commented 1 year ago

Correct the Path which is checking for Downloadfile otherwise it will not return true ever

alagesanbe08 commented 1 year ago

@coolcat-creations it will return fatal error, because $root undefined

Original code: administrator/components/com_j2store/models/orderdownloads.php:401

    $params = J2Store::config();
    $path = $params->get('attachmentfolderpath');
    //$savepath = $path.DS.'products';
    $file = JPath::clean($path.'/'.$productfile->product_file_save_name);

if(!JFile::exists($file)) {
        $root = JPATH_ROOT.'/';
        $current = JPath::clean($path.'/'.$productfile->product_file_save_name);
        $file = $root.trim($current,'/');
    }
coolcat-creations commented 1 year ago

Then please it would be good if you fix the issue in the future version. Thanks.