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

Rebuild thumbs

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 06-10-2015, 10:07 PM
 
Roman Prisiazniuk Roman Prisiazniuk is offline
 

Member
  
Join Date: Jun 2015
Posts: 27
 

Default Rebuild thumbs

How can I rebuild thumbs to size 270px on this site http://squirrelpoker.co.uk/xcart/?
__________________
xcart5
Reply With Quote
  #2  
Old 06-12-2015, 10:53 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

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

Default Re: Rebuild thumbs

Hello @Roman,

Check this thread out:
http://forum.x-cart.com/showthread.php?t=69263&highlight=image+size

and let me know if there is any question after that.

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:
Roman Prisiazniuk (06-15-2015)
  #3  
Old 06-13-2015, 05:20 AM
 
Roman Prisiazniuk Roman Prisiazniuk is offline
 

Member
  
Join Date: Jun 2015
Posts: 27
 

Default Re: Rebuild thumbs

Quote:
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:
Code:
protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams += array( self::PARAM_PRODUCT_ID => new \XLite\Model\WidgetParam\ObjectId\Product('Product Id', 0, true), self::PARAM_ICON_MAX_WIDTH => new \XLite\Model\WidgetParam\Int( 'Maximal icon width', 160, true ), self::PARAM_ICON_MAX_HEIGHT => new \XLite\Model\WidgetParam\Int( 'Maximal icon height', 160, true ), ); }
Please tell me what name of decorator should be and in what location it must be placed and what namespace must it use?
IT would be better if u write full code of this decorator and say me where must it be located
__________________
xcart5
Reply With Quote
  #4  
Old 06-13-2015, 12:23 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

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

Default Re: Rebuild thumbs

Roman,
I assume you already have a custom module. Therefore your module has a name and a directory: classes/XLite/Module/YourDevID/YourModuleName/

If you are decorating XLite/View/ProductBox.php, then you place the file in your module: classes/XLite/Module/YourDevID/YourModuleName/View/ProductBox.php

Then you can determine the namespace, in the case above it would be:
namespace XLite\Module\YourDevID\YourModuleName\View;
__________________
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:
Roman Prisiazniuk (06-15-2015)
  #5  
Old 06-15-2015, 01:25 AM
 
Roman Prisiazniuk Roman Prisiazniuk is offline
 

Member
  
Join Date: Jun 2015
Posts: 27
 

Default Re: Rebuild thumbs

I did as you say but it does not work, store still generates 160px thumbs
http://squirrelpoker.co.uk/xcart/
I even tried to change paratemers in function defineWidgetParams in classes/Xlite/view/ProductBox but it still does not work
__________________
xcart5
Reply With Quote
  #6  
Old 06-15-2015, 02:59 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

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

Default Re: Rebuild thumbs

Hello Roman,

I believe you need to decorate the \XLite\View\ItemsList\Product\Customer\Category\AC ategroy class instead of \XLite\View\ProductBox one.

Please, let me know if it works out.

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
  #7  
Old 06-15-2015, 11:41 PM
 
Roman Prisiazniuk Roman Prisiazniuk is offline
 

Member
  
Join Date: Jun 2015
Posts: 27
 

Default Re: Rebuild thumbs

Here is a code of ACategory.php
PHP Code:
namespace XLite\Module\XC\CustomSkin\View;

class 
ACategroy extends \XLite\View\ItemsList\Product\Customer\Category\ACategroy 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'270true
                
),
            
self::PARAM_ICON_MAX_HEIGHT => new \XLite\Model\WidgetParam\Int(
                    
'Maximal icon height'270true
                
),
        );
    }

but it does not work
__________________
xcart5
Reply With Quote
  #8  
Old 06-16-2015, 01:46 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

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

Default Re: Rebuild thumbs

Hello Roman.

You should change class declaration from
PHP Code:
class ACategroy extends \XLite\View\ItemsList\Product\Customer\Category\ACategroy implements \XLite\Base\IDecorator 

to

PHP Code:
class ACategory extends \XLite\View\ItemsList\Product\Customer\Category\ACategory implements \XLite\Base\IDecorator 

I.e. replace ACategroy with ACategory.

Please, let me know if it works out.

Tony

Quote:
Originally Posted by Roman Prisiazniuk
Here is a code of ACategory.php
PHP Code:
namespace XLite\Module\XC\CustomSkin\View;

class 
ACategroy extends \XLite\View\ItemsList\Product\Customer\Category\ACategroy 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'270true
                
),
            
self::PARAM_ICON_MAX_HEIGHT => new \XLite\Model\WidgetParam\Int(
                    
'Maximal icon height'270true
                
),
        );
    }

but it does not work
__________________
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
  #9  
Old 06-16-2015, 06:21 AM
 
Roman Prisiazniuk Roman Prisiazniuk is offline
 

Member
  
Join Date: Jun 2015
Posts: 27
 

Default Re: Rebuild thumbs

changed to ACategory, but still it does not work
__________________
xcart5
Reply With Quote
  #10  
Old 06-17-2015, 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: Rebuild thumbs

Oh, yes, sorry, the correct instruction on setting image sizes is here:
http://forum.x-cart.com/showthread.php?t=69263&page=2&highlight=image+size

So, eventually, I had the following code in my decorating class:
PHP Code:
<?php

namespace XLite\Module\XC\CustomSkin\View


abstract class 
ACategory extends \XLite\View\ItemsList\Product\Customer\Category\ACategoryAbstract implements \XLite\Base\IDecorator 

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

        
$this->widgetParams[static::PARAM_ICON_MAX_WIDTH]->setValue(270);
        
$this->widgetParams[static::PARAM_ICON_MAX_HEIGHT]->setValue(270);
    }
}
__________________
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 (06-17-2015)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



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 01:04 PM.

   

 
X-Cart forums © 2001-2020