I've tried it with and without echo/return=true, unfortunately, it returns nothing in either case. Suggestions? Clues? I'm all ears!
If you're curious, I'm employing it at http://dev.seedplanted.org/shop to return some fancy hover previews, similar to many stock photo sites. The URL should be injected into the rel attribute of each thumbnail's enclosing anchor tag.
Well, I'm close, at least. Regardless of whether I specify 'small', 'thumbnail' or 'image' it returns the same file.
Granted, I have set the thumbnail and gallery image dimensions to be the same, but even so, what I'm trying to get is the original, un-modified image. Is there a way to pull that via template tag? (I assume their must, as it's pulled in to the thickbox link somehow)
Why does the loop default to thumbs only, shouldn't the loop pull all images by default, leaving it up to the image tag to specify the image type to return (especially since the image tag defaults to thumbnails, anyhow)? That's just the logic my own mind follows, your mileage may vary.
Get URL of product image via template tag
Profile
Hey All,
I'm having a bit of trouble retrieving the URL for the full-size product image within the category.php template. Have a lake at the code below:
<?php echo shopp('product','image','type=image&property=url&return=true'); ?>
I've tried it with and without echo/return=true, unfortunately, it returns nothing in either case. Suggestions? Clues? I'm all ears!
If you're curious, I'm employing it at http://dev.seedplanted.org/shop to return some fancy hover previews, similar to many stock photo sites. The URL should be injected into the rel attribute of each thumbnail's enclosing anchor tag.
Profile
Alright, I neglected the part of the doc that insisted this tag be used within the images loop. It works just fine. What a n00b.
Here's where I'm at now:
<?php if(shopp('product','has-images')): while(shopp('product','images')): shopp('product','image','type=image&property=url'); endwhile; endif; ?>Profile
Well, I'm close, at least. Regardless of whether I specify 'small', 'thumbnail' or 'image' it returns the same file.
Granted, I have set the thumbnail and gallery image dimensions to be the same, but even so, what I'm trying to get is the original, un-modified image. Is there a way to pull that via template tag? (I assume their must, as it's pulled in to the thickbox link somehow)
Profile
<?php if(shopp('product','has-images','type=image')) : ?>
...
<?php endif; ?>
Profile
Awesome, thanks! Works like a champ.
Why does the loop default to thumbs only, shouldn't the loop pull all images by default, leaving it up to the image tag to specify the image type to return (especially since the image tag defaults to thumbnails, anyhow)? That's just the logic my own mind follows, your mileage may vary.
Profile
I am glad it works.
You could also say, why load it all if you only need one.
There are so many ways to Rome:)
Profile
Oh so true. Makes no nevermind to me!
Reply
You must log in to post.