Customer user group admin magento
i want to create customer group admin to view orders only .
Basically i have created 3 customer group - A,B,C
Now i want that there should be user (basically new admin roles) like Ma whill can see all order done by customer of group A
like wise Mb can view all order done by customer of Group B.
How can i do it ...
Any way to do it vai observer , which observer should i write plese guide me ..
admin customer
add a comment |
i want to create customer group admin to view orders only .
Basically i have created 3 customer group - A,B,C
Now i want that there should be user (basically new admin roles) like Ma whill can see all order done by customer of group A
like wise Mb can view all order done by customer of Group B.
How can i do it ...
Any way to do it vai observer , which observer should i write plese guide me ..
admin customer
add a comment |
i want to create customer group admin to view orders only .
Basically i have created 3 customer group - A,B,C
Now i want that there should be user (basically new admin roles) like Ma whill can see all order done by customer of group A
like wise Mb can view all order done by customer of Group B.
How can i do it ...
Any way to do it vai observer , which observer should i write plese guide me ..
admin customer
i want to create customer group admin to view orders only .
Basically i have created 3 customer group - A,B,C
Now i want that there should be user (basically new admin roles) like Ma whill can see all order done by customer of group A
like wise Mb can view all order done by customer of Group B.
How can i do it ...
Any way to do it vai observer , which observer should i write plese guide me ..
admin customer
admin customer
edited Mar 27 '15 at 21:06
user2045
65121328
65121328
asked Feb 11 '15 at 12:18
user1799722user1799722
44411644
44411644
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Create a custom module. Then use a various observer to filter the collection related to customer and orders. If this admin user has limited ACL access then you may not need to implement all of the event listed below.
Config.xml
<config>
<modules>
<Company_Module>
<version>0.1.0</version>
</Company_Module>
</modules>
<global>
<blocks>
<company_module>
<class>Company_Module_Block</class>
</company_module>
</blocks>
</global>
<adminhtml>
<events>
<sales_order_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_grid_collection_load_before>
<eav_collection_abstract_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleCustomerCollectionBefore</method>
</layout_before>
</observers>
</eav_collection_abstract_load_before>
<sales_order_invoice_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_invoice_grid_collection_load_before>
<core_collection_abstract_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleCoreCollectionBefore</method>
</layout_before>
</observers>
</core_collection_abstract_load_before>
<sales_order_creditmemo_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_creditmemo_grid_collection_load_before>
</events>
</adminhtml>
</config>
In observer.php
Company_Module_Model_Observer{
public function handleOrderCollectionBefore(){
$collection = $observer->getEvent()->getOrderGridCollection();
//logic for getting customer group
//customerGroupIds
$collection->addAttributeToFilter('customer_group_id', array('in' => $customerGroupIds));
}
//limit access to customer
public function handleCustomerCollectionBefore(){
$collection = $observer->getCollection();
if (strpos(get_class($collection),'Customer_Collection')){
//logic for getting customer group
//only show customer from group they have access to
}
}
//limit access to invoice
public function handleCoreCollectionBefore(){
$collection = $observer->getCollection();
if ($collection instanceof Mage_Sales_Model_Mysql4_Order_Grid_Collection)
{
//logic for getting customer group and filter order
}
}
}
add a comment |
This is an overly broad question, but I will take a stab at a simple implementation.
Once you've created the roles and linked them (however you want) with the customer groups, you can filter order collections for the admin grid using the sales_order_grid_collection_load_before
event, adding your group filtering logic (the sales_flat_order
table stores the customer_group_id
field).
You'll want to encapsulate that order-to-customer-group logic somehow, as you will also want to filter/restrict access to individual orders.
can u please tell what to write in observer.php for it, with static paramter like show order for user group A
– user1799722
Feb 16 '15 at 5:57
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%2f55371%2fcustomer-user-group-admin-magento%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. Then use a various observer to filter the collection related to customer and orders. If this admin user has limited ACL access then you may not need to implement all of the event listed below.
Config.xml
<config>
<modules>
<Company_Module>
<version>0.1.0</version>
</Company_Module>
</modules>
<global>
<blocks>
<company_module>
<class>Company_Module_Block</class>
</company_module>
</blocks>
</global>
<adminhtml>
<events>
<sales_order_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_grid_collection_load_before>
<eav_collection_abstract_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleCustomerCollectionBefore</method>
</layout_before>
</observers>
</eav_collection_abstract_load_before>
<sales_order_invoice_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_invoice_grid_collection_load_before>
<core_collection_abstract_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleCoreCollectionBefore</method>
</layout_before>
</observers>
</core_collection_abstract_load_before>
<sales_order_creditmemo_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_creditmemo_grid_collection_load_before>
</events>
</adminhtml>
</config>
In observer.php
Company_Module_Model_Observer{
public function handleOrderCollectionBefore(){
$collection = $observer->getEvent()->getOrderGridCollection();
//logic for getting customer group
//customerGroupIds
$collection->addAttributeToFilter('customer_group_id', array('in' => $customerGroupIds));
}
//limit access to customer
public function handleCustomerCollectionBefore(){
$collection = $observer->getCollection();
if (strpos(get_class($collection),'Customer_Collection')){
//logic for getting customer group
//only show customer from group they have access to
}
}
//limit access to invoice
public function handleCoreCollectionBefore(){
$collection = $observer->getCollection();
if ($collection instanceof Mage_Sales_Model_Mysql4_Order_Grid_Collection)
{
//logic for getting customer group and filter order
}
}
}
add a comment |
Create a custom module. Then use a various observer to filter the collection related to customer and orders. If this admin user has limited ACL access then you may not need to implement all of the event listed below.
Config.xml
<config>
<modules>
<Company_Module>
<version>0.1.0</version>
</Company_Module>
</modules>
<global>
<blocks>
<company_module>
<class>Company_Module_Block</class>
</company_module>
</blocks>
</global>
<adminhtml>
<events>
<sales_order_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_grid_collection_load_before>
<eav_collection_abstract_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleCustomerCollectionBefore</method>
</layout_before>
</observers>
</eav_collection_abstract_load_before>
<sales_order_invoice_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_invoice_grid_collection_load_before>
<core_collection_abstract_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleCoreCollectionBefore</method>
</layout_before>
</observers>
</core_collection_abstract_load_before>
<sales_order_creditmemo_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_creditmemo_grid_collection_load_before>
</events>
</adminhtml>
</config>
In observer.php
Company_Module_Model_Observer{
public function handleOrderCollectionBefore(){
$collection = $observer->getEvent()->getOrderGridCollection();
//logic for getting customer group
//customerGroupIds
$collection->addAttributeToFilter('customer_group_id', array('in' => $customerGroupIds));
}
//limit access to customer
public function handleCustomerCollectionBefore(){
$collection = $observer->getCollection();
if (strpos(get_class($collection),'Customer_Collection')){
//logic for getting customer group
//only show customer from group they have access to
}
}
//limit access to invoice
public function handleCoreCollectionBefore(){
$collection = $observer->getCollection();
if ($collection instanceof Mage_Sales_Model_Mysql4_Order_Grid_Collection)
{
//logic for getting customer group and filter order
}
}
}
add a comment |
Create a custom module. Then use a various observer to filter the collection related to customer and orders. If this admin user has limited ACL access then you may not need to implement all of the event listed below.
Config.xml
<config>
<modules>
<Company_Module>
<version>0.1.0</version>
</Company_Module>
</modules>
<global>
<blocks>
<company_module>
<class>Company_Module_Block</class>
</company_module>
</blocks>
</global>
<adminhtml>
<events>
<sales_order_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_grid_collection_load_before>
<eav_collection_abstract_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleCustomerCollectionBefore</method>
</layout_before>
</observers>
</eav_collection_abstract_load_before>
<sales_order_invoice_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_invoice_grid_collection_load_before>
<core_collection_abstract_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleCoreCollectionBefore</method>
</layout_before>
</observers>
</core_collection_abstract_load_before>
<sales_order_creditmemo_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_creditmemo_grid_collection_load_before>
</events>
</adminhtml>
</config>
In observer.php
Company_Module_Model_Observer{
public function handleOrderCollectionBefore(){
$collection = $observer->getEvent()->getOrderGridCollection();
//logic for getting customer group
//customerGroupIds
$collection->addAttributeToFilter('customer_group_id', array('in' => $customerGroupIds));
}
//limit access to customer
public function handleCustomerCollectionBefore(){
$collection = $observer->getCollection();
if (strpos(get_class($collection),'Customer_Collection')){
//logic for getting customer group
//only show customer from group they have access to
}
}
//limit access to invoice
public function handleCoreCollectionBefore(){
$collection = $observer->getCollection();
if ($collection instanceof Mage_Sales_Model_Mysql4_Order_Grid_Collection)
{
//logic for getting customer group and filter order
}
}
}
Create a custom module. Then use a various observer to filter the collection related to customer and orders. If this admin user has limited ACL access then you may not need to implement all of the event listed below.
Config.xml
<config>
<modules>
<Company_Module>
<version>0.1.0</version>
</Company_Module>
</modules>
<global>
<blocks>
<company_module>
<class>Company_Module_Block</class>
</company_module>
</blocks>
</global>
<adminhtml>
<events>
<sales_order_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_grid_collection_load_before>
<eav_collection_abstract_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleCustomerCollectionBefore</method>
</layout_before>
</observers>
</eav_collection_abstract_load_before>
<sales_order_invoice_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_invoice_grid_collection_load_before>
<core_collection_abstract_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleCoreCollectionBefore</method>
</layout_before>
</observers>
</core_collection_abstract_load_before>
<sales_order_creditmemo_grid_collection_load_before>
<observers>
<layout_before>
<class>module/observer</class>
<method>handleOrderCollectionBefore</method>
</layout_before>
</observers>
</sales_order_creditmemo_grid_collection_load_before>
</events>
</adminhtml>
</config>
In observer.php
Company_Module_Model_Observer{
public function handleOrderCollectionBefore(){
$collection = $observer->getEvent()->getOrderGridCollection();
//logic for getting customer group
//customerGroupIds
$collection->addAttributeToFilter('customer_group_id', array('in' => $customerGroupIds));
}
//limit access to customer
public function handleCustomerCollectionBefore(){
$collection = $observer->getCollection();
if (strpos(get_class($collection),'Customer_Collection')){
//logic for getting customer group
//only show customer from group they have access to
}
}
//limit access to invoice
public function handleCoreCollectionBefore(){
$collection = $observer->getCollection();
if ($collection instanceof Mage_Sales_Model_Mysql4_Order_Grid_Collection)
{
//logic for getting customer group and filter order
}
}
}
edited 8 mins ago
Utsav Gupta
17013
17013
answered Feb 18 '15 at 12:39
Renon StewartRenon Stewart
11.9k11941
11.9k11941
add a comment |
add a comment |
This is an overly broad question, but I will take a stab at a simple implementation.
Once you've created the roles and linked them (however you want) with the customer groups, you can filter order collections for the admin grid using the sales_order_grid_collection_load_before
event, adding your group filtering logic (the sales_flat_order
table stores the customer_group_id
field).
You'll want to encapsulate that order-to-customer-group logic somehow, as you will also want to filter/restrict access to individual orders.
can u please tell what to write in observer.php for it, with static paramter like show order for user group A
– user1799722
Feb 16 '15 at 5:57
add a comment |
This is an overly broad question, but I will take a stab at a simple implementation.
Once you've created the roles and linked them (however you want) with the customer groups, you can filter order collections for the admin grid using the sales_order_grid_collection_load_before
event, adding your group filtering logic (the sales_flat_order
table stores the customer_group_id
field).
You'll want to encapsulate that order-to-customer-group logic somehow, as you will also want to filter/restrict access to individual orders.
can u please tell what to write in observer.php for it, with static paramter like show order for user group A
– user1799722
Feb 16 '15 at 5:57
add a comment |
This is an overly broad question, but I will take a stab at a simple implementation.
Once you've created the roles and linked them (however you want) with the customer groups, you can filter order collections for the admin grid using the sales_order_grid_collection_load_before
event, adding your group filtering logic (the sales_flat_order
table stores the customer_group_id
field).
You'll want to encapsulate that order-to-customer-group logic somehow, as you will also want to filter/restrict access to individual orders.
This is an overly broad question, but I will take a stab at a simple implementation.
Once you've created the roles and linked them (however you want) with the customer groups, you can filter order collections for the admin grid using the sales_order_grid_collection_load_before
event, adding your group filtering logic (the sales_flat_order
table stores the customer_group_id
field).
You'll want to encapsulate that order-to-customer-group logic somehow, as you will also want to filter/restrict access to individual orders.
answered Feb 14 '15 at 19:19
benmarks♦benmarks
15.2k434103
15.2k434103
can u please tell what to write in observer.php for it, with static paramter like show order for user group A
– user1799722
Feb 16 '15 at 5:57
add a comment |
can u please tell what to write in observer.php for it, with static paramter like show order for user group A
– user1799722
Feb 16 '15 at 5:57
can u please tell what to write in observer.php for it, with static paramter like show order for user group A
– user1799722
Feb 16 '15 at 5:57
can u please tell what to write in observer.php for it, with static paramter like show order for user group A
– user1799722
Feb 16 '15 at 5:57
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%2f55371%2fcustomer-user-group-admin-magento%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