I'm using Products 2.18.4. I do realise that there is a newer version but...
I need the Attributes function that is not available in the latest version, so...
My Problem...
When I 'Add Hierarchy Item', I specify an image to upload with the 'Image' Choose File function.
How do I get that image to display in the Summary mode?
I cannot see what I need to do in either the Summary or Hierarchy Report templates.
Anyone have experience with this?
[SOLVED] How do I display Image in Products Hierarchy
-
CapereSpiritum
- Forum Members

- Posts: 223
- Joined: Wed Dec 28, 2011 12:11 pm
[SOLVED] How do I display Image in Products Hierarchy
Last edited by CapereSpiritum on Thu Aug 29, 2013 5:40 pm, edited 1 time in total.
Re: How do I display Image in Products Hierarchy
I would put {get_template_vars} in the products template to see what fields are available...
-
CapereSpiritum
- Forum Members

- Posts: 223
- Joined: Wed Dec 28, 2011 12:11 pm
Re: How do I display Image in Products Hierarchy
Hi Doc
Did that and got this... Can't see anything that helps tho...
Did that and got this... Can't see anything that helps tho...
app_name = CMS
cgsimple = Object
ccuser = Object
feu_smarty = Object
sitename = Ticky Turner
content_obj = Object
content_id = 57
page = Shopping
page_id = Shopping
page_name = Shopping
page_alias = Shopping
position = 3
friendly_position = 3
lang = en_US
encoding = utf-8
smarty =
gcb_params = Array (1)
actionid = m55afb
actionparams = Array (3)
returnid = 57
actionmodule = Products
menuparams = Array (4)
count = 5
nodelist = Array (5)
number_of_levels = 10000
node = Object
classes = menuactive
mod = Object
Products = Object
items = Array (1)
totalcount = 1
itemcount = 1
pagetext = Page
oftext = Of
pagecount = 1
curpage = 1
firstlink = <<
prevlink = <
lastlink = >>
nextlink = >
currency_symbol = £
weight_units = lbs
entry = Object
SCRIPT_NAME = /index.php
Re: How do I display Image in Products Hierarchy
Probably it's somewhere in the Products of Items variable.
I often use the {debug} tag inside summary/details templates (though never used products) to see what's in the items. You need to enable popups in your browser.
I often use the {debug} tag inside summary/details templates (though never used products) to see what's in the items. You need to enable popups in your browser.
Re: How do I display Image in Products Hierarchy
To get a list of items and probably the fields too try
{$items|@print_r}.
*edited: missed the $... so its $items, not items
{$items|@print_r}.
*edited: missed the $... so its $items, not items
Last edited by Jo Morg on Wed Aug 28, 2013 5:26 pm, edited 1 time in total.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: How do I display Image in Products Hierarchy
Now if you do what Jo Morg says you will see what is available in Products items...
-
CapereSpiritum
- Forum Members

- Posts: 223
- Joined: Wed Dec 28, 2011 12:11 pm
Re: How do I display Image in Products Hierarchy
Sorted...
Although I suspect there was an easier way, I added a little code after {* IMAGE *}
Although I suspect there was an easier way, I added a little code after {* IMAGE *}
Code: Select all
{if !isset($hdepth) && isset($hierarchy_item)}
<h3>Hierarchy Data for {$hierarchy_item.name} ({$hierarchy_item.id})</h3>
{/if}
{if !isset($hdepth)}{assign var='hdepth' value='0'}{/if}
<ul class="products_hierarchy_level{$hdepth}">
{foreach from=$hierdata key='key' item='item'}
{strip}
<div id="hierpic">
<li {if isset($active_hierarchy) and $item.id == $active_hierarchy} {/if}>
<h4><a href="{$item.url}" title="{$item.name}">{$item.name}</a></h4>
{* IMAGE *} <a href="{$item.url}"><img src="uploads/Products/hierarchy/{$item.image}" title="{$item.name}" /></a>
{if isset($item.children) } {include file=$smarty.template hierdata=$item.children hdepth=$hdepth+1} {/if}
</li>
</div>
{/strip}
{/foreach}
</ul>

