本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Product::getMarketplace方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Product::getMarketplace方法的具体用法?PHP Ess_M2ePro_Model_Listing_Product::getMarketplace怎么用?PHP Ess_M2ePro_Model_Listing_Product::getMarketplace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Product
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Product::getMarketplace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(array $params = array(), Ess_M2ePro_Model_Listing_Product $listingProduct)
{
if (!is_null($listingProduct->getActionConfigurator())) {
$actionConfigurator = $listingProduct->getActionConfigurator();
} else {
$actionConfigurator = Mage::getModel('M2ePro/Ebay_Listing_Product_Action_Configurator');
}
$this->listingProduct = $listingProduct->loadInstance($listingProduct->getId());
$this->listingProduct->setActionConfigurator($actionConfigurator);
parent::__construct($params, $this->listingProduct->getMarketplace(), $this->listingProduct->getAccount());
}
示例2: __construct
public function __construct(array $params = array(), Ess_M2ePro_Model_Listing_Product $listingProduct)
{
$this->listingProduct = $listingProduct;
parent::__construct($params, $this->listingProduct->getMarketplace(), $this->listingProduct->getAccount());
}
示例3: updateProductAfterAction
protected function updateProductAfterAction(Ess_M2ePro_Model_Listing_Product $listingProduct, array $nativeRequestData = array(), array $params = array(), $ebayItemsId = NULL, $saveSoldData = false)
{
$dataForUpdate = array('status' => Ess_M2ePro_Model_Listing_Product::STATUS_LISTED, 'additional_data' => $listingProduct->getAdditionalData());
!empty($nativeRequestData['title']) && ($dataForUpdate['online_title'] = $nativeRequestData['title']);
!empty($nativeRequestData['sku']) && ($dataForUpdate['online_sku'] = $nativeRequestData['sku']);
$dataForUpdate['additional_data']['is_eps_ebay_images_mode'] = $params['is_eps_ebay_images_mode'];
$isImagesUploadError = isset($params['is_images_upload_error']) ? $params['is_images_upload_error'] : false;
if (isset($nativeRequestData['images']['images']) && !$isImagesUploadError) {
$dataForUpdate['additional_data']['ebay_product_images_hash'] = sha1(json_encode($nativeRequestData['images']['images']));
}
!is_null($ebayItemsId) && ($dataForUpdate['ebay_item_id'] = (int) $ebayItemsId);
isset($params['status_changer']) && ($dataForUpdate['status_changer'] = (int) $params['status_changer']);
if (isset($nativeRequestData['category_main_id'])) {
$dataForUpdate['online_category'] = Mage::helper('M2ePro/Component_Ebay_Category_Ebay')->getPath($nativeRequestData['category_main_id'], $listingProduct->getMarketplace()->getId()) . ' (' . $nativeRequestData['category_main_id'] . ')';
}
if (isset($params['start_date_raw'])) {
$dataForUpdate['start_date'] = Ess_M2ePro_Model_Connector_Server_Ebay_Abstract::ebayTimeToString($params['start_date_raw']);
}
if (isset($params['end_date_raw'])) {
$dataForUpdate['end_date'] = Ess_M2ePro_Model_Connector_Server_Ebay_Abstract::ebayTimeToString($params['end_date_raw']);
}
if ($saveSoldData) {
$dataForUpdate['online_qty_sold'] = is_null($listingProduct->getChildObject()->getOnlineQtySold()) ? 0 : $listingProduct->getChildObject()->getOnlineQtySold();
$tempIsVariation = $nativeRequestData['is_variation_item'] && isset($nativeRequestData['variation']);
$tempUpdateFlag = $tempIsVariation || isset($nativeRequestData['qty']);
if ($tempUpdateFlag) {
$tempQty = $tempIsVariation ? $listingProduct->getChildObject()->getQty() : $nativeRequestData['qty'];
$dataForUpdate['online_qty'] = (int) $tempQty + (int) $dataForUpdate['online_qty_sold'];
}
} else {
$dataForUpdate['online_qty_sold'] = 0;
$tempIsVariation = $nativeRequestData['is_variation_item'] && isset($nativeRequestData['variation']);
$tempUpdateFlag = $tempIsVariation || isset($nativeRequestData['qty']);
if ($tempUpdateFlag) {
$tempQty = $tempIsVariation ? $listingProduct->getChildObject()->getQty() : $nativeRequestData['qty'];
$dataForUpdate['online_qty'] = $tempQty;
}
}
if ($listingProduct->getChildObject()->isListingTypeFixed()) {
$dataForUpdate['online_start_price'] = NULL;
$dataForUpdate['online_reserve_price'] = NULL;
$dataForUpdate['online_bids'] = NULL;
$tempIsVariation = $nativeRequestData['is_variation_item'] && isset($nativeRequestData['variation']);
$tempUpdateFlag = $tempIsVariation || isset($nativeRequestData['price_fixed']);
if ($tempUpdateFlag) {
if ($tempIsVariation) {
$tempPrice = NULL;
foreach ($nativeRequestData['variation'] as $variation) {
if ((int) $variation['qty'] <= 0) {
continue;
}
if (!is_null($tempPrice) && (double) $variation['price'] >= $tempPrice) {
continue;
}
$tempPrice = (double) $variation['price'];
}
} else {
$tempPrice = $nativeRequestData['price_fixed'];
}
$dataForUpdate['online_buyitnow_price'] = (double) $tempPrice;
}
} else {
!$saveSoldData && ($dataForUpdate['online_bids'] = 0);
if (isset($nativeRequestData['price_start'])) {
$dataForUpdate['online_start_price'] = (double) $nativeRequestData['price_start'];
}
if (isset($nativeRequestData['price_reserve'])) {
$dataForUpdate['online_reserve_price'] = (double) $nativeRequestData['price_reserve'];
}
if (isset($nativeRequestData['price_buyitnow'])) {
$dataForUpdate['online_buyitnow_price'] = (double) $nativeRequestData['price_buyitnow'];
}
}
$dataForUpdate['additional_data'] = json_encode($dataForUpdate['additional_data']);
$listingProduct->addData($dataForUpdate)->save();
}