How to automatically add customers to customer group based on admin that added them
I need to make happen following:
- I have five admins that can only access "Customer" area
- They are adding customers to buy in the front end
- Customers are divided into five groups
I need to make the process of adding users so it excludes choosing to which group customer is added but it needs to be added automatically based on which admin is adding the user.
admin customer-segmentation
add a comment |
I need to make happen following:
- I have five admins that can only access "Customer" area
- They are adding customers to buy in the front end
- Customers are divided into five groups
I need to make the process of adding users so it excludes choosing to which group customer is added but it needs to be added automatically based on which admin is adding the user.
admin customer-segmentation
add a comment |
I need to make happen following:
- I have five admins that can only access "Customer" area
- They are adding customers to buy in the front end
- Customers are divided into five groups
I need to make the process of adding users so it excludes choosing to which group customer is added but it needs to be added automatically based on which admin is adding the user.
admin customer-segmentation
I need to make happen following:
- I have five admins that can only access "Customer" area
- They are adding customers to buy in the front end
- Customers are divided into five groups
I need to make the process of adding users so it excludes choosing to which group customer is added but it needs to be added automatically based on which admin is adding the user.
admin customer-segmentation
admin customer-segmentation
edited 10 mins ago
Utsav Gupta
17013
17013
asked Aug 8 '14 at 13:18
DinoDino
32
32
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Create a custom module with an observer for adminhtml_customer_save_after
In config.xml
<events>
<adminhtml_customer_save_after>
<observers>
<magepal_admincustomergroup>
<type>model</type>
<class>admincustomergroup/observer</class>
<method>saveAdminCustomerGroup</method>
</magepal_admincustomergroup>
</observers>
</adminhtml_customer_save_after>
</events>
In your observer
public function saveAdminCustomerGroup(Varien_Event_Observer $observer)
{
$customer = $observer->getCustomer();
$user = Mage::getSingleton('admin/session');
$userId = $user->getUser()->getUserId();
//check current admin user info and set customer group
// $customer->setData( 'group_id', 5 );
// save customer
// may want to check if customer already assign to a group
}
How can I tell it which admin is adding user to which group?
– Dino
Aug 27 '14 at 8:48
$user->getUser()
contain all the admin user info... see blog.chapagain.com.np/…
– Renon Stewart
Aug 27 '14 at 12:54
add a comment |
Yo can create an observer for the event adminhtml_customer_save_after
, see the logged user and act consequently.
Please be more specific and elaborate, I'm not so advanced with Magento platform.
– Dino
Aug 8 '14 at 13:45
The entire process you want to follow without your custom logic is here: magento.stackexchange.com/questions/15155/…
– mbalparda
Aug 8 '14 at 13:47
Link is not helping me at all... I'm just trying to understand that if there is a way to disable the selection of customer groups when adding the customer and make that customer part of group based on the admin adding the customer..
– Dino
Aug 8 '14 at 14:25
Like if one admin is named "manager1" it adds to corresponding group automatically.
– Dino
Aug 8 '14 at 14:26
There is no way to do what you want without a pretty extensive knowledge in Magento since its not a core feature and as far as i saw, there is no extension for this. The links so far have everything you need but you also will need to fully understand how Magento works in order to accomplish what you need.
– mbalparda
Aug 8 '14 at 14:28
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f31718%2fhow-to-automatically-add-customers-to-customer-group-based-on-admin-that-added-t%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Create a custom module with an observer for adminhtml_customer_save_after
In config.xml
<events>
<adminhtml_customer_save_after>
<observers>
<magepal_admincustomergroup>
<type>model</type>
<class>admincustomergroup/observer</class>
<method>saveAdminCustomerGroup</method>
</magepal_admincustomergroup>
</observers>
</adminhtml_customer_save_after>
</events>
In your observer
public function saveAdminCustomerGroup(Varien_Event_Observer $observer)
{
$customer = $observer->getCustomer();
$user = Mage::getSingleton('admin/session');
$userId = $user->getUser()->getUserId();
//check current admin user info and set customer group
// $customer->setData( 'group_id', 5 );
// save customer
// may want to check if customer already assign to a group
}
How can I tell it which admin is adding user to which group?
– Dino
Aug 27 '14 at 8:48
$user->getUser()
contain all the admin user info... see blog.chapagain.com.np/…
– Renon Stewart
Aug 27 '14 at 12:54
add a comment |
Create a custom module with an observer for adminhtml_customer_save_after
In config.xml
<events>
<adminhtml_customer_save_after>
<observers>
<magepal_admincustomergroup>
<type>model</type>
<class>admincustomergroup/observer</class>
<method>saveAdminCustomerGroup</method>
</magepal_admincustomergroup>
</observers>
</adminhtml_customer_save_after>
</events>
In your observer
public function saveAdminCustomerGroup(Varien_Event_Observer $observer)
{
$customer = $observer->getCustomer();
$user = Mage::getSingleton('admin/session');
$userId = $user->getUser()->getUserId();
//check current admin user info and set customer group
// $customer->setData( 'group_id', 5 );
// save customer
// may want to check if customer already assign to a group
}
How can I tell it which admin is adding user to which group?
– Dino
Aug 27 '14 at 8:48
$user->getUser()
contain all the admin user info... see blog.chapagain.com.np/…
– Renon Stewart
Aug 27 '14 at 12:54
add a comment |
Create a custom module with an observer for adminhtml_customer_save_after
In config.xml
<events>
<adminhtml_customer_save_after>
<observers>
<magepal_admincustomergroup>
<type>model</type>
<class>admincustomergroup/observer</class>
<method>saveAdminCustomerGroup</method>
</magepal_admincustomergroup>
</observers>
</adminhtml_customer_save_after>
</events>
In your observer
public function saveAdminCustomerGroup(Varien_Event_Observer $observer)
{
$customer = $observer->getCustomer();
$user = Mage::getSingleton('admin/session');
$userId = $user->getUser()->getUserId();
//check current admin user info and set customer group
// $customer->setData( 'group_id', 5 );
// save customer
// may want to check if customer already assign to a group
}
Create a custom module with an observer for adminhtml_customer_save_after
In config.xml
<events>
<adminhtml_customer_save_after>
<observers>
<magepal_admincustomergroup>
<type>model</type>
<class>admincustomergroup/observer</class>
<method>saveAdminCustomerGroup</method>
</magepal_admincustomergroup>
</observers>
</adminhtml_customer_save_after>
</events>
In your observer
public function saveAdminCustomerGroup(Varien_Event_Observer $observer)
{
$customer = $observer->getCustomer();
$user = Mage::getSingleton('admin/session');
$userId = $user->getUser()->getUserId();
//check current admin user info and set customer group
// $customer->setData( 'group_id', 5 );
// save customer
// may want to check if customer already assign to a group
}
answered Aug 8 '14 at 14:39
Renon StewartRenon Stewart
11.9k11941
11.9k11941
How can I tell it which admin is adding user to which group?
– Dino
Aug 27 '14 at 8:48
$user->getUser()
contain all the admin user info... see blog.chapagain.com.np/…
– Renon Stewart
Aug 27 '14 at 12:54
add a comment |
How can I tell it which admin is adding user to which group?
– Dino
Aug 27 '14 at 8:48
$user->getUser()
contain all the admin user info... see blog.chapagain.com.np/…
– Renon Stewart
Aug 27 '14 at 12:54
How can I tell it which admin is adding user to which group?
– Dino
Aug 27 '14 at 8:48
How can I tell it which admin is adding user to which group?
– Dino
Aug 27 '14 at 8:48
$user->getUser()
contain all the admin user info... see blog.chapagain.com.np/…– Renon Stewart
Aug 27 '14 at 12:54
$user->getUser()
contain all the admin user info... see blog.chapagain.com.np/…– Renon Stewart
Aug 27 '14 at 12:54
add a comment |
Yo can create an observer for the event adminhtml_customer_save_after
, see the logged user and act consequently.
Please be more specific and elaborate, I'm not so advanced with Magento platform.
– Dino
Aug 8 '14 at 13:45
The entire process you want to follow without your custom logic is here: magento.stackexchange.com/questions/15155/…
– mbalparda
Aug 8 '14 at 13:47
Link is not helping me at all... I'm just trying to understand that if there is a way to disable the selection of customer groups when adding the customer and make that customer part of group based on the admin adding the customer..
– Dino
Aug 8 '14 at 14:25
Like if one admin is named "manager1" it adds to corresponding group automatically.
– Dino
Aug 8 '14 at 14:26
There is no way to do what you want without a pretty extensive knowledge in Magento since its not a core feature and as far as i saw, there is no extension for this. The links so far have everything you need but you also will need to fully understand how Magento works in order to accomplish what you need.
– mbalparda
Aug 8 '14 at 14:28
add a comment |
Yo can create an observer for the event adminhtml_customer_save_after
, see the logged user and act consequently.
Please be more specific and elaborate, I'm not so advanced with Magento platform.
– Dino
Aug 8 '14 at 13:45
The entire process you want to follow without your custom logic is here: magento.stackexchange.com/questions/15155/…
– mbalparda
Aug 8 '14 at 13:47
Link is not helping me at all... I'm just trying to understand that if there is a way to disable the selection of customer groups when adding the customer and make that customer part of group based on the admin adding the customer..
– Dino
Aug 8 '14 at 14:25
Like if one admin is named "manager1" it adds to corresponding group automatically.
– Dino
Aug 8 '14 at 14:26
There is no way to do what you want without a pretty extensive knowledge in Magento since its not a core feature and as far as i saw, there is no extension for this. The links so far have everything you need but you also will need to fully understand how Magento works in order to accomplish what you need.
– mbalparda
Aug 8 '14 at 14:28
add a comment |
Yo can create an observer for the event adminhtml_customer_save_after
, see the logged user and act consequently.
Yo can create an observer for the event adminhtml_customer_save_after
, see the logged user and act consequently.
answered Aug 8 '14 at 13:33
mbalpardambalparda
6,63631543
6,63631543
Please be more specific and elaborate, I'm not so advanced with Magento platform.
– Dino
Aug 8 '14 at 13:45
The entire process you want to follow without your custom logic is here: magento.stackexchange.com/questions/15155/…
– mbalparda
Aug 8 '14 at 13:47
Link is not helping me at all... I'm just trying to understand that if there is a way to disable the selection of customer groups when adding the customer and make that customer part of group based on the admin adding the customer..
– Dino
Aug 8 '14 at 14:25
Like if one admin is named "manager1" it adds to corresponding group automatically.
– Dino
Aug 8 '14 at 14:26
There is no way to do what you want without a pretty extensive knowledge in Magento since its not a core feature and as far as i saw, there is no extension for this. The links so far have everything you need but you also will need to fully understand how Magento works in order to accomplish what you need.
– mbalparda
Aug 8 '14 at 14:28
add a comment |
Please be more specific and elaborate, I'm not so advanced with Magento platform.
– Dino
Aug 8 '14 at 13:45
The entire process you want to follow without your custom logic is here: magento.stackexchange.com/questions/15155/…
– mbalparda
Aug 8 '14 at 13:47
Link is not helping me at all... I'm just trying to understand that if there is a way to disable the selection of customer groups when adding the customer and make that customer part of group based on the admin adding the customer..
– Dino
Aug 8 '14 at 14:25
Like if one admin is named "manager1" it adds to corresponding group automatically.
– Dino
Aug 8 '14 at 14:26
There is no way to do what you want without a pretty extensive knowledge in Magento since its not a core feature and as far as i saw, there is no extension for this. The links so far have everything you need but you also will need to fully understand how Magento works in order to accomplish what you need.
– mbalparda
Aug 8 '14 at 14:28
Please be more specific and elaborate, I'm not so advanced with Magento platform.
– Dino
Aug 8 '14 at 13:45
Please be more specific and elaborate, I'm not so advanced with Magento platform.
– Dino
Aug 8 '14 at 13:45
The entire process you want to follow without your custom logic is here: magento.stackexchange.com/questions/15155/…
– mbalparda
Aug 8 '14 at 13:47
The entire process you want to follow without your custom logic is here: magento.stackexchange.com/questions/15155/…
– mbalparda
Aug 8 '14 at 13:47
Link is not helping me at all... I'm just trying to understand that if there is a way to disable the selection of customer groups when adding the customer and make that customer part of group based on the admin adding the customer..
– Dino
Aug 8 '14 at 14:25
Link is not helping me at all... I'm just trying to understand that if there is a way to disable the selection of customer groups when adding the customer and make that customer part of group based on the admin adding the customer..
– Dino
Aug 8 '14 at 14:25
Like if one admin is named "manager1" it adds to corresponding group automatically.
– Dino
Aug 8 '14 at 14:26
Like if one admin is named "manager1" it adds to corresponding group automatically.
– Dino
Aug 8 '14 at 14:26
There is no way to do what you want without a pretty extensive knowledge in Magento since its not a core feature and as far as i saw, there is no extension for this. The links so far have everything you need but you also will need to fully understand how Magento works in order to accomplish what you need.
– mbalparda
Aug 8 '14 at 14:28
There is no way to do what you want without a pretty extensive knowledge in Magento since its not a core feature and as far as i saw, there is no extension for this. The links so far have everything you need but you also will need to fully understand how Magento works in order to accomplish what you need.
– mbalparda
Aug 8 '14 at 14:28
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f31718%2fhow-to-automatically-add-customers-to-customer-group-based-on-admin-that-added-t%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown