event observer for the creation of new productsHow can I differentiate between product creation and saving existing products?Event Observer Module for UpsellHow to create an new observer on the event catalog_product_save_beforeHow to create/update bulk of products at a time programmaticallyevent-observer conflict: catalog_product_collection_load_beforeCollection items don't trigger product load event observers or backend models, but can they?Event Observer for specific storeSet custom price of product when adding to cart code not workingSimple Observer not firing on eventEvent observer not workingEvent for before invoice creation magento 2

Is it possible to do 50 km distance without any previous training?

Can I ask the recruiters in my resume to put the reason why I am rejected?

Doing something right before you need it - expression for this?

Modeling an IP Address

Intersection point of 2 lines defined by 2 points each

Add text to same line using sed

Replacing matching entries in one column of a file by another column from a different file

Approximately how much travel time was saved by the opening of the Suez Canal in 1869?

What is the word for reserving something for yourself before others do?

Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?

Why can't I see bouncing of a switch on an oscilloscope?

Has there ever been an airliner design involving reducing generator load by installing solar panels?

LWC SFDX source push error TypeError: LWC1009: decl.moveTo is not a function

What would happen to a modern skyscraper if it rains micro blackholes?

Is it legal for company to use my work email to pretend I still work there?

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

How much RAM could one put in a typical 80386 setup?

Do infinite dimensional systems make sense?

How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?

How to determine what difficulty is right for the game?

RSA: Danger of using p to create q

High voltage LED indicator 40-1000 VDC without additional power supply

