Ezmage_OscommerceImport - Version 1.7.3

Version Notes

The DataBase Prefix hasn't work on this version yet

Download this release

Release Info

Developer ezMage
Extension Ezmage_OscommerceImport
Version 1.7.3
Comparing to
See all releases


Version 1.7.3

app/code/community/Ezmage/OscommerceImport/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ezmage_OscommerceImport_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/community/Ezmage/OscommerceImport/Model/Source/GetAttributeSets.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * osCommerce Import
4
+ *
5
+ * @category Tweakmag
6
+ * @package Ezmage_OscommerceImport
7
+ * @copyright Copyright (c) 2012 ezMage (http://www.ezmage.com http://www.atwoodz.com http://www.ezosc.com )
8
+ * @author luis villarino luis@atwoodz.com
9
+ * @license Opensource
10
+ * @link http://www.ezmage.com
11
+ */
12
+
13
+ class Ezmage_OscommerceImport_Model_Source_GetAttributeSets
14
+ {
15
+ public function toOptionArray()
16
+ {
17
+ $entityTypeId = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();
18
+ $attributeSetCollection = Mage::getModel('eav/entity_attribute_set')->getCollection()->setEntityTypeFilter($entityTypeId);
19
+ foreach($attributeSetCollection as $_attributeSet){
20
+ $_attributeSet_info = $_attributeSet->getData();
21
+ $_attributeSet_array[] = array('value' => $_attributeSet_info['attribute_set_id'], 'label' =>$_attributeSet_info['attribute_set_name']);
22
+ }
23
+
24
+ return $_attributeSet_array;
25
+ }
26
+ }
app/code/community/Ezmage/OscommerceImport/controllers/IndexController.php ADDED
@@ -0,0 +1,815 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ezmage_OscommerceImport_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+
7
+ Mage::register('image_status1','check-no.jpg');
8
+ Mage::register('image_status2','check-no.jpg');
9
+ Mage::register('image_status3','check-no.jpg');
10
+ Mage::register('image_status4','check-no.jpg');
11
+ Mage::register('image_status5','check-no.jpg');
12
+ Mage::register('image_status6','check-no.jpg');
13
+
14
+
15
+ //check if configuration has values
16
+ $conf_hostname = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_hostname',Mage::app()->getStore());
17
+ $conf_port = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_port',Mage::app()->getStore());
18
+ $conf_db = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_db',Mage::app()->getStore());
19
+ $conf_db_username = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_username',Mage::app()->getStore());
20
+ $conf_db_password = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_password',Mage::app()->getStore());
21
+ $conf_table_prefix = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_prefix',Mage::app()->getStore());
22
+ $conf_website = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_website',Mage::app()->getStore());
23
+ $conf_category = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_category',Mage::app()->getStore());
24
+ $conf_attribute = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_attribute',Mage::app()->getStore());
25
+
26
+
27
+
28
+ if ( ($conf_hostname != "") and ($conf_db != "") and ($conf_db_username != "") and ($conf_db_password != "")){
29
+ Mage::register('conf_hostname',$conf_hostname);
30
+ Mage::register('conf_port',$conf_port);
31
+ Mage::register('conf_db',$conf_db);
32
+ Mage::register('conf_db_username',$conf_db);
33
+ Mage::register('conf_db_password',$conf_db_password);
34
+ Mage::register('conf_table_prefix',$conf_table_prefix);
35
+ Mage::register('conf_website',$conf_website);
36
+ Mage::register('conf_category',$conf_category);
37
+ Mage::register('conf_attribute',$conf_attribute);
38
+
39
+ Mage::unregister('image_status1');
40
+ Mage::register('image_status1','check-ok.jpg');
41
+ }
42
+
43
+ // step 2
44
+ $step2Status=Mage::getSingleton('core/session')->getstep2Status();
45
+ if ($step2Status == 'ok'){
46
+ Mage::unregister('image_status2');
47
+ Mage::register('image_status2','check-ok.jpg');
48
+ }
49
+
50
+ //step3
51
+ $importCategoryTotal = Mage::getSingleton('core/session')->getimportCategoryTotal();
52
+ $importProductsTotal = Mage::getSingleton('core/session')->getimportProductsTotal();
53
+ if (($importCategoryTotal > 0) or ($importProductsTotal > 0)){
54
+ Mage::unregister('image_status3');
55
+ Mage::register('image_status3','check-ok.jpg');
56
+ }
57
+
58
+ // step4
59
+ $importCategoryTotal = Mage::getSingleton('core/session')->getimportCategoryTotal();
60
+ $importedCategoryTotal = Mage::getSingleton('core/session')->getimportedCategoryTotal();
61
+ if ( ($importCategoryTotal == $importedCategoryTotal) and ($importCategoryTotal > 0)) {
62
+ Mage::unregister('image_status4');
63
+ Mage::register('image_status4','check-ok.jpg');
64
+ }
65
+
66
+ // step4
67
+ $importProductsTotal = Mage::getSingleton('core/session')->getimportProductsTotal();
68
+ $importedProductsTotal = Mage::getSingleton('core/session')->getimportedProductsTotal();
69
+ if (($importProductsTotal == $importedProductsTotal) and ($importProductsTotal > 0)) {
70
+ Mage::unregister('image_status5');
71
+ Mage::register('image_status5','check-ok.jpg');
72
+ }
73
+
74
+ // Layout Out Put
75
+ $this->loadLayout();
76
+
77
+ $block = $this->getLayout()->createBlock(
78
+ 'Mage_Core_Block_Template',
79
+ 'block_ezmage_oscommerce_import_step1',
80
+ array('template' => 'ezmage/oscommerceimport/step0.phtml')
81
+ );
82
+
83
+ $this->getLayout()->getBlock('content')->append($block);
84
+ $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
85
+
86
+ $this->renderLayout();
87
+ }
88
+
89
+ /*******************************************************************************/
90
+ /* Step 1 */
91
+ /*******************************************************************************/
92
+ public function step1Action()
93
+ {
94
+ $this->loadLayout();
95
+
96
+ $block = $this->getLayout()->createBlock(
97
+ 'Mage_Core_Block_Template',
98
+ 'block_ezmage_oscommerce_import_step1',
99
+ array('template' => 'ezmage/oscommerceimport/step1.phtml')
100
+ );
101
+
102
+ $this->getLayout()->getBlock('content')->append($block);
103
+ $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
104
+
105
+ $this->renderLayout();
106
+ }
107
+
108
+ /*******************************************************************************/
109
+ /* Step 2 */
110
+ /*******************************************************************************/
111
+ public function step2Action()
112
+ {
113
+ // check if tmp are created
114
+ $resource = Mage::getSingleton('core/resource');
115
+ $readConnection = $resource->getConnection('core_read');
116
+ $writeConnection = $resource->getConnection('core_write');
117
+
118
+ $query = 'show tables like "ezmage_categories"';
119
+ $list = $readConnection->fetchAll($query);
120
+ $ezmage_categories = sizeof($list);
121
+ // create table if don't exit
122
+ if ($ezmage_categories == 0){
123
+ $query = "CREATE TABLE IF NOT EXISTS `ezmage_categories` (`osc_cat_id` int(11) NOT NULL,`osc_cat_title` varchar(200) COLLATE utf8_unicode_ci NOT NULL,`osc_cat_parent` int(11) NOT NULL,`mage_cat_id` int(11) NOT NULL,`mage_cat_name` varchar(200) COLLATE utf8_unicode_ci NOT NULL,`mage_cat_parent` int(11) NOT NULL,`cat_imported` varchar(1) COLLATE utf8_unicode_ci NOT NULL,`osc_cat_image` varchar(200) COLLATE utf8_unicode_ci NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
124
+ $writeConnection->query($query);
125
+ }
126
+
127
+ $query = 'show tables like "ezmage_products"';
128
+ $list = $readConnection->fetchAll($query);
129
+ $ezmage_products = sizeof($list);
130
+ // create table if don't exit
131
+ if ($ezmage_products == 0){
132
+ $query = "CREATE TABLE IF NOT EXISTS `ezmage_products` (`osc_product_id` int(11) NOT NULL,`osc_product_name` varchar(200) COLLATE utf8_unicode_ci NOT NULL,`mage_product_id` int(11) NOT NULL,`product_imported` varchar(1) COLLATE utf8_unicode_ci NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
133
+ $writeConnection->query($query);
134
+ }
135
+
136
+ $query = 'show tables like "ezmage_log"';
137
+ $list = $readConnection->fetchAll($query);
138
+ $ezmage_log = sizeof($list);
139
+ if ($ezmage_log == 0){
140
+ $query = "CREATE TABLE IF NOT EXISTS `ezmage_log` (`importtime` datetime NOT NULL,`log_type` varchar(100) COLLATE utf8_unicode_ci NOT NULL,`log_desc` varchar(200) COLLATE utf8_unicode_ci NOT NULL,`mage_log` varchar(255) COLLATE utf8_unicode_ci NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
141
+ $writeConnection->query($query);
142
+ }
143
+
144
+ if ( ($ezmage_categories == 1) and ($ezmage_products == 1) and ($ezmage_log == 1) ){
145
+ $step2Status = 'ok';
146
+ Mage::getSingleton('core/session')->setstep2Status($step2Status);
147
+
148
+ }
149
+
150
+ $this->loadLayout();
151
+
152
+ $block = $this->getLayout()->createBlock(
153
+ 'Mage_Core_Block_Template',
154
+ 'block_ezmage_oscommerce_import_step2',
155
+ array('template' => 'ezmage/oscommerceimport/step2.phtml')
156
+ );
157
+
158
+ $this->getLayout()->getBlock('content')->append($block);
159
+ $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
160
+
161
+ $this->renderLayout();
162
+ }
163
+
164
+
165
+ /*******************************************************************************/
166
+ /* Step 2.1 */
167
+ /*******************************************************************************/
168
+ public function step21Action()
169
+ {
170
+
171
+ try{
172
+ // check if tmp are created
173
+ $resource = Mage::getSingleton('core/resource');
174
+ $writeConnection = $resource->getConnection('core_write');
175
+ // Remove tmp tables
176
+ $query = 'TRUNCATE TABLE ezmage_categories';
177
+ $writeConnection->query($query);
178
+ $query = 'TRUNCATE TABLE ezmage_log';
179
+ $writeConnection->query($query);
180
+ $query = 'TRUNCATE TABLE ezmage_products';
181
+ $writeConnection->query($query);
182
+
183
+ }
184
+ catch (Exception $ex) {
185
+ echo $ex->getMessage();
186
+ }
187
+
188
+ Mage::register('truncate_tables','yes');
189
+ Mage::getSingleton('core/session')->unsimportCategoryTotal();
190
+ Mage::getSingleton('core/session')->unsimportProductsTotal();
191
+ Mage::getSingleton('core/session')->unsimportCategoryTotal();
192
+ Mage::getSingleton('core/session')->unsimportedCategoryTotal();
193
+ Mage::getSingleton('core/session')->unsimportProductsTotal();
194
+ Mage::getSingleton('core/session')->unsimportedProductsTotal();
195
+
196
+ $this->loadLayout();
197
+
198
+ $block = $this->getLayout()->createBlock(
199
+ 'Mage_Core_Block_Template',
200
+ 'block_ezmage_oscommerce_import_step4',
201
+ array('template' => 'ezmage/oscommerceimport/step2.phtml')
202
+ );
203
+
204
+ $this->getLayout()->getBlock('content')->append($block);
205
+ $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
206
+
207
+ $this->renderLayout();
208
+ }
209
+
210
+
211
+ /*******************************************************************************/
212
+ /* Step 3 */
213
+ /*******************************************************************************/
214
+ public function step3Action()
215
+ {
216
+
217
+ $_config = $this->setRemoteConectionConfig();
218
+ try {
219
+ $_connection = Mage::getSingleton('core/resource')->createConnection('oscommerce_conection', 'pdo_mysql', $_config);
220
+ $query = 'show tables like "ezmage_log"';
221
+ $list = $_connection->fetchAll($query);
222
+ Mage::register('conection_status',"ok");
223
+ }
224
+ catch (Exception $ex) {
225
+ Mage::register('conection_status',$ex->getMessage());
226
+ }
227
+
228
+ $this->loadLayout();
229
+
230
+ $block = $this->getLayout()->createBlock(
231
+ 'Mage_Core_Block_Template',
232
+ 'block_ezmage_oscommerce_import_step3',
233
+ array('template' => 'ezmage/oscommerceimport/step3.phtml')
234
+ );
235
+
236
+ $this->getLayout()->getBlock('content')->append($block);
237
+ $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
238
+
239
+ $this->renderLayout();
240
+ }
241
+
242
+ /*******************************************************************************/
243
+ /* Step 3.1 */
244
+ /*******************************************************************************/
245
+ public function step31Action()
246
+ {
247
+
248
+ $_config = $this->setRemoteConectionConfig();
249
+ try {
250
+
251
+ $resource = Mage::getSingleton('core/resource');
252
+ $readConnection = $resource->getConnection('core_read');
253
+ $writeConnection = $resource->getConnection('core_write');
254
+
255
+ $_connection_remote = Mage::getSingleton('core/resource')->createConnection('oscommerce_conection', 'pdo_mysql', $_config);
256
+
257
+ $conf_prefix = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_prefix',Mage::app()->getStore());
258
+
259
+ $query = 'select categories.categories_id ,categories.categories_image, categories.parent_id, categories_description.categories_name from categories LEFT JOIN categories_description on categories_description.categories_id = categories.categories_id and categories_description.language_id = 1';
260
+ $results = $_connection_remote->fetchAll($query);
261
+ foreach($results as $row) {
262
+ // check if category exist
263
+ $sql = "select osc_cat_id from ezmage_categories where osc_cat_id=".$row['categories_id'];
264
+ $list = $readConnection->fetchAll($sql);
265
+ if (sizeof($list) == 0){
266
+ $row['categories_name'] = str_replace('"',"",$row['categories_name']);
267
+ $sql = 'insert into ezmage_categories (osc_cat_id,osc_cat_title,osc_cat_parent,osc_cat_image) values('.$row['categories_id'].',"'.$row['categories_name'].'","'.$row['parent_id'].'","'.$row['categories_image'].'")';
268
+ $writeConnection->query($sql);
269
+ }
270
+ }
271
+
272
+
273
+ $sql = "select osc_cat_id from ezmage_categories";
274
+ $list = $readConnection->fetchAll($sql);
275
+ $importCategoryTotal = sizeof($list);
276
+ Mage::getSingleton('core/session')->setimportCategoryTotal($importCategoryTotal);
277
+
278
+ // products
279
+ $query = 'select products_id,products_name from products_description where language_id = 1';
280
+ $results = $_connection_remote->fetchAll($query);
281
+ foreach($results as $row) {
282
+ // check if category exist
283
+ $sql = "select osc_product_id from ezmage_products where osc_product_id=".$row['products_id'];
284
+ $list = $readConnection->fetchAll($sql);
285
+ if (sizeof($list) == 0){
286
+ $row['products_name'] = str_replace('"',"",$row['products_name']);
287
+ $sql = 'insert into ezmage_products values('.$row['products_id'].',"'.$row['products_name'].'","","")';
288
+ $writeConnection->query($sql);
289
+ }
290
+ }
291
+
292
+ $sql = "select osc_product_id from ezmage_products";
293
+ $list = $readConnection->fetchAll($sql);
294
+ $importProductsTotal = sizeof($list);
295
+ Mage::getSingleton('core/session')->setimportProductsTotal($importProductsTotal);
296
+
297
+
298
+ }
299
+ catch (Exception $ex) {
300
+ //Mage::register('conection_status',$ex->getMessage());
301
+ echo $ex->getMessage();
302
+ }
303
+
304
+ $this->loadLayout();
305
+
306
+ $block = $this->getLayout()->createBlock(
307
+ 'Mage_Core_Block_Template',
308
+ 'block_ezmage_oscommerce_import_step31',
309
+ array('template' => 'ezmage/oscommerceimport/step31.phtml')
310
+ );
311
+
312
+ $this->getLayout()->getBlock('content')->append($block);
313
+ $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
314
+
315
+ $this->renderLayout();
316
+ }
317
+
318
+
319
+ /*******************************************************************************/
320
+ /* Step 4 */
321
+ /*******************************************************************************/
322
+ public function step4Action()
323
+ {
324
+ try {
325
+ $resource = Mage::getSingleton('core/resource');
326
+ $readConnection = $resource->getConnection('core_read');
327
+
328
+ $sql = "select osc_cat_id from ezmage_categories where cat_imported='y'";
329
+ $list = $readConnection->fetchAll($sql);
330
+ $importedCategoryTotal = sizeof($list);
331
+ Mage::getSingleton('core/session')->setimportedCategoryTotal($importedCategoryTotal);
332
+ }
333
+ catch (Exception $ex) {
334
+ //Mage::register('conection_status',$ex->getMessage());
335
+ echo $ex->getMessage();
336
+ }
337
+
338
+ $this->loadLayout();
339
+
340
+ $block = $this->getLayout()->createBlock(
341
+ 'Mage_Core_Block_Template',
342
+ 'block_ezmage_oscommerce_import_step4',
343
+ array('template' => 'ezmage/oscommerceimport/step4.phtml')
344
+ );
345
+
346
+ $this->getLayout()->getBlock('content')->append($block);
347
+ $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
348
+
349
+ $this->renderLayout();
350
+ }
351
+
352
+
353
+ /*******************************************************************************/
354
+ /* Step 4.1 */
355
+ /*******************************************************************************/
356
+ public function step41Action()
357
+ {
358
+
359
+ // Stop Indexes
360
+ // http://www.clounce.com/magento/magento-reindex-programmatically
361
+ // http://stackoverflow.com/questions/5420552/magento-programmatically-disable-automatic-indexing
362
+ $pCollection = Mage::getSingleton('index/indexer')->getProcessesCollection();
363
+ foreach ($pCollection as $process) {
364
+ $process->setMode(Mage_Index_Model_Process::MODE_MANUAL)->save();
365
+ }
366
+
367
+ $totalimport = 0;
368
+
369
+ try {
370
+ $resource = Mage::getSingleton('core/resource');
371
+ $readConnection = $resource->getConnection('core_read');
372
+ $writeConnection = $resource->getConnection('core_write');
373
+
374
+ $storeId = Mage::getStoreConfig('oscommerceimportconf/mageconfiguration/conf_website',Mage::app()->getStore());
375
+
376
+ $categories_array = array();
377
+ $this->tep_get_subcategories(&$categories_array, 0, $readConnection);
378
+ foreach($categories_array as $category_row){
379
+ if ($category_row['cat_imported'] != 'y'){
380
+ //print $category_row['osc_cat_id'].' => '.$category_row['osc_cat_title'].' => '.$category_row['osc_cat_parent'].'<br>';
381
+ $category = Mage::getModel( 'catalog/category' );
382
+ $category->setStoreId( $storeId );
383
+ $category->setName($category_row['osc_cat_title']);
384
+ $category->setIsActive(1);
385
+ $category->setIsAnchor(0);
386
+ $category->setDisplayMode('PRODUCTS');
387
+ $category->setIncludeInMenu(0);
388
+
389
+ if ($category_row['osc_cat_parent'] != 0){
390
+ $parent_id = $this->getMageParentID($category_row['osc_cat_parent'],$readConnection);
391
+ $parent = Mage::getModel('catalog/category')->load($parent_id);
392
+ }else{
393
+ $parent = Mage::getModel('catalog/category')->load(Mage::getStoreConfig('oscommerceimportconf/mageconfiguration/conf_category',Mage::app()->getStore()));
394
+ }
395
+ $category->setPath( $parent->getPath() );
396
+
397
+ $path = $this->getDownloadImage("category",$category_row['osc_cat_image']);
398
+ if ($category_row['osc_cat_image'] != ""){
399
+ $data['thumbnail'] = $path;
400
+ $category->addData($data);
401
+ }
402
+
403
+ $category->save();
404
+
405
+ // update tmp table
406
+ $sql = "update ezmage_categories set cat_imported='y',mage_cat_id=".$category->getId().", mage_cat_parent=".$parent->getId()." where osc_cat_id=".$category_row['osc_cat_id'];
407
+ $writeConnection->query($sql);
408
+
409
+ $totalimport++;
410
+ if ($totalimport == 10){
411
+ break;
412
+ }
413
+ }
414
+ }
415
+
416
+
417
+ // get import status
418
+ $sql = "select osc_cat_id from ezmage_categories where cat_imported='y'";
419
+ $list = $readConnection->fetchAll($sql);
420
+ $importedCategoryTotal = sizeof($list);
421
+ Mage::getSingleton('core/session')->setimportedCategoryTotal($importedCategoryTotal);
422
+
423
+ }
424
+ catch (Exception $ex) {
425
+ //Mage::register('conection_status',$ex->getMessage());
426
+ echo $ex->getMessage();
427
+ }
428
+
429
+ // Start Indexes
430
+ foreach ($pCollection as $process) {
431
+ $process->setMode(Mage_Index_Model_Process::MODE_REAL_TIME)->save();
432
+ }
433
+
434
+ $this->loadLayout();
435
+
436
+ $block = $this->getLayout()->createBlock(
437
+ 'Mage_Core_Block_Template',
438
+ 'block_ezmage_oscommerce_import_step4',
439
+ array('template' => 'ezmage/oscommerceimport/step4.phtml')
440
+ );
441
+
442
+ $this->getLayout()->getBlock('content')->append($block);
443
+ $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
444
+
445
+ $this->renderLayout();
446
+ }
447
+
448
+
449
+ /*******************************************************************************/
450
+ /* Step 5 */
451
+ /*******************************************************************************/
452
+ public function step5Action()
453
+ {
454
+ try {
455
+ $resource = Mage::getSingleton('core/resource');
456
+ $readConnection = $resource->getConnection('core_read');
457
+
458
+ $sql = "select osc_product_id from ezmage_products where product_imported='y'";
459
+ $list = $readConnection->fetchAll($sql);
460
+ $importedProductsTotal = sizeof($list);
461
+ Mage::getSingleton('core/session')->setimportedProductsTotal($importedProductsTotal);
462
+ }
463
+ catch (Exception $ex) {
464
+ //Mage::register('conection_status',$ex->getMessage());
465
+ echo $ex->getMessage();
466
+ }
467
+
468
+ $this->loadLayout();
469
+
470
+ $block = $this->getLayout()->createBlock(
471
+ 'Mage_Core_Block_Template',
472
+ 'block_ezmage_oscommerce_import_step4',
473
+ array('template' => 'ezmage/oscommerceimport/step5.phtml')
474
+ );
475
+
476
+ $this->getLayout()->getBlock('content')->append($block);
477
+ $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
478
+
479
+ $this->renderLayout();
480
+ }
481
+
482
+ /*******************************************************************************/
483
+ /* Step 5.1 */
484
+ /*******************************************************************************/
485
+ public function step51Action()
486
+ {
487
+
488
+ $_config = $this->setRemoteConectionConfig();
489
+ // Stop Indexes
490
+ // http://www.clounce.com/magento/magento-reindex-programmatically
491
+ // http://stackoverflow.com/questions/5420552/magento-programmatically-disable-automatic-indexing
492
+ $pCollection = Mage::getSingleton('index/indexer')->getProcessesCollection();
493
+ foreach ($pCollection as $process) {
494
+ $process->setMode(Mage_Index_Model_Process::MODE_MANUAL)->save();
495
+ }
496
+
497
+ try {
498
+ $resource = Mage::getSingleton('core/resource');
499
+ $readConnection = $resource->getConnection('core_read');
500
+ $writeConnection = $resource->getConnection('core_write');
501
+ $_connection_remote = Mage::getSingleton('core/resource')->createConnection('oscommerce_conection', 'pdo_mysql', $_config);
502
+
503
+ $storeId = Mage::getStoreConfig('oscommerceimportconf/mageconfiguration/conf_website',Mage::app()->getStore());
504
+ $AttributeSetId = Mage::getStoreConfig('oscommerceimportconf/mageconfiguration/conf_attribute',Mage::app()->getStore());
505
+
506
+ $sql = "select * from ezmage_products where product_imported<>'y'";
507
+ $results = $readConnection->fetchAll($sql);
508
+
509
+ foreach($results as $row) {
510
+ //print $row['osc_product_id'].' => '.$row['osc_product_name'].' => '.$row['mage_product_id'].'<br>';
511
+
512
+ $product_osc = $this->getProductFromOSC($row['osc_product_id'],$readConnection,$_connection_remote);
513
+ $product_categories_osc = $this->getCategoriesProductFromOSC($row['osc_product_id'],$readConnection,$_connection_remote);
514
+
515
+ // some validation
516
+ if ($product_osc['products_model'] == '') {
517
+ $product_osc['products_model'] = $row['products_id'];
518
+ }
519
+
520
+ //search if sku exits
521
+ $oProduct = Mage::getModel("catalog/product")
522
+ ->getCollection()
523
+ ->setStoreId($storeId)
524
+ ->addAttributeToSelect("sku")
525
+ ->addFieldToFilter("sku", array('eq' => $product_osc['products_model']))
526
+ ->getFirstItem();
527
+
528
+ if ( sizeof($oProduct->getData()) > 0){
529
+ $product_osc['products_model'] = $product_osc['products_model'].rand(1111,9999);
530
+ }
531
+
532
+
533
+ //$product = Mage::getModel('catalog/product');
534
+ $product = new Mage_Catalog_Model_Product();
535
+
536
+ // Build the product
537
+ $product->setSku($product_osc['products_model']);
538
+ $product->setAttributeSetId($AttributeSetId);
539
+ $product->setTypeId('simple');
540
+ $product->setName($product_osc['products_name']);
541
+ $product->setCategoryIds($product_categories_osc);
542
+ $product->setWebsiteIDs(array($storeId));
543
+ $product->setDescription($product_osc['products_description']);
544
+ $product->setShortDescription('-');
545
+ $product->setPrice($product_osc['products_price']);
546
+ $product->setWeight($product_osc['products_weight']);
547
+
548
+ $product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
549
+ $product->setStatus($product_osc['products_status']);
550
+ $product->setTaxClassId(0); # My default tax class
551
+ $product->setStockData(array(
552
+ 'is_in_stock' => 1,
553
+ 'qty' => $product_osc['products_quantity']
554
+ ));
555
+
556
+ $product->setCreatedAt(strtotime('now'));
557
+
558
+ if ($product_osc['products_image'] != ''){
559
+ $image_location = $this->getDownloadImage("product",$product_osc['products_image']);
560
+ if ( file_exists($image_location) ) {
561
+ $product->addImageToMediaGallery($image_location,array('thumbnail','small_image','image'),true,false);
562
+ }
563
+ }
564
+
565
+ $product->save();
566
+
567
+ // update tmp table
568
+ $sql = "update ezmage_products set product_imported='y',mage_product_id=".$product->getId()." where osc_product_id=".$row['osc_product_id'];
569
+ $writeConnection->query($sql);
570
+
571
+ $totalimport++;
572
+ if ($totalimport == Mage::getStoreConfig('oscommerceimportconf/mageconfiguration/conf_totalperimport',Mage::app()->getStore())){
573
+ break;
574
+ }
575
+ }
576
+
577
+ // get import status
578
+ $sql = "select osc_product_id from ezmage_products where product_imported='y'";
579
+ $list = $readConnection->fetchAll($sql);
580
+ $importedProductsTotal = sizeof($list);
581
+ Mage::getSingleton('core/session')->setimportedProductsTotal($importedProductsTotal);
582
+
583
+ }
584
+ catch (Exception $ex) {
585
+ //Mage::register('conection_status',$ex->getMessage());
586
+ echo $row['osc_product_id'].' - '.$ex->getMessage();
587
+ }
588
+
589
+
590
+ // Start Indexes
591
+ foreach ($pCollection as $process) {
592
+ $process->setMode(Mage_Index_Model_Process::MODE_REAL_TIME)->save();
593
+ }
594
+
595
+ // Layaout
596
+ $this->loadLayout();
597
+
598
+ $block = $this->getLayout()->createBlock(
599
+ 'Mage_Core_Block_Template',
600
+ 'block_ezmage_oscommerce_import_step4',
601
+ array('template' => 'ezmage/oscommerceimport/step5.phtml')
602
+ );
603
+
604
+ $this->getLayout()->getBlock('content')->append($block);
605
+ $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
606
+
607
+ $this->renderLayout();
608
+ }
609
+
610
+
611
+
612
+ /*******************************************************************************/
613
+ /* Step 6 */
614
+ /*******************************************************************************/
615
+ public function step6Action()
616
+ {
617
+ $this->loadLayout();
618
+
619
+ $block = $this->getLayout()->createBlock(
620
+ 'Mage_Core_Block_Template',
621
+ 'block_ezmage_oscommerce_import_step4',
622
+ array('template' => 'ezmage/oscommerceimport/step6.phtml')
623
+ );
624
+
625
+ $this->getLayout()->getBlock('content')->append($block);
626
+ $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
627
+
628
+ $this->renderLayout();
629
+ }
630
+
631
+ /*******************************************************************************/
632
+ /* Step 6.1 */
633
+ /*******************************************************************************/
634
+ public function step61Action()
635
+ {
636
+
637
+ try{
638
+ // check if tmp are created
639
+ $resource = Mage::getSingleton('core/resource');
640
+ $writeConnection = $resource->getConnection('core_write');
641
+ // Remove tmp tables
642
+ $query = 'drop table ezmage_categories';
643
+ $writeConnection->query($query);
644
+ $query = 'drop table ezmage_log';
645
+ $writeConnection->query($query);
646
+ $query = 'drop table ezmage_products';
647
+ $writeConnection->query($query);
648
+
649
+ }
650
+ catch (Exception $ex) {
651
+ echo $ex->getMessage();
652
+ }
653
+
654
+ // unregister variables
655
+ Mage::getSingleton('core/session')->unsstep2Status();
656
+ Mage::getSingleton('core/session')->unsimportCategoryTotal();
657
+ Mage::getSingleton('core/session')->unsimportProductsTotal();
658
+ Mage::getSingleton('core/session')->unsimportCategoryTotal();
659
+ Mage::getSingleton('core/session')->unsimportedCategoryTotal();
660
+ Mage::getSingleton('core/session')->unsimportProductsTotal();
661
+ Mage::getSingleton('core/session')->unsimportedProductsTotal();
662
+
663
+ $this->loadLayout();
664
+
665
+ $block = $this->getLayout()->createBlock(
666
+ 'Mage_Core_Block_Template',
667
+ 'block_ezmage_oscommerce_import_step4',
668
+ array('template' => 'ezmage/oscommerceimport/step6.phtml')
669
+ );
670
+
671
+ $this->getLayout()->getBlock('content')->append($block);
672
+ $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
673
+
674
+ $this->renderLayout();
675
+ }
676
+
677
+
678
+
679
+ /***************************************************************************************************************/
680
+ // Utils
681
+ /***************************************************************************************************************/
682
+
683
+ // Get product Information from oscommerce
684
+ public function getProductFromOSC($osc_product_id,$readConnection,$_connection_remote){
685
+ $query = 'select products_description.*,products.* from products left join products_description on products.products_id=products_description.products_id where products.products_id = '.$osc_product_id.' and products_description.language_id = 1';
686
+ $results = $_connection_remote->fetchAll($query);
687
+ if (sizeof($results) == 1){
688
+ $product = $results[0];
689
+ }else{
690
+ $product['products_id'] = 0;
691
+ }
692
+ return $product;
693
+ }
694
+
695
+ // Returns Mage Categories
696
+ public function getCategoriesProductFromOSC($osc_product_id,$readConnection,$_connection_remote){
697
+ $query = 'select categories_id from products_to_categories where products_id = '.$osc_product_id;
698
+ $results = $_connection_remote->fetchAll($query);
699
+ foreach($results as $row) {
700
+ // find magento category id
701
+ $sql = "select mage_cat_id from ezmage_categories where osc_cat_id=".$row['categories_id'];
702
+ $mage_cat_id = $readConnection->fetchOne($sql);
703
+ if ($mage_cat_id > 0){
704
+ $product_categories[] = $mage_cat_id;
705
+ }
706
+ }
707
+ if (sizeof($product_categories) == 0){
708
+ $product_categories[] = Mage::getModel('catalog/category')->load(Mage::getStoreConfig('oscommerceimportconf/mageconfiguration/conf_category',Mage::app()->getStore()));
709
+ }
710
+ return $product_categories;
711
+ }
712
+
713
+
714
+ // Download Image
715
+ public function getDownloadImage($type,$file){
716
+ $path = str_replace("index.php","",$_SERVER["SCRIPT_FILENAME"]);
717
+ $import_location = $path.'media/catalog/';
718
+ if (!file_exists($import_location)){
719
+ mkdir($import_location, 0755);
720
+ }
721
+ $import_location = $path.'media/catalog/'.$type.'/';
722
+ if (!file_exists($import_location)){
723
+ mkdir($import_location, 0755);
724
+ }
725
+
726
+ // todo check if last character has /
727
+
728
+ $file_source = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_imageurl',Mage::app()->getStore()).$file;
729
+ $file_target = $import_location."/".basename($file);
730
+
731
+ $file_path = "";
732
+ if (($file != '') and (!file_exists($file_target))){
733
+ $rh = fopen($file_source, 'rb');
734
+ $wh = fopen($file_target, 'wb');
735
+ if ($rh===false || $wh===false) {
736
+ // error reading or opening file
737
+ $file_path = "";
738
+ }
739
+ while (!feof($rh)) {
740
+ if (fwrite($wh, fread($rh, 1024)) === FALSE) {
741
+ $file_path = $file_target;
742
+ }
743
+ }
744
+ fclose($rh);
745
+ fclose($wh);
746
+ }
747
+ if (file_exists($file_target)){
748
+ if ($type == 'category'){
749
+ $file_path = $file;
750
+ }else{
751
+ $file_path = $file_target;
752
+ }
753
+ }
754
+
755
+ return $file_path;
756
+ }
757
+
758
+ // Generate mage parent id
759
+ public function getMageParentID($osc_cat_parent,$readConnection) {
760
+ $sql = "select mage_cat_id from ezmage_categories where osc_cat_id=".(int)$osc_cat_parent;
761
+ $mage_cat_id = $readConnection->fetchOne($sql);
762
+ return $mage_cat_id;
763
+ }
764
+
765
+ // Generate category tree
766
+ public function tep_get_subcategories(&$categories_array = '', $parent_id = '0',$readConnection) {
767
+ $languages_id = 1;
768
+ if (!is_array($categories_array)) $categories_array = array();
769
+ $sql = "select * from ezmage_categories where osc_cat_parent=".(int)$parent_id;
770
+ $results = $readConnection->fetchAll($sql);
771
+ foreach($results as $row) {
772
+ $counter = count($categories_array);
773
+ $categories_array[$counter]['osc_cat_id'] = $row['osc_cat_id'];
774
+ $categories_array[$counter]['osc_cat_title'] = $row['osc_cat_title'];
775
+ $categories_array[$counter]['osc_cat_parent'] = $row['osc_cat_parent'];
776
+ $categories_array[$counter]['osc_cat_image'] = $row['osc_cat_image'];
777
+ $categories_array[$counter]['cat_imported'] = $row['cat_imported'];
778
+
779
+ if ($row['osc_cat_id'] != $parent_id) {
780
+ $categories_array = $this->tep_get_subcategories(&$categories_array, $row['osc_cat_id'],$readConnection);
781
+ }
782
+
783
+ }
784
+ return $categories_array;
785
+ }
786
+
787
+
788
+ // Save Log
789
+ public function saveException($log_type,$log_desc,$mage_log){
790
+ }
791
+
792
+ // Set remote conection
793
+ public function setRemoteConectionConfig(){
794
+ // Conect to remote db
795
+ $_config = array();
796
+ $_config['host'] = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_hostname',Mage::app()->getStore());
797
+ if (Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_port',Mage::app()->getStore()) != ''){
798
+ $_config['port'] = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_port',Mage::app()->getStore());
799
+ }
800
+ $_config['dbname'] = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_db',Mage::app()->getStore());
801
+ $_config['username'] = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_username',Mage::app()->getStore());
802
+ $_config['password'] = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_password',Mage::app()->getStore());
803
+ $_config_prefix = Mage::getStoreConfig('oscommerceimportconf/oscconfiguration/conf_prefix',Mage::app()->getStore());
804
+ // Setting the default Values
805
+ $_config['initStatements'] = 'SET NAMES utf8';
806
+ $_config['model'] = 'mysql4';
807
+ $_config['type'] = 'pdo_mysql';
808
+ $_config['pdoType'] = '';
809
+ $_config['active'] = '1';
810
+
811
+ return $_config;
812
+ }
813
+
814
+
815
+ }
app/code/community/Ezmage/OscommerceImport/etc/config.xml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Ezmage_OscommerceImport>
6
+ <version>1.7.3</version>
7
+ </Ezmage_OscommerceImport>
8
+ </modules>
9
+
10
+ <frontend>
11
+ <routers>
12
+ <ezmage_oscommerceimport> <!-- name of router. for consistency sake, match this to frontName -->
13
+ <use>standard</use> <!-- this is a standard router -->
14
+ <args>
15
+ <module>Ezmage_OscommerceImport</module> <!-- what module we should look at for the 'helloworld' router -->
16
+ <frontName>oscommerceimport</frontName> <!-- for consistency sake, match this to router name -->
17
+ </args>
18
+ </ezmage_oscommerceimport>
19
+ </routers>
20
+ </frontend>
21
+
22
+ <global>
23
+ <helpers>
24
+ <oscommerceimporthelper1>
25
+ <class>Ezmage_OscommerceImport_Helper</class>
26
+ </oscommerceimporthelper1>
27
+ </helpers>
28
+ </global>
29
+
30
+ <adminhtml>
31
+ <acl>
32
+ <resources>
33
+ <admin>
34
+ <children>
35
+ <system>
36
+ <children>
37
+ <config>
38
+ <children>
39
+ <oscommerceimportconf translate="title" module="oscommerceimporthelper1">
40
+ <title>osCommerce Import</title>
41
+ <sort_order>50</sort_order>
42
+ </oscommerceimportconf>
43
+ </children>
44
+ </config>
45
+ </children>
46
+ </system>
47
+ </children>
48
+ </admin>
49
+ </resources>
50
+ </acl>
51
+ </adminhtml>
52
+
53
+ </config>
app/code/community/Ezmage/OscommerceImport/etc/system.xml ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <tabs>
5
+ <oscommerceimporttab1 translate="label" module="oscommerceimporthelper1">
6
+ <label>osCommerce Import</label>
7
+ <sort_order>1</sort_order>
8
+ </oscommerceimporttab1>
9
+ </tabs>
10
+
11
+ <sections>
12
+ <oscommerceimportconf translate="label" module="oscommerceimporthelper1">
13
+ <class>separator-top</class>
14
+ <label>Configuration</label>
15
+ <tab>oscommerceimporttab1</tab>
16
+ <sort_order>130</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>1</show_in_website>
19
+ <show_in_store>1</show_in_store>
20
+ <groups>
21
+ <oscconfiguration translate="label">
22
+ <label>Step 1 - osCommerce Configuration</label>
23
+ <frontend_type>text</frontend_type>
24
+ <sort_order>10</sort_order>
25
+ <show_in_default>1</show_in_default>
26
+ <show_in_website>1</show_in_website>
27
+ <show_in_store>1</show_in_store>
28
+ <fields>
29
+ <conf_hostname translate="label">
30
+ <label>Ip or Hostname</label>
31
+ <frontend_type>text</frontend_type>
32
+ <sort_order>1</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ <validate>required-entry</validate>
37
+ <comment><![CDATA[Remember to enabled the remote mysql conection in your oscommerce server. <a href="https://www.google.com/search?q=cpanel+allow+remote+mysql+access" target="_blank">click here for help</a> ]]></comment>
38
+ </conf_hostname>
39
+
40
+ <conf_port translate="label">
41
+ <label>Port (Default as 3306)</label>
42
+ <frontend_type>text</frontend_type>
43
+ <sort_order>2</sort_order>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>1</show_in_website>
46
+ <show_in_store>1</show_in_store>
47
+ </conf_port>
48
+
49
+ <conf_db translate="label">
50
+ <label>DataBase</label>
51
+ <frontend_type>text</frontend_type>
52
+ <sort_order>3</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>1</show_in_website>
55
+ <show_in_store>1</show_in_store>
56
+ <validate>required-entry</validate>
57
+ </conf_db>
58
+
59
+ <conf_username translate="label">
60
+ <label>DataBase Username</label>
61
+ <frontend_type>text</frontend_type>
62
+ <sort_order>4</sort_order>
63
+ <show_in_default>1</show_in_default>
64
+ <show_in_website>1</show_in_website>
65
+ <show_in_store>1</show_in_store>
66
+ <validate>required-entry</validate>
67
+ </conf_username>
68
+
69
+ <conf_password translate="label">
70
+ <label>DataBase Password</label>
71
+ <frontend_type>text</frontend_type>
72
+ <sort_order>5</sort_order>
73
+ <show_in_default>1</show_in_default>
74
+ <show_in_website>1</show_in_website>
75
+ <show_in_store>1</show_in_store>
76
+ <validate>required-entry</validate>
77
+ </conf_password>
78
+
79
+ <conf_prefix translate="label">
80
+ <label>DataBase Prefix</label>
81
+ <frontend_type>text</frontend_type>
82
+ <sort_order>6</sort_order>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>1</show_in_website>
85
+ <show_in_store>1</show_in_store>
86
+ </conf_prefix>
87
+
88
+ <conf_imageurl translate="label">
89
+ <label>Image URL Location</label>
90
+ <frontend_type>text</frontend_type>
91
+ <sort_order>7</sort_order>
92
+ <show_in_default>1</show_in_default>
93
+ <show_in_website>1</show_in_website>
94
+ <show_in_store>1</show_in_store>
95
+ <validate>required-entry validate-url</validate>
96
+ <comment><![CDATA[osCommerce Image Folder url ex: http://yourstore.com/images/ ]]></comment>
97
+ </conf_imageurl>
98
+
99
+ </fields>
100
+ </oscconfiguration>
101
+
102
+ <mageconfiguration translate="label">
103
+ <label>Step 2 - Magento Configuration</label>
104
+ <frontend_type>text</frontend_type>
105
+ <sort_order>11</sort_order>
106
+ <show_in_default>1</show_in_default>
107
+ <show_in_website>1</show_in_website>
108
+ <show_in_store>1</show_in_store>
109
+ <fields>
110
+ <conf_website translate="label">
111
+ <label>Create Under default website</label>
112
+ <frontend_type>select</frontend_type>
113
+ <source_model>adminhtml/system_config_source_store</source_model>
114
+ <sort_order>1</sort_order>
115
+ <show_in_default>1</show_in_default>
116
+ <show_in_website>1</show_in_website>
117
+ <show_in_store>1</show_in_store>
118
+ <validate>required-entry</validate>
119
+ </conf_website>
120
+
121
+ <conf_category translate="label">
122
+ <label>Default Category</label>
123
+ <frontend_type>select</frontend_type>
124
+ <source_model>adminhtml/system_config_source_category</source_model>
125
+ <sort_order>2</sort_order>
126
+ <show_in_default>1</show_in_default>
127
+ <show_in_website>1</show_in_website>
128
+ <show_in_store>1</show_in_store>
129
+ <validate>required-entry</validate>
130
+ </conf_category>
131
+
132
+ <conf_attribute translate="label">
133
+ <label>Default Attribute Set</label>
134
+ <frontend_type>select</frontend_type>
135
+ <source_model>Ezmage_OscommerceImport_Model_Source_GetAttributeSets</source_model>
136
+ <sort_order>2</sort_order>
137
+ <show_in_default>1</show_in_default>
138
+ <show_in_website>1</show_in_website>
139
+ <show_in_store>1</show_in_store>
140
+ <validate>required-entry</validate>
141
+ </conf_attribute>
142
+
143
+ <conf_totalperimport translate="label">
144
+ <label>Total Products</label>
145
+ <frontend_type>text</frontend_type>
146
+ <sort_order>3</sort_order>
147
+ <show_in_default>1</show_in_default>
148
+ <show_in_website>1</show_in_website>
149
+ <show_in_store>1</show_in_store>
150
+ <validate>required-entry validate-number</validate>
151
+ <comment><![CDATA[We recommend to do 50 products per batch]]></comment>
152
+ </conf_totalperimport>
153
+
154
+ </fields>
155
+
156
+
157
+ </mageconfiguration>
158
+
159
+ <oscommercebegin translate="label">
160
+ <label>Step 3 - Navigate to the import tool</label>
161
+ <frontend_type>text</frontend_type>
162
+ <sort_order>12</sort_order>
163
+ <show_in_default>1</show_in_default>
164
+ <show_in_website>1</show_in_website>
165
+ <show_in_store>1</show_in_store>
166
+ <comment><![CDATA[The URL will be http://www.<b>your-magento-domain.com</b>/oscommerceimport]]></comment>
167
+ </oscommercebegin>
168
+
169
+ </groups>
170
+ </oscommerceimportconf>
171
+
172
+ </sections>
173
+ </config>
app/design/frontend/default/default/template/ezmage/oscommerceimport/_notes/dwsync.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <dwsync>
3
+ <file name="step5.phtml" server="php53.ezosc.com//public_html/magento1.7/" local="129822021581830893" remote="129822095400000000" />
4
+ <file name="step0.phtml" server="php53.ezosc.com//public_html/magento1.7/" local="129822021619343039" remote="129822094800000000" />
5
+ <file name="step6.phtml" server="php53.ezosc.com//public_html/magento1.7/" local="129822021582310921" remote="129822095400000000" />
6
+ <file name="step31.phtml" server="php53.ezosc.com//public_html/magento1.7/" local="129822021580840837" remote="129822095400000000" />
7
+ <file name="step2.phtml" server="php53.ezosc.com//public_html/magento1.7/" local="129822021579910783" remote="129822094800000000" />
8
+ <file name="step1.phtml" server="php53.ezosc.com//public_html/magento1.7/" local="129822021579430756" remote="129822094800000000" />
9
+ <file name="step3.phtml" server="php53.ezosc.com//public_html/magento1.7/" local="129822021580370810" remote="129822095400000000" />
10
+ <file name="step4.phtml" server="php53.ezosc.com//public_html/magento1.7/" local="129822021581360866" remote="129822095400000000" />
11
+ </dwsync>
app/design/frontend/default/default/template/ezmage/oscommerceimport/step0.phtml ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $image_status1 = Mage::registry('image_status1');
3
+ $image_status2 = Mage::registry('image_status2');
4
+ $image_status3 = Mage::registry('image_status3');
5
+ $image_status4 = Mage::registry('image_status4');
6
+ $image_status5 = Mage::registry('image_status5');
7
+ $image_status6 = Mage::registry('image_status6');
8
+
9
+ ?>
10
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
11
+ <tr>
12
+ <td align="center"><h1><strong>osCommerce Products/Categories Import </strong></h1></td>
13
+ </tr>
14
+ <tr>
15
+ <td>&nbsp;</td>
16
+ </tr>
17
+ <tr>
18
+ <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
19
+ <tr>
20
+ <td><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>Ezmage/OscommerceImport/<?php echo $image_status1; ?>" />&nbsp;&nbsp;<a href="<?php echo $this->getUrl('oscommerceimport/index/step1/')?>">1. Configuration</a> <br />
21
+ <br /></td>
22
+ </tr>
23
+ <?php if ( $image_status1 == 'check-no.jpg') {?>
24
+ <tr>
25
+ <td><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>Ezmage/OscommerceImport/<?php echo $image_status2; ?>" />&nbsp;&nbsp;2. Create TMP Tables<br /><br /></td>
26
+ </tr>
27
+ <?php }else{ ?>
28
+ <tr>
29
+ <td><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>Ezmage/OscommerceImport/<?php echo $image_status2; ?>" />&nbsp;&nbsp;<a href="<?php echo $this->getUrl('oscommerceimport/index/step2/')?>">2. Create TMP Tables</a><br /><br /></td>
30
+ </tr>
31
+ <?php } ?>
32
+
33
+ <?php if ( $image_status2 == 'check-no.jpg') {?>
34
+ <tr>
35
+ <td><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>Ezmage/OscommerceImport/<?php echo $image_status3; ?>" />&nbsp;&nbsp;3. Preparing TMP Tables<br />
36
+ <br /></td>
37
+ </tr>
38
+ <?php }else{ ?>
39
+ <tr>
40
+ <td><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>Ezmage/OscommerceImport/<?php echo $image_status3; ?>" />&nbsp;&nbsp;<a href="<?php echo $this->getUrl('oscommerceimport/index/step3/')?>">3. Preparing TMP Tables</a><br /><br /></td>
41
+ </tr>
42
+
43
+ <?php } ?>
44
+
45
+ <?php if ( $image_status3 == 'check-no.jpg') {?>
46
+ <tr>
47
+ <td><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>Ezmage/OscommerceImport/<?php echo $image_status4; ?>" />&nbsp;&nbsp;4. Import Categories<br /><br /></td>
48
+ </tr>
49
+ <?php }else{ ?>
50
+ <tr>
51
+ <td><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>Ezmage/OscommerceImport/<?php echo $image_status4; ?>" />&nbsp;&nbsp;<a href="<?php echo $this->getUrl('oscommerceimport/index/step4/')?>">4. Import Categories</a><br /><br /></td>
52
+ </tr>
53
+ <?php } ?>
54
+
55
+
56
+ <?php if ( $image_status4 == 'check-no.jpg') {?>
57
+ <tr>
58
+ <td><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>Ezmage/OscommerceImport/<?php echo $image_status5; ?>" />&nbsp;&nbsp;5. Import Products<br /><br /></td>
59
+ </tr>
60
+ <?php }else{ ?>
61
+ <tr>
62
+ <td><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>Ezmage/OscommerceImport/<?php echo $image_status5; ?>" />&nbsp;&nbsp;<a href="<?php echo $this->getUrl('oscommerceimport/index/step5/')?>">5. Import Products</a><br /><br /></td>
63
+ </tr>
64
+ <?php }?>
65
+
66
+ <?php if ( $image_status5 == 'check-no.jpg') {?>
67
+ <tr>
68
+ <td><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>Ezmage/OscommerceImport/<?php echo $image_status6; ?>" />&nbsp;&nbsp;6. Uninstall and Enjoy<br />
69
+ <br /></td>
70
+ </tr>
71
+ <?php }else{ ?>
72
+ <tr>
73
+ <td><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>Ezmage/OscommerceImport/<?php echo $image_status6; ?>" />&nbsp;&nbsp;<a href="<?php echo $this->getUrl('oscommerceimport/index/step6/')?>">6. Uninstall and Enjoy</a><br /><br /></td>
74
+ </tr>
75
+ <?php }?>
76
+
77
+ </table></td>
78
+ </tr>
79
+
80
+
81
+ <tr>
82
+ <td>&nbsp;</td>
83
+ </tr>
84
+ <tr>
85
+ <td>&nbsp;</td>
86
+ </tr>
87
+ <tr>
88
+ <td>&nbsp;</td>
89
+ </tr>
90
+ <tr>
91
+ <td><div align="center">Powered by <a href="http://www.atwoodz.com/" target="_blank">ezMage</a> - We provide Magento Support 702-485-3332</div></td>
92
+ </tr>
93
+ </table>
app/design/frontend/default/default/template/ezmage/oscommerceimport/step1.phtml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
2
+
3
+ <tr>
4
+
5
+ <td align="center"><h1><strong>osCommerce Products/Categories Import </strong></h1></td>
6
+
7
+ </tr>
8
+
9
+ <tr>
10
+
11
+ <td><strong>Step 1. Configuration</strong></td>
12
+
13
+ </tr>
14
+
15
+ <tr>
16
+
17
+ <td>Go to your <a href="<?php echo $this->getUrl()?>admin">Admin Secton</a> -&gt; Click &quot;System&quot; -&gt; Click &quot;Configuration&quot; -&gt; Click &quot;Configuration&quot; under letf menu &quot;osCommerce Import&quot;<br /><br />
18
+
19
+ </td>
20
+
21
+ </tr>
22
+
23
+ <tr>
24
+
25
+ <td><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>Ezmage/OscommerceImport/step1.png" width="598" height="514" /></td>
26
+
27
+ </tr>
28
+
29
+ <tr>
30
+
31
+ <td></td>
32
+
33
+ </tr>
34
+
35
+ <tr>
36
+
37
+ <td><br />
38
+
39
+ <br />
40
+
41
+ <br /> <div align="center"><a href="<?php echo $this->getUrl('oscommerceimport')?>">Main Menu</a></div></td>
42
+
43
+ </tr>
44
+
45
+ <tr>
46
+
47
+ <td>&nbsp;</td>
48
+
49
+ </tr>
50
+
51
+ <tr>
52
+
53
+ <td><div align="center">Powered by <a href="http://www.atwoodz.com/" target="_blank">ezMage</a> - We provide Magento Support 702-485-3332</div></td>
54
+
55
+ </tr>
56
+
57
+ </table>
58
+
app/design/frontend/default/default/template/ezmage/oscommerceimport/step2.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $truncate_tables = Mage::registry('truncate_tables');
3
+ ?>
4
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
5
+ <tr>
6
+ <td align="center"><h1><strong>osCommerce Products/Categories Import </strong></h1></td>
7
+ </tr>
8
+ <tr>
9
+ <td><strong>Step 2. Create TMP Tables</strong></td>
10
+ </tr>
11
+ <tr>
12
+ <td><br /><br />
13
+ </td>
14
+ </tr>
15
+ <tr>
16
+ <td>TMP tables: <em>ezmage_categories , ezmage_products , ezmage_log </em>have been created</td>
17
+ </tr>
18
+ <tr>
19
+ <td><br />
20
+ If you want to delete this tables run this sql <br />
21
+ <br />
22
+ drop table ezmage_categories;<br />
23
+ drop table ezmage_log;<br />
24
+ drop table ezmage_products; </td>
25
+ </tr>
26
+ <tr>
27
+ <td>&nbsp;</td>
28
+ </tr>
29
+ <tr>
30
+ <td>If you want to clean the tmp tables please <a href="<?php echo $this->getUrl('oscommerceimport/index/step21/')?>">click here</a><br />
31
+ <?php if ($truncate_tables == 'yes'){?>
32
+ <br />
33
+ <br />
34
+ The tmp have been truncated
35
+ <?php } ?>
36
+ </td>
37
+ </tr>
38
+ <tr>
39
+ <td><br />
40
+ <br />
41
+ <br /> <div align="center"><a href="<?php echo $this->getUrl('oscommerceimport')?>">Main Menu</a></div></td>
42
+ </tr>
43
+ <tr>
44
+ <td>&nbsp;</td>
45
+ </tr>
46
+ <tr>
47
+ <td><div align="center">Powered by <a href="http://www.atwoodz.com/" target="_blank">ezMage</a> - We provide Magento Support 702-485-3332</div></td>
48
+ </tr>
49
+ </table>
app/design/frontend/default/default/template/ezmage/oscommerceimport/step3.phtml ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $conection_status = Mage::registry('conection_status');
4
+
5
+
6
+
7
+ ?>
8
+
9
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
10
+
11
+ <tr>
12
+
13
+ <td align="center"><h1><strong>osCommerce Products/Categories Import </strong></h1></td>
14
+
15
+ </tr>
16
+
17
+ <tr>
18
+
19
+ <td><strong>Step 3. Preparing TMP Tables</strong></td>
20
+
21
+ </tr>
22
+
23
+ <tr>
24
+
25
+ <td><br /><br />
26
+
27
+ </td>
28
+
29
+ </tr>
30
+
31
+ <tr>
32
+
33
+ <td>We will go to conect to the oscommerce database and read all the products id and categories id and save the information in the tmp tables</td>
34
+
35
+ </tr>
36
+
37
+ <tr>
38
+
39
+ <td><br />
40
+
41
+ <a href="<?php echo $this->getUrl('oscommerceimport/index/step31/')?>">Please click here to begin this proccess<br />
42
+
43
+ <br /> </a>
44
+
45
+ <br />
46
+
47
+ <strong>Conection Status:</strong> <?php echo $conection_status; ?></td>
48
+
49
+ </tr>
50
+
51
+ <tr>
52
+
53
+ <td><br />
54
+
55
+ <br />
56
+
57
+ <br /> <div align="center"><a href="<?php echo $this->getUrl('oscommerceimport')?>">Main Menu</a></div></td>
58
+
59
+ </tr>
60
+
61
+ <tr>
62
+
63
+ <td>&nbsp;</td>
64
+
65
+ </tr>
66
+
67
+ <tr>
68
+
69
+ <td><div align="center">Powered by <a href="http://www.atwoodz.com/" target="_blank">ezMage</a> - We provide Magento Support 702-485-3332</div></td>
70
+
71
+ </tr>
72
+
73
+ </table>
74
+
app/design/frontend/default/default/template/ezmage/oscommerceimport/step31.phtml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $importCategoryTotal = Mage::getSingleton('core/session')->getimportCategoryTotal();
3
+ $importProductsTotal = Mage::getSingleton('core/session')->getimportProductsTotal();
4
+ ?>
5
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
6
+ <tr>
7
+ <td align="center"><h1><strong>osCommerce Products/Categories Import </strong></h1></td>
8
+ </tr>
9
+ <tr>
10
+ <td><strong>Step 3. Preparing TMP Tables</strong></td>
11
+ </tr>
12
+ <tr>
13
+ <td><br /><br />
14
+ </td>
15
+ </tr>
16
+ <tr>
17
+ <td>We will go to conect to the oscommerce database and read all the products id and categories id and save the information in the tmp tables</td>
18
+ </tr>
19
+ <tr>
20
+ <td><br />
21
+ <strong>Total categories to import:</strong> <?php echo $importCategoryTotal; ?><br />
22
+ <strong>Total products to import:</strong> <?php echo $importProductsTotal; ?></td>
23
+ </tr>
24
+ <tr>
25
+ <td><br />
26
+ <br />
27
+ <br /> <div align="center"><a href="<?php echo $this->getUrl('oscommerceimport')?>">Main Menu</a></div></td>
28
+ </tr>
29
+ <tr>
30
+ <td>&nbsp;</td>
31
+ </tr>
32
+ <tr>
33
+ <td><div align="center">Powered by <a href="http://www.atwoodz.com/" target="_blank">ezMage</a> - We provide Magento Support 702-485-3332</div></td>
34
+ </tr>
35
+ </table>
app/design/frontend/default/default/template/ezmage/oscommerceimport/step4.phtml ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $importCategoryTotal = Mage::getSingleton('core/session')->getimportCategoryTotal();
4
+
5
+ $importedCategoryTotal = Mage::getSingleton('core/session')->getimportedCategoryTotal();
6
+
7
+ ?>
8
+
9
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
10
+
11
+ <tr>
12
+
13
+ <td align="center"><h1><strong>osCommerce Products/Categories Import </strong></h1></td>
14
+
15
+ </tr>
16
+
17
+ <tr>
18
+
19
+ <td><strong>Step 4. Import Categories</strong></td>
20
+
21
+ </tr>
22
+
23
+ <tr>
24
+
25
+ <td><br /><br />
26
+
27
+ </td>
28
+
29
+ </tr>
30
+
31
+ <tr>
32
+
33
+ <td><br />
34
+
35
+ <?php if ($importCategoryTotal != $importedCategoryTotal) { ?>
36
+
37
+ Click the link below to import the categories<br /><br />
38
+
39
+ <a href="<?php echo $this->getUrl('oscommerceimport/index/step41/')?>">Please click to import</a>
40
+
41
+ <?php }else{?>
42
+
43
+ Congratulation the categories have been imported <img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>Ezmage/OscommerceImport/check-ok.jpg" />
44
+
45
+ <?php }?>
46
+
47
+ <br />
48
+
49
+ <br />
50
+
51
+ <br />
52
+
53
+ <strong>Total categories to import:</strong> <?php echo $importCategoryTotal; ?><br />
54
+
55
+ <strong>Total categories imported:</strong> <?php echo $importedCategoryTotal; ?></td>
56
+
57
+ </tr>
58
+
59
+ <tr>
60
+
61
+ <td><br />
62
+
63
+ <br />
64
+
65
+ <br /> <div align="center"><a href="<?php echo $this->getUrl('oscommerceimport')?>">Main Menu</a></div></td>
66
+
67
+ </tr>
68
+
69
+ <tr>
70
+
71
+ <td>&nbsp;</td>
72
+
73
+ </tr>
74
+
75
+ <tr>
76
+
77
+ <td><div align="center">Powered by <a href="http://www.atwoodz.com/" target="_blank">ezMage</a> - We provide Magento Support 702-485-3332</div></td>
78
+
79
+ </tr>
80
+
81
+ </table>
82
+
app/design/frontend/default/default/template/ezmage/oscommerceimport/step5.phtml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $importProductsTotal = Mage::getSingleton('core/session')->getimportProductsTotal();
3
+ $importedProductsTotal = Mage::getSingleton('core/session')->getimportedProductsTotal();
4
+
5
+ ?>
6
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
7
+ <tr>
8
+ <td align="center"><h1><strong>osCommerce Products/Categories Import </strong></h1></td>
9
+ </tr>
10
+ <tr>
11
+ <td><strong>Step 5. Import Products</strong></td>
12
+ </tr>
13
+ <tr>
14
+ <td><br /><br />
15
+ </td>
16
+ </tr>
17
+ <tr>
18
+ <td><br />
19
+ <?php if ($importProductsTotal != $importedProductsTotal) { ?>
20
+ Click the link below to import the products, every time that you click teh script will go to import <?php echo Mage::getStoreConfig('oscommerceimportconf/mageconfiguration/conf_totalperimport',Mage::app()->getStore()); ?> products<br /><br />
21
+ <a href="<?php echo $this->getUrl('oscommerceimport/index/step51/')?>">Please click to import</a>
22
+ <?php }else{?>
23
+ Congratulation the products have been imported <img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>Ezmage/OscommerceImport/check-ok.jpg" />
24
+ <?php }?>
25
+ <br />
26
+ <br />
27
+ <br />
28
+ <strong>Total products to import:</strong> <?php echo $importProductsTotal; ?><br />
29
+ <strong>Total products imported:</strong> <?php echo $importedProductsTotal; ?></td>
30
+ </tr>
31
+ <tr>
32
+ <td><br />
33
+ <br />
34
+ <br /> <div align="center"><a href="<?php echo $this->getUrl('oscommerceimport')?>">Main Menu</a></div></td>
35
+ </tr>
36
+ <tr>
37
+ <td>&nbsp;</td>
38
+ </tr>
39
+ <tr>
40
+ <td><div align="center">Powered by <a href="http://www.atwoodz.com/" target="_blank">ezMage</a> - We provide Magento Support 702-485-3332</div></td>
41
+ </tr>
42
+ </table>
app/design/frontend/default/default/template/ezmage/oscommerceimport/step6.phtml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //$importProductsTotal = Mage::getSingleton('core/session')->getimportProductsTotal();
3
+ //$importedProductsTotal = Mage::getSingleton('core/session')->getimportedProductsTotal();
4
+
5
+ ?>
6
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
7
+ <tr>
8
+ <td align="center"><h1><strong>osCommerce Products/Categories Import </strong></h1></td>
9
+ </tr>
10
+ <tr>
11
+ <td><strong>Step 6. Uninstall and Enjoy</strong></td>
12
+ </tr>
13
+ <tr>
14
+ <td><br /><br />
15
+ </td>
16
+ </tr>
17
+ <tr>
18
+ <td valign="top"><p>The import is done , please click the link below to remove the tmp tables and revome this extension</p>
19
+ <p><a href="<?php echo $this->getUrl('oscommerceimport/index/step61/')?>">Delete TMP Tables</a>
20
+ <br />
21
+ <br />
22
+ <br />
23
+ </p></td>
24
+ </tr>
25
+ <tr>
26
+ <td valign="top"><div align="center"><h3>Need Help with Magento? Call us at 702-485-3332</h3></div></td>
27
+ </tr>
28
+ <tr>
29
+ <td align="center" valign="top"><div align="center"></div></td>
30
+ </tr>
31
+ <tr>
32
+ <td><br />
33
+ <br />
34
+ <br /> <div align="center"><a href="<?php echo $this->getUrl('oscommerceimport')?>">Main Menu</a></div></td>
35
+ </tr>
36
+ <tr>
37
+ <td>&nbsp;</td>
38
+ </tr>
39
+ <tr>
40
+ <td><div align="center">Powered by <a href="http://www.atwoodz.com/" target="_blank">ezMage</a> - We provide Magento Support 702-485-3332</div></td>
41
+ </tr>
42
+ </table>
app/etc/modules/Ezmage_OscommerceImport.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Ezmage_OscommerceImport>
6
+ <active>true</active>
7
+ <codePool>community</codePool>
8
+ </Ezmage_OscommerceImport>
9
+ </modules>
10
+ </config>
media/Ezmage/OscommerceImport/check-no.jpg ADDED
Binary file
media/Ezmage/OscommerceImport/check-ok.jpg ADDED
Binary file
media/Ezmage/OscommerceImport/step1.png ADDED
Binary file
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Ezmage_OscommerceImport</name>
4
+ <version>1.7.3</version>
5
+ <stability>stable</stability>
6
+ <license>OSL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Easily import categories and products from an osCommerce store into a Magento website! </summary>
10
+ <description>A tool that is designed for people who may have outgrown their current osCommerce platform or want to take the next step in e-commerce and move to an enterprise level platform. The osCommerce Categories / Products Migration tool allows you to easily export your products, images and product descriptions into a new Magento e-commerce store. Within minutes you can have your Magento store populated with the products you probably spent hours inserting into your osCommerce store!</description>
11
+ <notes>The DataBase Prefix hasn't work on this version yet</notes>
12
+ <authors><author><name>ezMage</name><user>ezosc</user><email>luis@ezosc.com</email></author></authors>
13
+ <date>2012-06-04</date>
14
+ <time>17:51:55</time>
15
+ <contents><target name="magecommunity"><dir name="Ezmage"><dir name="OscommerceImport"><dir name="Helper"><file name="Data.php" hash="001ce1cd0278e96f0ebf2bcde0f1f740"/></dir><dir name="Model"><dir name="Source"><file name="GetAttributeSets.php" hash="b9b1f50222887f9724419b2e81c8c9bf"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="95118471d19419757e63fb809e41c136"/></dir><dir name="etc"><file name="config.xml" hash="53ecad3ade04fb22d2e272edbdb0decc"/><file name="system.xml" hash="af31bdd08e50a2a457950aa6ab74e7d9"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ezmage_OscommerceImport.xml" hash="9ffd2089fb62be0b12887a5d1d84d1a9"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="ezmage"><dir name="oscommerceimport"><dir name="_notes"><file name="dwsync.xml" hash="dda7f97949607ebb10b0d4734fe9104b"/></dir><file name="step0.phtml" hash="b2458c73080dedcf4a0acd811f7a4fe3"/><file name="step1.phtml" hash="a4578bb8371691c821202b489657780f"/><file name="step2.phtml" hash="e01fcab81f47b4334cb183b2eb23edc5"/><file name="step3.phtml" hash="145a50cfdec3908b0b2e0926d17d01c0"/><file name="step31.phtml" hash="dbb9189ef42976729aa34b5f2d18dee6"/><file name="step4.phtml" hash="1499ed4a8fda73865913d23af4e7ced1"/><file name="step5.phtml" hash="4d5ab6864b8372a381a1fb6167fdf9d4"/><file name="step6.phtml" hash="a46b3bbc9b6d24bdcfb9d047ce10e4e8"/></dir></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="Ezmage"><dir name="OscommerceImport"><file name="check-no.jpg" hash="1c9c306222acaf4150291d5f82e15389"/><file name="check-ok.jpg" hash="1a990bbbbead79f7af02883406c420f9"/><file name="step1.png" hash="4ca193b1b5ccc8012ef85c0e62743cf7"/></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>