Proper way to work using the real image of a product on OpenCart 2

后端 未结 1 1510
闹比i
闹比i 2020-12-12 05:59

I\'m currently looking for the proper way to work on a theme using the real image of a product and not its thumbnail (identified as $thumb in the default theme)

1条回答
  •  感动是毒
    2020-12-12 06:09

    With help from members of OpenCart forum, I managed to find a functional solution (using vQmod). It is thus require to create an .xml file placed in the vqmod/xml folder and containing, for example:

    
    
        Recover Real Image
        
        
        
        
        
        
        
            
            
        
        
    
    

    If product image can not be found and assuming a is put the root of the folder, the element can be replaced by:

    if(empty($product_info['image'])){
        $data['picture'] = HTTP_SERVER.'image/default.jpg';
    }
    else{
        $data['picture'] = HTTP_SERVER.'image/'.$product_info['image'];
    }
    

    Other possible suggestions, by using:

    • OCmod can be found here
    • Image Autosize extension can be found here

    0 讨论(0)
提交回复
热议问题