X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Thumbnail size in xc5 (https://forum.x-cart.com/showthread.php?t=69263)

RichieRich 05-29-2014 05:31 AM

Thumbnail size in xc5
 
Is there a setting for the thumbnail size? As the thumbnail images are generated I would like to make mine slightly larger, maybe 180px or 200px.

tony_sologubov 06-02-2014 03:48 AM

Re: Thumbnail size in xc5
 
Hi Richard!

These values are hard-coded. However, you can easily define new values by creating a decoration of the XLite/View/ProductBox class in your module.

You should override the following method in this class:
PHP Code:

protected function defineWidgetParams()
    {
        
parent::defineWidgetParams();

        
$this->widgetParams += array(
            
self::PARAM_PRODUCT_ID => new \XLite\Model\WidgetParam\ObjectId\Product('Product Id'0true),
            
self::PARAM_ICON_MAX_WIDTH => new \XLite\Model\WidgetParam\Int(
                
'Maximal icon width'160true
            
),
            
self::PARAM_ICON_MAX_HEIGHT => new \XLite\Model\WidgetParam\Int(
                
'Maximal icon height'160true
            
),
        );
    } 


Quote:

Originally Posted by RichieRich
Is there a setting for the thumbnail size? As the thumbnail images are generated I would like to make mine slightly larger, maybe 180px or 200px.


RichieRich 06-03-2014 08:00 AM

Re: Thumbnail size in xc5
 
Is this likely to become a standard setting do you think? It is in x-cart 4. Also, is there any reason the image quality is reduced in the thumbnail generation so much? I understand the performance/ load time of higher image, but what if you only had 5 high-end products. It appears about 70% reduction in quality for thumbnails.

Also, there could be 2 thumbnails generated, with one displayed to standard screen and one to retina display screens.

tony_sologubov 06-03-2014 02:00 PM

Re: Thumbnail size in xc5
 
We are thinking of it, but not sure yet.

Generally the size of thumbnail is dictated by the theme, so the size of thumbnails is the option of a theme, not the entire store. X-Cart 4 has such settings, but most of 3rd party skins disregard them.

As for thumbnail quality, there are two sides of the coin, some merchants want lower quality, small images, some want high quality and do not care about size. That is why we implemented it in a way to cover the general majority of users (as we felt) and now are getting feedback about what is good and what can be improved. At this point, you can easily apply the mod, so your thumbnails would not be that much resized + you can register an idea about high quality thumbnails.

As for retina images, I believe, it should implemented as a mod and X-Cart allows to define you two images for a single thumbnail in order to server retina needs.

Quote:

Originally Posted by RichieRich
Is this likely to become a standard setting do you think? It is in x-cart 4. Also, is there any reason the image quality is reduced in the thumbnail generation so much? I understand the performance/ load time of higher image, but what if you only had 5 high-end products. It appears about 70% reduction in quality for thumbnails.

Also, there could be 2 thumbnails generated, with one displayed to standard screen and one to retina display screens.


RichieRich 06-03-2014 04:54 PM

Re: Thumbnail size in xc5
 
Quote:

Originally Posted by tony_sologubov
We are thinking of it, but not sure yet.

Generally the size of thumbnail is dictated by the theme, so the size of thumbnails is the option of a theme, not the entire store. X-Cart 4 has such settings, but most of 3rd party skins disregard them.



I think there is space for a larger thumbnail without breaking the theme. And it could be allowed up to a maximum of the space that is allowed, or even if you have a bigger thumbnail, it will squeeze into the size of the theme in this new repsonsive templates which dont allow images to go outside the containers.

tony_sologubov 06-04-2014 03:32 AM

Re: Thumbnail size in xc5
 
That is true if we are talking about default theme. But most of 3rd party themes just force the exact thumbnail size. They do not want to support several thumbnail sizes.

So, there will be a setting an admin area and merchants would think that it affects the display, but if they install 3rd party theme, this setting suddenly stops working. We do not want this effect.

Quote:

Originally Posted by RichieRich
I think there is space for a larger thumbnail without breaking the theme. And it could be allowed up to a maximum of the space that is allowed, or even if you have a bigger thumbnail, it will squeeze into the size of the theme in this new repsonsive templates which dont allow images to go outside the containers.


RichieRich 06-04-2014 03:45 AM

Re: Thumbnail size in xc5
 
Dont most people use default responsive theme? Is there a way you can make a setting if the customer is using the default responsive theme for the majority?

tony_sologubov 06-25-2014 01:41 PM

Re: Thumbnail size in xc5
 
Hi Richard!

Sorry for being silent for a while. We have been to IRCE. Now I am back from the trip and catching up with all the work.

I am not sure, but I feel that majority of people tend to use a custom theme. Anyways, if you feel that this setting is a must, please post an idea here:
http://ideas.x-cart.com/forums/229428-x-cart-5-ideas

We want to implement features that are needed for merchants/developers, so your voice would be highly appreciated.

Finally, if you need to change the thumbnail sizes in your own store, I can show you the approach as a part of dev docs. Now I am working on complete guide for theme creation, so I will describe this process there.

UPDATE: oops, I already explained it earlier in this thread: http://forum.x-cart.com/showpost.php?p=373839&postcount=2

Tony.

spdesign 10-31-2014 02:49 PM

Re: Thumbnail size in xc5
 
I have been trying to change the size of the category icons. Am I correct that the procedure is to create

/XLite/modules/MyName/MyThemeName/View/Subcategories.php

which has the code

Code:

namespace XLite\Module\MyName\MyThemeName\View;

class Subcategories extends \XLite\View\Subcategories implements \XLite\Base\IDecorator
{
 
    protected function defineWidgetParams()
    {
        parent::defineWidgetParams();

        $this->widgetParams += array(
            self::PARAM_DISPLAY_MODE => new \XLite\Model\WidgetParam\Set(
                'Display mode', $this->getDisplayMode(), true, $this->displayModes
            ),
            self::PARAM_ICON_MAX_WIDTH => new \XLite\Model\WidgetParam\Int(
                'Maximal icon width', 200, true
            ),
            self::PARAM_ICON_MAX_HEIGHT => new \XLite\Model\WidgetParam\Int(
                'Maximal icon height', 200, true
            ),
        );
    }

}


to change icon size to 200px? It doesn't seem to work for me. Icons remain at 160px.

tony_sologubov 11-03-2014 04:03 AM

Re: Thumbnail size in xc5
 
It should've worked out. Could you please send your whole module, so I could check?

Tony.


All times are GMT -8. The time now is 12:53 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.