本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Product类的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Product类的具体用法?PHP Ess_M2ePro_Model_Listing_Product怎么用?PHP Ess_M2ePro_Model_Listing_Product使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Ess_M2ePro_Model_Listing_Product类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例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: updateAfterAction
public function updateAfterAction(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
if ($listingProduct->getMagentoProduct()->isProductWithoutVariations()) {
return;
}
// TODO next release
}
示例4: setListAttemptData
private function setListAttemptData(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
$additionalData = $listingProduct->getAdditionalData();
$additionalData['last_list_attempt_date'] = Mage::helper('M2ePro')->getCurrentGmtDate();
$listingProduct->setSettings('additional_data', $additionalData);
$listingProduct->save();
}
示例5: 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);
}
示例6: 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)));
}
示例7: processAddedListingProduct
protected function processAddedListingProduct(Ess_M2ePro_Model_Listing_Product $listingProduct, array $params)
{
if (!empty($params['template_category_id'])) {
$listingProduct->setData('template_category_id', $params['template_category_id']);
}
if (!empty($params['template_other_category_id'])) {
$listingProduct->setData('template_other_category_id', $params['template_other_category_id']);
}
$listingProduct->save();
}
示例8: 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();
}
示例9: 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();
}
示例10: 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();
}
}
示例11: 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();
}
示例12: 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();
}
示例13: getSpecifics
public function getSpecifics(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
$attributeCode = Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/ebay/motor/', 'motors_specifics_attribute');
if (empty($attributeCode)) {
return false;
}
$attributeValue = $listingProduct->getMagentoProduct()->getAttributeValue($attributeCode);
if (empty($attributeValue)) {
return array();
}
$epids = explode(self::VALUE_SEPARATOR, $attributeValue);
return Mage::getModel('M2ePro/Ebay_Motor_Specific')->getCollection()->addFieldToFilter('epid', array('in' => $epids))->getItems();
}
示例14: 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;
}
示例15: 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;
}