Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

How to make thumbnails larger in Category view

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 10-18-2014, 09:29 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default How to make thumbnails larger in Category view

Is there a way to make the size of the thumbnails larger in the category view?
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #2  
Old 10-19-2014, 07:03 AM
  RichieRich's Avatar 
RichieRich RichieRich is offline
 

X-Adept
  
Join Date: Sep 2004
Location: London, England
Posts: 750
 

Default Re: How to make thumbnails larger in Category view

I think it requires some modification to the core, I have asked this before
__________________
Richard


Ultimate 5.4 testing
Reply With Quote
  #3  
Old 10-19-2014, 07:27 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default 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.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #4  
Old 10-20-2014, 06:24 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default 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.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #5  
Old 10-20-2014, 06:27 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default 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
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #6  
Old 10-21-2014, 07:17 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default 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
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #7  
Old 10-23-2014, 03:57 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default 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.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #8  
Old 10-23-2014, 04:07 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default 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),
        );
    }

__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #9  
Old 10-23-2014, 04:13 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default 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.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #10  
Old 10-23-2014, 06:01 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default 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),
        );
    }
}
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:10 PM.

   

 
X-Cart forums © 2001-2020