本文整理汇总了PHP中Ess_M2ePro_Model_Listing_Product::getActionTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Ess_M2ePro_Model_Listing_Product::getActionTitle方法的具体用法?PHP Ess_M2ePro_Model_Listing_Product::getActionTitle怎么用?PHP Ess_M2ePro_Model_Listing_Product::getActionTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ess_M2ePro_Model_Listing_Product
的用法示例。
在下文中一共展示了Ess_M2ePro_Model_Listing_Product::getActionTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeAction
public function executeAction($action, $percentsFrom, $percentsTo)
{
$this->setPercents($percentsFrom);
$products = $this->getActionProducts($action);
if (empty($products)) {
return array();
}
$totalProductsCount = count($products);
$processedProductsCount = 0;
$percentsOneProduct = ($percentsTo - $percentsFrom) / $totalProductsCount;
$results = array();
foreach (array_chunk($products, $this->getMaxProductsPerStep()) as $stepProducts) {
$countString = Mage::helper('M2ePro')->__('%perStep% from %total% Product(s).', count($stepProducts), $totalProductsCount);
if (count($stepProducts) < 10) {
$productsIds = array();
foreach ($stepProducts as $product) {
$productsIds[] = $product->getProductId();
}
$productsIds = implode('", "', $productsIds);
$countString = Mage::helper('M2ePro')->__('Product(s) with ID(s)') . " \"{$productsIds}\".";
}
$this->setStatus(Ess_M2ePro_Model_Listing_Product::getActionTitle($action) . ' ' . $countString . ' ' . Mage::helper('M2ePro')->__('Please wait...'));
$results[] = Mage::getModel('M2ePro/' . $this->getConnectorModel())->process($action, $stepProducts, array('status_changer' => Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_SYNCH));
$processedProductsCount += count($stepProducts);
$tempPercents = $percentsFrom + $processedProductsCount * $percentsOneProduct;
$this->setPercents($tempPercents > $percentsTo ? $percentsTo : $tempPercents);
$this->activate();
}
$this->setPercents($percentsTo);
return $results;
}
示例2: executeAction
public function executeAction($action, $percentsFrom, $percentsTo)
{
$this->setPercents($percentsFrom);
$results = array();
$combinations = $this->getCombinations($action);
$totalProductsCount = 0;
$processedProductsCount = 0;
foreach ($combinations as $combination) {
$totalProductsCount += count($combination['products']);
}
if (!$totalProductsCount) {
return $results;
}
$percentsOneProduct = ($percentsTo - $percentsFrom) / $totalProductsCount;
foreach ($combinations as $combination) {
$combination['params']['status_changer'] = Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_SYNCH;
foreach (array_chunk($combination['products'], $this->getMaxProductsPerStep()) as $products) {
$productsCount = count($products);
$countString = $productsCount . ' ' . Mage::helper('M2ePro')->__('Product(s).');
if ($productsCount < 10) {
$productsIds = array();
foreach ($products as $product) {
$productsIds[] = $product->getData('product_id');
}
$productsIds = implode('", "', $productsIds);
$countString = Mage::helper('M2ePro')->__('Product(s) with ID(s)') . " \"{$productsIds}\".";
}
$this->setStatus(Ess_M2ePro_Model_Listing_Product::getActionTitle($action) . ' ' . $countString . ' ' . Mage::helper('M2ePro')->__('Please wait...'));
$results[] = Mage::getModel('M2ePro/' . $this->getConnectorModel())->process($action, $products, $combination['params']);
$processedProductsCount += count($products);
$tempPercents = $percentsFrom + $processedProductsCount * $percentsOneProduct;
$this->setPercents($tempPercents > $percentsTo ? $percentsTo : $tempPercents);
$this->activate();
}
}
$this->setPercents($percentsTo);
return $results;
}