Product Asset (Besides Images)
- igavemybest
- Captain (CAPT)
- Posts: 388
- Joined: Sun Apr 06, 2008 5:47 pm
Product Asset (Besides Images)
Is there an easy way to add an asset (a file) to a product. This would work great for a spec sheet or a sales flyer. Any suggestions?
Re: Product Asset (Besides Images)
Well we have the support to keep assets for products in code and database but this functionality is not exposed to UI. So all you need is to create some sort of UI to handle the assets. Here is sample code about how to add product asset
Code: Select all
//SUPPOSE WE LOAD PRODUCT WITH ID=1
Product product = ProductDataSource.Load(1);
//CREATE NEW ASSET RECORD FOR README.PDF FILE
ProductAsset productAssest = new ProductAsset();
productAssest.AssetUrl = "http://xyz.tld/readme.pdf";
//ASSOCIATE ASSET WITH PRODUCT
product.Assets.Add(productAssest);
product.Save();
-
- Lieutenant (LT)
- Posts: 77
- Joined: Mon Apr 19, 2010 4:52 pm
Re: Product Asset (Besides Images)
I am not sure what your code does, mazhar. I can see that it adds a URL as an asset to the product DB (essentially a pointer to the pdf file), but how would you use it?
We have "datasheets" (specifications) on a large number of our products.
What we have done is one of two things depending on the location of the datasheet.pdf itself.
1. If we are maintaining the pdf file on our server, we use FTP to upload the pdf into a folder which we have named using a sort of standard. For example we will have
~Assets/info/[product name or product category]/xxxx.pdf
Then in the description of the product we would use that URL in a "href =.." to create a hyperlink for the customer to click on.
Example in the description might be:
<p>You may download the datasheet for this item <a href="~Assets/info/product/datasheet.pdf">here.</a>
2. If we are pointing to the manufacturer's server then it's really simple, but change the above example to point to the URL on their site.
Are you suggesting there is a better way?
Makes me think also that there might be a better way to handle all sorts of "boilerplate" information. In our descriptions we have a section that is pretty consistent for almost all products on "Warranty and Service" (we have two versions of this essentially and all products have version A or version B). We also have several products, kits in most cases, where there is common information in the descriptions and it would be great to only have to change one copy and have it permeate the rest of the products that have that same common information.
We have "datasheets" (specifications) on a large number of our products.
What we have done is one of two things depending on the location of the datasheet.pdf itself.
1. If we are maintaining the pdf file on our server, we use FTP to upload the pdf into a folder which we have named using a sort of standard. For example we will have
~Assets/info/[product name or product category]/xxxx.pdf
Then in the description of the product we would use that URL in a "href =.." to create a hyperlink for the customer to click on.
Example in the description might be:
<p>You may download the datasheet for this item <a href="~Assets/info/product/datasheet.pdf">here.</a>
2. If we are pointing to the manufacturer's server then it's really simple, but change the above example to point to the URL on their site.
Are you suggesting there is a better way?
Makes me think also that there might be a better way to handle all sorts of "boilerplate" information. In our descriptions we have a section that is pretty consistent for almost all products on "Warranty and Service" (we have two versions of this essentially and all products have version A or version B). We also have several products, kits in most cases, where there is common information in the descriptions and it would be great to only have to change one copy and have it permeate the rest of the products that have that same common information.
- igavemybest
- Captain (CAPT)
- Posts: 388
- Joined: Sun Apr 06, 2008 5:47 pm
Re: Product Asset (Besides Images)
Yes, I was looking more for a backend, "Browse" button, with the ability to upload one or more files, then an automated way to display the files associated with the product on the frontend. Obviously if it was just a link, I could add a link in the HTML description.