本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Product::isComponentModeEbay方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Product::isComponentModeEbay方法的具体用法?PHP Ess_M2ePro_Model_Listing_Product::isComponentModeEbay怎么用?PHP Ess_M2ePro_Model_Listing_Product::isComponentModeEbay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Product
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Product::isComponentModeEbay方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItemDataByListingProduct
private function getItemDataByListingProduct(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
$connectorClassName = 'Ess_M2ePro_Model_Connector_' . ucfirst($listingProduct->getComponentMode()) . '_';
$connectorClassName .= $listingProduct->isComponentModeEbay() ? 'Item' : 'Product';
$connectorClassName .= '_Stop_Multiple' . ($listingProduct->isComponentModeEbay() ? '' : 'Requester');
$connectorParams = array('logs_action_id' => 0, 'status_changer' => Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_UNKNOWN);
try {
$connector = new $connectorClassName($connectorParams, array($listingProduct));
$itemData = $connector->getRequestDataPackage();
} catch (Exception $exception) {
return NULL;
}
if (!isset($itemData['data']['items'])) {
return NULL;
}
return array_shift($itemData['data']['items']);
}
示例2: getItemDataByListingProduct
private function getItemDataByListingProduct(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
$connectorClassName = 'Ess_M2ePro_Model_Connector_Server_' . ucfirst($listingProduct->getComponentMode()) . '_';
$connectorClassName .= $listingProduct->isComponentModeEbay() ? 'Item' : 'Product';
$connectorClassName .= '_Stop_Multiple';
try {
$connector = new $connectorClassName(array(), array($listingProduct));
$itemData = $connector->getRequestDataPackage();
} catch (Exception $exception) {
return NULL;
}
if (!isset($itemData['data']['items'])) {
return NULL;
}
return array_shift($itemData['data']['items']);
}
示例3: 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);
}
示例4: logListingProductMessage
private function logListingProductMessage(Ess_M2ePro_Model_Listing_Product $listingProduct, $action, $oldValue, $newValue, $messagePostfix = '')
{
// M2ePro_TRANSLATIONS
// From [%from%] to [%to%].
if ($listingProduct->isComponentModeEbay()) {
$log = Mage::getModel('M2ePro/Listing_Log');
$log->setComponentMode($listingProduct->getComponentMode());
} else {
$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;
}
$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);
}