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

Sorry, no product image for "XYZ" - grey background


Go to End


6 Posts   2848 Views

Avatar
growin

Community Member, 41 Posts

3 November 2009 at 12:48am

I've just installed the ecommerce module and added a few hundred products but am having some difficulty with an odd grey background behind "Sorry, no product image for "xyz" and behind product images. I have no clue where to look to change this. It'd almost be better to remove this all together if I could. I'm using the standard theme Black Candy. Anyone point me in the right direction to the documentation for the ecommerce module? Here's an example of what I mean: http://www.tscnursery.com/broadleaved-evergreens/ I also had a few products that belong to more than one ProductGroup but when it gets added to the other group, it is completely out of alpha order. Any way to keep things in alpha-order? Any other suggestion/comments are welcome. Thanks!

Avatar
growin

Community Member, 41 Posts

3 November 2009 at 10:27am

Ok, I was able to find out where this comes from in the ProductGroupItem.ss with this statement: <img src="ecommerce/images/productPlaceHolderThumbnail.gif" alt="<% sprintf(_t("NOIMAGE","Sorry, no product image for &quot;%s&quot;"),$Title) %>" /></a>

So how do I change this so that there is no reference to an image, no little grey box as if an image should be there, etc? I've been trying all kinds of changes but none make it vanish.

Thanks!

Avatar
rbquirke

Community Member, 70 Posts

4 November 2009 at 5:18am

Well you could remove the img tag
The related css styling will be in the ecommerce/css/ folder. Should be called ProductGroup.css I think.

Avatar
growin

Community Member, 41 Posts

5 November 2009 at 7:56pm

Would that remove all images or adjust the ones that aren't there?

Avatar
rbquirke

Community Member, 70 Posts

5 November 2009 at 8:07pm

ok, I assume that you don't understand how the template code works?
No problem

<% if Image %>
		<a href="$Link" title="<% sprintf(_t("READMORE","Click here to read more on &quot;%s&quot;"),$Title) %>"><img src="$Image.Thumbnail.URL" alt="<% sprintf(_t("IMAGE","%s image"),$Title) %>" /></a>
	<% else %>
		<a href="$Link" title="<% sprintf(_t("READMORE"),$Title) %>"><img src="ecommerce/images/productPlaceHolderThumbnail.gif" alt="<% sprintf(_t("NOIMAGE","Sorry, no product image for &quot;%s&quot;"),$Title) %>" /></a>
	<% end_if %>

if you see the part where it says "if Image", that checks to see if the product has an image, and if so, runs the next line. Leave that bit alone.

then there is the "else" line, so if it doesn't have an image, it runs the next line with the productPlaceHolderThumbnail.gif etc.
Removing this line would therefore only affect products with no images.

Make sense? :)

A detailed explanation of how templates work can be found here: http://doc.silverstripe.org/doku.php?id=templates
You might find some useful info to help you in other places

Avatar
growin

Community Member, 41 Posts

5 November 2009 at 11:20pm

Well that did it. Thank You!!!!! I'm not sure why I didn't see those lines above the ones I mentioned. Thank you for pointing that all out. The ecommerce appearance looks so much better. http://www.tscnursery.com/ferns/ (no messy coding showing where there isn't an image) I kinda have an understanding of the templates and code but SS is new. Only had experience with oscommerce.