Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Making images the same size without messing them up

Making images the same size without messing them up

Views: 1,085

Results 1 to 5 of 5
30 Jun 2013, 1:36 AM
#1
silverhd avatar

silverhd

Totally Zenned

Join Date:
Mar 2008
Location:
USA
Posts:
563
Plugin Contributions:
0

Making images the same size without messing them up

Hello again,

I have a problem with images that have been downloaded. I would like them to be a uniform size so they are more easy on the customers eyes. I hope I am explaining this right. This is one of my categories that I am talking about:

http://www.petluxuryboutique.com/index.php?main_page=index&cPath=1319

Thanks,

Silver

21 Jul 2013, 3:44 PM
#2
ravynw34 avatar

ravynw34

Zen Follower

Join Date:
Feb 2007
Location:
Pennsylvania
Posts:
112
Plugin Contributions:
0

Re: Making images the same size without messing them up

Your best bet would be to resize your images then upload them. If you simply change the image sizes in admin it may squish or distort some images. Hope that helps a little.

23 Jul 2013, 2:24 PM
#3
kitten091182 avatar

kitten091182

Zen Follower

Join Date:
May 2007
Posts:
110
Plugin Contributions:
0

Re: Making images the same size without messing them up

Hi,
I had the same problem with my website, even though i resized the images i couldn't get the product names to line up right. I got round it by putting a div box around the images which would then make all the images line up even if they aren't the same size:
http://www.drgreens.co.uk/Grow-Room-Tools/Miscellaneous

You have to modify includes/modules/YOURTEMPLATE/product_listing.php
find this part

case 'PRODUCT_LIST_QUANTITY':

        $lc_align = 'right';

        $lc_text = $listing->fields['products_quantity'];

        break;

        case 'PRODUCT_LIST_WEIGHT':

        $lc_align = 'right';

        $lc_text = $listing->fields['products_weight'];

        break;

        case 'PRODUCT_LIST_IMAGE':

        $lc_align = 'center';

        if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {

          $lc_text = '';

        } else {

          if (isset($_GET['manufacturers_id'])) {

            $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';

          } else {

            $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';

and change to:

case 'PRODUCT_LIST_QUANTITY':
        $lc_align = 'right';
        $lc_text = $listing->fields['products_quantity'];
        break;
        case 'PRODUCT_LIST_WEIGHT':
        $lc_align = 'right';
        $lc_text = $listing->fields['products_weight'];
        break;
        case 'PRODUCT_LIST_IMAGE':
        $lc_align = 'center';
        if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
          $lc_text = '';
        } else {
          if (isset($_GET['manufacturers_id'])) {
            $lc_text = '<div id="listingPImage">'.'<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'.'</div>';
          } else {
            $lc_text = '<div id="listingPImage">'.'<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'.'</div>';

You can then style listingPimage in your stylesheet to be the size and height that you would like it

23 Jul 2013, 3:15 PM
#4
silverhd avatar

silverhd

Totally Zenned

Join Date:
Mar 2008
Location:
USA
Posts:
563
Plugin Contributions:
0

Re: Making images the same size without messing them up

kitten091182:

Thanks for the explicit detail.

Regards,

Silver

23 Mar 2016, 9:03 PM
#5
wastaboo avatar

wastaboo

New Zenner

Join Date:
May 2007
Location:
Montebello, CA
Posts:
40
Plugin Contributions:
0

Re: Making images the same size without messing them up

I use this and it works thank you.:yes: :smartalec:

kitten091182:

Hi,
I had the same problem with my website, even though i resized the images i couldn't get the product names to line up right. I got round it by putting a div box around the images which would then make all the images line up even if they aren't the same size:
http://www.drgreens.co.uk/Grow-Room-Tools/Miscellaneous

You have to modify includes/modules/YOURTEMPLATE/product_listing.php
find this part

case 'PRODUCT_LIST_QUANTITY':

    $lc_align = 'right';

    $lc_text = $listing->fields['products_quantity'];

    break;

    case 'PRODUCT_LIST_WEIGHT':

    $lc_align = 'right';

    $lc_text = $listing->fields['products_weight'];

    break;

    case 'PRODUCT_LIST_IMAGE':

    $lc_align = 'center';

    if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {

      $lc_text = '';

    } else {

      if (isset($_GET['manufacturers_id'])) {

        $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';

      } else {

        $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
> 
> and change to:
> 
> ```php
case 'PRODUCT_LIST_QUANTITY':
        $lc_align = 'right';
        $lc_text = $listing->fields['products_quantity'];
        break;
        case 'PRODUCT_LIST_WEIGHT':
        $lc_align = 'right';
        $lc_text = $listing->fields['products_weight'];
        break;
        case 'PRODUCT_LIST_IMAGE':
        $lc_align = 'center';
        if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
          $lc_text = '';
        } else {
          if (isset($_GET['manufacturers_id'])) {
            $lc_text = '<div id="listingPImage">'.'<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'.'</div>';
          } else {
            $lc_text = '<div id="listingPImage">'.'<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'.'</div>';

You can then style listingPimage in your stylesheet to be the size and height that you would like it