本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Product::getData方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Product::getData方法的具体用法?PHP Ess_M2ePro_Model_Listing_Product::getData怎么用?PHP Ess_M2ePro_Model_Listing_Product::getData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Product
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Product::getData方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveVariationsSets
protected function saveVariationsSets(Ess_M2ePro_Model_Listing_Product $listingProduct, $variations)
{
if (!isset($variations['set'])) {
return;
}
$additionalData = $listingProduct->getData('additional_data');
$additionalData = is_null($additionalData) ? array() : json_decode($additionalData, true);
$additionalData['variations_sets'] = $variations['set'];
$listingProduct->setData('additional_data', json_encode($additionalData))->save();
}
示例2: saveVariationsData
protected function saveVariationsData(Ess_M2ePro_Model_Listing_Product $listingProduct, $variationsData)
{
$additionalData = $listingProduct->getData('additional_data');
$additionalData = is_null($additionalData) ? array() : (array) json_decode($additionalData, true);
if (isset($variationsData['set'])) {
$additionalData['variations_sets'] = $variationsData['set'];
}
if (isset($variationsData['additional']['attributes'])) {
$additionalData['configurable_attributes'] = $variationsData['additional']['attributes'];
}
$listingProduct->setData('additional_data', json_encode($additionalData))->save();
}
示例3: isChangeInitiatorOnlyInspector
protected function isChangeInitiatorOnlyInspector(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
$changeInitiators = $listingProduct->getData('change_initiators');
if (empty($changeInitiators)) {
return false;
}
$changeInitiators = (array) explode(',', $changeInitiators);
$changeInitiators = array_unique($changeInitiators);
if (count($changeInitiators) != 1) {
return false;
}
if ((int) reset($changeInitiators) != Ess_M2ePro_Model_ProductChange::INITIATOR_INSPECTOR) {
return false;
}
return true;
}
示例4: linkItem
private function linkItem(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
$data = array('general_id' => $listingProduct->getData('general_id'), 'is_isbn_general_id' => Mage::helper('M2ePro')->isISBN($listingProduct->getData('general_id')), 'sku' => $listingProduct->getData('sku'), 'status' => Ess_M2ePro_Model_Listing_Product::STATUS_STOPPED);
$listingProduct->addData($data)->save();
$dataForAdd = array('account_id' => $listingProduct->getListing()->getAccountId(), 'marketplace_id' => $listingProduct->getListing()->getMarketplaceId(), 'sku' => $listingProduct->getData('sku'), 'product_id' => $listingProduct->getProductId(), 'store_id' => $listingProduct->getListing()->getStoreId());
Mage::getModel('M2ePro/Amazon_Item')->setData($dataForAdd)->save();
$message = Mage::helper('M2ePro')->__('The product was found in your Amazon inventory and linked by SKU.');
$this->addListingsProductsLogsMessage($listingProduct, $message, Ess_M2ePro_Model_Log_Abstract::TYPE_SUCCESS, Ess_M2ePro_Model_Log_Abstract::PRIORITY_MEDIUM);
}
示例5: modifyAndLogListingProduct
private function modifyAndLogListingProduct(Ess_M2ePro_Model_Listing_Product $listingProduct, $status, $duplicateItemId = null)
{
/** @var Ess_M2ePro_Model_Listing_Log $logModel */
$logModel = Mage::getModel('M2ePro/Listing_Log');
$logModel->setComponentMode(Ess_M2ePro_Helper_Component_Ebay::NICK);
$logsActionId = $logModel->getNextActionId();
$statusLogMessage = $this->getStatusLogMessage($listingProduct->getStatus(), $status);
$logModel->addProductMessage($listingProduct->getData('listing_id'), $listingProduct->getData('product_id'), $listingProduct->getId(), Ess_M2ePro_Helper_Data::INITIATOR_EXTENSION, $logsActionId, Ess_M2ePro_Model_Listing_Log::ACTION_CHANNEL_CHANGE, $statusLogMessage, Ess_M2ePro_Model_Log_Abstract::TYPE_SUCCESS, Ess_M2ePro_Model_Log_Abstract::PRIORITY_LOW);
$additionalData = $listingProduct->getAdditionalData();
unset($additionalData['last_failed_action_data']);
$listingProduct->addData(array('status' => $status, 'additional_data' => json_encode($additionalData)))->save();
$listingProduct->getChildObject()->updateVariationsStatus();
if (is_null($duplicateItemId)) {
return;
}
// M2ePro_TRANSLATIONS
// Duplicated Item %item_id% was found and Stopped on eBay.
$textToTranslate = 'Duplicated Item %item_id% was found and stopped on eBay.';
$duplicateDeletedMessage = Mage::helper('M2ePro')->__($textToTranslate, $duplicateItemId);
$logModel->addProductMessage($listingProduct->getData('listing_id'), $listingProduct->getData('product_id'), $listingProduct->getId(), Ess_M2ePro_Helper_Data::INITIATOR_EXTENSION, $logsActionId, Ess_M2ePro_Model_Listing_Log::ACTION_CHANNEL_CHANGE, $duplicateDeletedMessage, Ess_M2ePro_Model_Log_Abstract::TYPE_WARNING, Ess_M2ePro_Model_Log_Abstract::PRIORITY_LOW);
}
示例6: linkItem
private function linkItem(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
$data = array('general_id' => $listingProduct->getData('general_id'), 'sku' => $listingProduct->getData('sku'), 'status' => Ess_M2ePro_Model_Listing_Product::STATUS_STOPPED);
$listingProduct->addData($data)->save();
$dataForAdd = array('account_id' => $listingProduct->getListing()->getAccountId(), 'marketplace_id' => $listingProduct->getListing()->getMarketplaceId(), 'sku' => $listingProduct->getData('sku'), 'product_id' => $listingProduct->getProductId(), 'store_id' => $listingProduct->getListing()->getStoreId());
if ($listingProduct->getChildObject()->isVariationsReady()) {
$variations = $listingProduct->getVariations(true);
/* @var $variation Ess_M2ePro_Model_Listing_Product_Variation */
$variation = reset($variations);
$options = $variation->getOptions();
$dataForAdd['variation_options'] = array();
foreach ($options as $optionData) {
$dataForAdd['variation_options'][$optionData['attribute']] = $optionData['option'];
}
$dataForAdd['variation_options'] = json_encode($dataForAdd['variation_options']);
}
Mage::getModel('M2ePro/Buy_Item')->setData($dataForAdd)->save();
$message = Mage::helper('M2ePro')->__('The product was found in your Rakuten.com inventory and linked by Reference ID.');
$this->addListingsProductsLogsMessage($listingProduct, $message, Ess_M2ePro_Model_Log_Abstract::TYPE_SUCCESS, Ess_M2ePro_Model_Log_Abstract::PRIORITY_MEDIUM);
}
示例7: logListingProductMessage
private function logListingProductMessage(Ess_M2ePro_Model_Listing_Product $listingProduct, $action, $oldValue, $newValue, $messagePostfix = '')
{
// M2ePro_TRANSLATIONS
// From [%from%] to [%to%].
$log = Mage::getModel('M2ePro/' . ucfirst($listingProduct->getComponentMode()) . '_Listing_Log');
$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;
}
if ($listingProduct->isComponentModeEbay() && is_array($listingProduct->getData('found_options_ids'))) {
$collection = Mage::getModel('M2ePro/Listing_Product_Variation_Option')->getCollection()->addFieldToFilter('main_table.id', array('in' => $listingProduct->getData('found_options_ids')));
$additionalData = array();
foreach ($collection as $listingProductVariationOption) {
/** @var Ess_M2ePro_Model_Listing_Product_Variation_Option $listingProductVariationOption */
$additionalData['variation_options'][$listingProductVariationOption->getAttribute()] = $listingProductVariationOption->getOption();
}
if (!empty($additionalData['variation_options']) && $collection->getFirstItem()->getProductType() == Ess_M2ePro_Model_Magento_Product::TYPE_BUNDLE) {
foreach ($additionalData['variation_options'] as $attribute => $option) {
$log->addProductMessage($listingProduct->getListingId(), $listingProduct->getProductId(), $listingProduct->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, array('variation_options' => array($attribute => $option)));
}
return;
}
$log->addProductMessage($listingProduct->getListingId(), $listingProduct->getProductId(), $listingProduct->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, $additionalData);
return;
}
$log->addProductMessage($listingProduct->getListingId(), $listingProduct->getProductId(), $listingProduct->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);
}