private function logOtherListingMessage(Ess_M2ePro_Model_Listing_Other $otherListing, $action, $oldValue, $newValue) { // M2ePro_TRANSLATIONS // From [%from%] to [%to%]. $log = Mage::getModel('M2ePro/Listing_Other_Log'); $log->setComponentMode($otherListing->getComponentMode()); $log->addProductMessage($otherListing->getId(), Ess_M2ePro_Helper_Data::INITIATOR_EXTENSION, NULL, $action, Mage::getModel('M2ePro/Log_Abstract')->encodeDescription('From [%from%] to [%to%]', array('from' => $oldValue, 'to' => $newValue)), Ess_M2ePro_Model_Log_Abstract::TYPE_NOTICE, Ess_M2ePro_Model_Log_Abstract::PRIORITY_LOW); }
private function logOtherListingMessage(Ess_M2ePro_Model_Listing_Other $otherListing, $action, $oldValue, $newValue, $messagePostfix = '') { // M2ePro_TRANSLATIONS // From [%from%] to [%to%]. $log = Mage::getModel('M2ePro/Listing_Other_Log'); $log->setComponentMode($otherListing->getComponentMode()); $oldValue = strlen($oldValue) > 150 ? substr($oldValue, 0, 150) . ' ...' : $oldValue; $newValue = strlen($newValue) > 150 ? substr($newValue, 0, 150) . ' ...' : $newValue; $messagePostfix = trim(trim($messagePostfix), '.'); if (!empty($messagePostfix)) { $messagePostfix = ' ' . $messagePostfix; } $log->addProductMessage($otherListing->getId(), Ess_M2ePro_Helper_Data::INITIATOR_EXTENSION, NULL, $action, Mage::getModel('M2ePro/Log_Abstract')->encodeDescription('From [%from%] to [%to%]' . $messagePostfix . '.', array('!from' => $oldValue, '!to' => $newValue)), Ess_M2ePro_Model_Log_Abstract::TYPE_NOTICE, Ess_M2ePro_Model_Log_Abstract::PRIORITY_LOW); }