Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Saguaros Moderator
    #1088904

    Hi,

    I updated this file on your site: /plugins/jamegafilter/virtuemart/helper.php

    In the getThumbnail function:

    function getThumbnail($id, $lang)
    {
    $explode = explode('_', $lang);
    $lang_tag = $explode[0].'-'.strtoupper ($explode[1]);
    
    $db = JFactory::getDbo();
    $select = 'select vpme.*, vm.file_url, vm.file_lang';
    $from = 'from #__virtuemart_product_medias as vpme';
    $join = 'left join #__virtuemart_medias as vm on vpme.virtuemart_media_id = vm.virtuemart_media_id';
    $where = 'where vpme.virtuemart_product_id ='. (int) $id.' and vm.published = 1';
    $order = 'order by ordering asc';
    $q = $select.' '.$from.' '.$join.' '.$where.' '.$order;
    
    $db->setQuery($q);
    $list = $db->loadAssocList();
    
    if (empty($list)) {
        return 'components/com_virtuemart/assets/images/vmgeneral/' . VmConfig::get('no_image_set');
    }
    
    foreach ($list as $item )
    {
        $file_lang = explode(',', $item['file_lang']);
        if ( empty($file_lang[0]) || in_array($lang_tag, $file_lang)) {
    
            $thumb_width = VmConfig::get('img_width', 0) ? VmConfig::get('img_width', 0) : 0;
            $thumb_height = VmConfig::get('img_height', 0) ? VmConfig::get('img_height', 0) : 0;
            $file = end(explode('/', $item['file_url']));
            $name = JFile::stripExt($file);
            $path = str_replace($file, '', $item['file_url']);
            $ext = JFile::getExt($item['file_url']);
            $image = $path . 'resized/' . $name . '_' . $thumb_width . 'x' . $thumb_height . '.' . $ext;
            return  $image;
        }
    }
    
    }

    Pls also note that when you add a new product, you need to access that product from frontend at least once so that your site can generate the thumbnail and the filter will retrieve that thumbnail to display in the filter.

    Regards

    mazhar shah Friend
    #1088926

    Thank you!

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  mazhar shah 6 years, 2 months ago.

The topic ‘Not loading thumbnail images from virtuemart’ is closed to new replies.