Designcomplex_Producturlkey - Version 1.0.0

Version Notes

system.xml coders wanted!

Download this release

Release Info

Developer Thomas Klosinsky
Extension Designcomplex_Producturlkey
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Designcomplex/Producturlkey/Model/Observer.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Designcomplex
16
+ * @package Designcomplex_Urlkey
17
+ * @copyright Copyright (c) 2014 Thomas Klosinsky, Designcomplex
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class Designcomplex_Producturlkey_Model_Observer {
22
+ public function updateurl($observer){
23
+ //Mage::log('URLKey log', null, 'urlkey.log');
24
+ if($observer->getEvent()->getProduct()){
25
+ $Product=$observer->getEvent()->getProduct();
26
+ $Url='';
27
+ /* Manufacturer added to urlkey */
28
+ if(!is_null($Product->getData('manufacturer'))):
29
+ $Url=$Url.$Product->getAttributeText('manufacturer').'-';
30
+ endif;
31
+ /* Name added to urlkey */
32
+ if(!is_null($Product->getData('name'))):
33
+ $Url=$Url.$Product->getData('name');
34
+ endif;
35
+ /* SKU added to urlkey */
36
+ if(!is_null($Product->getData('sku'))):
37
+ $Url=$Url.$Product->getData('sku').'-';
38
+ endif;
39
+ //Mage::log('URLKey log'.$Url, null, 'urlkey.log');
40
+ $Product->setData('url_key',$Url);
41
+
42
+ }
43
+ }
44
+ }
app/code/community/Designcomplex/Producturlkey/etc/config.xml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Designcomplex
17
+ * @package Designcomplex_Urlkey
18
+ * @copyright Copyright (c) 2014 Thomas Klosinsky, Designcomplex
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ -->
22
+ <config>
23
+ <modules>
24
+ <Designcomplex_Producturlkey>
25
+ <version>0.1.0</version>
26
+ </Designcomplex_Producturlkey>
27
+ </modules>
28
+ <global>
29
+ <models>
30
+ <Designcomplex_Producturlkey>
31
+ <class>Designcomplex_Urlkey_Model</class>
32
+ </Designcomplex_Producturlkey>
33
+ </models>
34
+ </global>
35
+ <global>
36
+ <events>
37
+ <catalog_product_save_before>
38
+ <observers>
39
+ <Designcomplex_Producturlkey>
40
+ <type>singleton</type>
41
+ <class>Designcomplex_Urlkey/observer</class>
42
+ <method>updateurl</method>
43
+ </Designcomplex_Producturlkey>
44
+ </observers>
45
+ </catalog_product_save_before>
46
+ </events>
47
+ </global>
48
+ </config>
app/etc/modules/Designcomplex_Producturlkey.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" ?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Designcomplex
17
+ * @package Designcomplex_Urlkey
18
+ * @copyright Copyright (c) 2014 Thomas Klosinsky, Designcomplex
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ -->
22
+ <config>
23
+ <modules>
24
+ <Designcomplex_Producturlkey>
25
+ <codePool>community</codePool>
26
+ <active>true</active>
27
+ </Designcomplex_Producturlkey>
28
+ </modules>
29
+ </config>
package.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Designcomplex_Producturlkey</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>OSL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>autofill urlkey with attributes like manufacturer, name, sku, custom attributes, etc. on product save</summary>
10
+ <description>&lt;p&gt;With this extension you can manage an autofill of the urlkey from all possible attributes&lt;/p&gt;&#xD;
11
+ &#xD;
12
+ &lt;p&gt;&amp;lt;strong&amp;gt;IMPORTANT!&amp;lt;strong&amp;gt;&lt;br /&gt;&#xD;
13
+ This extension requires file modification for customization.&lt;/p&gt;&#xD;
14
+ &#xD;
15
+ &lt;p&gt;Standard setup is:&lt;br /&gt;&#xD;
16
+ &amp;lt;strong&amp;gt;manufacturer-name-skugetData('manufacturer'))):&#xD;
17
+ $Url=$Url.$Product-&amp;gt;getAttributeText('manufacturer').'-';&#xD;
18
+ endif;&#xD;
19
+ /* Name added to urlkey */&#xD;
20
+ if(!is_null($Product-&amp;gt;getData('name'))):&#xD;
21
+ $Url=$Url.$Product-&amp;gt;getData('name');&#xD;
22
+ endif;&#xD;
23
+ /* SKU added to urlkey */&#xD;
24
+ if(!is_null($Product-&amp;gt;getData('sku'))):&#xD;
25
+ $Url=$Url.$Product-&amp;gt;getData('sku').'-';&#xD;
26
+ endif;&#xD;
27
+ &#xD;
28
+ &#xD;
29
+ &lt;p /&gt;If there are any questions, please let me know&lt;/p&gt;&#xD;
30
+ &lt;p&gt;If there are people out who could help with system.xml and AdminOptions for this extension, please also let me know and help the community to have a better user interface.&lt;/p&gt;</description>
31
+ <notes>system.xml coders wanted!</notes>
32
+ <authors><author><name>Thomas Klosinsky</name><user>thomasklosinsky</user><email>thomas@designcomplex.de</email></author></authors>
33
+ <date>2014-10-08</date>
34
+ <time>05:47:32</time>
35
+ <contents><target name="magecommunity"><dir name="Designcomplex"><dir name="Producturlkey"><dir name="Model"><file name="Observer.php" hash="6d0114330f4c559f1173acd2968647b6"/></dir><dir name="etc"><file name="config.xml" hash="24d20f75a57d2f2e1ed257df21638f8c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Designcomplex_Producturlkey.xml" hash="24e50ca845668b2da93ff36e38e1644e"/></dir></target></contents>
36
+ <compatible/>
37
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
38
+ </package>