X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Limiting the image size in the shopping cart (https://forum.x-cart.com/showthread.php?t=17910)

hyratech 11-11-2005 12:50 PM

Limiting the image size in the shopping cart
 
Is there a way to limit the size of the image in the shopping cart?

to avoid errors.. I'm only using 1 Image as both the Main image and thumbnail..

The Product page.. it's the same image but just limited to 80 pixels..

and the detail's picture it's all set to 300 pixels..


Is there a way to do this to the images in the shopping cart also?

balinor 11-11-2005 01:01 PM

Just edit the x value where the image appears in the code to a specific number, ie in cart.tpl, replace this

Code:

image_x=$products[product].image_x

with this

Code:

image_x=100

replace 100 with whatever number you want. You'll also have to remove the image_y all together so that it doesn't stretch the image.

hyratech 11-11-2005 01:25 PM

is the cart.tpl in customer/main/cart.tpl?

balinor 11-11-2005 01:25 PM

Yes

hyratech 11-11-2005 01:32 PM

the image is not in proportion..

the width is 70 now.. but the height is still the original.. and the picture is just stretched....

balinor 11-11-2005 01:35 PM

Like I said above, you need to remove the y component all together. Just delete this part:

image_y=$products[product].image_y

hyratech 11-11-2005 01:42 PM

That did the trick.... Thanx a LOT!!! :-) you guys are the best!

floydiology 01-24-2007 12:34 PM

Re: Limiting the image size in the shopping cart
 
I have tried all these steps here and I still do not see any change. I even deleted the entire line of code and no effect to the site. It appears that it is not using this template? where can I find the proper template to edit. I am editing skin1/customer/main/cart.tpl

LisaB 01-30-2007 07:55 PM

Re: Limiting the image size in the shopping cart
 
Hi! Looked for that line in my cart.tpl and couldn't even find it. Would it be different in my version? And can the same be done for the wish list? Thanks!

LisaB 01-30-2007 09:04 PM

Re: Limiting the image size in the shopping cart
 
I found it, and fixed it. :) Worked for both the cart and the wishlist.

LisaB 01-30-2007 09:04 PM

Re: Limiting the image size in the shopping cart
 
I found it, and fixed it. :) Worked for both the cart and the wish list.

floydiology 02-01-2007 09:15 AM

Re: Limiting the image size in the shopping cart
 
Lisa, we had to fix the permissions on the file and that seemed to allow the change.

annasoaps 05-16-2007 05:17 PM

Re: Limiting the image size in the shopping cart
 
I can't find this file in my cart.tpl :oops: Is it different for the 4.1.7 version? I would really like to scale down the pictures in the shopping cart. Most of all I'd like to use the thumbnails of the products. Is that possible?

/Anna

icnjan 06-08-2007 12:19 PM

Re: Limiting the image size in the shopping cart
 
Anna, did you find a solution for the cart image size issue? I could not find it in my 4.1.6 cart.tpl file either and am wondering if it has to do with Fast Lane Checkout. Was interested enough to file a support ticket.

Essentially, since our product thumbnail and detail pictures vary in size and we do not want X-Cart to resize all images using the "thumbnail width in the product list" option, we are stuck seeing oddly sized product detail pictures in the cart.

Product support has confirmed that it is an issue - if we want only product thumbnails to appear in the cart - they can fix it for us in exchange for support points.

Anyone able to fix this on their own??

Thanks!!

annasoaps 06-08-2007 04:45 PM

Re: Limiting the image size in the shopping cart
 
Icnjan,

No I never found a solutions to this.
So I think I will sacrifice support points then, because some pictures are a little too large. I would find this a little.... excessive as a customer :)

/Anna

icnjan 06-19-2007 11:28 AM

Re: Limiting the image size in the shopping cart
 
Anna,

With the support dept approval here are the fixes that they suggested:

Images stored outside the file system (this worked for me):

In order the thumbnail image to be always displayed instead of the product images, you should open the '<root directory of X-Cart>/include/func.cart.php' file again and delete the following pieces of code:

$tmp = func_query_first("SELECT id, image_path, image_x, image_y FROM $sql_tbl[images_P] WHERE id = '$productid' LIMIT 1");

IF($sql_tbl[images_P].id IS NULL, '', 'P') as is_pimage,

Please note, in this case the products must always have the thumbnail image. I recommend making a backup copy for the file before the modification.


Images stored within the file system:

In order all the images on the cart page to be thumbnails you should do the following:
1.Open the '<root directory of X-Cart>/include/func.cart.php'
2.Find the

# Get thumbnail's URL (uses only if images stored in FS)

area.
3. Change the string

if (!empty($products_array['pimage_path']) && !empty($products_array['is_pimage'])) {

to

if (false && !empty($products_array['pimage_path']) && !empty($products_array['is_pimage'])) {

string.

Hope that helps!!

Jan

annasoaps 06-20-2007 05:45 PM

Re: Limiting the image size in the shopping cart
 
Jan you are an angel!!
It worked perfectly! Thank you SOOO much!!!:D/

O:) <---- Jan

Thanks!!!

Kind regards,
Anna


All times are GMT -8. The time now is 11:16 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.