本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Product::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Product::getId方法的具体用法?PHP Ess_M2ePro_Model_Listing_Product::getId怎么用?PHP Ess_M2ePro_Model_Listing_Product::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Product
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Product::getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validateChannelConditions
protected function validateChannelConditions($sourceVariations, $writeLogs = true)
{
$tempLog = Mage::getModel('M2ePro/Listing_Log');
$tempLog->setComponentMode(Ess_M2ePro_Helper_Component_Ebay::NICK);
$failResult = array('set' => array(), 'variations' => array());
$set = $sourceVariations['set'];
$variations = $sourceVariations['variations'];
foreach ($set as $singleSet) {
if (count($singleSet) > 30) {
// Maximum 30 options by one attribute:
// Color: Red, Blue, Green, ...
$writeLogs && $tempLog->addProductMessage($this->listingProduct->getListingId(), $this->listingProduct->getProductId(), $this->listingProduct->getId(), $this->logsInitiator, $this->logsActionId, $this->logsAction, 'The product will be listed as a simple product as it has limitation for multi-variation items. Reason: ' . 'number of values for each option more than 30.', Ess_M2ePro_Model_Log_Abstract::TYPE_WARNING, Ess_M2ePro_Model_Log_Abstract::PRIORITY_MEDIUM);
return $failResult;
}
}
foreach ($variations as $singleVariation) {
if (count($singleVariation) > 5) {
// Max 5 pair attribute-option:
// Color: Blue, Size: XL, ...
$writeLogs && $tempLog->addProductMessage($this->listingProduct->getListingId(), $this->listingProduct->getProductId(), $this->listingProduct->getId(), Ess_M2ePro_Model_Log_Abstract::INITIATOR_UNKNOWN, NULL, Ess_M2ePro_Model_Listing_Log::ACTION_ADD_PRODUCT_TO_LISTING, 'The product will be listed as a simple product as it has limitation for multi-variation items. Reason: ' . 'number of options more than 5.', Ess_M2ePro_Model_Log_Abstract::TYPE_WARNING, Ess_M2ePro_Model_Log_Abstract::PRIORITY_MEDIUM);
return $failResult;
}
}
if (count($variations) > 250) {
// Not more that 250 possible variations
$writeLogs && $tempLog->addProductMessage($this->listingProduct->getListingId(), $this->listingProduct->getProductId(), $this->listingProduct->getId(), Ess_M2ePro_Model_Log_Abstract::INITIATOR_UNKNOWN, NULL, Ess_M2ePro_Model_Listing_Log::ACTION_ADD_PRODUCT_TO_LISTING, 'The product will be listed as a simple product as it has limitation for multi-variation items. Reason: ' . 'sum of quantities of all possible products options more than 250.', Ess_M2ePro_Model_Log_Abstract::TYPE_WARNING, Ess_M2ePro_Model_Log_Abstract::PRIORITY_MEDIUM);
return $failResult;
}
return $sourceVariations;
}
示例2: checkVariationStructureChanges
private function checkVariationStructureChanges(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager $variationManager */
$variationManager = $listingProduct->getChildObject()->getVariationManager();
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_Abstract $typeModel */
$typeModel = $variationManager->getTypeModel();
if ($variationManager->isRelationParentType()) {
$this->parentListingsProductsForProcessing[$listingProduct->getId()] = $listingProduct;
return;
}
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_PhysicalUnit $typeModel */
if (!$typeModel->isActualProductAttributes()) {
if ($variationManager->isRelationChildType()) {
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_Type_Relation_Child $typeModel */
$this->parentListingsProductsForProcessing[$typeModel->getParentListingProduct()->getId()] = $typeModel->getParentListingProduct();
return;
}
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_Type_Individual $typeModel */
$typeModel->resetProductVariation();
return;
}
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_PhysicalUnit $typeModel */
if ($typeModel->isVariationProductMatched() && !$typeModel->isActualProductVariation()) {
if ($variationManager->isRelationChildType()) {
/** @var Ess_M2ePro_Model_Amazon_Listing_Product_Variation_Manager_Type_Relation_Child $typeModel */
$this->parentListingsProductsForProcessing[$typeModel->getParentListingProduct()->getId()] = $typeModel->getParentListingProduct();
return;
}
$typeModel->unsetProductVariation();
}
}
示例3: isExistProductAction
public function isExistProductAction(Ess_M2ePro_Model_Listing_Product $listingProductInstance, $action, array $params = array())
{
$newListingsProductId = $listingProductInstance->getId();
$params['status_changer'] = Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_SYNCH;
if (!isset($this->_actionsProducts[$newListingsProductId])) {
return false;
}
if ($this->_actionsProducts[$newListingsProductId]['action'] != $action) {
return false;
}
$tempExistItem = $this->_actionsProducts[$newListingsProductId];
foreach ($params as $tempParamKey => $tempParamValue) {
if (!isset($tempExistItem['params'][$tempParamKey])) {
return false;
}
if (is_array($tempExistItem['params'][$tempParamKey]) && is_array($tempParamValue)) {
foreach ($tempParamValue as $tempParamKeyTwo => $tempParamValueTwo) {
if (!isset($tempExistItem['params'][$tempParamKey][$tempParamKeyTwo])) {
return false;
}
if ($tempExistItem['params'][$tempParamKey][$tempParamKeyTwo] != $tempParamValueTwo) {
return false;
}
}
continue;
}
if ($tempExistItem['params'][$tempParamKey] != $tempParamValue) {
return false;
}
}
return true;
}
示例4: logListingProductMessage
public function logListingProductMessage(Ess_M2ePro_Model_Listing_Product $listingProduct, array $messageData, $priority = Ess_M2ePro_Model_Log_Abstract::PRIORITY_MEDIUM)
{
if ($this->storeMode) {
$this->storedMessages[] = array('type' => $this->initLogType($messageData[Ess_M2ePro_Model_Connector_Protocol::MESSAGE_TYPE_KEY]), 'text' => $messageData[Ess_M2ePro_Model_Connector_Protocol::MESSAGE_TEXT_KEY]);
return;
}
$this->getListingLog()->addProductMessage($listingProduct->getListingId(), $listingProduct->getProductId(), $listingProduct->getId(), $this->initiator, $this->actionId, $this->action, $messageData[Ess_M2ePro_Model_Connector_Protocol::MESSAGE_TEXT_KEY], $this->initLogType($messageData[Ess_M2ePro_Model_Connector_Protocol::MESSAGE_TYPE_KEY]), $priority);
}
示例5: getSuccessfulParams
protected function getSuccessfulParams(Ess_M2ePro_Model_Listing_Product $listingProduct, $response)
{
foreach ($response['skus'] as $key => $generalId) {
if ((int) $key != (int) $listingProduct->getId()) {
continue;
}
return array('general_id' => $generalId);
}
return array();
}
示例6: getSuccessfulParams
protected function getSuccessfulParams(Ess_M2ePro_Model_Listing_Product $listingProduct, $response)
{
if (!is_array($response['asins']) || empty($response['asins'])) {
return array();
}
foreach ($response['asins'] as $key => $asin) {
if ((int) $key != (int) $listingProduct->getId()) {
continue;
}
return array('general_id' => $asin);
}
return array();
}
示例7: process
public function process(Ess_M2ePro_Model_Listing_Product $listingProduct, $query)
{
$searchMethod = 'byQuery';
$tempQuery = str_replace('-', '', $query);
if ($this->isQueryEan($tempQuery) || $this->isQueryIsbn($tempQuery)) {
$query = $tempQuery;
$searchMethod = 'byEanIsbn';
}
$params = array('query' => $query, 'type' => 'manual', 'listing_product_id' => $listingProduct->getId());
Mage::getModel('M2ePro/Connector_Play_Dispatcher')->processConnector('search', $searchMethod, 'requester', $params, $listingProduct->getAccount(), 'Ess_M2ePro_Model_Play');
$result = Mage::helper('M2ePro/Data_Global')->getValue('temp_play_manual_search_result');
Mage::helper('M2ePro/Data_Global')->unsetValue('temp_play_manual_search_result');
return $result;
}
示例8: process
public function process(Ess_M2ePro_Model_Listing_Product $listingProduct, $query)
{
$searchMethod = 'byQuery';
if ($this->isQueryGeneralId($query) || $this->isQueryUpc($query)) {
$searchMethod = 'byIdentifier';
}
$params = array('query' => $query, 'type' => 'manual', 'listing_product_id' => $listingProduct->getId());
if ($searchMethod == 'byIdentifier') {
$params['search_type'] = $this->getSearchType($query);
}
Mage::getModel('M2ePro/Connector_Buy_Dispatcher')->processConnector('search', $searchMethod, 'requester', $params, $listingProduct->getAccount(), 'Ess_M2ePro_Model_Buy');
$result = Mage::helper('M2ePro/Data_Global')->getValue('temp_buy_manual_search_result');
Mage::helper('M2ePro/Data_Global')->unsetValue('temp_buy_manual_search_result');
return $result;
}
示例9: addListingsProductsLogsMessage
protected function addListingsProductsLogsMessage(Ess_M2ePro_Model_Listing_Product $listingProduct, $text, $type = Ess_M2ePro_Model_Log_Abstract::TYPE_NOTICE, $priority = Ess_M2ePro_Model_Log_Abstract::PRIORITY_MEDIUM)
{
$action = Ess_M2ePro_Model_Listing_Log::ACTION_TRANSLATE_PRODUCT;
if ($this->getStatusChanger() == Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_UNKNOWN) {
$initiator = Ess_M2ePro_Helper_Data::INITIATOR_UNKNOWN;
} else {
if ($this->getStatusChanger() == Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_USER) {
$initiator = Ess_M2ePro_Helper_Data::INITIATOR_USER;
} else {
$initiator = Ess_M2ePro_Helper_Data::INITIATOR_EXTENSION;
}
}
$logModel = Mage::getModel('M2ePro/Listing_Log');
$logModel->setComponentMode(Ess_M2ePro_Helper_Component_Ebay::NICK);
$logModel->addProductMessage($listingProduct->getListingId(), $listingProduct->getProductId(), $listingProduct->getId(), $initiator, $this->getLogsActionId(), $action, $text, $type, $priority);
}
示例10: process
public function process(Ess_M2ePro_Model_Listing_Product $listingProduct, $query)
{
$searchMethod = 'byQuery';
$validation = Mage::helper('M2ePro');
$tempQuery = str_replace('-', '', $query);
if (Mage::helper('M2ePro/Component_Amazon')->isASIN($tempQuery) || $validation->isISBN10($tempQuery)) {
$query = $tempQuery;
$searchMethod = 'byAsin';
} elseif ($validation->isEAN($tempQuery) || $validation->isUPC($tempQuery) || $validation->isISBN13($tempQuery)) {
$query = $tempQuery;
$searchMethod = 'byIdentifier';
}
$params = array('item' => $query, 'type' => 'manual', 'only_realtime' => true, 'search_method' => $searchMethod, 'listing_product_id' => $listingProduct->getId());
if ($searchMethod == 'byIdentifier') {
$params['id_type'] = $this->getIdentifierType($query);
}
Mage::getModel('M2ePro/Connector_Amazon_Dispatcher')->processConnector('search', $searchMethod, 'requester', $params, $listingProduct->getAccount(), 'Ess_M2ePro_Model_Amazon');
$result = Mage::helper('M2ePro/Data_Global')->getValue('temp_amazon_manual_search_result');
Mage::helper('M2ePro/Data_Global')->unsetValue('temp_amazon_manual_search_result');
return $result;
}
示例11: 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);
}
示例12: addBaseListingsLogsMessage
protected function addBaseListingsLogsMessage(Ess_M2ePro_Model_Listing_Product $listingProduct, $text, $type = Ess_M2ePro_Model_Log_Abstract::TYPE_NOTICE, $priority = Ess_M2ePro_Model_Log_Abstract::PRIORITY_MEDIUM, $isListingMode = true)
{
$action = $this->getListingsLogsCurrentAction();
is_null($action) && ($action = Ess_M2ePro_Model_Listing_Log::ACTION_UNKNOWN);
switch ($type) {
case Ess_M2ePro_Model_Log_Abstract::TYPE_ERROR:
$this->setStatus(Ess_M2ePro_Helper_Data::STATUS_ERROR);
break;
case Ess_M2ePro_Model_Log_Abstract::TYPE_WARNING:
$this->setStatus(Ess_M2ePro_Helper_Data::STATUS_WARNING);
break;
case Ess_M2ePro_Model_Log_Abstract::TYPE_SUCCESS:
case Ess_M2ePro_Model_Log_Abstract::TYPE_NOTICE:
$this->setStatus(Ess_M2ePro_Helper_Data::STATUS_SUCCESS);
break;
default:
$this->setStatus(Ess_M2ePro_Helper_Data::STATUS_ERROR);
break;
}
$initiator = Ess_M2ePro_Model_Log_Abstract::INITIATOR_UNKNOWN;
if ($this->params['status_changer'] == Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_UNKNOWN) {
$initiator = Ess_M2ePro_Model_Log_Abstract::INITIATOR_UNKNOWN;
} else {
if ($this->params['status_changer'] == Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_USER) {
$initiator = Ess_M2ePro_Model_Log_Abstract::INITIATOR_USER;
} else {
$initiator = Ess_M2ePro_Model_Log_Abstract::INITIATOR_EXTENSION;
}
}
$logModel = Mage::getModel('M2ePro/Listing_Log');
$logModel->setComponentMode(Ess_M2ePro_Helper_Component_Play::NICK);
if ($isListingMode) {
$logModel->addListingMessage($listingProduct->getListingId(), $initiator, $this->logsActionId, $action, $text, $type, $priority);
} else {
$logModel->addProductMessage($listingProduct->getListingId(), $listingProduct->getProductId(), $listingProduct->getId(), $initiator, $this->logsActionId, $action, $text, $type, $priority);
}
}
示例13: getRequestDataObject
/**
* @param Ess_M2ePro_Model_Listing_Product $listingProduct
* @return Ess_M2ePro_Model_Buy_Listing_Product_Action_RequestData
*/
protected function getRequestDataObject(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
if (!isset($this->requestsDataObjects[$listingProduct->getId()])) {
/** @var Ess_M2ePro_Model_Buy_Listing_Product_Action_RequestData $requestData */
$requestData = Mage::getModel('M2ePro/Buy_Listing_Product_Action_RequestData');
$requestData->setData($this->params['products'][$listingProduct->getId()]);
$requestData->setListingProduct($listingProduct);
$this->requestsDataObjects[$listingProduct->getId()] = $requestData;
}
return $this->requestsDataObjects[$listingProduct->getId()];
}
示例14: isMeetListRequirements
private function isMeetListRequirements(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
// Is checked before?
//--------------------
if (in_array($listingProduct->getId(), $this->_checkedListingsProductsIds)) {
return false;
} else {
$this->_checkedListingsProductsIds[] = $listingProduct->getId();
}
//--------------------
// eBay available status
//--------------------
if (!$listingProduct->isNotListed()) {
return false;
}
if (!$listingProduct->isListable()) {
return false;
}
if ($this->_runnerActions->isExistProductAction($listingProduct, Ess_M2ePro_Model_Connector_Server_Ebay_Item_Dispatcher::ACTION_LIST, array())) {
return false;
}
//--------------------
/* @var $ebaySynchronizationTemplate Ess_M2ePro_Model_Ebay_Template_Synchronization */
$ebaySynchronizationTemplate = $listingProduct->getChildObject()->getEbaySynchronizationTemplate();
// Correct synchronization
//--------------------
if (!$listingProduct->getChildObject()->isSetCategoryTemplate()) {
return false;
}
if (!$ebaySynchronizationTemplate->isListMode()) {
return false;
}
if ($ebaySynchronizationTemplate->isScheduleEnabled()) {
if (!$ebaySynchronizationTemplate->isScheduleIntervalNow() || !$ebaySynchronizationTemplate->isScheduleWeekNow()) {
return false;
}
}
//--------------------
$productsIdsForEachVariation = NULL;
// Check filters
//--------------------
if ($ebaySynchronizationTemplate->isListStatusEnabled()) {
if ($listingProduct->getMagentoProduct()->getStatus() != Mage_Catalog_Model_Product_Status::STATUS_ENABLED) {
return false;
} else {
if (is_null($productsIdsForEachVariation)) {
$productsIdsForEachVariation = $listingProduct->getProductsIdsForEachVariation();
}
if (count($productsIdsForEachVariation) > 0) {
$tempStatuses = $listingProduct->getVariationsStatuses($productsIdsForEachVariation);
// all variations are disabled
if ((int) min($tempStatuses) == Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
return false;
}
}
}
}
if ($ebaySynchronizationTemplate->isListIsInStock()) {
if (!$listingProduct->getMagentoProduct()->getStockAvailability()) {
return false;
} else {
if (is_null($productsIdsForEachVariation)) {
$productsIdsForEachVariation = $listingProduct->getProductsIdsForEachVariation();
}
if (count($productsIdsForEachVariation) > 0) {
$tempStocks = $listingProduct->getVariationsStockAvailabilities($productsIdsForEachVariation);
// all variations are out of stock
if (!(int) max($tempStocks)) {
return false;
}
}
}
}
if ($ebaySynchronizationTemplate->isListWhenQtyHasValue()) {
$result = false;
$productQty = (int) $listingProduct->getChildObject()->getQty(true);
$typeQty = (int) $ebaySynchronizationTemplate->getListWhenQtyHasValueType();
$minQty = (int) $ebaySynchronizationTemplate->getListWhenQtyHasValueMin();
$maxQty = (int) $ebaySynchronizationTemplate->getListWhenQtyHasValueMax();
if ($typeQty == Ess_M2ePro_Model_Ebay_Template_Synchronization::LIST_QTY_LESS && $productQty <= $minQty) {
$result = true;
}
if ($typeQty == Ess_M2ePro_Model_Ebay_Template_Synchronization::LIST_QTY_MORE && $productQty >= $minQty) {
$result = true;
}
if ($typeQty == Ess_M2ePro_Model_Ebay_Template_Synchronization::LIST_QTY_BETWEEN && $productQty >= $minQty && $productQty <= $maxQty) {
$result = true;
}
if (!$result) {
return false;
}
}
//--------------------
return true;
}
示例15: getRequestObject
/**
* @param Ess_M2ePro_Model_Listing_Product $listingProduct
* @return Ess_M2ePro_Model_Buy_Listing_Product_Action_Type_Request
*/
protected function getRequestObject(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
if (!isset($this->requestsObjects[$listingProduct->getId()])) {
/* @var $request Ess_M2ePro_Model_Buy_Listing_Product_Action_Type_List_Request */
$request = Mage::getModel('M2ePro/Buy_Listing_Product_Action_Type_List_Request');
$request->setParams($this->params);
$request->setListingProduct($listingProduct);
$request->setConfigurator($this->getConfigurator());
$request->setValidatorsData($this->getValidatorsData($listingProduct));
$this->requestsObjects[$listingProduct->getId()] = $request;
}
return $this->requestsObjects[$listingProduct->getId()];
}