Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

How to add a product image thumbnail to SwipeStripe product categories?


Go to End


4 Posts   3055 Views

Avatar
AdamDimech

Community Member, 6 Posts

23 February 2014 at 5:18pm

Edited: 23/02/2014 5:19pm

I have installed SwipeStripe, SwipeStripe Category, SilverStripe Gallery and SwipeStripe Gallery. What I want to do is add an image beside the description of each product in my shop on the category pages.

At present, my categories page will list each product as a hyperlink with its corresponding price. There are no images.

How do I get category pages to include product images? (Example)

For each product, I can select an image via the Gallery tab and even display a range of images on each product page (ie a thumbnail is generated). What I can't do is take that thumbnail and add it to:

/swipestripe-gallery/templates/Includes/Products.ss

Any help would be most appreciated.

Avatar
frankmullenger

Forum Moderator, 53 Posts

26 February 2014 at 9:00am

Hi Adam,

You probably want to do something like:

<% loop Products %>
$Images.First.SetWidth(200)
<% end_loop %>

Basically, Gallery_PageExtension is applied to the Product class which adds a many_many relation for Images. Hope that helps :-)

Avatar
AdamDimech

Community Member, 6 Posts

3 March 2014 at 1:03am

Thank-you so very much - that was a tremendous help.

I have written this up on my blog so that others can also benefit. The URL is http://code.adonline.id.au/swipestripe-category/

Avatar
frankmullenger

Forum Moderator, 53 Posts

3 March 2014 at 8:39am

Cheers Adam, glad that it's sorted out. Thanks for writing up a blog post!