Event Observer for import with magmiHow to create/update bulk of products at a time programmaticallyHow to import custom option values with magmiImport Multiple Images with MagmiCollection items don't trigger product load event observers or backend models, but can they?Set custom price of product when adding to cart code not workingSimple Observer not firing on eventmagmi product import problemproducts not getting assigned to vendor through import via magmiMagmi import productsExport Category name in xml feed Magento 1.9.2

If a centaur druid Wild Shapes into a Giant Elk, do their Charge features stack?

What is the offset in a seaplane's hull?

Doomsday-clock for my fantasy planet

Is there a familial term for apples and pears?

How do you conduct xenoanthropology after first contact?

Can I find out the caloric content of bread by dehydrating it?

What does "enim et" mean?

Is there a way to make member function NOT callable from constructor?

Is "plugging out" electronic devices an American expression?

How to manage monthly salary

extract characters between two commas?

Can I legally use front facing blue light in the UK?

Is Fable (1996) connected in any way to the Fable franchise from Lionhead Studios?

Does the average primeness of natural numbers tend to zero?

Calculate Levenshtein distance between two strings in Python

Could a US political party gain complete control over the government by removing checks & balances?

What is the meaning of "of trouble" in the following sentence?

Why is my log file so massive? 22gb. I am running log backups

Mapping arrows in commutative diagrams

Could Giant Ground Sloths have been a Good Pack Animal for the Ancient Mayans

Is it true that "The augmented fourth (A4) and the diminished fifth (d5) are the only aug and dim intervals that appear in diatonic scales"

Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?

Why is the design of haulage companies so “special”?

"listening to me about as much as you're listening to this pole here"



Event Observer for import with magmi


How to create/update bulk of products at a time programmaticallyHow to import custom option values with magmiImport Multiple Images with MagmiCollection items don't trigger product load event observers or backend models, but can they?Set custom price of product when adding to cart code not workingSimple Observer not firing on eventmagmi product import problemproducts not getting assigned to vendor through import via magmiMagmi import productsExport Category name in xml feed Magento 1.9.2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I created an event observer to report the creation of new magento products, but the observer doesn't work when the products are created by importing Magmi.



My magento version is 1.9.3.9



This is the config.xml



 <global>
<models>
<wally_logproductupdate>
<class>Wally_LogProductUpdate_Model</class>
</wally_logproductupdate>
</models>
<events>
<catalog_product_save_before>
<observers>
<wally_logproductupdate>
<class>wally_logproductupdate/observer</class>
<method>beforeSave</method>
<type>singleton</type>
</wally_logproductupdate>
</observers>
</catalog_product_save_before>
</events>
</global>


This is the Observer:



class Wally_LogProductUpdate_Model_Observer

protected $isNew = false;

public function beforeSave($observer)

$product = $observer->getEvent()->getProduct();
if ($product->isObjectNew())
$this->isNew = true;
$this->afterSave($observer);



public function afterSave($observer)

$product = $observer->getEvent()->getProduct();
if ($this->isNew)
$name = $product->getName();
$sku = $product->getSku();
$price = $product->getPrice();

Mage::log("[$name ($sku) $price] aggiornato", null, 'product-updates.log');





Is it the right way or do I have to work in other ways to import products using magmi?