strTok function (thread safe, supports empty tokens, doesn't change string)

Can a vampire attack twice with their claws using Multiattack?



event observer for the creation of new products


How can I differentiate between product creation and saving existing products?Event Observer Module for UpsellHow to create an new observer on the event catalog_product_save_beforeHow to create/update bulk of products at a time programmaticallyevent-observer conflict: catalog_product_collection_load_beforeCollection items don't trigger product load event observers or backend models, but can they?Event Observer for specific storeSet custom price of product when adding to cart code not workingSimple Observer not firing on eventEvent observer not workingEvent for before invoice creation magento 2






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








2















I want to run the observer only when the product is created and not when it is updated. I found this discussion: product-creation-and-saving-existing-products and I followed Tim Ramsey's advice.



So I put this in 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>


and this in Observer.php:



class Wally_LogProductUpdate_Model_Observer

protected $isNew = false;

public function beforeSave($observer)

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



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





The problem is that the log file is not updated when a new product is created.



How can i solve?










share|improve this question
























  • What is your magento version?

    – Sohel Rana
    yesterday











  • My magento version is 1.9.3.9

    – Mastafis
    yesterday






  • 1





    log file will not create because afterSave function never called! you need to call $this->afterSave(); after check isNew.

    – Pawan
    yesterday






  • 1





    you need to pass $observer as parameter like $this->afterSave($observer);

    – Pawan
    yesterday






  • 1





    you can also eliminate ` $this->isNew = true;` flag and direct call $this->afterSave($observer); in if condition!

    – Pawan
    yesterday

















2















I want to run the observer only when the product is created and not when it is updated. I found this discussion: product-creation-and-saving-existing-products and I followed Tim Ramsey's advice.



So I put this in 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>


and this in Observer.php:



class Wally_LogProductUpdate_Model_Observer

protected $isNew = false;

public function beforeSave($observer)

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



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





The problem is that the log file is not updated when a new product is created.



How can i solve?










share|improve this question
























  • What is your magento version?

    – Sohel Rana
    yesterday











  • My magento version is 1.9.3.9

    – Mastafis
    yesterday






  • 1





    log file will not create because afterSave function never called! you need to call $this->afterSave(); after check isNew.

    – Pawan
    yesterday






  • 1





    you need to pass $observer as parameter like $this->afterSave($observer);

    – Pawan
    yesterday






  • 1





    you can also eliminate ` $this->isNew = true;` flag and direct call $this->afterSave($observer); in if condition!

    – Pawan
    yesterday













2












2








2








I want to run the observer only when the product is created and not when it is updated. I found this discussion: product-creation-and-saving-existing-products and I followed Tim Ramsey's advice.



So I put this in 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>


and this in Observer.php:



class Wally_LogProductUpdate_Model_Observer

protected $isNew = false;

public function beforeSave($observer)

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



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





The problem is that the log file is not updated when a new product is created.



How can i solve?










share|improve this question
















I want to run the observer only when the product is created and not when it is updated. I found this discussion: product-creation-and-saving-existing-products and I followed Tim Ramsey's advice.



So I put this in 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>


and this in Observer.php:



class Wally_LogProductUpdate_Model_Observer

protected $isNew = false;

public function beforeSave($observer)

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



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





The problem is that the log file is not updated when a new product is created.



How can i solve?







magento-1.9 event-observer






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 23 hours ago









Rakesh Donga

2,393316




2,393316










asked yesterday









MastafisMastafis

375




375












  • What is your magento version?

    – Sohel Rana
    yesterday











  • My magento version is 1.9.3.9

    – Mastafis
    yesterday






  • 1





    log file will not create because afterSave function never called! you need to call $this->afterSave(); after check isNew.

    – Pawan
    yesterday






  • 1





    you need to pass $observer as parameter like $this->afterSave($observer);

    – Pawan
    yesterday






  • 1





    you can also eliminate ` $this->isNew = true;` flag and direct call $this->afterSave($observer); in if condition!

    – Pawan
    yesterday

















  • What is your magento version?

    – Sohel Rana
    yesterday











  • My magento version is 1.9.3.9

    – Mastafis
    yesterday






  • 1





    log file will not create because afterSave function never called! you need to call $this->afterSave(); after check isNew.

    – Pawan
    yesterday






  • 1





    you need to pass $observer as parameter like $this->afterSave($observer);

    – Pawan
    yesterday






  • 1





    you can also eliminate ` $this->isNew = true;` flag and direct call $this->afterSave($observer); in if condition!

    – Pawan
    yesterday
















What is your magento version?

– Sohel Rana
yesterday





What is your magento version?

– Sohel Rana
yesterday













My magento version is 1.9.3.9

– Mastafis
yesterday





My magento version is 1.9.3.9

– Mastafis
yesterday




1




1





log file will not create because afterSave function never called! you need to call $this->afterSave(); after check isNew.

– Pawan
yesterday





log file will not create because afterSave function never called! you need to call $this->afterSave(); after check isNew.

– Pawan
yesterday




1




1





you need to pass $observer as parameter like $this->afterSave($observer);

– Pawan
yesterday





you need to pass $observer as parameter like $this->afterSave($observer);

– Pawan
yesterday




1




1





you can also eliminate ` $this->isNew = true;` flag and direct call $this->afterSave($observer); in if condition!

– Pawan
yesterday





you can also eliminate ` $this->isNew = true;` flag and direct call $this->afterSave($observer); in if condition!

– Pawan
yesterday










2 Answers
2






active

oldest

votes


















1














Log file will not create because afterSave function never called!
you need to call $this->afterSave($observer); after check isNew.



Like:



public function beforeSave($observer)

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




Note: you can also eliminate $this->isNew = true; flag and direct call $this->afterSave($observer); in if condition!






share|improve this answer






























    0














    Try the following:




    app/code/local/SR/MagentoCommunity/etc/config.xml




    <?xml version="1.0"?>
    <config>
    <modules>
    <SR_MagentoCommunity>
    <version>0.0.0.2</version>
    </SR_MagentoCommunity>
    </modules>
    <global>
    <models>
    <sr_magentocommunity>
    <class>SR_MagentoCommunity_Model</class>
    </sr_magentocommunity>
    </models>
    <events>
    <catalog_product_save_before>
    <observers>
    <sr_catalog_product_save_before>
    <class>sr_magentocommunity/observer</class>
    <method>catalogProductSaveBefore</method>
    <type>singleton</type>
    </sr_catalog_product_save_before>
    </observers>
    </catalog_product_save_before>
    <catalog_product_save_after>
    <observers>
    <sr_catalog_product_save_after>
    <class>sr_magentocommunity/observer</class>
    <method>catalogProductSaveAfter</method>
    <type>singleton</type>
    </sr_catalog_product_save_after>
    </observers>
    </catalog_product_save_after>
    </events>
    </global>
    </config>



    app/code/local/SR/MagentoCommunity/Model/Observer.php




    <?php
    class SR_MagentoCommunity_Model_Observer

    protected $isNew = false;

    /**
    * @param Varien_Event_Observer $observer
    * @return $this
    */
    public function catalogProductSaveBefore(Varien_Event_Observer $observer)

    /** @var Mage_Catalog_Model_Product $product */
    $product = $observer->getEvent()->getProduct();
    if ($product->isObjectNew())
    $this->isNew = true;


    return $this;


    /**
    * @param Varien_Event_Observer $observer
    * @return $this
    */
    public function catalogProductSaveAfter(Varien_Event_Observer $observer)

    /** @var Mage_Catalog_Model_Product $product */
    $product = $observer->getEvent()->getProduct();
    if ($this->isNew)
    $name = $product->getName();
    $sku = $product->getSku();
    $price = $product->getPrice();
    error_log("[$name ($sku) $price] aggiornato");
    Mage::log("[$name ($sku) $price] aggiornato", null, 'product-updates.log');

    return $this;







    share|improve this answer























      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%2f268827%2fevent-observer-for-the-creation-of-new-products%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














      Log file will not create because afterSave function never called!
      you need to call $this->afterSave($observer); after check isNew.



      Like:



      public function beforeSave($observer)

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




      Note: you can also eliminate $this->isNew = true; flag and direct call $this->afterSave($observer); in if condition!






      share|improve this answer



























        1














        Log file will not create because afterSave function never called!
        you need to call $this->afterSave($observer); after check isNew.



        Like:



        public function beforeSave($observer)

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




        Note: you can also eliminate $this->isNew = true; flag and direct call $this->afterSave($observer); in if condition!






        share|improve this answer

























          1












          1








          1







          Log file will not create because afterSave function never called!
          you need to call $this->afterSave($observer); after check isNew.



          Like:



          public function beforeSave($observer)

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




          Note: you can also eliminate $this->isNew = true; flag and direct call $this->afterSave($observer); in if condition!






          share|improve this answer













          Log file will not create because afterSave function never called!
          you need to call $this->afterSave($observer); after check isNew.



          Like:



          public function beforeSave($observer)

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




          Note: you can also eliminate $this->isNew = true; flag and direct call $this->afterSave($observer); in if condition!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered yesterday









          PawanPawan

          2,0312618




          2,0312618























              0














              Try the following:




              app/code/local/SR/MagentoCommunity/etc/config.xml




              <?xml version="1.0"?>
              <config>
              <modules>
              <SR_MagentoCommunity>
              <version>0.0.0.2</version>
              </SR_MagentoCommunity>
              </modules>
              <global>
              <models>
              <sr_magentocommunity>
              <class>SR_MagentoCommunity_Model</class>
              </sr_magentocommunity>
              </models>
              <events>
              <catalog_product_save_before>
              <observers>
              <sr_catalog_product_save_before>
              <class>sr_magentocommunity/observer</class>
              <method>catalogProductSaveBefore</method>
              <type>singleton</type>
              </sr_catalog_product_save_before>
              </observers>
              </catalog_product_save_before>
              <catalog_product_save_after>
              <observers>
              <sr_catalog_product_save_after>
              <class>sr_magentocommunity/observer</class>
              <method>catalogProductSaveAfter</method>
              <type>singleton</type>
              </sr_catalog_product_save_after>
              </observers>
              </catalog_product_save_after>
              </events>
              </global>
              </config>



              app/code/local/SR/MagentoCommunity/Model/Observer.php




              <?php
              class SR_MagentoCommunity_Model_Observer

              protected $isNew = false;

              /**
              * @param Varien_Event_Observer $observer
              * @return $this
              */
              public function catalogProductSaveBefore(Varien_Event_Observer $observer)

              /** @var Mage_Catalog_Model_Product $product */
              $product = $observer->getEvent()->getProduct();
              if ($product->isObjectNew())
              $this->isNew = true;


              return $this;


              /**
              * @param Varien_Event_Observer $observer
              * @return $this
              */
              public function catalogProductSaveAfter(Varien_Event_Observer $observer)

              /** @var Mage_Catalog_Model_Product $product */
              $product = $observer->getEvent()->getProduct();
              if ($this->isNew)
              $name = $product->getName();
              $sku = $product->getSku();
              $price = $product->getPrice();
              error_log("[$name ($sku) $price] aggiornato");
              Mage::log("[$name ($sku) $price] aggiornato", null, 'product-updates.log');

              return $this;







              share|improve this answer



























                0














                Try the following:




                app/code/local/SR/MagentoCommunity/etc/config.xml




                <?xml version="1.0"?>
                <config>
                <modules>
                <SR_MagentoCommunity>
                <version>0.0.0.2</version>
                </SR_MagentoCommunity>
                </modules>
                <global>
                <models>
                <sr_magentocommunity>
                <class>SR_MagentoCommunity_Model</class>
                </sr_magentocommunity>
                </models>
                <events>
                <catalog_product_save_before>
                <observers>
                <sr_catalog_product_save_before>
                <class>sr_magentocommunity/observer</class>
                <method>catalogProductSaveBefore</method>
                <type>singleton</type>
                </sr_catalog_product_save_before>
                </observers>
                </catalog_product_save_before>
                <catalog_product_save_after>
                <observers>
                <sr_catalog_product_save_after>
                <class>sr_magentocommunity/observer</class>
                <method>catalogProductSaveAfter</method>
                <type>singleton</type>
                </sr_catalog_product_save_after>
                </observers>
                </catalog_product_save_after>
                </events>
                </global>
                </config>



                app/code/local/SR/MagentoCommunity/Model/Observer.php




                <?php
                class SR_MagentoCommunity_Model_Observer

                protected $isNew = false;

                /**
                * @param Varien_Event_Observer $observer
                * @return $this
                */
                public function catalogProductSaveBefore(Varien_Event_Observer $observer)

                /** @var Mage_Catalog_Model_Product $product */
                $product = $observer->getEvent()->getProduct();
                if ($product->isObjectNew())
                $this->isNew = true;


                return $this;


                /**
                * @param Varien_Event_Observer $observer
                * @return $this
                */
                public function catalogProductSaveAfter(Varien_Event_Observer $observer)

                /** @var Mage_Catalog_Model_Product $product */
                $product = $observer->getEvent()->getProduct();
                if ($this->isNew)
                $name = $product->getName();
                $sku = $product->getSku();
                $price = $product->getPrice();
                error_log("[$name ($sku) $price] aggiornato");
                Mage::log("[$name ($sku) $price] aggiornato", null, 'product-updates.log');

                return $this;







                share|improve this answer

























                  0












                  0








                  0







                  Try the following:




                  app/code/local/SR/MagentoCommunity/etc/config.xml




                  <?xml version="1.0"?>
                  <config>
                  <modules>
                  <SR_MagentoCommunity>
                  <version>0.0.0.2</version>
                  </SR_MagentoCommunity>
                  </modules>
                  <global>
                  <models>
                  <sr_magentocommunity>
                  <class>SR_MagentoCommunity_Model</class>
                  </sr_magentocommunity>
                  </models>
                  <events>
                  <catalog_product_save_before>
                  <observers>
                  <sr_catalog_product_save_before>
                  <class>sr_magentocommunity/observer</class>
                  <method>catalogProductSaveBefore</method>
                  <type>singleton</type>
                  </sr_catalog_product_save_before>
                  </observers>
                  </catalog_product_save_before>
                  <catalog_product_save_after>
                  <observers>
                  <sr_catalog_product_save_after>
                  <class>sr_magentocommunity/observer</class>
                  <method>catalogProductSaveAfter</method>
                  <type>singleton</type>
                  </sr_catalog_product_save_after>
                  </observers>
                  </catalog_product_save_after>
                  </events>
                  </global>
                  </config>



                  app/code/local/SR/MagentoCommunity/Model/Observer.php




                  <?php
                  class SR_MagentoCommunity_Model_Observer

                  protected $isNew = false;

                  /**
                  * @param Varien_Event_Observer $observer
                  * @return $this
                  */
                  public function catalogProductSaveBefore(Varien_Event_Observer $observer)

                  /** @var Mage_Catalog_Model_Product $product */
                  $product = $observer->getEvent()->getProduct();
                  if ($product->isObjectNew())
                  $this->isNew = true;


                  return $this;


                  /**
                  * @param Varien_Event_Observer $observer
                  * @return $this
                  */
                  public function catalogProductSaveAfter(Varien_Event_Observer $observer)

                  /** @var Mage_Catalog_Model_Product $product */
                  $product = $observer->getEvent()->getProduct();
                  if ($this->isNew)
                  $name = $product->getName();
                  $sku = $product->getSku();
                  $price = $product->getPrice();
                  error_log("[$name ($sku) $price] aggiornato");
                  Mage::log("[$name ($sku) $price] aggiornato", null, 'product-updates.log');

                  return $this;







                  share|improve this answer













                  Try the following:




                  app/code/local/SR/MagentoCommunity/etc/config.xml




                  <?xml version="1.0"?>
                  <config>
                  <modules>
                  <SR_MagentoCommunity>
                  <version>0.0.0.2</version>
                  </SR_MagentoCommunity>
                  </modules>
                  <global>
                  <models>
                  <sr_magentocommunity>
                  <class>SR_MagentoCommunity_Model</class>
                  </sr_magentocommunity>
                  </models>
                  <events>
                  <catalog_product_save_before>
                  <observers>
                  <sr_catalog_product_save_before>
                  <class>sr_magentocommunity/observer</class>
                  <method>catalogProductSaveBefore</method>
                  <type>singleton</type>
                  </sr_catalog_product_save_before>
                  </observers>
                  </catalog_product_save_before>
                  <catalog_product_save_after>
                  <observers>
                  <sr_catalog_product_save_after>
                  <class>sr_magentocommunity/observer</class>
                  <method>catalogProductSaveAfter</method>
                  <type>singleton</type>
                  </sr_catalog_product_save_after>
                  </observers>
                  </catalog_product_save_after>
                  </events>
                  </global>
                  </config>



                  app/code/local/SR/MagentoCommunity/Model/Observer.php




                  <?php
                  class SR_MagentoCommunity_Model_Observer

                  protected $isNew = false;

                  /**
                  * @param Varien_Event_Observer $observer
                  * @return $this
                  */
                  public function catalogProductSaveBefore(Varien_Event_Observer $observer)

                  /** @var Mage_Catalog_Model_Product $product */
                  $product = $observer->getEvent()->getProduct();
                  if ($product->isObjectNew())
                  $this->isNew = true;


                  return $this;


                  /**
                  * @param Varien_Event_Observer $observer
                  * @return $this
                  */
                  public function catalogProductSaveAfter(Varien_Event_Observer $observer)

                  /** @var Mage_Catalog_Model_Product $product */
                  $product = $observer->getEvent()->getProduct();
                  if ($this->isNew)
                  $name = $product->getName();
                  $sku = $product->getSku();
                  $price = $product->getPrice();
                  error_log("[$name ($sku) $price] aggiornato");
                  Mage::log("[$name ($sku) $price] aggiornato", null, 'product-updates.log');

                  return $this;








                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered yesterday









                  Sohel RanaSohel Rana

                  23.1k34461




                  23.1k34461



























                      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%2f268827%2fevent-observer-for-the-creation-of-new-products%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

                      Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                      Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                      Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form