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

Thumbnail size in xc5

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #11  
Old 12-02-2014, 03:10 PM
 
DTS DTS is offline
 

Newbie
  
Join Date: Jun 2012
Posts: 9
 

Default Re: Thumbnail size in xc5

Is there a way to disable the resizing of the icons so we can control our layout without software intervention?
__________________
This is too complicated,
X-Cart DB Version: 4.4.5 GOLD
Reply With Quote
  #12  
Old 12-02-2014, 03:39 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Thumbnail size in xc5

Quote:
Originally Posted by DTS
Is there a way to disable the resizing of the icons so we can control our layout without software intervention?
I think it may be more trouble than it is worth. Looks like the resize function is triggered in XLite\Model\Base\Image. The method I'm looking at is resizeIcon

That would be a starting point, but I see so much code that depends upon this that I think it would be a massive undertaking to disable it completely. Much easier to simply embrace it and twist it to your own advantage.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following user thanks totaltec for this useful post:
tony_sologubov (12-03-2014)
  #13  
Old 12-03-2014, 02:46 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

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

Default Re: Thumbnail size in xc5

Guys, I just wrote an article about disabling resizing routine here:
http://kb.x-cart.com/display/XDD/Working+with+image+resizing+routine

Check it out!
__________________
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

The following user thanks tony_sologubov for this useful post:
totaltec (12-03-2014)
  #14  
Old 12-03-2014, 03:30 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Thumbnail size in xc5

Very cool Tony! Your mod is an elegant way to handle this.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #15  
Old 02-23-2015, 09:21 AM
 
flipp2k flipp2k is offline
 

Newbie
  
Join Date: Feb 2015
Posts: 2
 

Default Re: Thumbnail size in xc5

Hi Tony,

I'm also having trouble with resizing thumbnail images. I tried the solution you suggested but it also isn't working for me. Any Ideas?
__________________
xcart 5.1.1
Reply With Quote
  #16  
Old 02-24-2015, 04:47 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

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

Default Re: Thumbnail size in xc5

Hello @flipp2k and welcome to X-Cart community.

Could you please give me more details about what you were trying to achieve, what you did and what actually happened instead of what you expected to see?
__________________
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
  #17  
Old 03-05-2015, 10:46 AM
 
ant99 ant99 is offline
 

Advanced Member
  
Join Date: Mar 2015
Posts: 39
 

Default Re: Thumbnail size in xc5

Everything here seems really useful and exactly fitting for what I need. I am wanting to change the category thumbnail size to 300x300. I'm also wanting to change the product thumbnail size to 300x300. As of now, the categories are showing 160x160. Also the products in the grid view are showing 160x160.

However, I tried integrating this into my theme and it doesn't seem to be working at all? What am I missing? Attached are the files that I've added to my module. Any insight is appreciated!

/XLite/Module/DevID/ModuleID/View/ProductBox.php
PHP Code:
<?php
namespace XLite\Module\DevID\ModuleID\View;

abstract class 
ProductBox extends \XLite\View\ProductBox implements \XLite\Base\IDecorator

{   

    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'300true 
                
), 
                
self::PARAM_ICON_MAX_HEIGHT => new \XLite\Model\WidgetParam\Int
                    
'Maximal icon height'300true 
                
), 
            ); 
        }

}
?>

/XLite/Module/DevID/ModuleID/View/Subcategories.php
PHP Code:
<?php
namespace XLite\Module\DevID\ModuleID\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'300true
            
),
            
self::PARAM_ICON_MAX_HEIGHT => new \XLite\Model\WidgetParam\Int(
                
'Maximal icon height'300true
            
),
        );
    }

}
?>
__________________
Ant

XC v5.3.1.8
Horizontal Flyout Categories Menu Module
CloudSearch / CloudFilters

XC v4.7.6
CloudSearch
Reply With Quote
  #18  
Old 03-10-2015, 12:08 PM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

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

Default Re: Thumbnail size in xc5

@ant99 it should have worked out. Could you please send me your module, so I could check out what is wrong exactly?

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

The following user thanks tony_sologubov for this useful post:
ant99 (03-12-2015)
  #19  
Old 03-17-2015, 11:42 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

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

Default Re: Thumbnail size in xc5

Thanks for sending me the module.

The correct implementation of the \XLite\Module\Dev-ID\Module-ID\View\Subcategories class should be as follows:

PHP Code:
<?php

namespace XLite\Module\Dev-ID\Module-ID\View;

abstract class 
Subcategories extends \XLite\View\Subcategories implements \XLite\Base\IDecorator
{
    public function 
setWidgetParams(array $params)
    {
        
parent::setWidgetParams($params);

        
$this->widgetParams[static::PARAM_ICON_MAX_WIDTH]->setValue(300);
        
$this->widgetParams[static::PARAM_ICON_MAX_HEIGHT]->setValue(300);
    }
}

In other words, you should decorate the setWidgetParams() method instead of defineWidgetParams() one.
__________________
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
  #20  
Old 03-26-2015, 10:27 PM
 
ant99 ant99 is offline
 

Advanced Member
  
Join Date: Mar 2015
Posts: 39
 

Default Re: Thumbnail size in xc5

Quote:
Originally Posted by tony_sologubov
In other words, you should decorate the setWidgetParams() method instead of defineWidgetParams() one.

Thank you, that works perfectly for the Category images. However, I tried to apply the fix for Product thumbnail images also and had no success. Here is what I have.

PHP Code:
<?php
namespace XLite\Module\Dev-ID\Module-ID\View;

abstract class 
ProductBox extends \XLite\View\ProductBox implements \XLite\Base\IDecorator

{   

    public function 
setWidgetParams(array $params)
        { 
            
parent::setWidgetParams($params); 

            
$this->widgetParams[static::PARAM_ICON_MAX_WIDTH]->setValue(300);
            
$this->widgetParams[static::PARAM_ICON_MAX_HEIGHT]->setValue(300);
        }

}

?>

Any suggestions? Thanks for your help.
__________________
Ant

XC v5.3.1.8
Horizontal Flyout Categories Menu Module
CloudSearch / CloudFilters

XC v4.7.6
CloudSearch
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 10:24 AM.

   

 
X-Cart forums © 2001-2020