share|improve this question






























    1















    I created an event observer to report the creation of new magento products, but the observer doesn't work when the products are created by importing Magmi.



    My magento version is 1.9.3.9



    This is the config.xml



     <global>
    <models>
    <wally_logproductupdate>
    <class>Wally_LogProductUpdate_Model</class>
    </wally_logproductupdate>
    </models>
    <events>
    <catalog_product_save_before>
    <observers>
    <wally_logproductupdate>
    <class>wally_logproductupdate/observer</class>
    <method>beforeSave</method>
    <type>singleton</type>
    </wally_logproductupdate>
    </observers>
    </catalog_product_save_before>
    </events>
    </global>


    This is the Observer:



    class Wally_LogProductUpdate_Model_Observer

    protected $isNew = false;

    public function beforeSave($observer)

    $product = $observer->getEvent()->getProduct();
    if ($product->isObjectNew())
    $this->isNew = true;
    $this->afterSave($observer);



    public function afterSave($observer)

    $product = $observer->getEvent()->getProduct();
    if ($this->isNew)
    $name = $product->getName();
    $sku = $product->getSku();
    $price = $product->getPrice();

    Mage::log("[$name ($sku) $price] aggiornato", null, 'product-updates.log');





    Is it the right way or do I have to work in other ways to import products using magmi?










    share|improve this question


























      1












      1








      1








      I created an event observer to report the creation of new magento products, but the observer doesn't work when the products are created by importing Magmi.



      My magento version is 1.9.3.9



      This is the config.xml



       <global>
      <models>
      <wally_logproductupdate>
      <class>Wally_LogProductUpdate_Model</class>
      </wally_logproductupdate>
      </models>
      <events>
      <catalog_product_save_before>
      <observers>
      <wally_logproductupdate>
      <class>wally_logproductupdate/observer</class>
      <method>beforeSave</method>
      <type>singleton</type>
      </wally_logproductupdate>
      </observers>
      </catalog_product_save_before>
      </events>
      </global>


      This is the Observer:



      class Wally_LogProductUpdate_Model_Observer

      protected $isNew = false;

      public function beforeSave($observer)

      $product = $observer->getEvent()->getProduct();
      if ($product->isObjectNew())
      $this->isNew = true;
      $this->afterSave($observer);



      public function afterSave($observer)

      $product = $observer->getEvent()->getProduct();
      if ($this->isNew)
      $name = $product->getName();
      $sku = $product->getSku();
      $price = $product->getPrice();

      Mage::log("[$name ($sku) $price] aggiornato", null, 'product-updates.log');





      Is it the right way or do I have to work in other ways to import products using magmi?










      share|improve this question
















      I created an event observer to report the creation of new magento products, but the observer doesn't work when the products are created by importing Magmi.



      My magento version is 1.9.3.9



      This is the config.xml



       <global>
      <models>
      <wally_logproductupdate>
      <class>Wally_LogProductUpdate_Model</class>
      </wally_logproductupdate>
      </models>
      <events>
      <catalog_product_save_before>
      <observers>
      <wally_logproductupdate>
      <class>wally_logproductupdate/observer</class>
      <method>beforeSave</method>
      <type>singleton</type>
      </wally_logproductupdate>
      </observers>
      </catalog_product_save_before>
      </events>
      </global>


      This is the Observer:



      class Wally_LogProductUpdate_Model_Observer

      protected $isNew = false;

      public function beforeSave($observer)

      $product = $observer->getEvent()->getProduct();
      if ($product->isObjectNew())
      $this->isNew = true;
      $this->afterSave($observer);



      public function afterSave($observer)

      $product = $observer->getEvent()->getProduct();
      if ($this->isNew)
      $name = $product->getName();
      $sku = $product->getSku();
      $price = $product->getPrice();

      Mage::log("[$name ($sku) $price] aggiornato", null, 'product-updates.log');





      Is it the right way or do I have to work in other ways to import products using magmi?







      magento-1.9 database event-observer sql magmi






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 5 at 7:47







      Mastafis

















      asked Apr 5 at 7:33









      MastafisMastafis

      426




      426




















          1 Answer
          1






          active

          oldest

          votes


















          0














          As per official wiki of magmi:



          Magmi is a Magento Mass Importer developed as a magento DATABASE client, (ie not a magento extension) , that operates directly in SQL.



          So magmi runs raw query and any event will not dispatched during import by magmi!






          share|improve this answer























          • Yes, these days I have read that magmi does not pass by the orm model of magento, so what is the best solution to get the id of new products imported from magmi?

            – Mastafis
            3 hours ago











          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%2f268878%2fevent-observer-for-import-with-magmi%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          As per official wiki of magmi:



          Magmi is a Magento Mass Importer developed as a magento DATABASE client, (ie not a magento extension) , that operates directly in SQL.



          So magmi runs raw query and any event will not dispatched during import by magmi!






          share|improve this answer























          • Yes, these days I have read that magmi does not pass by the orm model of magento, so what is the best solution to get the id of new products imported from magmi?

            – Mastafis
            3 hours ago















          0














          As per official wiki of magmi:



          Magmi is a Magento Mass Importer developed as a magento DATABASE client, (ie not a magento extension) , that operates directly in SQL.



          So magmi runs raw query and any event will not dispatched during import by magmi!






          share|improve this answer























          • Yes, these days I have read that magmi does not pass by the orm model of magento, so what is the best solution to get the id of new products imported from magmi?

            – Mastafis
            3 hours ago













          0












          0








          0







          As per official wiki of magmi:



          Magmi is a Magento Mass Importer developed as a magento DATABASE client, (ie not a magento extension) , that operates directly in SQL.



          So magmi runs raw query and any event will not dispatched during import by magmi!






          share|improve this answer













          As per official wiki of magmi:



          Magmi is a Magento Mass Importer developed as a magento DATABASE client, (ie not a magento extension) , that operates directly in SQL.



          So magmi runs raw query and any event will not dispatched during import by magmi!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 17 hours ago









          PawanPawan

          2,0412618




          2,0412618












          • Yes, these days I have read that magmi does not pass by the orm model of magento, so what is the best solution to get the id of new products imported from magmi?

            – Mastafis
            3 hours ago

















          • Yes, these days I have read that magmi does not pass by the orm model of magento, so what is the best solution to get the id of new products imported from magmi?

            – Mastafis
            3 hours ago
















          Yes, these days I have read that magmi does not pass by the orm model of magento, so what is the best solution to get the id of new products imported from magmi?

          – Mastafis
          3 hours ago





          Yes, these days I have read that magmi does not pass by the orm model of magento, so what is the best solution to get the id of new products imported from magmi?

          – Mastafis
          3 hours ago

















          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%2f268878%2fevent-observer-for-import-with-magmi%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

          Sum ergo cogito? 1 nng

          419 nièngy_Soadمي 19bal1.5o_g

          Queiggey Chernihivv 9NnOo i Zw X QqKk LpB