Close

Link to attachments in product detail

cbaldo
5 years ago
#15113 Quote
Avatar
  • 9
Hi
A customer would like to have a link to a specific type of attachment (a datasheet) even in the product detail box. There is only one datasheet for each product and there are two type pf attachments: manuals and datasheets. Is it possible to satisfy this request?

thank you

Claudio
anton_ivanov
5 years ago
#15114 Quote
Avatar
  • Moderator
  • 277
Hello Claudio,

It can be possible. There are a lot of limitations if you try to achieve this.
The limitations are as follows:
1. All of the attachments mapped to the products will be shown not only a certain type of attachments
2. You won't be able to say "show attachments in the product box of only on these products" ( well you can but it requires you manually enumerate the product ids and check against them)
3. You should not have any other widgets mapped to the widget zone that the attachments are mapped to.

If those aren't a problem for you, you can do the following thing:

Edit the ~/Views/Shared/_ProductBox.cshtml (or ~/Themes/YourTheme/Views/Shared/_ProductBox.cshtml if you are using a theme where YourTheme is your theme's name) view and put the following code somewhere that will fit your needs and styling:

@await Component.InvokeAsync("Widget", new { widgetZone = "your_attachments_widget_zone", additionalData = Model.Id });


Replace the "your_attachments_widget_zone" with the widget zone your attachments are mapped to.

Hope that helps!
Regards,
Anton Ivanov
Nop-Templates.com