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

thumbnails in cart pages

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #21  
Old 10-28-2008, 01:16 PM
 
Larry Stanford Larry Stanford is offline
 

Member
  
Join Date: Oct 2008
Posts: 24
 

Default Re: thumbnails in cart pages

Thank you.. that was quick and easy!!
__________________
X Cart Gold 4.1.11
Reply With Quote
  #22  
Old 11-17-2008, 08:19 AM
 
fropirate fropirate is offline
 

Member
  
Join Date: May 2008
Posts: 24
 

Default Re: thumbnails in cart pages

I've found a problem with the fix I posted. When you add a product to the cart that is a variant and has it's own image defined by the variant, the product thumbnail that shows up is incorrect. My cart seems to be displaying seemingly random product thumbnails in the cart for products with specific variant images. I don't have a fix for this short of returning to how the cart was before.

Edit: Fixed

In order to resolve this issue, I had to make it so it called the thumbnail for the productid, and not the variantid. So after you've done my previous fix, you need to do this:

(I do NOT recommend doing this if you want your variant images displayed)

Find in cart.tpl:
Code:
{assign var="imageid" value=$products[product].variantid}{else}{assign var="imageid" value=$products[product].productid}


Replace with:
Code:
{assign var="imageid" value=$products[product].productid}{else}{assign var="imageid" value=$products[product].productid}

This will make it so the thumbnail image that appears in your cart for regular products, and for products with variant images, all display the main product thumbnail image.
__________________
X-Cart Gold 4.1.10
www.oldworlddistributors.com - Live Store
www.coppercakestands.com - Live Store
--
My Website - www.frodesigns.com
Reply With Quote
  #23  
Old 03-21-2009, 10:44 AM
 
rshandel rshandel is offline
 

Senior Member
  
Join Date: Feb 2009
Posts: 125
 

Default Re: thumbnails in cart pages

Did anyone every come up with a solution to this problem? It seems that without being able to add thumbnail images to variants, you'd have to resize the product images in the cart.

This is how I did it:

I created an new template call cart_product_thumbnail.tpl:

and made the width and height to the desired size (in this example "75):

{if $config.Appearance.show_thumbnails eq "Y"}<img{if $id ne ''} id="{$id}"{/if} src="{if $tmbn_url}{$tmbn_url}{else}{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?type={$type|default:"T"}&amp;id={$produc tid}{/if}"
{if $image_x ne 0} width="75"{/if}{if $image_y ne 0} height="75"{/if}
alt="{$product|escape}" />{/if}


I changed the code in cart.tpl to call the new template:

before:


<a href="product.php?productid={$products[product].productid}">{if $products[product].is_pimage eq 'W' }{assign var="imageid" value=$products[product].variantid}{else}{assign var="imageid" value=$products[product].productid}{/if}{include file="product_thumbnail.tpl" productid=$imageid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].pimage_url type=$products[product].is_pimage}</a>

after:

<a href="product.php?productid={$products[product].productid}">{if $products[product].is_pimage eq 'W' }{assign var="imageid" value=$products[product].variantid}{else}{assign var="imageid" value=$products[product].productid}{/if}{include file="cart_product_thumbnail.tpl" productid=$imageid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].pimage_url type=$products[product].is_pimage}</a>

It does produce grainy images but at least it will show the customer the correct product image in the shopping cart.
__________________
x-cart 4.1.12
x-cart 4.2
Reply With Quote
  #24  
Old 03-31-2009, 05:46 PM
 
cosy cosy is offline
 

Advanced Member
  
Join Date: Mar 2009
Posts: 79
 

Default Re: thumbnails in cart pages

Quote:
Originally Posted by fropirate
Hi everyone,

I was able to make thumbnails instead of full sized images display in the cart so they aren't jaggy. It was really easy actually.

in /customer/main/cart.tpl find:
Code:
{include file="product_thumbnail.tpl" productid=$imageid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].pimage_url type=$products[product].is_pimage}

and repalce with:

Code:
{include file="product_thumbnail.tpl" productid=$imageid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].timage_url type=$products[product].is_timage}



all i had to do was replace the two "pimage" with "timage"

pls explain bit new to all?
__________________
Version 4.2.0
Testing v 4.4
Reply With Quote
  #25  
Old 11-03-2009, 07:55 PM
 
lash lash is offline
 

Senior Member
  
Join Date: Oct 2006
Posts: 138
 

Default Re: thumbnails in cart pages

Quote:
Originally Posted by cosy
pls explain bit new to all?

Use a ftp program. Go to skin1 click customer, then click main and find the above cart.tpl. Open that file and locate the code

products[product].product tmbn_url=$products[product].pimage_url type=$products[product].is_pimage}


Replace the two "pimage" with "timage". Basically you just have to change "p" with "t". Save the file as cart.tpl and upload to the same location (/customer/main/cart.tpl ), just overwrite the file and you are done.
__________________
4.1.9
www.lash.se
Reply With Quote
  #26  
Old 12-15-2009, 01:29 PM
 
Scott DeToffol Scott DeToffol is offline
 

Senior Member
  
Join Date: Apr 2005
Location: Minneapolis, MN
Posts: 174
 

Default Re: thumbnails in cart pages

I'm getting no thumbnail at all in the cart, images are fine everywhere else on the site (sundogtrading.com).

Is there some real basic code I can use in cart.tpl that will show the thumbnail?

Here is my current code:

Code:
<tr><td class="PListImgBox"> <a href="product.php?productid={$products[product].productid}">{if $products[product].is_pimage eq 'W' }{assign var="imageid" value=$products[product].variantid}{else}{assign var="imageid" value=$products[product].productid}{/if}{include file="product_thumbnail.tpl" productid=$imageid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].timage_url type=$products[product].is_timage} </a> {if $active_modules.Special_Offers ne "" and $products[product].have_offers} {include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]} {/if} </td>
__________________
Scott DeToffol
Online Marketing and E-Commerce Consulting in Minneapolis

X-Cart Gold Version 4.1.9 for www.sundogtrading.com
X-Cart Pro Version 4.2.3 for www.heavyglare.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not 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:13 PM.

   

 
X-Cart forums © 2001-2020