Jump to content

how to display pack contents image


Recommended Posts

product.tpl

{if $packItems|@count > 0}

<h3>{l s='Pack content'}</h3>

{foreach from=$packItems item=packItem}

<div class="pack_content">

<a href="{$link->getProductLink($packItem.id_product, $packItem.link_rewrite, $packItem.category)}">{$packItem.name|escape:'htmlall':'UTF-8'}</a> x {$packItem.pack_quantity}

<p>{$packItem.description_short}</p>

</div>

{/foreach}

{/if}

 

$packItem.name - pack content name

$packItem.pack_quantity - packed quantity

 

how about image?

please tell me ~~ <img src= ???

Link to comment
Share on other sites

for each packItem you get the following (in 1.4.8.0, and possibly earlier). You will need to make up the image link yourself from that info.

 

id_product
id_supplier
id_manufacturer
id_tax_rules_group
id_category_default
id_color_default
on_sale
online_only
ean13
upc
ecotax
quantity
minimal_quantity
price
wholesale_price
unity
unit_price_ratio
additional_shipping_cost
reference
supplier_reference
location
width
height
depth
weight
out_of_stock
quantity_discount
customizable
uploadable_files
text_fields
active
available_for_order
condition
show_price
indexed
cache_is_pack
cache_has_attachments
cache_default_attribute
date_add
date_upd
id_lang
description
description_short
link_rewrite
meta_description
meta_keywords
meta_title
name
available_now
available_later
id_image
legend
rate
category_default
pack_quantity
allow_oosp
id_product_attribute
category
link
attribute_price
price_tax_exc
price_without_reduction
reduction
specific_prices
features
attachments
pack
packItems
nopackprice

Link to comment
Share on other sites

  • 1 year later...

product.tpl

 

 

$packItem.name - pack content name

$packItem.pack_quantity - packed quantity

 

how about image?

please tell me ~~ <img src= ???

 

try this:

<img src="{$link->getImageLink($product->link_rewrite, $packItem.id_image, 'small')}" alt="{$packItem.name|escape:'htmlall':'UTF-8'}" title="{$packItem.name|escape:'htmlall':'UTF-8'}">

change 'small' size to home, medium etc... to fit your need :)

Link to comment
Share on other sites

try this:

<img src="{$link->getImageLink($product->link_rewrite, $packItem.id_image, 'small')}" alt="{$packItem.name|escape:'htmlall':'UTF-8'}" title="{$packItem.name|escape:'htmlall':'UTF-8'}">

change 'small' size to home, medium etc... to fit your need :)

for what ps version is your solution? im asking because this thread is a bit old, so i just want to ask before someone will try to use this

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...