Jump to content
Sign in to follow this  
jondrew

display attachments on category page

Recommended Posts

Hi,

I would like to display an attachment on a product on the category page. I've tried to take the code found on product.tpl and add it in to product-list.tpl file but this doesn't seem to work, I've alaso tried adding the following to the code to try and get it to pull the attachments into the product list file but with no luck:


<!-- product's features -->
{php}
global $cookie;
$product=$this->get_template_vars('product'); // nb $this IS smarty
$myprod = new Product($product['id_product']);
$features = $myprod->getAttachments(intval($cookie->id_lang));
$this->assign('attachments',$attachments);
{/php}
{if $attachments}

{foreach from=$attachments item=attachment}

{$attachment.name|escape:'htmlall':'UTF-8'}

{$attachment.description|escape:'htmlall':'UTF-8'}


{/foreach}

{/if}


I used the above to pull in product features but won't seem tot work fro attachments. I'm using version 1.3.

Any help is much appreciated.

Thanks

Jon

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More