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

Too much white space around product images.

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 08-25-2014, 09:15 AM
 
benmackie benmackie is offline
 

Advanced Member
  
Join Date: May 2013
Posts: 52
 

Default Too much white space around product images.

Under Featured Products, there seems to be a lot of white space. I want my images to fill more of that space. We uploaded large images for retina displays, but X-Cart seems to compress them to certain size, which we find too small.

http://tarheelants.net/
__________________
X-Cart 5
Reply With Quote
  #2  
Old 08-25-2014, 12:20 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

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

Default Re: Too much white space around product images.

Just adding some info that might help:
Looks like the icon sizes are defined in classes/XLite/View/ItemsList/Product/Customer/ACustomer.php

in the function:
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), ); }

I would try decorating this class, and defining my own sizes.
__________________
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
  #3  
Old 08-25-2014, 12:36 PM
 
benmackie benmackie is offline
 

Advanced Member
  
Join Date: May 2013
Posts: 52
 

Default Re: Too much white space around product images.

I actually changed the width in the class and it worked, but the images are all blurry because when you upload through the backend it actually compresses them to 160 x 160.
__________________
X-Cart 5
Reply With Quote
  #4  
Old 08-25-2014, 12:39 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

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

Default Re: Too much white space around product images.

Okay here is what I did.

I used the custom skin module, (for the second time today!) and I created a new file:
XLite\Module\XC\CustomSkin\View\Items_List\Product \Customer\ACustomer.php

with the following content:

Code:
namespace XLite\Module\XC\CustomSkin\View\Items_List\Product\Customer; /** * ACustomer */ abstract class ACustomer extends \XLite\Module\CDev\Sale\View\ItemsList implements \XLite\Base\IDecorator { /** * Get icon sizes * * @return array */ public static function getIconSizes() { return array( static::WIDGET_TYPE_SIDEBAR . '.' . static::DISPLAY_MODE_STHUMB => array(200, 200), static::WIDGET_TYPE_SIDEBAR . '.' . static::DISPLAY_MODE_BTHUMB => array(200, 200), static::WIDGET_TYPE_CENTER . '.' . static::DISPLAY_MODE_GRID => array(200, 200), static::WIDGET_TYPE_CENTER . '.' . static::DISPLAY_MODE_LIST => array(200, 200), 'other' => array(110, 110), ); } }

This set the icon sizes to 200. Amazingly, XC was smart enough to automatically generate icon thumbs at the correct size of 200 x 200, referenc them correctly, and place them in the var/images folder. Thanks Devs!
__________________
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:
Ksenia (08-27-2014)
  #5  
Old 08-25-2014, 12:41 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

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

Default Re: Too much white space around product images.

Quote:
Originally Posted by benmackie
I actually changed the width in the class and it worked, but the images are all blurry because when you upload through the backend it actually compresses them to 160 x 160.
Using my solution above they should not be blurry. I believe XC has retained your original images, and it will create proper sized thumbnails on the fly depending on the application and need.
__________________
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 (09-03-2014)
  #6  
Old 08-25-2014, 12:55 PM
 
benmackie benmackie is offline
 

Advanced Member
  
Join Date: May 2013
Posts: 52
 

Default Re: Too much white space around product images.

Ok, I did what you did and changed those values to 200.

I did it directly to the file. Do I need to create a new file for that to work?

Thanks.
__________________
X-Cart 5
Reply With Quote
  #7  
Old 08-25-2014, 02:28 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

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

Default Re: Too much white space around product images.

I see your new changes are in effect on your site. They look like they are set to 240.

With X-cart 5 you should never directly edit a file, or it will break future upgrades of the site. None of the default files should ever be changed, or your changes will be overwritten when you upgrade. Rather, you make all the changes in your custom created module, or in the provided module called Custom skin. The custom skin module is what I used above.

I just made a video about using the custom skin that might help you to better understand how it is used: http://youtu.be/LxpUCoYU_nU
__________________
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 4 users thank totaltec for this useful post:
Ksenia (08-27-2014), qualiteam (08-31-2014), tartaglia (08-27-2014), tony_sologubov (09-03-2014)
  #8  
Old 08-26-2014, 04:33 AM
 
benmackie benmackie is offline
 

Advanced Member
  
Join Date: May 2013
Posts: 52
 

Default Re: Too much white space around product images.

Like a child theme for wordpress. Got it. Thanks!
__________________
X-Cart 5
Reply With Quote
  #9  
Old 09-30-2014, 12:59 PM
 
GreatLakesVacuum GreatLakesVacuum is offline
 

eXpert
  
Join Date: Jan 2009
Posts: 286
 

Default Re: Too much white space around product images.

Mike is the module you made to do this available so one could simply install this module and enter the size of images they want for the categories thumbnails and add-to-cart popup? I find it silly that the Admin only contains places for us to define the product image and am not well versed in creating modules (and also have limited time right now to learn it)
__________________
X-Cart 4.5.4 Gold (Live Business Site)
X-Cart 5.1.9 Business (In Development Now)
Reply With Quote
  #10  
Old 09-30-2014, 08:31 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

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

Default Re: Too much white space around product images.

Quote:
Originally Posted by GreatLakesVacuum
Mike is the module you made to do this available so one could simply install this module and enter the size of images they want for the categories thumbnails and add-to-cart popup? I find it silly that the Admin only contains places for us to define the product image and am not well versed in creating modules (and also have limited time right now to learn it)

I think the best thing would be to create 1 custom module for your site, then we could put all the little changes like this into it. This change is so small, in my opinion it's not worth creating a module just for this. I think we will see these options show up in future X-cart 5 releases.
__________________
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
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 11:00 PM.

   

 
X-Cart forums © 2001-2020