Version Notes
Magento 1.5 version. Please use UTF-8 csv files (to convert from any charset please use iconv linux command)
Download this release
Release Info
Developer | Antonio Martinez |
Extension | AMartinez_CustomImportExport |
Version | 1.5.003 |
Comparing to | |
See all releases |
Code changes from version 1.5.002 to 1.5.003
- app/code/community/AMartinez/CustomImportExport/Model/Import/Entity/Product.php +16 -10
- app/code/community/AMartinez/CustomImportExport/Model/Import/Entity/Product/Type/Giftcard.php +0 -19
- app/code/community/AMartinez/CustomImportExport/etc/config.xml +1 -1
- app/code/community/AMartinez/CustomImportExport/shell/run.php +1 -1
- package.xml +4 -4
- var/customimportexport/test_single_row_style.csv1 +4 -4
app/code/community/AMartinez/CustomImportExport/Model/Import/Entity/Product.php
CHANGED
@@ -64,7 +64,8 @@ class AMartinez_CustomImportExport_Model_Import_Entity_Product extends Mage_Impo
|
|
64 |
case 'datetime':
|
65 |
$val = trim($rowData[$attrCode]);
|
66 |
$valid = strtotime($val)
|
67 |
-
|| preg_match('/^\d{2}.\d{2}.\d{2,4}(?:\s+\d{1,2}.\d{1,2}(?:.\d{1,2})?)?$/', $val)
|
|
|
68 |
break;
|
69 |
case 'text':
|
70 |
$val = Mage::helper('core/string')->cleanString($rowData[$attrCode]);
|
@@ -145,20 +146,25 @@ class AMartinez_CustomImportExport_Model_Import_Entity_Product extends Mage_Impo
|
|
145 |
* @return true
|
146 |
*/
|
147 |
function _addCategory($category, $storeId)
|
148 |
-
{
|
149 |
$store = Mage::app()->getStore($storeId);
|
150 |
$rootCategoryId = $store->getGroup()->root_category_id;
|
151 |
$rootCategoryPath = '1/' . $rootCategoryId;
|
|
|
|
|
152 |
|
153 |
-
$cat
|
154 |
-
->
|
|
|
|
|
|
|
155 |
->setPath($rootCategoryPath)
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
$this->_categories[$category] = $cat->getId();
|
163 |
|
164 |
return true;
|
64 |
case 'datetime':
|
65 |
$val = trim($rowData[$attrCode]);
|
66 |
$valid = strtotime($val)
|
67 |
+
|| preg_match('/^\d{2}.\d{2}.\d{2,4}(?:\s+\d{1,2}.\d{1,2}(?:.\d{1,2})?)?$/', $val)
|
68 |
+
|| $val == "1899-12-31"; // firebird null date
|
69 |
break;
|
70 |
case 'text':
|
71 |
$val = Mage::helper('core/string')->cleanString($rowData[$attrCode]);
|
146 |
* @return true
|
147 |
*/
|
148 |
function _addCategory($category, $storeId)
|
149 |
+
{
|
150 |
$store = Mage::app()->getStore($storeId);
|
151 |
$rootCategoryId = $store->getGroup()->root_category_id;
|
152 |
$rootCategoryPath = '1/' . $rootCategoryId;
|
153 |
+
|
154 |
+
$cat = Mage::getModel('catalog/category');
|
155 |
|
156 |
+
$cat->setStoreId(0)
|
157 |
+
->setName(trim($category))
|
158 |
+
->setDisplayMode(trim($category))
|
159 |
+
->setAttributeSetId($cat->getDefaultAttributeSetId())
|
160 |
+
->setIsActive(1)
|
161 |
->setPath($rootCategoryPath)
|
162 |
+
->setIsAnchor(true)
|
163 |
+
->save();
|
164 |
+
|
165 |
+
$cat->setStoreId(1)
|
166 |
+
->save();
|
167 |
+
|
168 |
$this->_categories[$category] = $cat->getId();
|
169 |
|
170 |
return true;
|
app/code/community/AMartinez/CustomImportExport/Model/Import/Entity/Product/Type/Giftcard.php
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* @category AMartinez
|
6 |
-
* @package AMartinez_CustomImportExport
|
7 |
-
* @author Antonio Martinez
|
8 |
-
* @copyright Copyright (c) 2011 Antonio Martínez (toniyecla@gmail.com)
|
9 |
-
* @license http://opensource.org/licenses/osl-3.0 Open Software License (OSL 3.0)
|
10 |
-
*/
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Import entity gift card product type model
|
14 |
-
*/
|
15 |
-
class AMartinez_CustomImportExport_Model_Import_Entity_Product_Type_Giftcard
|
16 |
-
extends Mage_ImportExport_Model_Import_Entity_Product_Type_Giftcard
|
17 |
-
{
|
18 |
-
|
19 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/AMartinez/CustomImportExport/etc/config.xml
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
|
15 |
<modules>
|
16 |
<AMartinez_CustomImportExport>
|
17 |
-
<version>1.5.
|
18 |
<depends>
|
19 |
<!-- no dependencies -->
|
20 |
</depends>
|
14 |
|
15 |
<modules>
|
16 |
<AMartinez_CustomImportExport>
|
17 |
+
<version>1.5.003</version>
|
18 |
<depends>
|
19 |
<!-- no dependencies -->
|
20 |
</depends>
|
app/code/community/AMartinez/CustomImportExport/shell/run.php
CHANGED
@@ -166,7 +166,7 @@ class AMartinez_CustomImportExport extends Mage_Shell_Abstract
|
|
166 |
{
|
167 |
return <<<HELP
|
168 |
|
169 |
-
AMartinez_CustomImportExport script (v. 1.5.
|
170 |
|
171 |
NAME
|
172 |
run.php
|
166 |
{
|
167 |
return <<<HELP
|
168 |
|
169 |
+
AMartinez_CustomImportExport script (v. 1.5.003)
|
170 |
|
171 |
NAME
|
172 |
run.php
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>AMartinez_CustomImportExport</name>
|
4 |
-
<version>1.5.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -47,9 +47,9 @@ More options is coming soon!
|
|
47 |
</form></description>
|
48 |
<notes>Magento 1.5 version. Please use UTF-8 csv files (to convert from any charset please use iconv linux command)</notes>
|
49 |
<authors><author><name>Antonio Martinez</name><user>amartinez</user><email>toniyecla@gmail.com</email></author></authors>
|
50 |
-
<date>2011-04-
|
51 |
-
<time>
|
52 |
-
<contents><target name="magecommunity"><dir name="AMartinez"><dir name="CustomImportExport"><dir name="Helper"><file name="Data.php" hash="0c8b64920ba9cf893513573bbbb55549"/></dir><dir name="Model"><dir name="Import"><dir name="Adapter"><file name="Csv1.php" hash="fa713ee0bc9034befd91eee758fc2d0a"/></dir><file name="Adapter.php" hash="6d7d568cc3dfe002763638513bc04b7f"/><dir name="Entity"><dir name="Product"><dir name="Type"><file name="Configurable.php" hash="3614bf1abe10bb500219c787c2a6ebcc"/><file name="
|
53 |
<compatible/>
|
54 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
55 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>AMartinez_CustomImportExport</name>
|
4 |
+
<version>1.5.003</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
47 |
</form></description>
|
48 |
<notes>Magento 1.5 version. Please use UTF-8 csv files (to convert from any charset please use iconv linux command)</notes>
|
49 |
<authors><author><name>Antonio Martinez</name><user>amartinez</user><email>toniyecla@gmail.com</email></author></authors>
|
50 |
+
<date>2011-04-28</date>
|
51 |
+
<time>11:30:09</time>
|
52 |
+
<contents><target name="magecommunity"><dir name="AMartinez"><dir name="CustomImportExport"><dir name="Helper"><file name="Data.php" hash="0c8b64920ba9cf893513573bbbb55549"/></dir><dir name="Model"><dir name="Import"><dir name="Adapter"><file name="Csv1.php" hash="fa713ee0bc9034befd91eee758fc2d0a"/></dir><file name="Adapter.php" hash="6d7d568cc3dfe002763638513bc04b7f"/><dir name="Entity"><dir name="Product"><dir name="Type"><file name="Configurable.php" hash="3614bf1abe10bb500219c787c2a6ebcc"/><file name="Grouped.php" hash="b7c054303353d88e5d0c9fd303670ef5"/><file name="Simple.php" hash="48cdfdfc5c2e42b011e83483f50690c4"/></dir></dir><file name="Product.php" hash="0c211bad9b0f30306b72f11b2116cd0c"/></dir></dir><file name="Import.php" hash="2659523fed863f17915134b4e8d5d347"/></dir><dir name="etc"><file name="config.xml" hash="71565db61607529502e877ffb485556a"/></dir><dir name="shell"><file name="run.php" hash="75a5b247c6057c9c7a50bf19559a9f81"/></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="AMartinez_CustomImportExport.xml" hash="75ba4fbc265d1cf2b6ab61b8f3a3b95e"/></dir></dir></dir><dir name="var"><dir name="customimportexport"><file name="test_configurable.csv" hash="da1cb8fea77cc7ee591e3488d12ca6d8"/><file name="test_grouped.csv" hash="1281612b7e89e4681367e654631b2521"/><file name="test_single_row_style.csv1" hash="dfcd266cb65ab97e93f9402e4f32bffb"/></dir><dir name="log"><file name="exception.log" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="system.log" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></target></contents>
|
53 |
<compatible/>
|
54 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
55 |
</package>
|
var/customimportexport/test_single_row_style.csv1
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
"sku", "_store", "_type", "_product_websites", "_attribute_set", "news_from_date", "tipo_articulo", "_category", "status", "visibility", "weight", "is_in_stock", "qty", "size", "price", "delivery_date", "tax_class_id", "name", "short_description", "description", "_associated_sku", "image", "small_image", "thumbnail"
|
2 |
-
"TEST1-S1-35",,"simple","base","Default","2011-4-8","Shoes","TEST COLLECTION","1","1","1.10","1","999","35","43.90","1899-12-31","2","TEST1-S1 (35)","TEST COLLECTION"
|
3 |
-
"TEST1-S1-36",,"simple","base","Default","2011-4-8","Shoes","TEST COLLECTION","1","1","1.10","1","999","36","43.90","1899-12-31","2","TEST1-S1 (36)","TEST COLLECTION"
|
4 |
-
"TEST1-S1-37",,"simple","base","Default","2011-4-8","Shoes","TEST COLLECTION","1","1","1.10","1","999","37","43.90","1899-12-31","2","TEST1-S1 (37)","TEST COLLECTION"
|
5 |
-
"TEST1-S1",,"grouped","base","Default","2011-4-8","Shoes","TEST COLLECTION,MALICIA","1","4","1.10","1","13986","","43.90","1899-12-31","2","TEST 1 ANTIK NEGRO, PISO TEST test","TEST COLLECTION"
|
1 |
"sku", "_store", "_type", "_product_websites", "_attribute_set", "news_from_date", "tipo_articulo", "_category", "status", "visibility", "weight", "is_in_stock", "qty", "size", "price", "delivery_date", "tax_class_id", "name", "short_description", "description", "_associated_sku", "image", "small_image", "thumbnail"
|
2 |
+
"TEST1-S1-35",,"simple","base","Default","2011-4-8","Shoes","TEST COLLECTION","1","1","1.10","1","999","35","43.90","1899-12-31","2","TEST1-S1 (35)","TEST COLLECTION","TEST COLLECTION",,,,
|
3 |
+
"TEST1-S1-36",,"simple","base","Default","2011-4-8","Shoes","TEST COLLECTION","1","1","1.10","1","999","36","43.90","1899-12-31","2","TEST1-S1 (36)","TEST COLLECTION","TEST COLLECTION",,,,
|
4 |
+
"TEST1-S1-37",,"simple","base","Default","2011-4-8","Shoes","TEST COLLECTION","1","1","1.10","1","999","37","43.90","1899-12-31","2","TEST1-S1 (37)","TEST COLLECTION","TEST COLLECTION",,,,
|
5 |
+
"TEST1-S1",,"grouped","base","Default","2011-4-8","Shoes","TEST COLLECTION,MALICIA","1","4","1.10","1","13986","","43.90","1899-12-31","2","TEST 1 ANTIK NEGRO, PISO TEST test","TEST COLLECTION","TEST COLLECTION","TEST1-S1-35,TEST1-S1-36,TEST1-S1-37","/img_articulos/TEST1-S1.jpg","/img_articulos/TEST1-S1.jpg","/img_articulos/TEST1-S1.jpg"
|