....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 107.180.102.13  /  Your IP : 216.73.216.127
Web Server : Apache
System : Linux ip-107-180-102-13.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64
User : nobody ( 99)
PHP Version : 7.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/egdeals/public_html/admin/controller/extension/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/egdeals/public_html/admin/controller/extension/import.php
<?php 
/**
 * TMD(http://opencartextensions.in/)
 *
 * Copyright (c) 2016 - 2019 TMD
 * This package is Copyright so please us only one domain 
 * 
 */
set_time_limit(0);
ini_set('memory_limit','9999M');
error_reporting(-1);
require_once(DIR_SYSTEM.'/library/tmd/PHPExcel.php');
//lib
require_once(DIR_SYSTEM.'library/tmd/system.php');
//lib

class ControllerExtensionimport extends Controller { 
	private $error = array();
	
	public function index() {	
		
		$totalnewproduct=0;
		$totalupdateproduct=0;

		$this->language->load('extension/import');
		
		// Default opencart table field list ///
		$defaultfild=array();
		$defaultfild[]='product_id';
		$defaultfild[]='model';
		$defaultfild[]='sku';
		$defaultfild[]='upc';
		$defaultfild[]='ean';
		$defaultfild[]='jan';
		$defaultfild[]='isbn';
		$defaultfild[]='mpn';
		$defaultfild[]='location';
		$defaultfild[]='quantity';
		$defaultfild[]='stock_status_id';
		$defaultfild[]='image';
		$defaultfild[]='manufacturer_id';
		$defaultfild[]='shipping';
		$defaultfild[]='price';
		$defaultfild[]='points';
		$defaultfild[]='tax_class_id';
		$defaultfild[]='date_available';
		$defaultfild[]='weight';
		$defaultfild[]='weight_class_id';
		$defaultfild[]='length';
		$defaultfild[]='width';
		$defaultfild[]='height';
		$defaultfild[]='length_class_id';
		$defaultfild[]='subtract';
		$defaultfild[]='minimum';
		$defaultfild[]='sort_order';
		$defaultfild[]='status';
		$defaultfild[]='viewed';
		$defaultfild[]='date_added';
		$defaultfild[]='date_modified';
		
		// Default opencart table field list ///
		////////////// Custome filed //
		$query=$this->db->query("SHOW COLUMNS FROM " . DB_PREFIX . "product");
		$data['cfiled']=array();
		foreach($query->rows as $row)
		{
			if(!in_array($row['Field'],$defaultfild))
			{
			$data['cfiled'][]=$row['Field'];
			}
		}
		$cfileds=$data['cfiled'];
		

		
		////////////// Custome filed //

		$this->document->setTitle($this->language->get('heading_title'));
		
		$this->load->model('extension/import');
				
		if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->user->hasPermission('modify', 'extension/import')) {
			
			$importexport=$this->config->get('tmdkey_importexport');
	/*	if (empty(trim($importexport))) {			
		$this->session->data['warning'] ='Module will Work after add License key!';
		$this->response->redirect($this->url->link('extension/import', 'user_token=' . $this->session->data['user_token'], true));
		}*/
		
			$language_id=$this->request->post['language_id'];
			$store_id=$this->request->post['store_id'];
			$importby=$this->request->post['importby'];
			
			if (is_uploaded_file($this->request->files['import']['tmp_name'])) {
				$content = file_get_contents($this->request->files['import']['tmp_name']);
			} else {
				$content = false;
			}


			$path_parts = pathinfo($this->request->files['import']['name']);
			if(!empty($path_parts['extension'])){
				$extension = $path_parts['extension'];
			}else{
				$extension = '';
			}


			if ($content && 'xml' == $extension && $this->request->post['format']=='xml'){
			$xml = simplexml_load_string($content);
			$i=0;
			foreach($xml->PRODUCT as $xmlData) {
			$model	=	$xmlData->MODEL;
				
				if(!empty($model)){
					
				/* stroers */
				$product_stores=array();
				$product_stores[]=0;
				
				$product_stornew = explode(';',(string) $xmlData->Stores);
				
				if(isset($product_stornew)){
					foreach($product_stornew as $product_store)
					{
					if(!empty($product_store))
						{
							$product_stores[]=(int)($product_store);
						}
					}
				}
				$product_stores=array_unique($product_stores);
				
				/*  END Stores */
				
				/* Step Get category ids  */
				$catgoryname = $xmlData->Categories;
				$catgorynames=explode(';',(string)$catgoryname);
				$category_id=array();
				if(isset($catgorynames))
				{
					foreach($catgorynames as $category)
					{
						$category=trim($category);
						if(!empty($category))
						{
							$category_id[]=$this->model_extension_import->category($category,0,$store_id,$language_id);
						}
					}
				}
				/* Step Get category ids  */
				
				/* Step Get Barnd  ids  */
				$brandname=$xmlData->Manufacturer;
				$brandnames=explode(';',(string)$brandname);
				$brand_id='';
				if(isset($brandnames)){
					foreach($brandnames as $brand){
						$brand=trim($brand);
						if(!empty($brand)){
							$brand_id=$this->model_extension_import->barnd($brand,$store_id,$language_id);
						}
					}
				}
				
				/* Step Get Barnd  ids  */
				
				/* Step Get Options and value insert  */
				$options=$xmlData->OptionName;
				$options=explode(';',(string)$options);
				
				if(isset($options)){
					foreach($options as $option){
						$option=trim($option);
						if(!empty($option)){
							$this->model_extension_import->option($option,$language_id);
						}
					}
				}
				
				$options=$xmlData->OptionValue;
				$options=explode(';',(string)$options);
				$productoptions=array();
				if(!empty($options)){
					foreach($options as $option){
						$option=trim($option);
						if(!empty($option)){
							$productoptions[]=$this->model_extension_import->optionvalue($option,$language_id);
						}
					}
				}
				/* Step End Get Options and value insert  */
				
			
				/* Step Product Main Image  */
				$image=$xmlData->Image;
				if(!empty($image)){
				$mainimage=$this->model_extension_import->imagesave($image);
				}else{
				$mainimage='';
				}
			
				/* Step End Product Main Image  */
				
				/* Step Start Product Filter Group  entry */
				
				if(isset($xmlData->FilterGroupName)){
					
				$filtergroup=$xmlData->FilterGroupName;
				if(!empty($filtergroup)){
					$filtergroups=explode(';',(string)$filtergroup);
					if(!empty($filtergroups)){
						foreach($filtergroups as $filtergroup){
							$filtergroup=trim($filtergroup);
							if(!empty($filtergroup)){
								$this->model_extension_import->filtergroup($filtergroup,$language_id);
							}
						}
					}
				}
				}
				/* Step Start Product Filter Group  entry */
				/* Step Start Product Filter name  entry */
				$fillterids=array();
				if(isset($xmlData->FilterNames)){
				$filternames=$xmlData->FilterNames;
				if(!empty($filternames)){
					$filternames=explode(';',(string)$filternames);
					if(!empty($filternames)){
						
						foreach($filternames as $filtername){
							$filtername=trim($filtername);
							if(!empty($filtername)){
							$fillterids[]=$this->model_extension_import->filtername($filtername,$language_id);
							}
						}
					}
				}
				}
				
			
				
				/* Start Attribute work */
				$attributes=array();
				if(isset($xmlData->Attributes)){
				$attributesname=$xmlData->Attributes;
				if(!empty($attributesname)){
					$attributess=explode(';',(string)$attributesname);
					if(!empty($attributess)){
						
						foreach($attributess as $attribute){
							if(!empty($attribute)){
							$attinfo=$this->model_extension_import->atributeallinfo($attribute,$language_id);
							$attributes[]=array(
							'attribute_id'=>$attinfo['attribute_id'],
							'text'=>$attinfo['text']
							);
							}
						}
					}
				}
				
				}
				
				/* End Attribute work */
				$discounts=array();
				if(isset($xmlData->Discount)){
					$discountinfo=$xmlData->Discount;
					$discountinfos=explode(';',(string)$discountinfo);
					if(!empty($discountinfos)){
						foreach($discountinfos as $discount){
							if(!empty($discount)){
							$info=explode(':',$discount);
							$discounts[]=array(
							'customer_group_id'=>$info[0],
							'quantity'=>$info[1],
							'priority'=>$info[2],
							'price'=>$info[3],
							'date_start'=>$info[4],
							'date_end'=>$info[5]
							);
							}
						}
						
					}
				}
				/* Start Discount work */
				
				/* END Discount work */
				
				/* Reward point */
				$point='';
				if(!empty($xmlData->RewardPoints)){
				$point=$xmlData->RewardPoints;
				}
				
				/* Step Product Images  */
				$productimages=array();
				$images=$xmlData->additionalImages;
				$images=explode(';',(string)$images);
				
				if(isset($images)){
					foreach($images as $image){
					
						if(!empty($image)){
						$productimages[]=$this->model_extension_import->imagesave($image);
						}
					}
				}
				
				/* Step End Product Images  */
				
				/* Step Product Speical price  */
				 $specialpricenew=$xmlData->SpeicalPrice;
				
				$specialprice=array();
				if(!empty($specialpricenew)){
				$specialpriceset=explode(';',(string)$specialpricenew);
				
				foreach($specialpriceset as $set){
					if(!empty($set)){
						list($customer_group_id,$startdate,$enddate,$price)=explode(':',$set);
						$specialprice[]=array(
								'price'=>$price,
								'priority'=>1,
								'customer_group_id'=>$customer_group_id,
								'date_start'=>$startdate,
								'date_end'=>$enddate
						);
					}
					}
				}
				
				/* Step End Product Speical price  */
				
				/* Step End Product Speical price  */
				
				/* Step related products */
				 $relatedprodctinfo=$xmlData->RelatedProduct;
				
				$product_related=array();
				if(!empty($relatedprodctinfo)){
				$relatedprodctinfos=explode(';',(string)$relatedprodctinfo);
				
				foreach($relatedprodctinfos as $relatedprodctinfo){
					if(!empty($relatedprodctinfo)){
						$product_related[]=$this->model_extension_import->getproductbymodel($relatedprodctinfo);
					}
					}
				}
				
				/* Step End Product related  */
				
				
				/* Start Review  work */
				$reviews=array();
				$productreview=trim($xmlData->Reviews);
				if(!empty($productreview)){
						$productreviews=explode('|',$productreview);
						foreach($productreviews as $productreview){
							$productreview=trim($productreview);
							if(!empty($productreview)){
								$productreview=explode('::',$productreview);
								$reviews[]=array(
								'customer_id'=>$productreview[0],
								'author'=>$productreview[1],
								'text'=>$productreview[2],
								'rating'=>$productreview[3],
								'status'=>$productreview[4],
								'date_added'=>$productreview[5],
								'date_modified'=>$productreview[6],
								);
							}
						}
				}
				
				
				/* END Review  work /
				
				
				/* Start Product Download */
				$productdownloads=array();
				$downloadids=trim($xmlData->Downloadid);
				if(!empty($downloadids)){
					$downloadids=explode(';',(string)$downloadids);
					foreach($downloadids as $downloadid){
						if(isset($downloadid)){
						$productdownloads[]=$downloadid;
						}
					}
				}
				/* end Product Download */
				


				/* Step Product other  info collect */
				$model=$xmlData->MODEL;
				$sku=$xmlData->SKU;
				$upc=$xmlData->UPC;
				$ean=$xmlData->EAN;
				$jan=$xmlData->JAN;
				$isbn=$xmlData->ISBN;
				$mpn=$xmlData->MPN;
				$location=$xmlData->Location;
				$productname=$xmlData->ProductName;
				$metadescription=$xmlData->MetaTagDescription;
				$metatag=$xmlData->MetaTagKeywords;
				$description=$xmlData->Description;
				$tags=$xmlData->ProductTags;
				$price=$xmlData->Price;
				$quantity=$xmlData->Quantity;
				$mquantity=$xmlData->MinimumQuantity;
				$subtractstock=$xmlData->SubtractStock;
				$stockstatus=$xmlData->OutOfStockStatus;
				$shipping=$xmlData->RequiresShipping;
				$keyword=$xmlData->SEOKeyword;
				$available=$xmlData->DateAvailable;
				$lengthclass=$xmlData->LengthClass;
				$length=$xmlData->Length;
				$width=$xmlData->Width;
				$height=$xmlData->height;
				$weight=$xmlData->Weight;
				$weightclass=$xmlData->WeightClass;
				$status=$xmlData->Status;
				$sort_order=$xmlData->SortOrder;
				$viewed=$xmlData->Viewed;
				$meta_title=$xmlData->MetaTitle;
				$reviews=$reviews;
				
				if(isset($xmlData->TaxClass)){
				$tax_class_id=$xmlData->TaxClass;
				}else{
				$tax_class_id='';
				}
				$product_seo_url=array();				
				$product_seo_url[$language_id] =array(
					'store_id' => $store_id,
					'keyword' => $keyword,
				);
				$this->data='';
				$this->data=array(
				'product_category'=>$category_id,
				'manufacturer_id'=>$brand_id,
				'meta_title'=>$meta_title,
				'productoptions'=>$productoptions,
				'product_special'=>$specialprice,
				'image'=>$mainimage,
				'product_image'=>$productimages,
				'model'=>$model,
				'sku'=>$sku,
				'upc'=>$upc,
				'ean'=>$ean,
				'jan'=>$jan,
				'isbn'=>$isbn,
				'available'=>$available,
				'mpn'=>$mpn,
				'location'=>$location,
				'name'=>$productname,
				'meta_keyword'=>$metatag,
				'meta_description'=>$metadescription,
				'description'=>$description,
				'tag'=>$tags,
				'price'=>$price,
				'product_filter'=>$fillterids,
				'quantity'=>$quantity,
				'minimum'=>$mquantity,
				'subtract'=>$subtractstock,
				'tax_class_id'=>$tax_class_id,
				'stock_status_id'=>$stockstatus,
				'shipping'=>$shipping,
				'product_seo_url'=>$product_seo_url,
				'length_class_id'=>$lengthclass,
				'length'=>$length,
				'width'=>$width,
				'height'=>$height,
				'weight'=>$weight,
				'weight_class_id'=>$weightclass,
				'status'=>$status,
				'sort_order'=>$sort_order,
				'attributes'=>$attributes,
				'discounts'=>$discounts,
				'point'=>$point,
				'product_store'=>$product_stores,
				'product_related'=>$product_related,
				'viewed'=>$viewed,
				'reviews'=>$reviews,
				'productdownloads'=>$productdownloads,
				);
				$extra=array();
				if(isset($cfileds)){
					foreach($cfileds as $cfiled){
						if(!in_array($cfiled,$this->request->post)){	
							if(!empty($xmlData->$this->request->post[$cfiled])){
							$extra[$cfiled]=$xmlData->$this->request->post[$cfiled];
							}
						}
					}
				}
				

				$product_id=$this->model_extension_import->getproductbymodel($model);
				if(empty($product_id)){
					$this->model_extension_import->addproduct($this->data,$language_id,$extra);
					$totalnewproduct++;
				}else{
					$this->model_extension_import->editproduct($this->data,$product_id,$language_id,$extra);
					$totalupdateproduct++;
				}
				/* Step Product other  info collect */
				//print_r($xmlData);
				}
				}
				$i++;
				
				 $this->session->data['success']=$totalupdateproduct .' :: Total product update ' .$totalnewproduct. ':: Total New product added';
				
				////////////////////////// Started Import work  //////////////
				$this->response->redirect($this->url->link('extension/import', 'user_token=' . $this->session->data['user_token'], true));
			}
			if ($content  && 'csv' == $extension && $this->request->post['format']=='csv'){
			
				$arrResult = array();
				$handle = fopen($this->request->files['import']['tmp_name'], "r");
				if( $handle ) {
					$i=0;
				while (($importdata = fgetcsv($handle, 5000, ",")) !== FALSE) {
				
					if($i!=0){
					$al = "A";
					$sheetData = array(); // Initialize as an array
					foreach ($importdata as $data) {
					$sheetData[$al] = $data; // Now you can store the data in the array
					$al++;
					}

					
					$product_id=$sheetData['A'];
					$model=$sheetData['E'];
					if($importby==1){
						$product_id=$sheetData['A'];
					}else{
						$model=$sheetData['E'];
						$product_id=$this->model_extension_import->getproductbymodel($model);
					}
				
				if(isset($product_id) || isset($model)) {
				
				/* stroers */
				$product_stores=array();
				$product_stores[]=0;
				$product_stornew=explode(';',(string)$sheetData['D']);
				if(isset($product_stornew)){
					foreach($product_stornew as $product_store){
					if(!empty($product_store)){
							$product_stores[]=$product_store;
						}
					}
				}
				
				$product_stornew=explode(';',(string)$sheetData['C']);
				if(isset($product_stornew)){
					foreach($product_stornew as $product_store){
					if(!empty($product_store)){
							 $product_store=$this->model_extension_import->getstorebyname($product_store);
							$product_stores[]=$product_store;
						}
					}
				}
				$product_stores=array_unique($product_stores);
			
				/*  END Stores */
				
				/* Step Get category ids  */
				$catgoryname=$sheetData['AL'];
				$catgorynames=explode(';',(string)$catgoryname);
				$category_id=array();
				if(isset($catgorynames)){
					foreach($catgorynames as $category){
						$category=trim($category);
						if(!empty($category)){
							$category_id[]=$this->model_extension_import->category($category,0,$store_id,$language_id);
						}
					}
				}
				
				$catgoryname=$sheetData['AK'];
				$catgorynames=explode(';',(string)$catgoryname);
				
				if(isset($catgorynames)){
					foreach($catgorynames as $category){
						$category=trim($category);
						if(!empty($category)){
							$category_id[]=$category;
						}
					}
				}
				
				$category_id=array_unique($category_id);
				/* Step Get category ids  */
				
				/* Step Get Barnd  ids  */
				$brandname=$sheetData['AJ'];
				$brandnames=explode(';',(string)$brandname);
				$brand_id='';
				if(isset($brandnames)){
					foreach($brandnames as $brand){
						$brand=trim($brand);
						if(!empty($brand)){
							$brand_id=$this->model_extension_import->barnd($brand,$store_id,$language_id);
						}
					}
				}
				
				$brandname=$sheetData['AI'];
				if(isset($brandname)){
						$brand_id=$brandname;
				}
				
				/* Step Get Barnd  ids  */
				
				/* Step Get Options and value insert  */
				$options=$sheetData['AO'];
				$options=explode(';',(string)$options);
				
				if(isset($options)){
					foreach($options as $option){
						$option=trim($option);
						if(!empty($option)){
							$this->model_extension_import->option($option,$language_id);
						}
					}
				}
				
				$options=$sheetData['AP'];
				$options=explode(';',(string)$options);
				$productoptions=array();
				if(!empty($options)){
					foreach($options as $option){
						$option=trim($option);
						if(!empty($option)){
							$productoptions[]=$this->model_extension_import->optionvalue($option,$language_id);
						}
					}
				}
				/* Step End Get Options and value insert  */
				
			
				/* Step Product Main Image  */
				$image=$sheetData['Y'];
				if(!empty($image)){
				$mainimage=$this->model_extension_import->imagesave($image);
				}else{
				$mainimage='';
				}
				
				/* Step End Product Main Image  */
				
				/* Step Start Product Filter Group  entry */
				if(isset($sheetData['AT'])){
				$filtergroup=$sheetData['AT'];
				if(!empty($filtergroup)){
					$filtergroups=explode(';',(string)$filtergroup);
					if(!empty($filtergroups)){
						foreach($filtergroups as $filtergroup){
							$filtergroup=trim($filtergroup);
							if(!empty($filtergroup)){
								$this->model_extension_import->filtergroup($filtergroup,$language_id);
							}
						}
					}
				}
				}
				/* Step Start Product Filter Group  entry */
				/* Step Start Product Filter name  entry */
				$fillterids=array();
				if(isset($sheetData['AU'])){
				$filternames=$sheetData['AU'];
				if(!empty($filternames)){
					$filternames=explode(';',(string)$filternames);
					if(!empty($filternames)){
						
						foreach($filternames as $filtername){
							$filtername=trim($filtername);
							if(!empty($filtername)){
							$fillterids[]=$this->model_extension_import->filtername($filtername,$language_id);
							}
						}
					}
				}
				}
				
			
				
				/* Start Attribute work */
				$attributes=array();
				if(isset($sheetData['AV'])){
				$attributesname=$sheetData['AV'];
				if(!empty($attributesname)){
					$attributess=explode(';',(string)$attributesname);
					if(!empty($attributess)){
						
						foreach($attributess as $attribute){
							if(!empty($attribute)){
							$attinfo=$this->model_extension_import->atributeallinfo($attribute,$language_id);
							$attributes[]=array(
							'attribute_id'=>$attinfo['attribute_id'],
							'text'=>$attinfo['text']
							);
							}
						}
					}
				}
				
				}
				
				/* End Attribute work */
				$discounts=array();
				if(isset($sheetData['AW'])){
					$discountinfo=$sheetData['AW'];
					$discountinfos=explode(';',(string)$discountinfo);
					if(!empty($discountinfos)){
						foreach($discountinfos as $discount){
							if(!empty($discount)){
							$info=explode(':',$discount);
							$discounts[]=array(
							'customer_group_id'=>$info[0],
							'quantity'=>$info[1],
							'priority'=>$info[2],
							'price'=>$info[3],
							'date_start'=>$info[4],
							'date_end'=>$info[5]
							);
							}
						}
						
					}
				}
				/* Start Discount work */
				
				/* END Discount work */
				
				/* Reward point */
				$point='';
				if(!empty($sheetData['AX'])){
				$point=$sheetData['AX'];
				}
				
				/* Step Product Images  */
				$productimages=array();
				$images=$sheetData['AQ'];
				$images=explode(';',(string)$images);
				
				if(isset($images)){
					foreach($images as $image){
					
						if(!empty($image)){
						$productimages[]=$this->model_extension_import->imagesave($image);
						}
					}
				}
				
				/* Step End Product Images  */
				
				/* Step Product Speical price  */
				 $specialpricenew=$sheetData['AR'];
				
				$specialprice=array();
				if(!empty($specialpricenew)){
				$specialpriceset=explode(';',(string)$specialpricenew);
				
				foreach($specialpriceset as $set){
					if(!empty($set)){
						list($customer_group_id,$startdate,$enddate,$price)=explode(':',$set);
						$specialprice[]=array(
								'price'=>$price,
								'priority'=>1,
								'customer_group_id'=>$customer_group_id,
								'date_start'=>$startdate,
								'date_end'=>$enddate
						);
					}
					}
				}
				
				/* Step End Product Speical price  */
				
				/* Step related products */
				 $relatedprodctinfo=$sheetData['AN'];
				
				$product_related=array();
				if(!empty($relatedprodctinfo)){
				$relatedprodctinfos=explode(';',(string)$relatedprodctinfo);
				
				foreach($relatedprodctinfos as $relatedprodctinfo){
					if(!empty($relatedprodctinfo)){
						$product_related[]=$this->model_extension_import->getproductbymodel($relatedprodctinfo);
					}
					}
				}
				$relatedprodctinfo=$sheetData['AM'];
				if(!empty($relatedprodctinfo)){
				$relatedprodctinfos=explode(';',(string)$relatedprodctinfo);
				
				foreach($relatedprodctinfos as $relatedprodctinfo){
					if(!empty($relatedprodctinfo)){
						$product_related[]=$relatedprodctinfo;
					}
					}
				}
				$product_related=array_unique($product_related);
				/* Step End Product related  */
				/* Start Review  work */
				$reviews=array();
				$productreview=trim($sheetData['BB']);
				if(!empty($productreview)){
						$productreviews=explode('|',$productreview);
						foreach($productreviews as $productreview){
							$productreview=trim($productreview);
							if(!empty($productreview)){
								$productreview=explode('::',$productreview);
								$reviews[]=array(
								'customer_id'=>$productreview[0],
								'author'=>$productreview[1],
								'text'=>$productreview[2],
								'rating'=>$productreview[3],
								'status'=>$productreview[4],
								'date_added'=>$productreview[5],
								'date_modified'=>$productreview[6],
								);
							}
						}
				}
				
				
				/* END Review  work /
				
				/* Start Product Download */
				$productdownloads=array();
				$downloadids=trim($sheetData['BA']);
				if(!empty($downloadids)){
					$downloadids=explode(';',(string)$downloadids);
					foreach($downloadids as $downloadid){
						if(isset($downloadid)){
						$productdownloads[]=$downloadid;
						}
					}
				}
				/* end Product Download */
				
				/* Step Product other  info collect */
				$model=$sheetData['E'];
				$sku=$sheetData['F'];
				$upc=$sheetData['G'];
				$ean=$sheetData['H'];
				$jan=$sheetData['I'];
				$isbn=$sheetData['J'];
				$mpn=$sheetData['K'];
				$location=$sheetData['L'];
				$productname=$sheetData['M'];
				$metadescription=$sheetData['N'];
				$metatag=$sheetData['O'];
				$description=$sheetData['P'];
				$tags=$sheetData['Q'];
				$price=$sheetData['R'];
				$quantity=$sheetData['S'];
				$mquantity=$sheetData['T'];
				$subtractstock=$sheetData['U'];
				$stockstatus=$sheetData['V'];
				$shipping=$sheetData['W'];
				$keyword=$sheetData['X'];
				$available=$sheetData['Z'];
				$lengthclass=$sheetData['AA'];
				$length=$sheetData['AB'];
				$width=$sheetData['AC'];
				$height=$sheetData['AD'];
				$weight=$sheetData['AE'];
				$weightclass=$sheetData['AF'];
				$status=$sheetData['AG'];
				$sort_order=$sheetData['AH'];
				$viewed=$sheetData['AZ'];
				$reviews=$reviews;
				if(isset($sheetData['AY']))
				{
					$meta_title=$sheetData['AY'];
				}
				else
				{
					$meta_title=$sheetData['M'];
				}
				if(isset($sheetData['AS']))
				{
				$tax_class_id=$sheetData['AS'];
				}
				else
				{
				$tax_class_id='';
				}
				
				$extra=array();
				if(isset($cfileds)){
					foreach($cfileds as $cfiled){
						if(!in_array($cfiled,$this->request->post)){
							if(!empty($sheetData[$this->request->post[$cfiled]])){
							$extra[$cfiled]=$sheetData[$this->request->post[$cfiled]];
							}
						}
					}
				}





				$product_seo_url=array();				
				$product_seo_url[$language_id] =array(
					'store_id' => $store_id,
					'keyword' => $keyword,
				);
				$data='';
				$data=array(
				'product_category'=>$category_id,
				'manufacturer_id'=>$brand_id,
				'productoptions'=>$productoptions,
				'product_special'=>$specialprice,
				'image'=>$mainimage,
				'product_image'=>$productimages,
				'model'=>$model,
				'sku'=>$sku,
				'upc'=>$upc,
				'ean'=>$ean,
				'jan'=>$jan,
				'isbn'=>$isbn,
				'available'=>$available,
				'mpn'=>$mpn,
				'location'=>$location,
				'name'=>$productname,
				'meta_keyword'=>$metatag,
				'meta_description'=>$metadescription,
				'description'=>$description,
				'tag'=>$tags,
				'price'=>$price,
				'product_filter'=>$fillterids,
				'quantity'=>$quantity,
				'minimum'=>$mquantity,
				'subtract'=>$subtractstock,
				'tax_class_id'=>$tax_class_id,
				'stock_status_id'=>$stockstatus,
				'shipping'=>$shipping,
				'product_seo_url'=>$product_seo_url,
				'length_class_id'=>$lengthclass,
				'length'=>$length,
				'width'=>$width,
				'height'=>$height,
				'weight'=>$weight,
				'weight_class_id'=>$weightclass,
				'status'=>$status,
				'sort_order'=>$sort_order,
				'attributes'=>$attributes,
				'discounts'=>$discounts,
				'point'=>$point,
				'product_store'=>$product_stores,
				'product_related'=>$product_related,
				'meta_title'=>$meta_title,
				'viewed'=>$viewed,
				'reviews'=>$reviews,
				'productdownloads'=>$productdownloads,
				);
				
				
				if(empty($product_id))
				{
				$this->model_extension_import->addproduct($data,$language_id,$extra);
				$totalnewproduct++;
				}
				else
				{
				$this->model_extension_import->editproduct($data,$product_id,$language_id,$extra);
				$totalupdateproduct++;
				}
			
				}
				}
				$i++;
				}
				 $this->session->data['success']='Total product update : ' .$totalupdateproduct. ' <br /> Total New product added :'.$totalnewproduct;
				
				////////////////////////// Started Import work  //////////////
				$this->response->redirect($this->url->link('extension/import', 'user_token=' . $this->session->data['user_token'], true));
					}
				
			}elseif ($content){
				////////////////////////// Started Import work  //////////////
			
	            try {
					$objPHPExcel = PHPExcel_IOFactory::load($this->request->files['import']['tmp_name']);
				} catch(Exception $e) {
					die('Error loading file "'.pathinfo($this->path.$files,PATHINFO_BASENAME).'": '.$e->getMessage());
				}
				/*	@ get a file data into $sheetDatas variable */
				$objPHPExcel->setActiveSheetIndex(0);
				$sheetDatas = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);

				$i=0;
				/*
				@ arranging the data according to our need
				*/
				foreach($sheetDatas as $sheetData){
				if($i!=0)
				{
					$product_id=$sheetData['A'];
					$model=$sheetData['E'];
					if($importby==1)
					{
						$product_id=$sheetData['A'];
					}
					else
					{
						$model=$sheetData['E'];
						$product_id=$this->model_extension_import->getproductbymodel($model);
					}
				
				if(isset($product_id) || isset($model))
				{
				
				/* stroers */
				$product_stores=array();
				$product_stores[]=0;
				$product_stornew=explode(';',(string)$sheetData['D']);
				if(isset($product_stornew))
				{
					foreach($product_stornew as $product_store)
					{
					if(!empty($product_store))
						{
							$product_stores[]=$product_store;
						}
					}
				}
				
				$product_stornew=explode(';',(string)$sheetData['C']);
				if(isset($product_stornew))
				{
					foreach($product_stornew as $product_store)
					{
					if(!empty($product_store))
						{
							 $product_store=$this->model_extension_import->getstorebyname($product_store);
							$product_stores[]=$product_store;
						}
					}
				}
				$product_stores=array_unique($product_stores);
			
				/*  END Stores */
				
				/* Step Get category ids  */
				$catgoryname=$sheetData['AL'];
				$catgorynames=explode(';',(string)$catgoryname);
				$category_id=array();
				if(isset($catgorynames))
				{
					foreach($catgorynames as $category)
					{
						$category=trim($category);
						if(!empty($category))
						{
							$category_id[]=$this->model_extension_import->category($category,0,$store_id,$language_id);
						}
					}
				}
				
				$catgoryname=$sheetData['AK'];
				$catgorynames=explode(';',(string)$catgoryname);
				
				if(isset($catgorynames))
				{
					foreach($catgorynames as $category)
					{
						$category=trim($category);
						if(!empty($category))
						{
							$category_id[]=$category;
						}
					}
				}
				
				$category_id=array_unique($category_id);
				/* Step Get category ids  */
				
				/* Step Get Barnd  ids  */
				$brandname=$sheetData['AJ'];
				$brandnames=explode(';',(string)$brandname);
				$brand_id='';
				if(isset($brandnames))
				{
					foreach($brandnames as $brand)
					{
						$brand=trim($brand);
						if(!empty($brand))
						{
							$brand_id=$this->model_extension_import->barnd($brand,$store_id,$language_id);
						}
					}
				}
				
				$brandname=$sheetData['AI'];
				if(isset($brandname))
				{
						$brand_id=$brandname;
				}
				
				/* Step Get Barnd  ids  */
				
				/* Step Get Options and value insert  */
				$options=$sheetData['AO'];
				$options=explode(';',(string)$options);
				
				if(isset($options))
				{
					foreach($options as $option)
					{
						$option=trim($option);
						if(!empty($option))
						{
							$this->model_extension_import->option($option,$language_id);
						}
					}
				}
				
				$options=$sheetData['AP'];
				$options=explode(';',(string)$options);
				$productoptions=array();
				if(!empty($options))
				{
					foreach($options as $option)
					{
						$option=trim($option);
						if(!empty($option))
						{
							$productoptions[]=$this->model_extension_import->optionvalue($option,$language_id);
						}
					}
				}
				/* Step End Get Options and value insert  */
				
			
				/* Step Product Main Image  */
				$image=$sheetData['Y'];
				if(!empty($image))
				{
				$mainimage=$this->model_extension_import->imagesave($image);
				}
				else
				{
				$mainimage='';
				}
				
				/* Step End Product Main Image  */
				
				/* Step Start Product Filter Group  entry */
				if(isset($sheetData['AT']))
				{
				$filtergroup=$sheetData['AT'];
				if(!empty($filtergroup))
				{
					$filtergroups=explode(';',(string)$filtergroup);
					if(!empty($filtergroups))
					{
						foreach($filtergroups as $filtergroup)
						{
							$filtergroup=trim($filtergroup);
							if(!empty($filtergroup))
							{
								$this->model_extension_import->filtergroup($filtergroup,$language_id);
							}
						}
					}
				}
				}
				/* Step Start Product Filter Group  entry */
				/* Step Start Product Filter name  entry */
				$fillterids=array();
				if(isset($sheetData['AU']))
				{
				$filternames=$sheetData['AU'];
				if(!empty($filternames))
				{
					$filternames=explode(';',(string)$filternames);
					if(!empty($filternames))
					{
						
						foreach($filternames as $filtername)
						{
							$filtername=trim($filtername);
							if(!empty($filtername))
							{
							$fillterids[]=$this->model_extension_import->filtername($filtername,$language_id);
							}
						}
					}
				}
				}
				
			
				
				/* Start Attribute work */
				$attributes=array();
				if(isset($sheetData['AV']))
				{
				$attributesname=$sheetData['AV'];
				if(!empty($attributesname))
				{
					$attributess=explode(';',(string)$attributesname);
					if(!empty($attributess))
					{
						
						foreach($attributess as $attribute)
						{
							if(!empty($attribute))
							{
							$attinfo=$this->model_extension_import->atributeallinfo($attribute,$language_id);
							$attributes[]=array(
							'attribute_id'=>$attinfo['attribute_id'],
							'text'=>$attinfo['text']
							);
							}
						}
					}
				}
				
				}
				
				/* End Attribute work */
				$discounts=array();
				if(isset($sheetData['AW']))
				{
					$discountinfo=$sheetData['AW'];
					$discountinfos=explode(';',(string)$discountinfo);
					if(!empty($discountinfos))
					{
						foreach($discountinfos as $discount)
						{
							if(!empty($discount))
							{
							$info=explode(':',$discount);
							$discounts[]=array(
							'customer_group_id'=>$info[0],
							'quantity'=>$info[1],
							'priority'=>$info[2],
							'price'=>$info[3],
							'date_start'=>$info[4],
							'date_end'=>$info[5]
							);
							}
						}
						
					}
				}
				/* Start Discount work */
				
				/* END Discount work */
				
				/* Reward point */
				$point='';
				if(!empty($sheetData['AX']))
				{
				$point=$sheetData['AX'];
				}
				
				/* Step Product Images  */
				$productimages=array();
				$images=$sheetData['AQ'];
				$images=explode(';',(string)$images);
				
				if(isset($images))
				{
					foreach($images as $image)
					{
					
						if(!empty($image))
						{
						$productimages[]=$this->model_extension_import->imagesave($image);
						}
					}
				}
				
				/* Step End Product Images  */
				
				/* Step Product Speical price  */
				 $specialpricenew=$sheetData['AR'];
				
				$specialprice=array();
				if(!empty($specialpricenew))
				{
				$specialpriceset=explode(';',(string)$specialpricenew);
				
				foreach($specialpriceset as $set)
					{
					if(!empty($set))
						{
						list($customer_group_id,$startdate,$enddate,$price)=explode(':',$set);
						$specialprice[]=array(
								'price'=>$price,
								'priority'=>1,
								'customer_group_id'=>$customer_group_id,
								'date_start'=>$startdate,
								'date_end'=>$enddate
						);
					}
					}
				}
				
				/* Step End Product Speical price  */
				
				/* Step related products */
				 $relatedprodctinfo=$sheetData['AN'];
				
				$product_related=array();
				if(!empty($relatedprodctinfo))
				{
				$relatedprodctinfos=explode(';',(string)$relatedprodctinfo);
				
				foreach($relatedprodctinfos as $relatedprodctinfo)
					{
					if(!empty($relatedprodctinfo))
						{
						$product_related[]=$this->model_extension_import->getproductbymodel($relatedprodctinfo);
					}
					}
				}
				$relatedprodctinfo=$sheetData['AM'];
				if(!empty($relatedprodctinfo))
				{
				$relatedprodctinfos=explode(';',(string)$relatedprodctinfo);
				
				foreach($relatedprodctinfos as $relatedprodctinfo)
					{
					if(!empty($relatedprodctinfo))
						{
						$product_related[]=$relatedprodctinfo;
					}
					}
				}
				$product_related=array_unique($product_related);
				/* Step End Product related  */
				/* Start Review  work */
				$reviews=array();
				$productreview=trim((string)$sheetData['BB']);
				if(!empty($productreview))
				{
						$productreviews=explode('|',$productreview);
						foreach($productreviews as $productreview)
						{
							$productreview=trim($productreview);
							if(!empty($productreview))
							{
								$productreview=explode('::',$productreview);
								$reviews[]=array(
								'customer_id'=>$productreview[0],
								'author'=>$productreview[1],
								'text'=>$productreview[2],
								'rating'=>$productreview[3],
								'status'=>$productreview[4],
								'date_added'=>$productreview[5],
								'date_modified'=>$productreview[6],
								);
							}
						}
				}
				
				
				/* END Review  work /
				
				/* Start Product Download */
				$productdownloads=array();
				$downloadids=trim((string)$sheetData['BA']);
				if(!empty($downloadids))
				{
					$downloadids=explode(';',(string)$downloadids);
					foreach($downloadids as $downloadid)
					{
						if(isset($downloadid))
						{
						$productdownloads[]=$downloadid;
						}
					}
				}
				/* end Product Download */
				
				/* Step Product other  info collect */
				$model=$sheetData['E'];
				$sku=$sheetData['F'];
				$upc=$sheetData['G'];
				$ean=$sheetData['H'];
				$jan=$sheetData['I'];
				$isbn=$sheetData['J'];
				$mpn=$sheetData['K'];
				$location=$sheetData['L'];
				$productname=$sheetData['M'];
				$metadescription=$sheetData['N'];
				$metatag=$sheetData['O'];
				$description=$sheetData['P'];
				$tags=$sheetData['Q'];
				$price=$sheetData['R'];
				$quantity=$sheetData['S'];
				$mquantity=$sheetData['T'];
				$subtractstock=$sheetData['U'];
				$stockstatus=$sheetData['V'];
				$shipping=$sheetData['W'];
				$keyword=$sheetData['X'];
				$available=$sheetData['Z'];
				$lengthclass=$sheetData['AA'];
				$length=$sheetData['AB'];
				$width=$sheetData['AC'];
				$height=$sheetData['AD'];
				$weight=$sheetData['AE'];
				$weightclass=$sheetData['AF'];
				$status=$sheetData['AG'];
				$sort_order=$sheetData['AH'];
				$viewed=$sheetData['AZ'];
				$reviews=$reviews;
				if(isset($sheetData['AY']))
				{
					$meta_title=$sheetData['AY'];
				}
				else
				{
					$meta_title=$sheetData['M'];
				}
				if(isset($sheetData['AS']))
				{
				$tax_class_id=$sheetData['AS'];
				}
				else
				{
				$tax_class_id='';
				}
				
				$extra=array();
				if(isset($cfileds))
				{
					foreach($cfileds as $cfiled)
					{
						if(!in_array($cfiled,$this->request->post))
						{	if(!empty($sheetData[$this->request->post[$cfiled]]))
							{
							$extra[$cfiled]=$sheetData[$this->request->post[$cfiled]];
							}
						}
					}
				}
				

					$product_seo_url=array();				
				$product_seo_url[$language_id] =array(
					'store_id' => $store_id,
					'keyword' => $keyword,
				);
				$data='';
				$data=array(
				'product_category'=>$category_id,
				'manufacturer_id'=>$brand_id,
				'productoptions'=>$productoptions,
				'product_special'=>$specialprice,
				'image'=>$mainimage,
				'product_image'=>$productimages,
				'model'=>$model,
				'sku'=>$sku,
				'upc'=>$upc,
				'ean'=>$ean,
				'jan'=>$jan,
				'isbn'=>$isbn,
				'available'=>$available,
				'mpn'=>$mpn,
				'location'=>$location,
				'name'=>$productname,
				'meta_keyword'=>$metatag,
				'meta_description'=>$metadescription,
				'description'=>$description,
				'tag'=>$tags,
				'price'=>$price,
				'product_filter'=>$fillterids,
				'quantity'=>$quantity,
				'minimum'=>$mquantity,
				'subtract'=>$subtractstock,
				'tax_class_id'=>$tax_class_id,
				'stock_status_id'=>$stockstatus,
				'shipping'=>$shipping,
				'product_seo_url'=>$product_seo_url,
				'length_class_id'=>$lengthclass,
				'length'=>$length,
				'width'=>$width,
				'height'=>$height,
				'weight'=>$weight,
				'weight_class_id'=>$weightclass,
				'status'=>$status,
				'sort_order'=>$sort_order,
				'attributes'=>$attributes,
				'discounts'=>$discounts,
				'point'=>$point,
				'product_store'=>$product_stores,
				'product_related'=>$product_related,
				'meta_title'=>$meta_title,
				'viewed'=>$viewed,
				'reviews'=>$reviews,
				'productdownloads'=>$productdownloads,
				);
				
				
				if(empty($product_id))
				{
				$this->model_extension_import->addproduct($data,$language_id,$extra);
				$totalnewproduct++;
				}
				else
				{
				$this->model_extension_import->editproduct($data,$product_id,$language_id,$extra);
				$totalupdateproduct++;
				}
				/* Step Product other  info collect */
				
				}
				}
				$i++;
				}
				 $this->session->data['success']='Total product update : ' .$totalupdateproduct. ' <br /> Total New product added :'.$totalnewproduct;
				
				////////////////////////// Started Import work  //////////////
				$this->response->redirect($this->url->link('extension/import', 'user_token=' . $this->session->data['user_token'], true));
			} 
			 else {
				$this->session->data['warning'] = $this->language->get('error_empty');
			}
			
			
			
		}

		$data['heading_title'] = $this->language->get('heading_title1');
	
			/////////// Stores
		$this->load->model('setting/store');
		$data['stores'] = $this->model_setting_store->getStores();
		/////////// Stores
		/////////// Stock status
		$this->load->model('localisation/language');
		$data['languages'] = $this->model_localisation_language->getLanguages();
		/////////// Stores
		
		if (isset($this->session->data['warning'])) {
			$data['error_warning'] = $this->session->data['warning'];
		
			unset($this->session->data['warning']);
		} else {
			$data['error_warning'] = '';
		}
		
		if (isset($this->session->data['success'])) {
			$data['success'] = $this->session->data['success'];
		
			unset($this->session->data['success']);
		} else {
			$data['success'] = '';
		}
		
  		$data['breadcrumbs'] = array();

   		$data['breadcrumbs'][] = array(
       		'text'      => $this->language->get('text_home'),
			'href'      => $this->url->link('common/home', 'user_token=' . $this->session->data['user_token'], true)     		
      		
   		);

   		$data['breadcrumbs'][] = array(
       		'text'      => $this->language->get('heading_title'),
			'href'      => $this->url->link('extension/import', 'user_token=' . $this->session->data['user_token'], true)
      		
   		);
		
		$data['import'] = $this->url->link('extension/import', 'user_token=' . $this->session->data['user_token'], true);

		$data['header'] = $this->load->controller('common/header');
		$data['column_left'] = $this->load->controller('common/column_left');
		$data['footer'] = $this->load->controller('common/footer');
				
		$this->response->setOutput($this->load->view('extension/import', $data));
	}
	
	
}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit