impmort product's images
173
install/import.php
Normal file
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
use Thelia\Constraint\ConstraintFactory;
|
||||
use Thelia\Constraint\Rule\AvailableForTotalAmountManager;
|
||||
use Thelia\Constraint\Rule\AvailableForXArticlesManager;
|
||||
use Thelia\Constraint\Rule\Operators;
|
||||
use Thelia\Coupon\CouponRuleCollection;
|
||||
|
||||
|
||||
require __DIR__ . '/../core/bootstrap.php';
|
||||
|
||||
$thelia = new Thelia\Core\Thelia("dev", true);
|
||||
$thelia->boot();
|
||||
|
||||
$faker = Faker\Factory::create();
|
||||
|
||||
$con = \Propel\Runtime\Propel::getConnection(
|
||||
Thelia\Model\Map\ProductTableMap::DATABASE_NAME
|
||||
);
|
||||
$con->beginTransaction();
|
||||
|
||||
try {
|
||||
$stmt = $con->prepare("SET foreign_key_checks = 0");
|
||||
$stmt->execute();
|
||||
clearTables();
|
||||
$stmt = $con->prepare("SET foreign_key_checks = 1");
|
||||
|
||||
createCategories();
|
||||
|
||||
$stmt->execute();
|
||||
|
||||
$con->commit();
|
||||
} catch (Exception $e) {
|
||||
echo "error : ".$e->getMessage()."\n";
|
||||
$con->rollBack();
|
||||
}
|
||||
|
||||
function createCategories()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function clearTables()
|
||||
{
|
||||
$productAssociatedContent = Thelia\Model\ProductAssociatedContentQuery::create()
|
||||
->find();
|
||||
$productAssociatedContent->delete();
|
||||
|
||||
$categoryAssociatedContent = Thelia\Model\CategoryAssociatedContentQuery::create()
|
||||
->find();
|
||||
$categoryAssociatedContent->delete();
|
||||
|
||||
$featureProduct = Thelia\Model\FeatureProductQuery::create()
|
||||
->find();
|
||||
$featureProduct->delete();
|
||||
|
||||
$attributeCombination = Thelia\Model\AttributeCombinationQuery::create()
|
||||
->find();
|
||||
$attributeCombination->delete();
|
||||
|
||||
$feature = Thelia\Model\FeatureQuery::create()
|
||||
->find();
|
||||
$feature->delete();
|
||||
|
||||
$feature = Thelia\Model\FeatureI18nQuery::create()
|
||||
->find();
|
||||
$feature->delete();
|
||||
|
||||
$featureAv = Thelia\Model\FeatureAvQuery::create()
|
||||
->find();
|
||||
$featureAv->delete();
|
||||
|
||||
$featureAv = Thelia\Model\FeatureAvI18nQuery::create()
|
||||
->find();
|
||||
$featureAv->delete();
|
||||
|
||||
$attribute = Thelia\Model\AttributeQuery::create()
|
||||
->find();
|
||||
$attribute->delete();
|
||||
|
||||
$attribute = Thelia\Model\AttributeI18nQuery::create()
|
||||
->find();
|
||||
$attribute->delete();
|
||||
|
||||
$attributeAv = Thelia\Model\AttributeAvQuery::create()
|
||||
->find();
|
||||
$attributeAv->delete();
|
||||
|
||||
$attributeAv = Thelia\Model\AttributeAvI18nQuery::create()
|
||||
->find();
|
||||
$attributeAv->delete();
|
||||
|
||||
$category = Thelia\Model\CategoryQuery::create()
|
||||
->find();
|
||||
$category->delete();
|
||||
|
||||
$category = Thelia\Model\CategoryI18nQuery::create()
|
||||
->find();
|
||||
$category->delete();
|
||||
|
||||
$product = Thelia\Model\ProductQuery::create()
|
||||
->find();
|
||||
$product->delete();
|
||||
|
||||
$product = Thelia\Model\ProductI18nQuery::create()
|
||||
->find();
|
||||
$product->delete();
|
||||
|
||||
$customer = Thelia\Model\CustomerQuery::create()
|
||||
->find();
|
||||
$customer->delete();
|
||||
|
||||
$folder = Thelia\Model\FolderQuery::create()
|
||||
->find();
|
||||
$folder->delete();
|
||||
|
||||
$folder = Thelia\Model\FolderI18nQuery::create()
|
||||
->find();
|
||||
$folder->delete();
|
||||
|
||||
$content = Thelia\Model\ContentQuery::create()
|
||||
->find();
|
||||
$content->delete();
|
||||
|
||||
$content = Thelia\Model\ContentI18nQuery::create()
|
||||
->find();
|
||||
$content->delete();
|
||||
|
||||
$accessory = Thelia\Model\AccessoryQuery::create()
|
||||
->find();
|
||||
$accessory->delete();
|
||||
|
||||
$stock = \Thelia\Model\ProductSaleElementsQuery::create()
|
||||
->find();
|
||||
$stock->delete();
|
||||
|
||||
$productPrice = \Thelia\Model\ProductPriceQuery::create()
|
||||
->find();
|
||||
$productPrice->delete();
|
||||
|
||||
\Thelia\Model\ProductImageQuery::create()->find()->delete();
|
||||
\Thelia\Model\CategoryImageQuery::create()->find()->delete();
|
||||
\Thelia\Model\FolderImageQuery::create()->find()->delete();
|
||||
\Thelia\Model\ContentImageQuery::create()->find()->delete();
|
||||
|
||||
\Thelia\Model\ProductDocumentQuery::create()->find()->delete();
|
||||
\Thelia\Model\CategoryDocumentQuery::create()->find()->delete();
|
||||
\Thelia\Model\FolderDocumentQuery::create()->find()->delete();
|
||||
\Thelia\Model\ContentDocumentQuery::create()->find()->delete();
|
||||
|
||||
\Thelia\Model\CouponQuery::create()->find()->delete();
|
||||
}
|
||||
5
install/import/categories.csv
Normal file
@@ -0,0 +1,5 @@
|
||||
"CATEGORIES FR";"CATEGORIES UK"
|
||||
"Chaises";"Chairs"
|
||||
"Tabourets";"Stools"
|
||||
"Fauteuils";"Armchairs"
|
||||
"Canapés";"Sofas"
|
||||
|
BIN
install/import/images/PROD001-1.jpg
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
install/import/images/PROD001-2.jpg
Normal file
|
After Width: | Height: | Size: 105 KiB |
BIN
install/import/images/PROD001-3.jpg
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
install/import/images/PROD001-4.jpg
Normal file
|
After Width: | Height: | Size: 108 KiB |
BIN
install/import/images/PROD001-5.jpg
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
install/import/images/PROD002-1.jpg
Normal file
|
After Width: | Height: | Size: 138 KiB |
BIN
install/import/images/PROD002-2.jpg
Normal file
|
After Width: | Height: | Size: 124 KiB |
BIN
install/import/images/PROD002-3.jpg
Normal file
|
After Width: | Height: | Size: 73 KiB |
BIN
install/import/images/PROD002-4.jpg
Normal file
|
After Width: | Height: | Size: 128 KiB |
BIN
install/import/images/PROD002-5.jpg
Normal file
|
After Width: | Height: | Size: 127 KiB |
BIN
install/import/images/PROD002-6.jpg
Normal file
|
After Width: | Height: | Size: 126 KiB |
BIN
install/import/images/PROD003-1.jpg
Normal file
|
After Width: | Height: | Size: 157 KiB |
BIN
install/import/images/PROD003-2.jpg
Normal file
|
After Width: | Height: | Size: 267 KiB |
BIN
install/import/images/PROD003-3.jpg
Normal file
|
After Width: | Height: | Size: 254 KiB |
BIN
install/import/images/PROD004-1.jpg
Normal file
|
After Width: | Height: | Size: 217 KiB |
BIN
install/import/images/PROD004-2.jpg
Normal file
|
After Width: | Height: | Size: 123 KiB |
BIN
install/import/images/PROD005-1.jpg
Normal file
|
After Width: | Height: | Size: 155 KiB |
BIN
install/import/images/PROD005-2.jpg
Normal file
|
After Width: | Height: | Size: 142 KiB |
BIN
install/import/images/PROD005-3.jpg
Normal file
|
After Width: | Height: | Size: 141 KiB |
BIN
install/import/images/PROD005-4.jpg
Normal file
|
After Width: | Height: | Size: 79 KiB |
BIN
install/import/images/PROD005-5.jpg
Normal file
|
After Width: | Height: | Size: 144 KiB |
BIN
install/import/images/PROD005-6.jpg
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
install/import/images/PROD006-1.jpg
Normal file
|
After Width: | Height: | Size: 208 KiB |
BIN
install/import/images/PROD006-2.jpg
Normal file
|
After Width: | Height: | Size: 127 KiB |
BIN
install/import/images/PROD006-3.jpg
Normal file
|
After Width: | Height: | Size: 208 KiB |
BIN
install/import/images/PROD006-4.jpg
Normal file
|
After Width: | Height: | Size: 203 KiB |
BIN
install/import/images/PROD006-5.jpg
Normal file
|
After Width: | Height: | Size: 203 KiB |
BIN
install/import/images/PROD006-6.jpg
Normal file
|
After Width: | Height: | Size: 199 KiB |
BIN
install/import/images/PROD007-1.jpg
Normal file
|
After Width: | Height: | Size: 254 KiB |
BIN
install/import/images/PROD007-2.jpg
Normal file
|
After Width: | Height: | Size: 159 KiB |
BIN
install/import/images/PROD007-3.jpg
Normal file
|
After Width: | Height: | Size: 247 KiB |
BIN
install/import/images/PROD007-4.jpg
Normal file
|
After Width: | Height: | Size: 247 KiB |
BIN
install/import/images/PROD008-1.jpg
Normal file
|
After Width: | Height: | Size: 177 KiB |
BIN
install/import/images/PROD008-2.jpg
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
install/import/images/PROD008-3.jpg
Normal file
|
After Width: | Height: | Size: 184 KiB |
BIN
install/import/images/PROD008-4.jpg
Normal file
|
After Width: | Height: | Size: 190 KiB |
BIN
install/import/images/PROD008-5.jpg
Normal file
|
After Width: | Height: | Size: 184 KiB |
BIN
install/import/images/PROD009-1.jpg
Normal file
|
After Width: | Height: | Size: 126 KiB |
BIN
install/import/images/PROD009-2.jpg
Normal file
|
After Width: | Height: | Size: 123 KiB |
BIN
install/import/images/PROD009-3.jpg
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
install/import/images/PROD010-1.jpg
Normal file
|
After Width: | Height: | Size: 264 KiB |
BIN
install/import/images/PROD010-2.jpg
Normal file
|
After Width: | Height: | Size: 160 KiB |
BIN
install/import/images/PROD010-3.jpg
Normal file
|
After Width: | Height: | Size: 263 KiB |
BIN
install/import/images/PROD010-4.jpg
Normal file
|
After Width: | Height: | Size: 255 KiB |
BIN
install/import/images/PROD011-1.jpg
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
install/import/images/PROD011-2.jpg
Normal file
|
After Width: | Height: | Size: 108 KiB |
BIN
install/import/images/PROD011-3.jpg
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
install/import/images/PROD011-4.jpg
Normal file
|
After Width: | Height: | Size: 106 KiB |
BIN
install/import/images/PROD012-1.jpg
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
install/import/images/PROD012-2.jpg
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
install/import/images/PROD013-1.jpg
Normal file
|
After Width: | Height: | Size: 77 KiB |
BIN
install/import/images/PROD014-1.jpg
Normal file
|
After Width: | Height: | Size: 108 KiB |
BIN
install/import/images/PROD014-2.jpg
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
install/import/images/PROD014-3.jpg
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
install/import/images/PROD014-4.jpg
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
install/import/images/PROD015-1.jpg
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
install/import/images/PROD015-2.jpg
Normal file
|
After Width: | Height: | Size: 55 KiB |
BIN
install/import/images/PROD016-1.jpg
Normal file
|
After Width: | Height: | Size: 134 KiB |
BIN
install/import/images/PROD017-1.jpg
Normal file
|
After Width: | Height: | Size: 231 KiB |
BIN
install/import/images/PROD017-2.jpg
Normal file
|
After Width: | Height: | Size: 144 KiB |
BIN
install/import/images/PROD017-3.jpg
Normal file
|
After Width: | Height: | Size: 223 KiB |
BIN
install/import/images/PROD017-4.jpg
Normal file
|
After Width: | Height: | Size: 221 KiB |
BIN
install/import/images/PROD018-1.jpg
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
install/import/images/PROD019-1.jpg
Normal file
|
After Width: | Height: | Size: 148 KiB |
BIN
install/import/images/PROD019-2.jpg
Normal file
|
After Width: | Height: | Size: 146 KiB |
BIN
install/import/images/PROD019-3.jpg
Normal file
|
After Width: | Height: | Size: 83 KiB |
BIN
install/import/images/PROD019-4.jpg
Normal file
|
After Width: | Height: | Size: 136 KiB |
BIN
install/import/images/PROD019-5.jpg
Normal file
|
After Width: | Height: | Size: 140 KiB |
BIN
install/import/images/PROD020-1.jpg
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
install/import/images/PROD021-1.jpg
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
install/import/images/PROD021-2.jpg
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
install/import/images/PROD021-3.jpg
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
install/import/images/PROD021-4.jpg
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
install/import/images/PROD022-1.jpg
Normal file
|
After Width: | Height: | Size: 101 KiB |
BIN
install/import/images/PROD022-2.jpg
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
install/import/images/PROD022-3.jpg
Normal file
|
After Width: | Height: | Size: 158 KiB |
BIN
install/import/images/PROD022-4.jpg
Normal file
|
After Width: | Height: | Size: 156 KiB |
BIN
install/import/images/PROD022-5.jpg
Normal file
|
After Width: | Height: | Size: 158 KiB |
BIN
install/import/images/PROD023-1.jpg
Normal file
|
After Width: | Height: | Size: 108 KiB |
BIN
install/import/images/PROD023-2.jpg
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
install/import/images/PROD023-3.jpg
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
install/import/images/PROD023-4.jpg
Normal file
|
After Width: | Height: | Size: 105 KiB |
BIN
install/import/images/PROD023-5.jpg
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
install/import/images/PROD023-6.jpg
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
install/import/images/PROD024-1.jpg
Normal file
|
After Width: | Height: | Size: 218 KiB |
BIN
install/import/images/PROD024-2.jpg
Normal file
|
After Width: | Height: | Size: 217 KiB |
BIN
install/import/images/PROD024-3.jpg
Normal file
|
After Width: | Height: | Size: 222 KiB |
BIN
install/import/images/PROD024-4.jpg
Normal file
|
After Width: | Height: | Size: 211 KiB |
BIN
install/import/images/PROD024-5.jpg
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
install/import/images/PROD025-1.jpg
Normal file
|
After Width: | Height: | Size: 129 KiB |
BIN
install/import/images/PROD025-2.jpg
Normal file
|
After Width: | Height: | Size: 208 KiB |
BIN
install/import/images/PROD025-3.jpg
Normal file
|
After Width: | Height: | Size: 204 KiB |
BIN
install/import/images/PROD026-1.jpg
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
install/import/images/PROD027-1.jpg
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
install/import/images/PROD028-1.jpg
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
install/import/images/PROD029-1.jpg
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
install/import/images/PROD030-1.jpg
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
install/import/images/PROD030-2.jpg
Normal file
|
After Width: | Height: | Size: 94 KiB |