2

I want to add some new functionality on the administration product edit page; providing the ability to upload videos and audio.

How can I achieve this?

0

3 Answers 3

2

you can upload whatever from there if you remove the restrictions of file types from uploader. Little grep displays how it is done currently in core code:

grep 'setAllowedExtensions' app/code -rsn
app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php:40:            $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php:62:                $uploader->setAllowedExtensions($this->_getAllowedExtensions());
app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php:58:            $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Image.php:57:            $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php:281:            $uploader->setAllowedExtensions($allowed);
app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http.php:78:            $uploader->setAllowedExtensions(array('csv','xml'));
app/code/core/Mage/Dataflow/Model/Convert/Iterator/Http.php:49:            $uploader->setAllowedExtensions(array('csv','xml'));
app/code/core/Mage/Dataflow/Model/Profile.php:150:                    $uploader->setAllowedExtensions(array('csv','xml'));
app/code/core/Mage/Dataflow/Model/Session/Adapter/Http.php:50:            $uploader->setAllowedExtensions(array('csv','xml'));
app/code/core/Mage/ImportExport/Model/Import/Uploader.php:61:        $this->setAllowedExtensions(array_keys($this->_allowedMimeTypes));
app/code/core/Mage/XmlConnect/Helper/Image.php:93:            $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png')); 

rest is just implementing the file display in frontend with various plugins available on the internet. As your question is very abstract (try to ask better) this is the minimum that I can provide to answer it.

2

There are 2 ways to go:

  1. Just put the html embed code in the product description attribute. Since it accepts html, you can include audio, video or any other media type in it.
  2. Use a module that allows you to add media. I won't post links since there are a ton of modules (most of them free) that will add this feature.

Both ways are good, the best one depending on your requirements. No point in actually developing this feature yourself.

0

You can have a look at the opensource N98_InfoFiles module. (self-link)

Not the answer you're looking for? Browse other questions tagged or ask your own question.