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)
-   -   How to make thumbnails larger in Category view (https://forum.x-cart.com/showthread.php?t=70283)

minfinger 10-18-2014 09:29 PM

How to make thumbnails larger in Category view
 
Is there a way to make the size of the thumbnails larger in the category view?

RichieRich 10-19-2014 07:03 AM

Re: How to make thumbnails larger in Category view
 
I think it requires some modification to the core, I have asked this before

minfinger 10-19-2014 07:27 AM

Re: How to make thumbnails larger in Category view
 
Well I think I could make a Mod to do this, but there's no telling where the settings are for this.

Then if it was a Mod, you'd need have it on the back end to make the changes. However, I think this should be in Look & Feel, because there's nothing else in that area that worth having there lol

Or better yet, why doesn't it just size to the white area? If you look at my current site I'm working on, We made this Mod for the front page that uses the Category listing and it looks like this because the Thumbnails are so small! It makes it difficult to see the dogs.

http://i21.photobucket.com/albums/b298/fasterthanyours/frontpageexample.jpg

I'd also like to know how to change the Category listing to 2 columns that take up to whole width of the same area.

tony_sologubov 10-20-2014 06:24 AM

Re: How to make thumbnails larger in Category view
 
Hi Michael!

In order to apply this change, you need to decorate the getIconSizes() method of the
\XLite\View\ItemsList\Product\Customer\ACustomer class.

You will see that now thumbnail sizes are hard-coded to 160x160px.

The basic guide about how to perform a decoration is here:
http://kb.x-cart.com/display/XDD/Step+3+-+applying+logic+changes

Finally, I will pass the feedback about creating options for thumbnail sizes to the team.

Tony.

tony_sologubov 10-20-2014 06:27 AM

Re: How to make thumbnails larger in Category view
 
Alternatively, you can simply override the skins/default/en/items_list/product/center/list/parts/body/thumbnail.tpl
template using Custom Skin module and hard-code your thumbnail sizes in this piece:

Code:

      <widget
        class="\XLite\View\Image"
        image="{product.getImage()}"
        maxWidth="{getIconWidth()}"
        maxHeight="{getIconHeight()}"
        alt="{product.name}"
        className="photo" />


The basic guide about overriding templates is here:
http://kb.x-cart.com/display/XDD/Step+2+-+applying+design+changes

minfinger 10-21-2014 07:17 PM

Re: How to make thumbnails larger in Category view
 
Tony,

So help me out again if you would... I got as far as making to the Main.php and the ACustomer.php files

But I'm not 100% what to do with the getIconSize function

PHP Code:

<?php

namespace XLite\Module\FasterThanYours\LargerThumbnails\View\ItemsList\Product\Customer;

abstract class 
ACustomer extends \XLite\View\ItemsList\Product\Customer\ACustomer implements \XLite\Base\IDecorator
{
    protected function 
getIconSizes()
    {
        return 
$return;
    }
}


I was able to get it Installed and Enabled.

However, I'm not sure what to do about putting in my own sizes. I also think this could be better handled by having a Settings option.

Here's a link to the packed files https://www.dropbox.com/s/zdjnzjt6e5no5hh/FasterThanYours-LargerThumbnails-v5_1_6.tar?dl=0

tony_sologubov 10-23-2014 03:57 AM

Re: How to make thumbnails larger in Category view
 
Your implementation of getIconSizes() sizes must be similar to its default implementation in the classes/XLite/View/ItemsList/Product/Customer/ACustomer.php file.

Its default implementation is:
Code:

    public static function getIconSizes()
    {
        return array(
            static::WIDGET_TYPE_SIDEBAR . '.' . static::DISPLAY_MODE_STHUMB => array(160, 160),
            static::WIDGET_TYPE_SIDEBAR . '.' . static::DISPLAY_MODE_BTHUMB => array(160, 160),
            static::WIDGET_TYPE_CENTER . '.' . static::DISPLAY_MODE_GRID => array(160, 160),
            static::WIDGET_TYPE_CENTER . '.' . static::DISPLAY_MODE_LIST => array(160, 160),
            'other' => array(110, 110),
        );
    }


These lines:
Code:

            static::WIDGET_TYPE_CENTER . '.' . static::DISPLAY_MODE_GRID => array(160, 160),
            static::WIDGET_TYPE_CENTER . '.' . static::DISPLAY_MODE_LIST => array(160, 160),


define sizes of thumbnails in central area. You can change them to:
Code:

            static::WIDGET_TYPE_CENTER . '.' . static::DISPLAY_MODE_GRID => array(200, 200),
            static::WIDGET_TYPE_CENTER . '.' . static::DISPLAY_MODE_LIST => array(200, 200),


and thumbnails will become 200x200 size.

Please, let me know if it makes sense to you.

Tony.

minfinger 10-23-2014 04:07 AM

Re: How to make thumbnails larger in Category view
 
I found on this thread where totaltec had suggested the same thing
http://forum.x-cart.com/showpost.php?p=376532&postcount=4

Based on his recommendation I removed it from the original Mod location namespace XLite\Module\FasterThanYours\LargerThumbnails\View\ItemsList\Product\Customer; I place the ACustomer.php in XLite\Module\XC\CustomSkin\View\Items_List\Product \Customer\ACustomer.php But I don't get any results.

Here's the current PHP
PHP Code:

namespace XLite\Module\XC\CustomSkin\View\ItemsList\Product\Customer;

abstract class 
ACustomer extends \XLite\Module\CDev\Sale\View\ItemsList implements \XLite\Base\IDecorator
{
    protected function 
getIconSizes()
    {
        return array(
            static::
WIDGET_TYPE_SIDEBAR '.' . static::DISPLAY_MODE_STHUMB => array(200200),
            static::
WIDGET_TYPE_SIDEBAR '.' . static::DISPLAY_MODE_BTHUMB => array(200200),
            static::
WIDGET_TYPE_CENTER '.' . static::DISPLAY_MODE_GRID => array(200200),
            static::
WIDGET_TYPE_CENTER '.' . static::DISPLAY_MODE_LIST => array(200200),
            
'other' => array(110110),
        );
    }



tony_sologubov 10-23-2014 04:13 AM

Re: How to make thumbnails larger in Category view
 
In your code, you should replace the following string:

abstract class ACustomer extends \XLite\Module\CDev\Sale\View\ItemsList implements \XLite\Base\IDecorator
{

with the next one:

abstract class ACustomer extends \XLite\View\ItemsList\Product\Customer\ACustomer implements \XLite\Base\IDecorator
{

I.e. your previous code was right and new one is not.

minfinger 10-23-2014 06:01 AM

Re: How to make thumbnails larger in Category view
 
Do I need to change my Namespace and file path? I went back to using the other Custom Mod and disable Custom Skins.

Current Code:
PHP Code:

<?php

namespace XLite\Module\FasterThanYours\LargerThumbnails\View\ItemsList\Product\Customer;

abstract class 
ACustomer extends \XLite\View\ItemsList\Product\Customer\ACustomer implements \XLite\Base\IDecorator
{
    protected function 
getIconSizes()
    {
        return array(
            static::
WIDGET_TYPE_SIDEBAR '.' . static::DISPLAY_MODE_STHUMB => array(160160),
            static::
WIDGET_TYPE_SIDEBAR '.' . static::DISPLAY_MODE_BTHUMB => array(160160),
            static::
WIDGET_TYPE_CENTER '.' . static::DISPLAY_MODE_GRID => array(250250),
            static::
WIDGET_TYPE_CENTER '.' . static::DISPLAY_MODE_LIST => array(250250),
            
'other' => array(110110),
        );
    }
}



All times are GMT -8. The time now is 01:19 PM.

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