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)
-   -   Modifying a 4.4.1 skin questions... (https://forum.x-cart.com/showthread.php?t=57140)

artistwantab 12-27-2010 11:13 AM

Re: Modifying a 4.4.1 skin questions...
 
That is just it. It has BOTH images....

One in the file T/ and one in P/

When I changed the script above and you click the thumbnail it always gives me the thumbnail view...

But....when I right click in the browser and ask to view image it selects the correct image.

artistwantab 12-29-2010 01:21 PM

Re: Modifying a 4.4.1 skin questions...
 
3 Attachment(s)
Understanding how these tables work is beyond me.

I can't understand how everything works together.

I change two things.....
Quote:

{if $image_x ne 0} width="{$image_x}"{/if}
{if $image_y ne 0} height="{$image_y}"{/if} alt="{$product|escape}" />


To this and when clicking on Thumbnails you DON'T get the full image.

Quote:

{if $image_x ne 0} width="{150px}"{/if}
{if $image_y ne 0} height="{150px}"{/if} alt="{$product|escape}" />


Also now the table seems to want to move to the right AND give me uneven margins or padding from top to bottom.

All I wanted was a table with images evenly spaced and when the images were clicked then it would take you the next page with the full product description.

I have enclosed image examples of the working full size image with just changing the above code.

Also enclosed is the thumbnail table file....maybe it would have been easier to just rebuild the file then try to change the existing file to do what I want.

Any ideas?

cflsystems 12-29-2010 01:38 PM

Re: Modifying a 4.4.1 skin questions...
 
Change this

Quote:

{if $image_x ne 0} width="{150px}"{/if}
{if $image_y ne 0} height="{150px}"{/if} alt="{$product|escape}" />

to this
Quote:


{if $image_x ne 0} width="150px"{/if}
{if $image_y ne 0} height="150px"{/if} alt="{$product|escape}" />


artistwantab 12-29-2010 01:49 PM

Re: Modifying a 4.4.1 skin questions...
 
Steve,

Sorry I should have said this. I actually tried in numerous ways and you are correct, your method is the correct way but it still does not resolve the issue when selecting the thumbnail that the larger image defaults to the thumbnail.

cflsystems 12-29-2010 02:41 PM

Re: Modifying a 4.4.1 skin questions...
 
Not sure what you are trying to do, I just pointed out an error in your code.
Also if that code is used when showing the image it will set the image width/height to 150px/150px no matter what the actual dimensions are. That's why in the original code you have "$image_x/$image_y" which will default to the original image dimensions. Not sure what you are trying to do here

artistwantab 12-29-2010 03:14 PM

Re: Modifying a 4.4.1 skin questions...
 
Steve,

Thanks for answering.

That is exactly what I thought. I created thumbnails and the thumbnails were vertical or horizontal but I wanted square thumbnails.

So I then exported all the images and modified the pngs to square format.

With this code: The images still remained vertical or horizontal in the thumbnails regardless of the actual image size.

Quote:

{if $image_x ne 0} width="{$image_x}"{/if}
{if $image_y ne 0} height="{$image_y}"{/if} alt="{$product|escape}" />


So then I changed code above to the below code:

The thumbnails now showed correctly but when you click the thumbnail and go to view the larger image it ALSO shows the thumbnail.

Quote:

{if $image_x ne 0} width="150px"{/if}
{if $image_y ne 0} height="150px"{/if} alt="{$product|escape}" />

Strangest thing...

Go to the Site and click on one of the thumbnails. You will see that you get the exact thumbnail in the main product page.

Now right click on the image and click VIEW IMAGE. It shows the correct image.

I thought maybe a cache issue but I cleared my cache and still nothing.

Thanks.

artistwantab 12-29-2010 03:33 PM

Re: Modifying a 4.4.1 skin questions...
 
I think I see what its doing.

It is also changing the size on the image in the product page to...150px x 150px...

So it is using the same dimensions in the product_thumbnail.tpl regardless of the image size.

Any idea?

cflsystems 12-29-2010 03:39 PM

Re: Modifying a 4.4.1 skin questions...
 
And this is exactly why it is happening. The code in product template is (or similar to this)
Quote:

{include file="product_thumbnail.tpl" productid=$product.image_id image_x=$product.image_x image_y=$product.image_y product=$product.product|escape tmbn_url=$product.image_url id="product_thumbnail" type=$product.image_type}

Note "image_x" and "image_y" which are assigned actual product image dimensions (main image not thumbnail). These values are passed to product_thumbnail.tpl to use as image dimensions. But you changed the code in that template to use exact values (150/150) so the actual image dimensions are ignored.

artistwantab 12-29-2010 04:28 PM

Re: Modifying a 4.4.1 skin questions...
 
So if I eliminate...

Quote:

{if $image_x ne 0} width="{$image_x}"{/if}
{if $image_y ne 0} height="{$image_y}"{/if} alt="{$product|escape}" />


It works great.

Sometimes the solution is so simple you go right over it.

Thank you Steve.

artistwantab 01-02-2011 10:38 AM

Re: Modifying a 4.4.1 skin questions...
 
Ah Steve,

Now I know what you didn't comment on the above.

You assumed I would run into a problem because by eliminating the script I would be affecting situations in which the size was passed to other areas.

And I did. In the checkout area the images used are not the thumbnail images but the full size images and therefore are way over sized.

So what is you recommendation?

Do I write an if/else Statement that unless the customer is in the thumbnail area then size use the normal code?


All times are GMT -8. The time now is 01:24 PM.

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