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

First detailed image instead of thumbnail

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 08-18-2005, 03:49 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

wrap it with

Code:
{if $images[1].image} detailed include code {/if}
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #12  
Old 08-18-2005, 04:56 AM
 
mortickles mortickles is offline
 

Newbie
  
Join Date: Aug 2005
Posts: 6
 

Default

Thanks, Shan, worked like a charm! For the information of others following this thread, I wrapped Shan's code around the following line in customer/main/product.tpl:




{include file="modules/Detailed_Product_Images/product_images.tpl" }


Now here's another question for Shan or any other expert. If I have no image at all, how do I get the "no image" graphic to appear? Right now it's blank (where the first detailed image goes, which is where the thumbnail used to be).

I really appreciate the help!
__________________
x-cart 4.0.14
Reply With Quote
  #13  
Old 08-18-2005, 04:59 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

try

Code:
{if $images eq ""} no image code here {/if}
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #14  
Old 08-18-2005, 05:26 AM
 
mortickles mortickles is offline
 

Newbie
  
Join Date: Aug 2005
Posts: 6
 

Default

Hmmm, I can't seem to get this last bit (the code to show the "no image" image) to work. I've tried inserting it in a couple of places, now the "no image" image always shows up (if there already is a detailed image, now it shows up along with the "no image" one).

Am I trying it in the wrong place? I'm assuming it should somehow go in the modules/detailed_product_images called product_images_one.tpl somewhere. (Lightspeed posted this code in the opening message of this thread.)

Again, thanks for your help! I'm awed by the quick and kind responses in this forum.
__________________
x-cart 4.0.14
Reply With Quote
  #15  
Old 08-18-2005, 09:35 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

sorry, i put

$image

instead of

$images

i updated my other post
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #16  
Old 08-18-2005, 05:59 PM
 
mortickles mortickles is offline
 

Newbie
  
Join Date: Aug 2005
Posts: 6
 

Default

Works great now. Thanks for the great mod and the great help getting it up and running!
__________________
x-cart 4.0.14
Reply With Quote
  #17  
Old 08-28-2005, 04:03 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

more like this here

http://forum.x-cart.com/viewtopic.php?p=103505
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #18  
Old 12-30-2005, 02:33 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

If in your product.tpl you want to show the thumbnail when there is not detailed images, use:

Code:
{if $active_modules.Detailed_Product_Images ne "" && $images ne ""} {include file="modules/Detailed_Product_Images/product_images_one.tpl" }{else}{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail"}{/if}
Reply With Quote
  #19  
Old 12-30-2005, 02:43 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

In my detailed images it still showed the first detailed image in the detailed section below, after using it as the thumbnail.

Looking at the code of product_image.tpl I assumed this was because images were in the database.

I modified the code to start the loop iteration after the first image to fix the problem.

Code:
{section name=image loop=$images start=1}
Reply With Quote
  #20  
Old 01-09-2006, 05:28 AM
 
airman airman is offline
 

Newbie
  
Join Date: Nov 2005
Posts: 1
 

Default

This is a great mod, but ? is there a way to also have the first detailed image show up as the thumbnail image in the catagory section also? Basically wanting to use the detailed image as the product image. Just curious if this can be also done?

Thanks
__________________
X-Cart version 4.0.14
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 05:11 AM.

   

 
X-Cart forums © 2001-2020