本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Product::getChildObject方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Product::getChildObject方法的具体用法?PHP Ess_M2ePro_Model_Listing_Product::getChildObject怎么用?PHP Ess_M2ePro_Model_Listing_Product::getChildObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Product
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Product::getChildObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveVariationsSets
private function saveVariationsSets(Ess_M2ePro_Model_Listing_Product $listingProduct, $variations)
{
if (!isset($variations['set'])) {
return;
}
$additionalData = $listingProduct->getChildObject()->getData('additional_data');
$additionalData = is_null($additionalData) ? array() : json_decode($additionalData, true);
$additionalData['variations_sets'] = $variations['set'];
$listingProduct->getChildObject()->setData('additional_data', json_encode($additionalData))->save();
}
示例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: getConnectorParams
private function getConnectorParams()
{
$searchMethod = $this->getSearchMethod();
/** @var Ess_M2ePro_Model_Amazon_Listing_Product $amazonListingProduct */
$amazonListingProduct = $this->listingProduct->getChildObject();
$isModifyChildToSimple = !$amazonListingProduct->getVariationManager()->isRelationParentType();
$params = array('variation_bad_parent_modify_child_to_simple' => $isModifyChildToSimple);
if ($searchMethod == 'byQuery') {
$params['query'] = $this->query;
} else {
$params['query'] = $this->getStrippedQuery();
}
if ($searchMethod == 'byIdentifier') {
$params['query_type'] = $this->getIdentifierType();
}
return $params;
}
示例4: getRequestData
public function getRequestData(Ess_M2ePro_Model_Listing_Product $listingProduct, array &$requestData)
{
/** @var $categoryTemplate Ess_M2ePro_Model_Ebay_Template_Category */
$categoryTemplate = $listingProduct->getChildObject()->getCategoryTemplate();
$categoryTemplate->setMagentoProduct($listingProduct->getMagentoProduct());
/** @var $otherCategoryTemplate Ess_M2ePro_Model_Ebay_Template_OtherCategory */
$otherCategoryTemplate = $listingProduct->getChildObject()->getOtherCategoryTemplate();
if (!is_null($otherCategoryTemplate)) {
$otherCategoryTemplate->setMagentoProduct($listingProduct->getMagentoProduct());
}
$this->addMainCategoriesData($categoryTemplate, $otherCategoryTemplate, $requestData);
$this->addStoreCategoriesData($otherCategoryTemplate, $requestData);
$this->addMotorsSpecificsData($listingProduct, $listingProduct->getListing()->getMarketplace(), $categoryTemplate, $requestData);
$this->addItemSpecificsData($listingProduct, $categoryTemplate, $requestData);
$this->addCustomItemSpecificsData($listingProduct, $categoryTemplate, $requestData);
$this->clearConflictedItemSpecificsData($requestData);
$this->addAttributeSetData($listingProduct, $categoryTemplate, $requestData);
}
示例5: getRunnerData
private function getRunnerData(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
/** @var Ess_M2ePro_Model_Ebay_Listing_Product $ebayListingProduct */
$ebayListingProduct = $listingProduct->getChildObject();
if (!$ebayListingProduct->getEbaySellingFormatTemplate()->getOutOfStockControl()) {
return array('action' => Ess_M2ePro_Model_Listing_Product::ACTION_STOP, 'params' => array());
}
return array('action' => Ess_M2ePro_Model_Listing_Product::ACTION_REVISE, 'params' => array('replaced_action' => Ess_M2ePro_Model_Listing_Product::ACTION_STOP, 'only_data' => array('qty' => true, 'variations' => true)));
}
示例6: processSucceededResponseData
public function processSucceededResponseData($receivedItems)
{
if ($this->currentStep == Ess_M2ePro_Model_Buy_Search_Automatic_Requester::STEP_MAGENTO_TITLE) {
$tempReceivedItems = $this->filterReceivedItemsFullTitleMatch($receivedItems);
count($tempReceivedItems) == 1 && ($receivedItems = $tempReceivedItems);
}
$childListingProduct = $this->listingProduct->getChildObject();
if (count($receivedItems) <= 0) {
$temp = Ess_M2ePro_Model_Buy_Search_Automatic_Requester::STEP_MAGENTO_TITLE;
if ($this->currentStep >= $temp) {
$childListingProduct->setData('general_id_search_status', Ess_M2ePro_Model_Buy_Listing_Product::GENERAL_ID_SEARCH_STATUS_NONE);
$message = Mage::helper('M2ePro')->__('The Product(s) was not found on Rakuten.com.');
$childListingProduct->setData('general_id_search_suggest_data', json_encode(array('message' => $message)));
$childListingProduct->save();
return;
}
$params = array('listing_product' => $this->listingProduct, 'step' => $this->currentStep + 1);
$dispatcherObject = Mage::getModel('M2ePro/Buy_Connector')->getDispatcher();
$dispatcherObject->processConnector('search', 'automatic', 'requester', $params, $this->getMarketplace(), $this->getAccount(), 'Ess_M2ePro_Model_Buy');
return;
}
if (count($receivedItems) == 1) {
if (!isset($receivedItems[0]['variations'])) {
$childListingProduct->setData('general_id', $receivedItems[0]['general_id']);
$childListingProduct->setData('general_id_search_status', Ess_M2ePro_Model_Buy_Listing_Product::GENERAL_ID_SEARCH_STATUS_SET_AUTOMATIC);
$childListingProduct->setData('general_id_search_suggest_data', NULL);
$childListingProduct->save();
return;
}
if (count($receivedItems[0]['variations']['skus']) == 1) {
reset($receivedItems[0]['variations']['skus']);
$childListingProduct->setData('general_id', key($receivedItems[0]['variations']['skus']));
$childListingProduct->setData('general_id_search_status', Ess_M2ePro_Model_Buy_Listing_Product::GENERAL_ID_SEARCH_STATUS_SET_AUTOMATIC);
$childListingProduct->setData('general_id_search_suggest_data', NULL);
$childListingProduct->save();
return;
}
}
$childListingProduct->setData('general_id_search_status', Ess_M2ePro_Model_Buy_Listing_Product::GENERAL_ID_SEARCH_STATUS_NONE);
$childListingProduct->setData('general_id_search_suggest_data', json_encode($receivedItems));
$childListingProduct->save();
}
示例7: processSuccess
protected function processSuccess(Ess_M2ePro_Model_Listing_Product $listingProduct, array $params = array())
{
/** @var Ess_M2ePro_Model_Amazon_Listing_Product $amazonListingProduct */
$amazonListingProduct = $listingProduct->getChildObject();
if ($amazonListingProduct->getVariationManager()->isRelationMode() && !$this->getRequestDataObject($listingProduct)->hasProductId() && empty($params['general_id'])) {
$this->getLogger()->logListingProductMessage($listingProduct, 'Unexpected error. The ASIN/ISBN for Parent or Child Product was not returned from Amazon.
Operation cannot be finished correctly.', Ess_M2ePro_Model_Log_Abstract::TYPE_ERROR, Ess_M2ePro_Model_Log_Abstract::PRIORITY_MEDIUM);
return;
}
parent::processSuccess($listingProduct, $params);
}
示例8: checkVariationStructureChanges
private function checkVariationStructureChanges(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
/** @var Ess_M2ePro_Model_Buy_Listing_Product_Variation_Manager $variationManager */
$variationManager = $listingProduct->getChildObject()->getVariationManager();
if (!$variationManager->isActualProductAttributes()) {
$variationManager->resetProductVariation();
return;
}
if ($variationManager->isVariationProductMatched() && !$variationManager->isActualProductVariation()) {
$variationManager->unsetProductVariation();
}
}
示例9: calculateCurrentData
private function calculateCurrentData()
{
if (!empty($this->currentQuery) || $this->currentStep > self::STEP_MAGENTO_TITLE) {
return;
}
/** @var $listing Ess_M2ePro_Model_Buy_Listing */
$listing = $this->listingProduct->getListing()->getChildObject();
$tempQuery = '';
switch ($this->currentStep) {
case self::STEP_GENERAL_ID:
$tempQuery = $this->listingProduct->getChildObject()->getGeneralId();
empty($tempQuery) && ($tempQuery = $this->listingProduct->getChildObject()->getAddingGeneralId());
break;
case self::STEP_MAGENTO_TITLE:
if ($listing->isSearchByMagentoTitleModeEnabled()) {
$tempQuery = $this->listingProduct->getChildObject()->getActualMagentoProduct()->getName();
}
break;
}
!empty($tempQuery) ? $this->currentQuery = (string) $tempQuery : $this->currentStep++;
$this->calculateCurrentData();
}
示例10: prepareConfigurator
private function prepareConfigurator(Ess_M2ePro_Model_Listing_Product $listingProduct, Ess_M2ePro_Model_Ebay_Listing_Product_Action_Configurator $configurator, $action)
{
if ($action != Ess_M2ePro_Model_Listing_Product::ACTION_STOP) {
$configurator->setParams(array('replaced_action' => Ess_M2ePro_Model_Listing_Product::ACTION_STOP));
}
/** @var Ess_M2ePro_Model_Ebay_Listing_Product $ebayListingProduct */
$ebayListingProduct = $listingProduct->getChildObject();
if (!$ebayListingProduct->getEbaySellingFormatTemplate()->getOutOfStockControl() && $action == Ess_M2ePro_Model_Listing_Product::ACTION_STOP) {
return;
}
$configurator->setPartialMode();
$configurator->allowQty()->allowVariations();
}
示例11: filterReceivedItemsFullTitleMatch
protected function filterReceivedItemsFullTitleMatch($receivedItems)
{
$return = array();
$magentoProductTitle = $this->listingProduct->getChildObject()->getActualMagentoProduct()->getName();
$magentoProductTitle = trim(strtolower($magentoProductTitle));
foreach ($receivedItems as $item) {
$itemTitle = trim(strtolower($item['title']));
if ($itemTitle == $magentoProductTitle) {
$return[] = $item;
}
}
return $return;
}
示例12: isAddedNewVariationsAttributes
public function isAddedNewVariationsAttributes(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
if (!$listingProduct->getChildObject()->isListingTypeFixed() || !$listingProduct->getChildObject()->isVariationMode()) {
return false;
}
if ($listingProduct->getMagentoProduct()->isProductWithoutVariations()) {
return false;
}
$rawMagentoVariations = $listingProduct->getMagentoProduct()->getProductVariations();
$rawMagentoVariations = $this->validateLimitsConditions($rawMagentoVariations, NULL);
$magentoVariations = $this->prepareMagentoVariations($rawMagentoVariations);
$currentVariations = $this->prepareCurrentVariations($listingProduct->getVariations(true));
if (!isset($magentoVariations[0]) && !isset($currentVariations[0])) {
return false;
}
if (!isset($magentoVariations[0]) || !isset($currentVariations[0])) {
return true;
}
if (count($magentoVariations[0]['options']) != count($currentVariations[0]['options'])) {
return true;
}
return false;
}
示例13: processSucceededResponseData
public function processSucceededResponseData($receivedItems, $hash)
{
$this->unsetProcessingLock = true;
$this->unsetLocks($hash);
$this->unsetProcessingLock = false;
if ($this->currentStep == Ess_M2ePro_Model_Amazon_Search_Automatic_ByQuery_Requester::STEP_MAGENTO_TITLE) {
$tempReceivedItems = $this->filterReceivedItemsFullTitleMatch($receivedItems);
count($tempReceivedItems) == 1 && ($receivedItems = $tempReceivedItems);
}
$childListingProduct = $this->listingProduct->getChildObject();
if (count($receivedItems) <= 0) {
$temp = Ess_M2ePro_Model_Amazon_Search_Automatic_ByQuery_Requester::STEP_MAGENTO_TITLE;
if ($this->currentStep >= $temp) {
$childListingProduct->setData('general_id_search_status', Ess_M2ePro_Model_Amazon_Listing_Product::GENERAL_ID_SEARCH_STATUS_NONE);
$message = Mage::helper('M2ePro')->__('The Product(s) was not found on Amazon.');
$childListingProduct->setData('general_id_search_suggest_data', json_encode(array('message' => $message)));
$childListingProduct->save();
return;
}
$params = array('listing_product' => $this->listingProduct, 'step' => $this->currentStep + 1);
$dispatcherObject = Mage::getModel('M2ePro/Amazon_Connector')->getDispatcher();
$dispatcherObject->processConnector('automatic', 'byQuery', 'requester', $params, $this->getMarketplace(), $this->getAccount(), 'Ess_M2ePro_Model_Amazon_Search');
return;
}
if (count($receivedItems) == 1) {
$childListingProduct->setData('general_id', $receivedItems[0]['general_id']);
$childListingProduct->setData('is_isbn_general_id', (int) Mage::helper('M2ePro/Component_Amazon')->isISBN($receivedItems[0]['general_id']));
$temp = Ess_M2ePro_Model_Amazon_Listing_Product::GENERAL_ID_SEARCH_STATUS_SET_AUTOMATIC;
$childListingProduct->setData('general_id_search_status', $temp);
$childListingProduct->setData('general_id_search_suggest_data', NULL);
$childListingProduct->save();
return;
}
$childListingProduct->setData('general_id_search_status', Ess_M2ePro_Model_Amazon_Listing_Product::GENERAL_ID_SEARCH_STATUS_NONE);
$childListingProduct->setData('general_id_search_suggest_data', json_encode($receivedItems));
$childListingProduct->save();
}
示例14: calculateCurrentData
private function calculateCurrentData()
{
if (!empty($this->currentQuery) || $this->currentStep > self::STEP_MAGENTO_TITLE) {
return;
}
switch ($this->currentStep) {
case self::STEP_GENERAL_ID:
$tempQuery = $this->listingProduct->getChildObject()->getGeneralId();
empty($tempQuery) && ($tempQuery = $this->listingProduct->getChildObject()->getAddingGeneralId());
!empty($tempQuery) && ($this->currentStep = self::STEP_GENERAL_ID);
!empty($tempQuery) && ($this->currentQuery = (string) $tempQuery);
break;
case self::STEP_MAGENTO_TITLE:
$tempQuery = '';
if ($this->listingProduct->getGeneralTemplate()->getChildObject()->isSearchByMagentoTitleModeEnabled()) {
$tempQuery = $this->listingProduct->getMagentoProduct()->getName();
}
!empty($tempQuery) && ($this->currentStep = self::STEP_MAGENTO_TITLE);
!empty($tempQuery) && ($this->currentQuery = (string) $tempQuery);
break;
}
empty($this->currentQuery) && $this->currentStep++;
$this->calculateCurrentData();
}
示例15: calculateCurrentData
private function calculateCurrentData()
{
if (!empty($this->currentQuery) || $this->currentStep > self::STEP_MAGENTO_TITLE) {
return;
}
switch ($this->currentStep) {
case self::STEP_UPC_EAN:
$tempQuery = $this->listingProduct->getChildObject()->getWorldwideId();
empty($tempQuery) && ($tempQuery = $this->listingProduct->getChildObject()->getAddingWorldwideId());
!empty($tempQuery) && ($this->currentStep = self::STEP_UPC_EAN);
!empty($tempQuery) && ($this->currentQuery = (string) $tempQuery);
break;
case self::STEP_MAGENTO_TITLE:
$tempQuery = '';
if ($this->listingProduct->getListing()->getChildObject()->isSearchByMagentoTitleModeEnabled()) {
$tempQuery = $this->listingProduct->getChildObject()->getActualMagentoProduct()->getName();
}
!empty($tempQuery) && ($this->currentStep = self::STEP_MAGENTO_TITLE);
!empty($tempQuery) && ($this->currentQuery = (string) $tempQuery);
break;
}
empty($this->currentQuery) && $this->currentStep++;
$this->calculateCurrentData();
}