本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Product::getGeneralTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Product::getGeneralTemplate方法的具体用法?PHP Ess_M2ePro_Model_Listing_Product::getGeneralTemplate怎么用?PHP Ess_M2ePro_Model_Listing_Product::getGeneralTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Product
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Product::getGeneralTemplate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runManual
public function runManual(Ess_M2ePro_Model_Listing_Product $listingProduct, $query, Ess_M2ePro_Model_Marketplace $marketplace = NULL, Ess_M2ePro_Model_Account $account = NULL)
{
if (!$listingProduct->isNotListed() || empty($query)) {
return false;
}
$params = array('listing_product' => $listingProduct, 'query' => $query);
if (is_null($marketplace)) {
$marketplace = $listingProduct->getGeneralTemplate()->getMarketplace();
}
if (is_null($account)) {
$account = $listingProduct->getGeneralTemplate()->getAccount();
}
try {
$dispatcherObject = Mage::getModel('M2ePro/Amazon_Connector')->getDispatcher();
$dispatcherObject->processConnector('search', 'manual', 'requester', $params, $marketplace, $account, 'Ess_M2ePro_Model_Amazon');
} catch (Exception $exception) {
Mage::helper('M2ePro/Exception')->process($exception, true);
return false;
}
$result = Mage::helper('M2ePro')->getGlobalValue('temp_amazon_manual_search_asin_result');
Mage::helper('M2ePro')->unsetGlobalValue('temp_amazon_manual_search_asin_result');
if (!is_array($result)) {
return array();
}
return $result;
}
示例2: isAddedNewVariationsAttributes
public function isAddedNewVariationsAttributes(Ess_M2ePro_Model_Listing_Product $listingProduct)
{
if (!$listingProduct->getChildObject()->isListingTypeFixed() || !$listingProduct->getGeneralTemplate()->getChildObject()->isVariationMode()) {
return false;
}
return parent::isAddedNewVariationsAttributes($listingProduct);
}
示例3: 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();
}
示例4: addInternationalTradeData
protected function addInternationalTradeData(Ess_M2ePro_Model_Listing_Product $listingProduct, array &$requestData)
{
$requestData['international_trade'] = 'None';
$internationalTrade = $listingProduct->getGeneralTemplate()->getChildObject()->getSettings('international_trade');
if (!empty($internationalTrade)) {
if (isset($internationalTrade['international_trade_uk']) && (int) $internationalTrade['international_trade_uk'] == 1) {
$requestData['international_trade'] = 'UK';
}
if (isset($internationalTrade['international_trade_na']) && (int) $internationalTrade['international_trade_na'] == 1) {
$requestData['international_trade'] = 'North America';
}
}
}
示例5: updateAfterAction
public function updateAfterAction(Ess_M2ePro_Model_Listing_Product $listingProduct, array $nativeRequestData = array(), array $params = array(), $saveEbayQtySold = false)
{
if (!$listingProduct->getChildObject()->isListingTypeFixed() || !$listingProduct->getGeneralTemplate()->getChildObject()->isVariationMode() || $listingProduct->getMagentoProduct()->isProductWithoutVariations()) {
return;
}
// Delete Variations
//-----------------------------
$productVariations = $listingProduct->getVariations(true);
foreach ($productVariations as $variation) {
/** @var $variation Ess_M2ePro_Model_Listing_Product_Variation */
$variation->isDelete() && $variation->deleteInstance();
}
//-----------------------------
// Update Variations
//-----------------------------
$productVariations = $listingProduct->getVariations(true);
foreach ($productVariations as $variation) {
/** @var $variation Ess_M2ePro_Model_Listing_Product_Variation */
$dataForUpdate = array('online_price' => $variation->getChildObject()->getPrice(), 'add' => Ess_M2ePro_Model_Listing_Product_Variation::ADD_NO, 'delete' => Ess_M2ePro_Model_Listing_Product_Variation::DELETE_NO, 'status' => Ess_M2ePro_Model_Listing_Product::STATUS_LISTED);
if ($saveEbayQtySold) {
$dataForUpdate['online_qty_sold'] = is_null($variation->getChildObject()->getOnlineQtySold()) ? 0 : $variation->getChildObject()->getOnlineQtySold();
$dataForUpdate['online_qty'] = $variation->getChildObject()->getQty() + $dataForUpdate['online_qty_sold'];
} else {
$dataForUpdate['online_qty_sold'] = 0;
$dataForUpdate['online_qty'] = $variation->getChildObject()->getQty();
}
if ($dataForUpdate['online_qty'] <= $dataForUpdate['online_qty_sold']) {
$dataForUpdate['status'] = Ess_M2ePro_Model_Listing_Product::STATUS_SOLD;
}
if ($dataForUpdate['online_qty'] <= 0) {
$dataForUpdate['status'] = Ess_M2ePro_Model_Listing_Product::STATUS_NOT_LISTED;
}
$variation->addData($dataForUpdate)->save();
}
//-----------------------------
}
示例6: isWorldWideIdAlreadyExists
private function isWorldWideIdAlreadyExists($worldwideId, Ess_M2ePro_Model_Listing_Product $listingProduct)
{
if (!$worldwideId) {
return false;
}
$marketplaceObj = $listingProduct->getGeneralTemplate()->getMarketplace();
$accountObj = $listingProduct->getGeneralTemplate()->getAccount();
/** @var $dispatcher Ess_M2ePro_Model_Amazon_Search_Dispatcher */
$dispatcher = Mage::getModel('M2ePro/Amazon_Search_Dispatcher');
$results = $dispatcher->runManual($listingProduct, $worldwideId, $marketplaceObj, $accountObj);
if (empty($results)) {
return false;
}
return true;
}