Creare_Optimised_Product_Addition - Version 1.0.0

Version Notes

Second Release

Download this release

Release Info

Developer Magento Core Team
Extension Creare_Optimised_Product_Addition
Version 1.0.0
Comparing to
See all releases


Code changes from version 0.1.0 to 1.0.0

app/code/local/Creare/Opa/controllers/AjaxController.php CHANGED
@@ -6,7 +6,7 @@ class Creare_Opa_AjaxController extends Mage_Core_Controller_Front_Action
6
  public function indexAction()
7
  {
8
  $dbread = Mage::getSingleton('core/resource')->getConnection('core_read');
9
- $sql = $dbread->query("SELECT * FROM catalog_product_entity WHERE attribute_set_id != '10' AND sku != '' ORDER BY CAST(sku AS SIGNED) DESC");
10
  $res = $sql->fetch();
11
 
12
  if(empty($res["sku"])){
6
  public function indexAction()
7
  {
8
  $dbread = Mage::getSingleton('core/resource')->getConnection('core_read');
9
+ $sql = $dbread->query("SELECT * FROM catalog_product_entity ORDER BY CAST(sku AS SIGNED) DESC LIMIT 1");
10
  $res = $sql->fetch();
11
 
12
  if(empty($res["sku"])){
app/design/adminhtml/default/default/template/opa/opa.phtml CHANGED
@@ -3,7 +3,7 @@
3
  var $j = jQuery.noConflict();
4
  $j(document).ready(function(){
5
  if(document.getElementById('sku').value == ""){
6
- doOptimiseProductAddition();
7
  }
8
  });
9
  </script>
3
  var $j = jQuery.noConflict();
4
  $j(document).ready(function(){
5
  if(document.getElementById('sku').value == ""){
6
+ doOptimiseProductAddition('<?php echo Mage::getBaseUrl(); ?>');
7
  }
8
  });
9
  </script>
js/opa/optimisedproductaddition.js CHANGED
@@ -33,13 +33,14 @@ function doOptimiseProductAddition(base_url){
33
  document.getElementById('inventory_stock_availability').selectedIndex = 0;
34
  document.getElementById('inventory_is_qty_decimal').selectedIndex = 1;
35
  if(ajaxRequest.responseText != ""){
 
36
  document.getElementById('sku').value = parseInt(ajaxRequest.responseText)+1;
37
  }
38
  } else {
39
  document.getElementById('sku').value = '';
40
  }
41
  }
42
- ajaxRequest.open("POST", base_url+'opa/ajax/', true);
43
  ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
44
  ajaxRequest.setRequestHeader("Content-length", params.length);
45
  ajaxRequest.setRequestHeader("Connection", "close");
33
  document.getElementById('inventory_stock_availability').selectedIndex = 0;
34
  document.getElementById('inventory_is_qty_decimal').selectedIndex = 1;
35
  if(ajaxRequest.responseText != ""){
36
+ console.log(ajaxRequest.responseText);
37
  document.getElementById('sku').value = parseInt(ajaxRequest.responseText)+1;
38
  }
39
  } else {
40
  document.getElementById('sku').value = '';
41
  }
42
  }
43
+ ajaxRequest.open("POST", base_url+'opa/ajax/index/', true);
44
  ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
45
  ajaxRequest.setRequestHeader("Content-length", params.length);
46
  ajaxRequest.setRequestHeader("Connection", "close");
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Creare_Optimised_Product_Addition</name>
4
- <version>0.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -10,11 +10,11 @@
10
  <description>Creare's Optimised Product Addition saves you time when creating new products via the admin section of a Magento Store.&#xD;
11
  &#xD;
12
  It sets your product to enabled, sets your tax class to vat (or whatever is your default tax), it also sets your product to "in-stock" and automatically generates an incremental SKU.</description>
13
- <notes>First Release</notes>
14
- <authors><author><name>E-Commerce Web Design</name><user>EcommerceWD</user><email>dev@e-commercewebdesign.co.uk</email></author></authors>
15
- <date>2011-12-22</date>
16
- <time>12:55:47</time>
17
- <contents><target name="mageetc"><dir name="modules"><file name="Creare_Opa.xml" hash="9a9e382f3ac2cf6761080fd441a7d689"/></dir></target><target name="magelocal"><dir name="Creare"><dir name="Opa"><dir><dir name="controllers"><file name="AjaxController.php" hash="f6e40b4e233c5699c80066629af91597"/></dir><dir name="etc"><file name="config.xml" hash="13a77670a475fdfc82bd4f2dd0863969"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="opa.xml" hash="19dd070a5fe4346b6ee15baa58a12438"/></dir><dir name="template"><dir name="opa"><file name="opa.phtml" hash="289c9a52310c5eac834526741cafb114"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="opa"><file name="optimisedproductaddition.js" hash="496530db5df5afc29169232f17266f28"/></dir></dir></target></contents>
18
  <compatible/>
19
- <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Creare_Optimised_Product_Addition</name>
4
+ <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
10
  <description>Creare's Optimised Product Addition saves you time when creating new products via the admin section of a Magento Store.&#xD;
11
  &#xD;
12
  It sets your product to enabled, sets your tax class to vat (or whatever is your default tax), it also sets your product to "in-stock" and automatically generates an incremental SKU.</description>
13
+ <notes>Second Release</notes>
14
+ <authors><author><name>E-Commerce Web Design</name><user>auto-converted</user><email>dev@e-commercewebdesign.co.uk</email></author></authors>
15
+ <date>2012-02-15</date>
16
+ <time>09:16:01</time>
17
+ <contents><target name="mageetc"><dir name="modules"><file name="Creare_Opa.xml" hash="9a9e382f3ac2cf6761080fd441a7d689"/></dir></target><target name="magelocal"><dir name="Creare"><dir name="Opa"><dir name="controllers"><file name="AjaxController.php" hash="d2193114ad785871a3e44ef90f847e60"/></dir><dir name="etc"><file name="config.xml" hash="13a77670a475fdfc82bd4f2dd0863969"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="opa.xml" hash="19dd070a5fe4346b6ee15baa58a12438"/></dir><dir name="template"><dir name="opa"><file name="opa.phtml" hash="8079bb4fded6ed24ec038036c47856cc"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="opa"><file name="optimisedproductaddition.js" hash="2b266d9dc627c1e1b48787622d1d9514"/></dir></dir></target></contents>
18
  <compatible/>
19
+ <dependencies/>
20
  </package>