Jump to content

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
Link to comment
Share on other sites

  • 6 months later...
  • 1 year later...

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...