Version Notes
If customer already registered and placing order as a guest it will save order into customer profile automatically
Download this release
Release Info
Developer | Emizen Tech Private Limited |
Extension | Emizen_Salesautoassign |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/local/Emizen/Salesautoassign/Helper/Data.php +5 -0
- app/code/local/Emizen/Salesautoassign/Model/Observer.php +25 -0
- app/code/local/Emizen/Salesautoassign/etc/adminhtml.xml +23 -0
- app/code/local/Emizen/Salesautoassign/etc/config.xml +33 -0
- app/code/local/Emizen/Salesautoassign/etc/system.xml +41 -0
- app/etc/modules/Emizen_Salesautoassign.xml +10 -0
- package.xml +18 -0
app/code/local/Emizen/Salesautoassign/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Emizen_Salesautoassign_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
}
|
5 |
+
|
app/code/local/Emizen/Salesautoassign/Model/Observer.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Emizen_Salesautoassign_Model_Observer
|
3 |
+
{
|
4 |
+
|
5 |
+
public function assigncustomer(Varien_Event_Observer $observer)
|
6 |
+
{
|
7 |
+
|
8 |
+
if(!Mage::getStoreConfig('emizen/emizen/general')) // if not enable extension return false
|
9 |
+
return;
|
10 |
+
//Get Info
|
11 |
+
$order = $observer->getEvent()->getOrder();
|
12 |
+
if(!$order->getCustomerId()){
|
13 |
+
$email = $observer->getEvent()->getOrder()->getCustomerEmail();;
|
14 |
+
$customer = Mage::getModel("customer/customer");
|
15 |
+
$customer->setWebsiteId(Mage::app()->getWebsite()->getId());
|
16 |
+
$customer->loadByEmail($email);
|
17 |
+
#Mage::log($order->getCustomerId(), null, 'product-updates.log');
|
18 |
+
#Mage::log($customer->getId(), null, 'product-updates.log');
|
19 |
+
//$order->setCustomerId($customer->getId());
|
20 |
+
$order->setCustomer($customer);
|
21 |
+
$order->save();
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
}
|
app/code/local/Emizen/Salesautoassign/etc/adminhtml.xml
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<admin>
|
6 |
+
<children>
|
7 |
+
<system>
|
8 |
+
<children>
|
9 |
+
<config>
|
10 |
+
<children>
|
11 |
+
<emizen translate="title" module="salesautoassign">
|
12 |
+
<title>General Section</title>
|
13 |
+
<sort_order>0</sort_order>
|
14 |
+
</emizen>
|
15 |
+
</children>
|
16 |
+
</config>
|
17 |
+
</children>
|
18 |
+
</system>
|
19 |
+
</children>
|
20 |
+
</admin>
|
21 |
+
</resources>
|
22 |
+
</acl>
|
23 |
+
</config>
|
app/code/local/Emizen/Salesautoassign/etc/config.xml
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Emizen_Salesautoassign>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Emizen_Salesautoassign>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<helpers>
|
10 |
+
<salesautoassign>
|
11 |
+
<class>Emizen_Salesautoassign_Helper</class>
|
12 |
+
</salesautoassign>
|
13 |
+
</helpers>
|
14 |
+
<models>
|
15 |
+
<salesautoassign>
|
16 |
+
<class>Emizen_Salesautoassign_Model</class>
|
17 |
+
<resourceModel>salesautoassign_mysql4</resourceModel>
|
18 |
+
</salesautoassign>
|
19 |
+
</models>
|
20 |
+
<events>
|
21 |
+
<checkout_submit_all_after> <!-- identifier of the event we want to catch -->
|
22 |
+
<observers>
|
23 |
+
<checkout_submit_all_after_handler> <!-- identifier of the event handler -->
|
24 |
+
<type>model</type> <!-- class method call type; valid are model, object and singleton -->
|
25 |
+
<class>salesautoassign/observer</class> <!-- observers class alias -->
|
26 |
+
<method>assigncustomer</method> <!-- observer's method to be called -->
|
27 |
+
<args></args> <!-- additional arguments passed to observer -->
|
28 |
+
</checkout_submit_all_after_handler>
|
29 |
+
</observers>
|
30 |
+
</checkout_submit_all_after>
|
31 |
+
</events>
|
32 |
+
</global>
|
33 |
+
</config>
|
app/code/local/Emizen/Salesautoassign/etc/system.xml
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<emizen translate="label" module="salesautoassign">
|
5 |
+
<label>Emizen</label>
|
6 |
+
<sort_order>0</sort_order>
|
7 |
+
</emizen>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<emizen translate="label" module="salesautoassign">
|
11 |
+
<label>Sales Auto Assign</label>
|
12 |
+
<tab>emizen</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>0</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<emizen translate="label">
|
20 |
+
<label>Sales Auto Assign</label>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
+
<sort_order>0</sort_order>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>1</show_in_store>
|
26 |
+
<fields>
|
27 |
+
<general translate="label">
|
28 |
+
<label>Enable</label>
|
29 |
+
<frontend_type>select</frontend_type>
|
30 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
31 |
+
<sort_order>0</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>1</show_in_store>
|
35 |
+
</general>
|
36 |
+
</fields>
|
37 |
+
</emizen>
|
38 |
+
</groups>
|
39 |
+
</emizen>
|
40 |
+
</sections>
|
41 |
+
</config>
|
app/etc/modules/Emizen_Salesautoassign.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Emizen_Salesautoassign>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
<version>0.1.0</version>
|
8 |
+
</Emizen_Salesautoassign>
|
9 |
+
</modules>
|
10 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Emizen_Salesautoassign</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>If customer already registered and placing order as a guest it will save order into customer profile automatically</summary>
|
10 |
+
<description>If customer already registered and placing order as a guest it will save order into customer profile automatically</description>
|
11 |
+
<notes>If customer already registered and placing order as a guest it will save order into customer profile automatically</notes>
|
12 |
+
<authors><author><name>Emizen Tech Private Limited</name><user>emizen</user><email>info@emizentech.com</email></author></authors>
|
13 |
+
<date>2015-07-10</date>
|
14 |
+
<time>10:32:49</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Emizen"><dir name="Salesautoassign"><dir><dir name="Helper"><file name="Data.php" hash="d11b659f9cd62539967093a7fed7a52d"/></dir><dir name="Model"><file name="Observer.php" hash="286b6ce55fa0d4b6837c2f49a70e0130"/></dir><dir name="etc"><file name="adminhtml.xml" hash="dd18a709f145bca4c5b8c11c05c3d0bc"/><file name="config.xml" hash="497d15c7c9c131b784a8f8192fd92851"/><file name="system.xml" hash="c69183e9ff2b85094cd6faf11958d2e4"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Emizen_Salesautoassign.xml" hash="8a1e8c48999ee6bbf76ef5cce556283a"/></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|