Manufacturer_Model_Number - Version 1.2

Version Notes

I changed the Make field to not required in admin when adding a new MMN item. To make it possible to add an universal item with manufacturer, model and number empty.
Also added JavaScript code to disable the Go button if no option selected.

Download this release

Release Info

Developer Magento Core Team
Extension Manufacturer_Model_Number
Version 1.2
Comparing to
See all releases


Code changes from version 1.1 to 1.2

app/code/local/Pektsekye/Mmn/Block/Adminhtml/Mmn/Edit/Tab/Form.php CHANGED
@@ -16,7 +16,7 @@ class Pektsekye_Mmn_Block_Adminhtml_Mmn_Edit_Tab_Form extends Mage_Adminhtml_Blo
16
 
17
  $fieldset->addField('manufacturer', 'text', array(
18
  'label' => Mage::helper('mmn')->__('Printer Manufacturer'),
19
- 'required' => true,
20
  'name' => 'manufacturer',
21
  ));
22
 
16
 
17
  $fieldset->addField('manufacturer', 'text', array(
18
  'label' => Mage::helper('mmn')->__('Printer Manufacturer'),
19
+ 'required' => false,
20
  'name' => 'manufacturer',
21
  ));
22
 
app/code/local/Pektsekye/Mmn/controllers/Adminhtml/MmnController.php CHANGED
@@ -232,7 +232,7 @@ class Pektsekye_Mmn_Adminhtml_MmnController extends Mage_Adminhtml_Controller_ac
232
  Mage::getSingleton('adminhtml/session')->addError(Mage::helper('mmn')->__('Invalid file upload attempt'));
233
  }
234
 
235
- if (!empty($v[0]) && is_numeric($v[0]) && !empty($v[1])) {
236
 
237
  $v[1] = trim(preg_replace('/[^\w\s-]/','',$v[1]));
238
  $v[2] = trim(preg_replace('/[^\w\s-]/','',$v[2]));
232
  Mage::getSingleton('adminhtml/session')->addError(Mage::helper('mmn')->__('Invalid file upload attempt'));
233
  }
234
 
235
+ if (!empty($v[0]) && is_numeric($v[0])) {
236
 
237
  $v[1] = trim(preg_replace('/[^\w\s-]/','',$v[1]));
238
  $v[2] = trim(preg_replace('/[^\w\s-]/','',$v[2]));
app/design/frontend/default/default/template/mmn/mmn.phtml CHANGED
@@ -140,7 +140,7 @@ function pop_number(){
140
  echo Mage::getUrl('mmn/product/list');
141
  }
142
 
143
- ?>" method="get">
144
  <?php echo $hidden; ?>
145
  <div class="content">
146
  <select name="Manufacturer" onChange="pop_model();" style="width: 100%">
140
  echo Mage::getUrl('mmn/product/list');
141
  }
142
 
143
+ ?>" method="get" onsubmit="return document.manufacturer_model_number.Manufacturer.value != 'all' ? true : false">
144
  <?php echo $hidden; ?>
145
  <div class="content">
146
  <select name="Manufacturer" onChange="pop_model();" style="width: 100%">
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Manufacturer_Model_Number</name>
4
- <version>1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -11,11 +11,12 @@
11
 
12
  HOW TO USE:
13
  Go to your Magento admin panel -&gt;Mmn -&gt; Manage Items and add MMN items to all your products.</description>
14
- <notes>Locale language file was added. So the front end box can be translated now</notes>
 
15
  <authors><author><name>Stanislav</name><user>auto-converted</user><email>pektsekye@gmail.com</email></author></authors>
16
- <date>2009-08-16</date>
17
- <time>23:59:44</time>
18
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mmn.xml" hash="ccce6ec54f314a5cba835ed503aab154"/></dir><dir name="template"><dir name="mmn"><file name="importExport.phtml" hash="23a7b58d473f29f66b943f5ca678dd8f"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="mmn.xml" hash="8252b14ca06d69664202ed9cbdd7a41b"/></dir><dir name="template"><dir name="mmn"><file name="mmn.phtml" hash="6760228899a34961124a2cffd791532a"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Pektsekye_Mmn.csv" hash="3b26c323d14dbeb131a21770ab5de639"/></dir></target><target name="mageetc"><dir name="modules"><file name="Pektsekye_Catalog.xml" hash="89e3ec6056b4ba53d06df1370b347d42"/><file name="Pektsekye_CatalogSearch.xml" hash="c1152b8350ae4906db9736369c8e5edf"/><file name="Pektsekye_Mmn.xml" hash="44dbf66ea36b134b159edb1d51878a2a"/></dir></target><target name="magelocal"><dir name="Pektsekye"><dir name="Catalog"><dir name="Model"><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Category.php" hash="581fafac71ce0965cb48543bc8b26d80"/></dir></dir></dir><file name="Category.php" hash="418df457636d063fbcbc0e7266b2cf0b"/></dir></dir><dir name="CatalogSearch"><dir name="Model"><file name="Layer.php" hash="92da80a8187107d6eeebd25eaa718655"/></dir></dir><dir name="Mmn"><dir name="Block"><dir name="Adminhtml"><dir name="Mmn"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="c43285bb92566f85d1451297cb83f81a"/></dir><file name="Form.php" hash="3e2719346ecd021383a091efa5621611"/><file name="Tabs.php" hash="566c0485654104d853ccc55c78336cc4"/></dir><file name="Edit.php" hash="75610373c3eb5e335a3ff344716a1ea3"/><file name="Grid.php" hash="f0c4dbcbc1272a417780865d959da86f"/><file name="ImportExport.php" hash="a475879ab7f6c831aa01fc9927fda212"/></dir><file name="Mmn.php" hash="6ff0685d30001b1d32511bc0cd091c02"/></dir><dir name="Product"><file name="Result.php" hash="00641875e34a3bc2851f6785a9975f81"/></dir><file name="Mmn.php" hash="9c6bc640466ef349fc9fac3023f9f332"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MmnController.php" hash="23e03d59bdf2065d3d6bd9b3e6edd36b"/></dir><file name="IndexController.php" hash="aa43963369f7166820a20bec5c2d1c8b"/><file name="ProductController.php" hash="6f36953551c101f2d0e890b2569b8444"/></dir><dir name="etc"><file name="config.xml" hash="d04db3df66ea8f2f26da21101537392b"/><file name="system.xml" hash="9d2b000bba821307bde419a4e2b2fb13"/></dir><dir name="Helper"><file name="Data.php" hash="8b54f296fe7c06784a9fba900f9b0c35"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Mmn"><file name="Collection.php" hash="7a9240e2cef54b5e1796fb12d2d9369f"/></dir><file name="Mmn.php" hash="c67333dbda050636e9a85e7cfd963bdb"/></dir><file name="Mmn.php" hash="cef143b02735b99c273a8188efee3a38"/><file name="Status.php" hash="7706d422d80badeac80e81985fc2fe79"/></dir><dir name="sql"><dir name="mmn_setup"><file name="mysql4-install-0.1.0.php" hash="e0b1a7ec159b3ff8aa0d16cc4c3d32a0"/></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies/>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Manufacturer_Model_Number</name>
4
+ <version>1.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
11
 
