Be possible add this feature in Magento core?
Here are the changes that I’ve researched, is a very basic version.
Thanks
Magento 1.3.0
Product custom option “File”, Set max upload file size
core/Mage/Catalog/Model/product/Option/Type/File.php
In line 106
/* Validate size */
$_sizes[’max’] = $option->getFileSize();
$_sizes[’min’] = 1;
if(!empty($_sizes[’max’])){
$upload->addValidator(’FilesSize’, true, $_sizes);
}
/* Validate size */
---------------
core/Mage/Catalog/Model/Product/Option.php
In line 262
$this->setData(’file_size’, ‘0’);
---------------
core/Mage/Catalog/Model/Product/Edit/Tab/Option/Options.php
In line 235
$value[’file_size’] = $option->getFileSize();
-------------------
app/design/adminhtml/default/default/template/catalog/product/edit/options/type/file.phtml
In line 36
‘<th class="last"><?php echo Mage::helper('catalog')->__('Maximum File Size') ?></th>’+
In line 44
‘<td><input class="input-text" type="text" name="product[options][{{option_id}}][file_size]" value="{{file_size}}"> <?php echo Mage::helper('catalog')->__('bytes') ?></td>’+
-----------------------
In DB
ALTER TABLE `catalog_product_option` ADD `file_size` INT( 11 ) NOT NULL AFTER `file_extension` ;
Oliver
Image Attachments
Click thumbnail to see full-size image
Signature
MagentoXP
New Quote from Cart extension
-------------------------------------------------------------------------------------------------
Magento customization & development