Version Notes
fixed minor errors
Download this release
Release Info
Developer | Thomas Klosinsky |
Extension | Designcomplex_Producturlkey |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
app/code/community/Designcomplex/Producturlkey/Model/Observer.php
CHANGED
@@ -18,23 +18,14 @@
|
|
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 |
-
|
28 |
-
|
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);
|
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 |
+
if(!is_null($Product->getData('matchcode'))):
|
28 |
+
$Url=$Url.$Product->getData('matchcode');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
endif;
|
30 |
//Mage::log('URLKey log'.$Url, null, 'urlkey.log');
|
31 |
$Product->setData('url_key',$Url);
|
app/code/community/Designcomplex/Producturlkey/etc/config.xml
CHANGED
@@ -28,7 +28,7 @@
|
|
28 |
<global>
|
29 |
<models>
|
30 |
<Designcomplex_Producturlkey>
|
31 |
-
<class>
|
32 |
</Designcomplex_Producturlkey>
|
33 |
</models>
|
34 |
</global>
|
@@ -38,7 +38,7 @@
|
|
38 |
<observers>
|
39 |
<Designcomplex_Producturlkey>
|
40 |
<type>singleton</type>
|
41 |
-
<class>
|
42 |
<method>updateurl</method>
|
43 |
</Designcomplex_Producturlkey>
|
44 |
</observers>
|
28 |
<global>
|
29 |
<models>
|
30 |
<Designcomplex_Producturlkey>
|
31 |
+
<class>Designcomplex_Producturlkey_Model</class>
|
32 |
</Designcomplex_Producturlkey>
|
33 |
</models>
|
34 |
</global>
|
38 |
<observers>
|
39 |
<Designcomplex_Producturlkey>
|
40 |
<type>singleton</type>
|
41 |
+
<class>Designcomplex_Producturlkey/observer</class>
|
42 |
<method>updateurl</method>
|
43 |
</Designcomplex_Producturlkey>
|
44 |
</observers>
|
package.xml
CHANGED
@@ -1,38 +1,44 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Designcomplex_Producturlkey</name>
|
4 |
-
<version>1.0.
|
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
|
11 |

|
12 |
-
|
13 |
-
This extension requires file modification for customization
|
14 |

|
15 |
-
|
16 |
-
|
17 |
-
$Url=$Url.$Product-&gt;getAttributeText('manufacturer').'-';
|
18 |
-
endif;
|
19 |
-
/* Name added to urlkey */
|
20 |
-
if(!is_null($Product-&gt;getData('name'))):
|
21 |
-
$Url=$Url.$Product-&gt;getData('name');
|
22 |
-
endif;
|
23 |
-
/* SKU added to urlkey */
|
24 |
-
if(!is_null($Product-&gt;getData('sku'))):
|
25 |
-
$Url=$Url.$Product-&gt;getData('sku').'-';
|
26 |
-
endif;
|
27 |

|
|
|
|
|
28 |

|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
<authors><author><name>Thomas Klosinsky</name><user>thomasklosinsky</user><email>thomas@designcomplex.de</email></author></authors>
|
33 |
-
<date>
|
34 |
-
<time>
|
35 |
-
<contents><target name="magecommunity"><dir name="Designcomplex"><dir name="Producturlkey"><dir name="Model"><file name="Observer.php" hash="
|
36 |
<compatible/>
|
37 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
38 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Designcomplex_Producturlkey</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license>OSL 3.0</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>With this extension you can manage an autofill of the urlkey from all possible attributes
|
11 |

|
12 |
+
IMPORTANT!
|
13 |
+
This extension requires file modification for customization.
|
14 |

|
15 |
+
Standard setup is:
|
16 |
+
manufacturer-name-sku
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |

|
18 |
+
To modify the setup you need to change the following lines in
|
19 |
+
/app/code/community/Designcomplex/Model/Observer.php
|
20 |

|
21 |
+
/* Manufacturer added to urlkey */
|
22 |
+
if(!is_null($Product->getData('manufacturer'))):
|
23 |
+
$Url=$Url.$Product->getAttributeText('manufacturer').'-';
|
24 |
+
endif;
|
25 |
+
/* Name added to urlkey */
|
26 |
+
if(!is_null($Product->getData('name'))):
|
27 |
+
$Url=$Url.$Product->getData('name');
|
28 |
+
endif;
|
29 |
+
/* SKU added to urlkey */
|
30 |
+
if(!is_null($Product->getData('sku'))):
|
31 |
+
$Url=$Url.$Product->getData('sku').'-';
|
32 |
+
endif;
|
33 |
+

|
34 |
+
If there are any questions, please let me know
|
35 |
+

|
36 |
+
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.</description>
|
37 |
+
<notes>fixed minor errors</notes>
|
38 |
<authors><author><name>Thomas Klosinsky</name><user>thomasklosinsky</user><email>thomas@designcomplex.de</email></author></authors>
|
39 |
+
<date>2015-02-24</date>
|
40 |
+
<time>15:43:18</time>
|
41 |
+
<contents><target name="magecommunity"><dir name="Designcomplex"><dir name="Producturlkey"><dir name="Model"><file name="Observer.php" hash="7e5f9cdc82fe95de347abcee95b28ac3"/></dir><dir name="etc"><file name="config.xml" hash="ad9c14d4905701a3d610a8f750351d15"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Designcomplex_Producturlkey.xml" hash="24e50ca845668b2da93ff36e38e1644e"/></dir></target></contents>
|
42 |
<compatible/>
|
43 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
44 |
</package>
|