How to automatically add customers to customer group based on admin that added them












0















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.










share|improve this question





























    0















    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.










    share|improve this question



























      0












      0








      0








      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.










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 10 mins ago









      Utsav Gupta

      17013




      17013










      asked Aug 8 '14 at 13:18









      DinoDino

      32




      32






















          2 Answers
          2






          active

          oldest

          votes


















          1














          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
          }





          share|improve this answer
























          • 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



















          0














          Yo can create an observer for the event adminhtml_customer_save_after, see the logged user and act consequently.






          share|improve this answer
























          • 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











          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
          });


          }
          });














          draft saved

          draft discarded


















          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









          1














          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
          }





          share|improve this answer
























          • 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
















          1














          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
          }





          share|improve this answer
























          • 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














          1












          1








          1







          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
          }





          share|improve this answer













          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
          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          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



















          • 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













          0














          Yo can create an observer for the event adminhtml_customer_save_after, see the logged user and act consequently.






          share|improve this answer
























          • 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
















          0














          Yo can create an observer for the event adminhtml_customer_save_after, see the logged user and act consequently.






          share|improve this answer
























          • 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














          0












          0








          0







          Yo can create an observer for the event adminhtml_customer_save_after, see the logged user and act consequently.






          share|improve this answer













          Yo can create an observer for the event adminhtml_customer_save_after, see the logged user and act consequently.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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



















          • 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


















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Polycentropodidae

          Magento 2 Error message: Invalid state change requested

          Paulmy