![]() |
variantid in product.tpl?
I need to pull the variantid into the product.tpl and can't make it happen. Can anyone help me on this one?
You would think it is a variation of the call {$v.variantid} like in the check_options.tpl which shows up in the product.tpl. Ideas? Thanks, Mike |
{$variants[k].variantid} works for me, but I've done some funky stuff to my product.tpl
See if that works for ya :wink: |
instinctual,
Thanks- but no cigar. I guess the "k" is your item, but even replacing that with my "item" doesn't pull anything. There must be a way as the dropdown is loaded with variantid's but I can't see to pull the # out to use in in my image swap a href. Ideas? Thanks for your help. Just in case, here's the code I am trying to use to include the variantid. You can see it in the <a href>: Code:
{assign var="image_counter" value=0} |
|
To call the variantid, I simply needed to refer to it by name:
Code:
{$variants[swatch].variantid} But, does anyone know what statement I can wrap around my A HREF so that if there isn't an image for the variant, it isn't a link? The color swatch uses an onclick, but how can I take advantage of the checkoptions and do this for a plain link? That is my final issue in the progression of my auto-generated swatches.... Thanks for your help, Mike Code:
{assign var="image_counter" value=0} |
I'm wondering if something like this would do the trick:
Code:
I'm assuming you're using that image counter to count the # of images in your swatch, not sure. If so, if that eq 0, you have no image? |
Close- it gives me the "Image not Available" image. But, what I really need is there to be no link to make the swap. This is becuase we add many items where images are not available for every variant at the time of loading.
We are adding variant images daily, but would love to have the link present or not without having to make product by product if statements. So instead of changing the image to not present, it would not just not offer the link and show the default. Thanks, Mike |
Oh I see what you're saying - use this then:
Code:
{if $image_counter ne ''} |
I still an getting the no image available and a link is present. The if statement isn't needed for the image, it's needed for the link and whether to show the variant name as a link or as text.
It's a tricky call as it needs to basically say "If there is an image for that particular variant" be link otherwise, no. It works to call the swap of the image, but only when images exist. For items with no variant images, it needs to remain text. Tough... always something. Thanks Instinctual for giving it a go. - Mike |
All times are GMT -8. The time now is 10:13 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.