The senario is: I have a product that will have two images.
One pr. default and one that will sometimes be there, but not allways.
When a user clicks on any product in a list, he will be shown the product with (if any) product images. What I need to do is to check if there is a second images. I have tried to use a If Defined(Ecom:Product.ImageLarge.Default), but it does´nt seem to work..
The solution Im working on is: Dandryer.dk/admin
And the template is:
Product.html in Templates->ecom->product
Developer forum
E-mail notifications
Checking if ecom product images exist
Posted on 06/09/2010 12:14:37
Replies
Nicolai Høeg Pedersen
Posted on 06/09/2010 15:20:51
You need to do if defined on Ecom:Product.ImageLarge.Clean
Ecom:Product.ImageLarge.Default is the fallback image and will allways be there...
Ecom:Product.ImageLarge.Default is the fallback image and will allways be there...
Posted on 07/09/2010 08:30:45
I have allready tried that.. The Code Im trying to use is:
And that code in turn generates the result displayed in the image, on every product.
If Defined(Ecom:Product.ImageLarge)
Ecom:Product.ImageLarge
EndIf(Ecom:Product.ImageLarge)
And that code in turn generates the result displayed in the image, on every product.
Nicolai Høeg Pedersen
Posted on 07/09/2010 09:18:56
You have to use the extension .clean on your image in your if defined.
Posted on 07/09/2010 10:54:00
I tried to use .clean and its seems to be work. Thanks for the help
Posted on 07/09/2010 10:58:45
False alarm.. It still doesnt work.. I keep getting that "dead-link" images error when I use
If Defined(Ecom:Product.ImageLarge).
If Defined(Ecom:Product.ImageLarge).
Nicolai Høeg Pedersen
Posted on 07/09/2010 11:23:41
Well - you have to use: If Defined(Ecom:Product.ImageLarge.Clean)
Posted on 07/09/2010 11:29:29
Here is the code Im using both on the danish and german solution:
And this code generates a "broken link" image below the first image. I have used these dw-tag before without any problems.. It seems that the code or tag doesnt destinguish between weather or not an image exist on the product. It´s allmost as if the if/end if tag aren´t even visible or doesn´t work..
@If Defined(Ecom:Product.ImageLarge.Clean)
@Ecom:Product.ImageLarge
@EndIf(Ecom:Product.ImageLarge.Clean)
And this code generates a "broken link" image below the first image. I have used these dw-tag before without any problems.. It seems that the code or tag doesnt destinguish between weather or not an image exist on the product. It´s allmost as if the if/end if tag aren´t even visible or doesn´t work..
Nicolai Høeg Pedersen
Posted on 07/09/2010 11:50:35
ok...
Have checked it out.
Go to management center, ecommerce, advanced, images and remove the autoscale checkbox for large images. It seems like there is a bug when this is set, and no "no-image" is set.
When you uncheck that, use your original code:
If Defined(Ecom:Product.ImageLarge)
Ecom:Product.ImageLarge
EndIf(Ecom:Product.ImageLarge)
Posted on 07/09/2010 12:37:21
thanks for the help. I appreaciate it.
Posted on 05/04/2011 15:08:22
I having the same problem right now. I can not get it only to show the image if one is selected. I get no output at all.
<!--@If Defined(@Ecom:Product:Field.ExtraBillede3.Value.Clean)-->
<!--@Ecom:Product:Field.ExtraBillede3.Value-->
<!--@EndIf(@Ecom:Product:Field.ExtraBillede3.Value.Clean)-->
<!--@If Defined(@Ecom:Product:Field.ExtraBillede3.Value.Clean)-->
<!--@Ecom:Product:Field.ExtraBillede3.Value-->
<!--@EndIf(@Ecom:Product:Field.ExtraBillede3.Value.Clean)-->
Posted on 05/04/2011 15:36:28
Hi there,
You don't need the @ in the If Defined tag in front of the tag you're testing....
Imar
You don't need the @ in the If Defined tag in front of the tag you're testing....
Imar
You must be logged in to post in the forum