本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Other::getAdditionalData方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Other::getAdditionalData方法的具体用法?PHP Ess_M2ePro_Model_Listing_Other::getAdditionalData怎么用?PHP Ess_M2ePro_Model_Listing_Other::getAdditionalData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Other
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Other::getAdditionalData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modifyAndLogListingOther
private function modifyAndLogListingOther(Ess_M2ePro_Model_Listing_Other $listingOther, $status, $duplicateItemId = null)
{
/** @var Ess_M2ePro_Model_Listing_Other_Log $logModel */
$logModel = Mage::getModel('M2ePro/Listing_Other_Log');
$logModel->setComponentMode(Ess_M2ePro_Helper_Component_Ebay::NICK);
$logActionId = $logModel->getNextActionId();
$statusLogMessage = $this->getStatusLogMessage($listingOther->getStatus(), $status);
$logModel->addProductMessage($listingOther->getId(), Ess_M2ePro_Helper_Data::INITIATOR_EXTENSION, $logActionId, Ess_M2ePro_Model_Listing_Other_Log::ACTION_CHANNEL_CHANGE, $statusLogMessage, Ess_M2ePro_Model_Log_Abstract::TYPE_SUCCESS, Ess_M2ePro_Model_Log_Abstract::PRIORITY_LOW);
$additionalData = $listingOther->getAdditionalData();
unset($additionalData['last_failed_action_data']);
$listingOther->addData(array('status' => $status, 'additional_data' => json_encode($additionalData)))->save();
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($listingOther->getId(), Ess_M2ePro_Helper_Data::INITIATOR_EXTENSION, $logActionId, Ess_M2ePro_Model_Listing_Other_Log::ACTION_CHANNEL_CHANGE, $duplicateDeletedMessage, Ess_M2ePro_Model_Log_Abstract::TYPE_WARNING, Ess_M2ePro_Model_Log_Abstract::PRIORITY_LOW);
}
示例2: addProductFromOther
/**
* @param Ess_M2ePro_Model_Listing_Other $listingOtherProduct
* @param bool $checkingMode
* @param bool $checkHasProduct
* @return bool|Ess_M2ePro_Model_Listing_Product
* @throws Ess_M2ePro_Model_Exception_Logic
*/
public function addProductFromOther(Ess_M2ePro_Model_Listing_Other $listingOtherProduct, $checkingMode = false, $checkHasProduct = true)
{
if (!$listingOtherProduct->getProductId()) {
return false;
}
$productId = $listingOtherProduct->getProductId();
$result = $this->getParentObject()->addProduct($productId, $checkingMode, true);
if ($checkingMode) {
return $result;
}
if (!$result instanceof Ess_M2ePro_Model_Listing_Product) {
return false;
}
$listingProduct = $result;
/** @var $collection Mage_Core_Model_Mysql4_Collection_Abstract */
$collection = Mage::getModel('M2ePro/Ebay_Item')->getCollection()->addFieldToFilter('account_id', $listingOtherProduct->getAccount()->getId())->addFieldToFilter('item_id', $listingOtherProduct->getChildObject()->getItemId());
$ebayItem = $collection->getFirstItem();
$ebayItem->setData('store_id', $this->getParentObject()->getStoreId())->save();
$dataForUpdate = array('ebay_item_id' => $ebayItem->getId(), 'online_sku' => $listingOtherProduct->getChildObject()->getSku(), 'online_title' => $listingOtherProduct->getChildObject()->getTitle(), 'online_current_price' => $listingOtherProduct->getChildObject()->getOnlinePrice(), 'online_qty' => $listingOtherProduct->getChildObject()->getOnlineQty(), 'online_qty_sold' => $listingOtherProduct->getChildObject()->getOnlineQtySold(), 'online_bids' => $listingOtherProduct->getChildObject()->getOnlineBids(), 'start_date' => $listingOtherProduct->getChildObject()->getStartDate(), 'end_date' => $listingOtherProduct->getChildObject()->getEndDate(), 'status' => $listingOtherProduct->getStatus(), 'status_changer' => $listingOtherProduct->getStatusChanger());
$listingOtherAdditionalData = $listingOtherProduct->getAdditionalData();
if (!empty($listingOtherAdditionalData['out_of_stock_control'])) {
$listingProductAdditionalData = $listingProduct->getAdditionalData();
$additionalDataForUpdate = array_merge($listingProductAdditionalData, array('out_of_stock_control' => true));
$dataForUpdate['additional_data'] = json_encode($additionalDataForUpdate);
}
$listingProduct->addData($dataForUpdate)->save();
return $listingProduct;
}