当前位置: 首页>>代码示例>>PHP>>正文


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怎么用?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;
 }
开发者ID:ReeceCrossland,项目名称:essua-m2epro,代码行数:31,代码来源:Runner.php

示例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;
 }
开发者ID:newedge-media,项目名称:iwantmymeds,代码行数:38,代码来源:Runner.php


注:本文中的Ess_M2ePro_Model_Listing_Product::getActionTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。