Refactor ProductPriceImport -> ProductPricesImport
modifié: core/lib/Thelia/Config/Resources/import.xml renommé: core/lib/Thelia/ImportExport/Import/Type/ProductPriceImport.php -> core/lib/Thelia/ImportExport/Import/Type/ProductPricesImport.php modifié: core/lib/Thelia/Tests/ImportExport/Import/ProductPriceImportTest.php
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
</import_descriptive>
|
||||
</import>
|
||||
|
||||
<import id="thelia.import.price" class="Thelia\ImportExport\Import\Type\ProductPriceImport" category_id="thelia.import.products">
|
||||
<import id="thelia.import.price" class="Thelia\ImportExport\Import\Type\ProductPricesImport" category_id="thelia.import.products">
|
||||
<import_descriptive locale="fr_FR">
|
||||
<title>Importez vos prix</title>
|
||||
</import_descriptive>
|
||||
|
||||
@@ -22,11 +22,11 @@ use Thelia\Model\ProductPriceQuery;
|
||||
use Thelia\Model\ProductSaleElementsQuery;
|
||||
|
||||
/**
|
||||
* Class ProductPriceImport
|
||||
* Class ProductPricesImport
|
||||
* @package Thelia\ImportExport\Import\Type
|
||||
* @author Benjamin Perche <bperche@openstudio.fr>
|
||||
*/
|
||||
class ProductPriceImport extends ImportHandler
|
||||
class ProductPricesImport extends ImportHandler
|
||||
{
|
||||
/**
|
||||
* @return string|array
|
||||
@@ -63,6 +63,7 @@ class ProductPriceImport extends ImportHandler
|
||||
$translator = Translator::getInstance();
|
||||
|
||||
while (null !== $row = $data->popRow()) {
|
||||
if (count($row) > 1) {
|
||||
$obj = ProductSaleElementsQuery::create()->findOneByRef($row["ref"]);
|
||||
|
||||
if ($obj === null) {
|
||||
@@ -110,6 +111,7 @@ class ProductPriceImport extends ImportHandler
|
||||
$this->importedRows++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace Thelia\Tests\ImportExport\Import;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Thelia\Controller\Admin\ImportController;
|
||||
use Thelia\Core\FileFormat\Formatting\Formatter\JsonFormatter;
|
||||
use Thelia\ImportExport\Import\Type\ProductPriceImport;
|
||||
use Thelia\ImportExport\Import\Type\ProductPricesImport;
|
||||
use Thelia\Model\Currency;
|
||||
use Thelia\Model\ProductSaleElementsQuery;
|
||||
use Thelia\Tests\Controller\ControllerTestBase;
|
||||
@@ -49,7 +49,7 @@ class ProductPriceImportTest extends ControllerTestBase
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->import = new ProductPriceImport($this->container);
|
||||
$this->import = new ProductPricesImport($this->container);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user