12
  HOW TO USE:
13
  Go to your Magento admin panel -&gt;Mmn -&gt; Manage Items and add MMN items to all your products.</description>
14
+ <notes>I changed the Make field to not required in admin when adding a new MMN item. To make it possible to add an universal item with manufacturer, model and number empty.
15
+ Also added JavaScript code to disable the Go button if no option selected.</notes>
16
  <authors><author><name>Stanislav</name><user>auto-converted</user><email>pektsekye@gmail.com</email></author></authors>
17
+ <date>2009-08-28</date>
18
+ <time>02:38:24</time>
19
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mmn.xml" hash="ccce6ec54f314a5cba835ed503aab154"/></dir><dir name="template"><dir name="mmn"><file name="importExport.phtml" hash="23a7b58d473f29f66b943f5ca678dd8f"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="mmn.xml" hash="8252b14ca06d69664202ed9cbdd7a41b"/></dir><dir name="template"><dir name="mmn"><file name="mmn.phtml" hash="acb90c007ea2fe8ed684bd5550f4b724"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Pektsekye_Mmn.csv" hash="3b26c323d14dbeb131a21770ab5de639"/></dir></target><target name="mageetc"><dir name="modules"><file name="Pektsekye_Catalog.xml" hash="89e3ec6056b4ba53d06df1370b347d42"/><file name="Pektsekye_CatalogSearch.xml" hash="c1152b8350ae4906db9736369c8e5edf"/><file name="Pektsekye_Mmn.xml" hash="44dbf66ea36b134b159edb1d51878a2a"/></dir></target><target name="magelocal"><dir name="Pektsekye"><dir name="Catalog"><dir name="Model"><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Category.php" hash="581fafac71ce0965cb48543bc8b26d80"/></dir></dir></dir><file name="Category.php" hash="418df457636d063fbcbc0e7266b2cf0b"/></dir></dir><dir name="CatalogSearch"><dir name="Model"><file name="Layer.php" hash="92da80a8187107d6eeebd25eaa718655"/></dir></dir><dir name="Mmn"><dir name="Block"><dir name="Adminhtml"><dir name="Mmn"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="29d87dea7c2b18cf267f1ef0776fcb94"/></dir><file name="Form.php" hash="3e2719346ecd021383a091efa5621611"/><file name="Tabs.php" hash="566c0485654104d853ccc55c78336cc4"/></dir><file name="Edit.php" hash="75610373c3eb5e335a3ff344716a1ea3"/><file name="Grid.php" hash="f0c4dbcbc1272a417780865d959da86f"/><file name="ImportExport.php" hash="a475879ab7f6c831aa01fc9927fda212"/></dir><file name="Mmn.php" hash="6ff0685d30001b1d32511bc0cd091c02"/></dir><dir name="Product"><file name="Result.php" hash="00641875e34a3bc2851f6785a9975f81"/></dir><file name="Mmn.php" hash="9c6bc640466ef349fc9fac3023f9f332"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MmnController.php" hash="fd525445bccbf190fa92566605537686"/></dir><file name="IndexController.php" hash="aa43963369f7166820a20bec5c2d1c8b"/><file name="ProductController.php" hash="6f36953551c101f2d0e890b2569b8444"/></dir><dir name="etc"><file name="config.xml" hash="d04db3df66ea8f2f26da21101537392b"/><file name="system.xml" hash="9d2b000bba821307bde419a4e2b2fb13"/></dir><dir name="Helper"><file name="Data.php" hash="8b54f296fe7c06784a9fba900f9b0c35"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Mmn"><file name="Collection.php" hash="7a9240e2cef54b5e1796fb12d2d9369f"/></dir><file name="Mmn.php" hash="c67333dbda050636e9a85e7cfd963bdb"/></dir><file name="Mmn.php" hash="cef143b02735b99c273a8188efee3a38"/><file name="Status.php" hash="7706d422d80badeac80e81985fc2fe79"/></dir><dir name="sql"><dir name="mmn_setup"><file name="mysql4-install-0.1.0.php" hash="e0b1a7ec159b3ff8aa0d16cc4c3d32a0"/></dir></dir></dir></dir></target></contents>
20
  <compatible/>
21
  <dependencies/>
22
  </package>