[SOLVED] Products module / no images?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
thomahawk
Power Poster
Power Poster
Posts: 293
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

[SOLVED] Products module / no images?

Post by thomahawk »

I just installed CMSMS 1.11.10 and the Products module 2.20.1

First thing I try, add a product. Now there is no possibility to include an image which can be used small in listings, big in detail view. No field for a product image.

In setting it says: "Image processing functions are deprecated and will be removed in a future version. Use CGSmartImage for inline image processing." (Nevertheless, there are Settings for Images.)

I installed CGSmartImage, but still no entry field for a product image appears in the "add product" form.

What surprises me is, no one seems to have a problem with that, I can not find any post asking about how to make this work. And nothing about this in help either.

Who can lead me into the right direction here?

Or should I use another solution? I just want a product list, maybe 2-3 categories) and product detail view. Add to cart, Cart view and then a simple form for the address, who sends the order as an email, no real checkout/payment process.

I first tried the Articles 0.1.3 module, but its faulty, did not even show any entry fields in "add product".

Thanks in advance for any help.
Thom
Last edited by thomahawk on Fri Mar 14, 2014 8:23 am, edited 1 time in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3479
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Products module / no images?

Post by velden »

Just installed the module to check.

Think you need to add a Field Definition of type image.

And then when you add the product there's a tab 'Fields' where you can upload your image.

In templates you can use CGSmartImage to create a thumb of the image.
User avatar
thomahawk
Power Poster
Power Poster
Posts: 293
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

Re: Products module / no images?

Post by thomahawk »

Once again, velden raides to the rescue. Thank you!

Well, I have the image entry now under fields. So thats fine. But display it in the frontend, I could not. It appears in detail view, but not in the summary - which should be a products listing.

I took over this code which displays it in detail view
<img src="{$entry->file_location}/{$field->thumbnail}" alt="{$field->value}"/>

but its not working in the summary:

In detail view it displays correctly
...uploads/Products/product_3/thumb_resizedimage300417-Titel2010.jpg

In summary the links is not complete
...uploads/Products/product_3/

Is this an issue with Pretty URL? My first thought. But then, why does it work in detail view?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3479
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Products module / no images?

Post by velden »

I don't know which fields are available in the summary action but you should note that the $field variable comes with a foreach loop:

Code: Select all

{foreach from=$entry->fields key='name' item='field'}
You could try to use the foreach loop code from detail template or use it directly

Code: Select all

<img src="{$entry->file_location}/{$entry->fields.IMAGEFIELDALIASIDONTKNOW->thumbnail}" alt=""/>
If you don't know what fields are available try:

Code: Select all

<pre>{$entry|print_r}</pre>

Code: Select all

<pre>{$entry->fields|print_r}</pre>
etc
Adding {debug} at top of summary template can be helpful too
User avatar
thomahawk
Power Poster
Power Poster
Posts: 293
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

Re: Products module / no images?

Post by thomahawk »

Thank you velden, this did it:

<img src="{$entry->file_location}/{$entry->fields.produktbild->thumbnail}" alt=""/>
User avatar
Rolf
Dev Team Member
Dev Team Member
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Products module / no images?

Post by Rolf »

thomahawk wrote:Thank you velden, this did it:

<img src="{$entry->file_location}/{$entry->fields.produktbild->thumbnail}" alt=""/>
but that is the functionality that is deprecated like you mentioned in the first post... So will be removed in a next release! Use CGSI instead.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3479
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: [SOLVED] Products module / no images?

Post by velden »

I don't think you get the complete picture.

I THINK that "Image processing functions" means the functions that e.g. make a thumbnail version of the original image. It makes sense from CG's perspective to NOT implement those functions in each and every module.

Probably (remember: I don't know this module) there's a {$entry->fields.produktbild->value} too.

Then you can use CGSmartImage in your template(s) to create the thumbnail:

{CGSmartImage src1={$entry->file_location} src2={$entry->fields.produktbild->value} filter_xxx...} (read CGSmartImage help for all the options). That gives you much more flexibility. You can use different thumbnail sizes for every template, watermark images, everything CGSmartImage supports.
Post Reply

Return to “Modules/Add-Ons”