....................................../////.===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/catalog/controller/extension/onepagecheckout/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/egdeals/public_html/catalog/controller/extension/onepagecheckout/ordersuccess.php
<?php
class ControllerExtensionOnepagecheckoutOrderSuccess extends Controller {
	public function index(){
		
		$this->load->language('checkout/success');
		$this->load->model('checkout/order');
		$this->load->model('extension/onepagecheckout/customer');
		$data['heading_title'] = $this->language->get('heading_title');
		//session_start();
		if(isset($_SESSION['temp_shipping_methods'])){
			unset($_SESSION['temp_shipping_methods']);
		}
		
		if(isset($_SESSION['temp_payment_methods'])){
			unset($_SESSION['temp_payment_methods']);
		}
		
		if(isset($this->session->data['order_id'])){
			$this->session->data['orderid'] = $this->session->data['order_id'];
		}
		
		$order_id = (isset($this->session->data['orderid']) ? $this->session->data['orderid'] : 0);
		
		if(isset($this->session->data['order_id'])){
			$this->cart->clear();
			unset($this->session->data['shipping_method']);
			unset($this->session->data['shipping_methods']);
			unset($this->session->data['payment_method']);
			unset($this->session->data['payment_methods']);
			unset($this->session->data['guest']);
			unset($this->session->data['comment']);
			unset($this->session->data['order_id']);
			unset($this->session->data['coupon']);
			unset($this->session->data['reward']);
			unset($this->session->data['voucher']);
			unset($this->session->data['vouchers']);
			unset($this->session->data['totals']);
			unset($this->session->data['delivery_date']);
			unset($this->session->data['temp_payment_method']);
			unset($this->session->data['temp_shipping_method']);
		}
		
		$this->document->setTitle($this->language->get('heading_title'));

		$data['breadcrumbs'] = array();

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

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_basket'),
			'href' => $this->url->link('onepagecheckout/cart')
		);

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_checkout'),
			'href' => $this->url->link('onepagecheckout/checkout', '', true)
		);

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_success'),
			'href' => $this->url->link('checkout/success')
		);
		
		if ($this->customer->isLogged()) {
			$data['text_message'] = sprintf($this->language->get('text_customer'), $this->url->link('account/account', '', true), $this->url->link('account/order', '', true), $this->url->link('account/download', '', true), $this->url->link('information/contact'));
		} else {
			$data['text_message'] = sprintf($this->language->get('text_guest'), $this->url->link('information/contact'));
		}
		
		$order_info = $this->model_checkout_order->getOrder($order_id);
		
		if($order_info){
			$data['shipping_method'] = $order_info['shipping_method'];
			$find=array(
			  '{order_id}',
			  '{firstname}',
			  '{lastname}',
			  '{account}',
			  '{order_history}',
			  '{downloads}',
			  '{contact_us}',
			);
			
			$replace=array(
			  	'order_id' 		=> $order_info['order_id'],
			    'firstname'		=> $order_info['firstname'],
			    'lastname'		=> $order_info['lastname'],
			    'account'		=> $this->url->link('account/account','','SSL'),
			    'history'		=> $this->url->link('account/order','','SSL'),
			    'downloads'		=> $this->url->link('account/download','','SSL'),
			    'contact'		=> $this->url->link('information/contact','','SSL'),
			);
			
			
			$data['heading_title']  = str_replace(array("\r\n", "\r", "\n"), '<br />', preg_replace(array("/\s\s+/", "/\r\r+/", "/\n\n+/"), '<br />', trim(str_replace($find, $replace, $this->config->get('order_success_page_order_heading'.$this->config->get('config_language_id'))))));
			if ($this->customer->isLogged()) {
				$data['text_message']  = html_entity_decode(str_replace(array("\r\n", "\r", "\n"), '<br />', preg_replace(array("/\s\s+/", "/\r\r+/", "/\n\n+/"), '<br />', trim(str_replace($find, $replace, $this->config->get('order_success_page_register_message'.$this->config->get('config_language_id')))))));
			}else{
				$data['text_message']  = html_entity_decode(str_replace(array("\r\n", "\r", "\n"), '<br />', preg_replace(array("/\s\s+/", "/\r\r+/", "/\n\n+/"), '<br />', trim(str_replace($find, $replace, $this->config->get('order_success_page_guest_message'.$this->config->get('config_language_id')))))));
			}
			
			
			$data['button_continue'] = ($this->config->get('order_success_page_continue_text'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_continue_text'.$this->config->get('config_language_id')) : $this->language->get('button_continue'));
			
			$data['text_print_invoice'] = ($this->config->get('order_success_page_print_invoice_text'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_print_invoice_text'.$this->config->get('config_language_id')) : 'Print Invoice');
				
			$data['invoice']= '';
			if($this->config->get('order_success_page_order_invoice')){
				
				$data['invoice']= $this->CreateInvoice($order_info['order_id']);
			}
			
			$data['products'] = '';
			if($this->config->get('order_success_page_promote_products')){
				$data['products']= $this->getpromoationproduct($order_info['order_id']);
			}
	
			$data['print_invoice'] = '';
			if($this->config->get('order_success_page_print_invoice')){
				$data['print_invoice']= $this->url->link('extension/onepagecheckout/ordersuccess/printinvoice');
			}
			
			$data['show_bank_details'] = false;
			if($this->config->get('order_success_page_bank_details_status') && $order_info['payment_code']=='bank_transfer'){
				$data['show_bank_details'] = true;
				$this->load->language('extension/payment/bank_transfer');
				$data['text_instruction'] = $this->language->get('text_instruction');
				$data['text_description'] = $this->language->get('text_description');
				$data['text_payment'] = $this->language->get('text_payment');
				$data['bank'] = nl2br($this->config->get('payment_bank_transfer_bank' . $this->config->get('config_language_id')));
			}
			
			
			$data['order_success_page_google_analytics'] = html_entity_decode($this->config->get('order_success_page_google_analytics'), ENT_QUOTES, 'UTF-8');
			
			
		
		
			$data['continue'] = $this->url->link('common/home');

			$data['column_left'] = $this->load->controller('common/column_left');
			$data['column_right'] = $this->load->controller('common/column_right');
			$data['content_top'] = $this->load->controller('common/content_top');
			$data['content_bottom'] = $this->load->controller('common/content_bottom');
			$data['footer'] = $this->load->controller('common/footer');
			$data['header'] = $this->load->controller('common/header');

			$this->response->setOutput($this->load->view('extension/onepagecheckout/success', $data));
		
		}else{
			$this->load->language('checkout/success');

			$this->document->setTitle($this->language->get('heading_title'));

			$data['breadcrumbs'] = array();

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

			$data['breadcrumbs'][] = array(
				'text' => $this->language->get('text_basket'),
				'href' => $this->url->link('checkout/cart')
			);

			$data['breadcrumbs'][] = array(
				'text' => $this->language->get('text_checkout'),
				'href' => $this->url->link('checkout/checkout', '', true)
			);

			$data['breadcrumbs'][] = array(
				'text' => $this->language->get('text_success'),
				'href' => $this->url->link('checkout/success')
			);

			if ($this->customer->isLogged()) {
				$data['text_message'] = sprintf($this->language->get('text_customer'), $this->url->link('account/account', '', true), $this->url->link('account/order', '', true), $this->url->link('account/download', '', true), $this->url->link('information/contact'));
			} else {
				$data['text_message'] = sprintf($this->language->get('text_guest'), $this->url->link('information/contact'));
			}

			$data['continue'] = $this->url->link('common/home');

			$data['column_left'] = $this->load->controller('common/column_left');
			$data['column_right'] = $this->load->controller('common/column_right');
			$data['content_top'] = $this->load->controller('common/content_top');
			$data['content_bottom'] = $this->load->controller('common/content_bottom');
			$data['footer'] = $this->load->controller('common/footer');
			$data['header'] = $this->load->controller('common/header');

			$this->response->setOutput($this->load->view('common/success', $data));
		}
	}
	
	public function printinvoice(){
		if(isset($this->session->data['orderid'])){
			$order_id = $this->session->data['orderid'];
		}else{
			$order_id = 0;
		}
		
		$this->load->model('checkout/order');
		$this->load->model('catalog/product');
		$this->load->model('tool/image');
		$this->language->load('mail/order_add');
		$order_info = $this->model_checkout_order->getOrder($order_id);
		
		if($order_info){
			
				$download_status = false;
	
				$order_product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "'");
	
				foreach ($order_product_query->rows as $order_product) {
					// Check if there are any linked downloads
					$product_download_query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "product_to_download` WHERE product_id = '" . (int)$order_product['product_id'] . "'");
	
					if ($product_download_query->row['total']) {
						$download_status = true;
					}
				}
				
			
	
				$order_status_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_status WHERE order_status_id = '" . (int)$order_info['order_status_id'] . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
	
				if ($order_status_query->num_rows) {
					$order_status = $order_status_query->row['name'];
				} else {
					$order_status = '';
				}
			
				$data = array();
	
				$data['title'] = sprintf($this->language->get('text_subject'), $order_info['store_name'], $order_id);
	
				$data['text_greeting'] = sprintf($this->language->get('text_greeting'), $order_info['store_name']);
				$data['text_link'] = $this->language->get('text_link');
				$data['text_download'] = $this->language->get('text_download');
				$data['text_order_detail'] = ($this->config->get('order_success_page_order_details_heading'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_order_details_heading'.$this->config->get('config_language_id')) : $this->language->get('text_order_detail'));
				$data['text_instruction'] = ($this->config->get('order_success_page_order_comment_heading'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_order_comment_heading'.$this->config->get('config_language_id')) : $this->language->get('text_instruction'));
				$data['text_order_id'] = $this->language->get('text_order_id');
				$data['text_date_added'] = $this->language->get('text_date_added');
				$data['text_payment_method'] = $this->language->get('text_payment_method');
				$data['text_shipping_method'] = $this->language->get('text_shipping_method');
				$data['text_email'] = $this->language->get('text_email');
				$data['text_telephone'] = $this->language->get('text_telephone');
				$data['text_ip'] = $this->language->get('text_ip');
				$data['text_order_status'] = $this->language->get('text_order_status');
				$data['text_payment_address'] = ($this->config->get('order_success_page_payment_address_heading'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_payment_address_heading'.$this->config->get('config_language_id')) : $this->language->get('text_new_payment_address'));
				$data['text_shipping_address'] = ($this->config->get('order_success_page_shipping_address_heading'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_shipping_address_heading'.$this->config->get('config_language_id')) : $this->language->get('text_new_shipping_address'));
				
				$data['text_bank_details'] = ($this->config->get('order_success_page_bank_details_heading'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_bank_details_heading'.$this->config->get('config_language_id')) : $this->language->get('text_new_bank_details'));
				
				$data['text_product'] = ($this->config->get('order_success_page_product_title'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_product_title'.$this->config->get('config_language_id')) : $this->language->get('text_product'));
				
				$data['text_model'] = ($this->config->get('order_success_page_model_title'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_model_title'.$this->config->get('config_language_id')) : $this->language->get('text_model'));
				
				$data['text_sku'] = ($this->config->get('order_success_page_sku_title'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_sku_title'.$this->config->get('config_language_id')) : 'Sku');
				
				$data['text_image'] = ($this->config->get('order_success_page_image_title'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_image_title'.$this->config->get('config_language_id')) : 'Image');
				
				$data['text_quantity'] = ($this->config->get('order_success_page_qty_title'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_qty_title'.$this->config->get('config_language_id')) : $this->language->get('text_quantity'));
				
				$data['text_price'] = ($this->config->get('order_success_page_unit_title'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_unit_title'.$this->config->get('config_language_id')) : $this->language->get('text_price'));
				
				$data['text_total'] = ($this->config->get('order_success_page_total_title'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_total_title'.$this->config->get('config_language_id')) : $this->language->get('text_total'));
				$data['text_footer'] = $this->language->get('text_new_footer');
				
				$data['logo_status'] = true;
				$data['print_status'] = true;
				
				$data['logo'] = $this->config->get('config_url') . 'image/' . $this->config->get('config_logo');
				$data['store_name'] = $order_info['store_name'];
				$data['store_url'] = $order_info['store_url'];
				$data['customer_id'] = $order_info['customer_id'];
				$data['link'] = $order_info['store_url'] . 'index.php?route=account/order/info&order_id=' . $order_id;
	
				if ($download_status) {
					$data['download'] = $order_info['store_url'] . 'index.php?route=account/download';
				} else {
					$data['download'] = '';
				}
	
				$data['order_id'] = $order_id;
				$data['date_added'] = date($this->language->get('date_format_short'), strtotime($order_info['date_added']));
				$data['payment_method'] = $order_info['payment_method'];
				$data['shipping_method'] = $order_info['shipping_method'];
				$data['email'] = $order_info['email'];
				$data['telephone'] = $order_info['telephone'];
				$data['ip'] = $order_info['ip'];
				$data['order_status'] = $order_status;
				$data['comment'] = '';
				if ($order_info['comment']) {
					$data['comment'] = nl2br($order_info['comment']);
				}
				
	
				$payment_custom_field = $order_info['payment_custom_field'];
				$payment_custom_fields = array();
				$this->load->model('account/custom_field');
				$custom_fields = $this->model_account_custom_field->getCustomFields($this->config->get('onepagecheckout_customer_group_id'));
				foreach ($custom_fields as $custom_field) {
					if ($custom_field['location'] == 'address') {
						if ($custom_field['type'] == 'select') {
							foreach ($custom_field['custom_field_value'] as $custom_field_value) {
								if (isset($payment_custom_field[$custom_field['custom_field_id']]) && $custom_field_value['custom_field_value_id'] == $payment_custom_field[$custom_field['custom_field_id']]) {
									$payment_custom_fields[] = $custom_field_value['name'];
								}
							}
						}
						if ($custom_field['type'] == 'radio') {
							foreach ($custom_field['custom_field_value'] as $custom_field_value) {
								if (isset($payment_custom_field[$custom_field['custom_field_id']]) && $custom_field_value['custom_field_value_id'] == $payment_custom_field[$custom_field['custom_field_id']]) {
									$payment_custom_fields[] = $custom_field_value['name'];
								}
							}
						}
						
						if ($custom_field['type'] == 'checkbox') {
							foreach ($custom_field['custom_field_value'] as $custom_field_value) {
								foreach($payment_custom_field[$custom_field['custom_field_id']] as $checkboxvalue):
								 if (isset($payment_custom_field[$custom_field['custom_field_id']]) && $custom_field_value['custom_field_value_id'] == $checkboxvalue) {
									$payment_custom_fields[] = $custom_field_value['name'];
								 }
								 endforeach;
							}
						}
						
						if ($custom_field['type'] == 'text' || $custom_field['type'] == 'textarea' || $custom_field['type'] == 'file' || $custom_field['type'] == 'date' || $custom_field['type'] == 'datetime' || $custom_field['type'] == 'time') {
							$payment_custom_fields[] = $payment_custom_field[$custom_field['custom_field_id']];
							
						}
					}
				}
				
				$payment_custom_field_address ='';
				if($payment_custom_fields){
					$payment_custom_field_address= implode('<br/>',$payment_custom_fields);
				}
				
				if ($order_info['payment_address_format']) {
					$format = $order_info['payment_address_format'];
				} else {
					$format = '{firstname} {lastname}' . "\n" . '{company}' . "\n" . '{address_1}' ."\n".'{payment_custom_field}' ."\n" . '{address_2}' . "\n" . '{city} {postcode}' . "\n" . '{zone}' . "\n" . '{country}';
				}
	
				$find = array(
					'{firstname}',
					'{lastname}',
					'{company}',
					'{address_1}',
					'{payment_custom_field}',
					'{address_2}',
					'{city}',
					'{postcode}',
					'{zone}',
					'{zone_code}',
					'{country}',
				);
	
				$replace = array(
					'firstname' => $order_info['payment_firstname'],
					'lastname'  => $order_info['payment_lastname'],
					'company'   => $order_info['payment_company'],
					'address_1' => $order_info['payment_address_1'],
					'payment_custom_field' => $payment_custom_field_address,
					'address_2' => $order_info['payment_address_2'],
					'city'      => $order_info['payment_city'],
					'postcode'  => $order_info['payment_postcode'],
					'zone'      => $order_info['payment_zone'],
					'zone_code' => $order_info['payment_zone_code'],
					'country'   => $order_info['payment_country']
				);
	
				$data['payment_address'] = str_replace(array("\r\n", "\r", "\n"), '<br />', preg_replace(array("/\s\s+/", "/\r\r+/", "/\n\n+/"), '<br />', trim(str_replace($find, $replace, $format))));
				
				
				$shipping_custom_field = $order_info['shipping_custom_field'];
				
				$shipping_custom_fields=array();
				foreach ($custom_fields as $custom_field) {
					if ($custom_field['location'] == 'address') {
						if ($custom_field['type'] == 'select') {
							foreach ($custom_field['custom_field_value'] as $custom_field_value) {
								if (isset($shipping_custom_field[$custom_field['custom_field_id']]) && $custom_field_value['custom_field_value_id'] == $shipping_custom_field[$custom_field['custom_field_id']]) {
									$shipping_custom_fields[] = $custom_field_value['name'];
								}
							}
						}
						if ($custom_field['type'] == 'radio') {
							foreach ($custom_field['custom_field_value'] as $custom_field_value) {
								if (isset($shipping_custom_field[$custom_field['custom_field_id']]) && $custom_field_value['custom_field_value_id'] == $shipping_custom_field[$custom_field['custom_field_id']]) {
									$shipping_custom_fields[] = $custom_field_value['name'];
								}
							}
						}
						
						if ($custom_field['type'] == 'checkbox') {
							foreach ($custom_field['custom_field_value'] as $custom_field_value) {
								foreach($shipping_custom_field[$custom_field['custom_field_id']] as $checkboxvalue):
								 if (isset($shipping_custom_field[$custom_field['custom_field_id']]) && $custom_field_value['custom_field_value_id'] == $checkboxvalue) {
									$shipping_custom_fields[] = $custom_field_value['name'];
								 }
								 endforeach;
							}
						}
						
						if ($custom_field['type'] == 'text' || $custom_field['type'] == 'textarea' || $custom_field['type'] == 'file' || $custom_field['type'] == 'date' || $custom_field['type'] == 'datetime' || $custom_field['type'] == 'time') {
							$shipping_custom_fields[] = $shipping_custom_field[$custom_field['custom_field_id']];
							
						}
					}
				}
				
				$shipping_custom_field_address ='';
				if($shipping_custom_fields){
					$shipping_custom_field_address= implode('<br/>',$shipping_custom_fields);
				}
				
				if ($order_info['shipping_address_format']) {
					$format = $order_info['shipping_address_format'];
				} else {
					$format = '{firstname} {lastname}' . "\n" . '{company}' . "\n" . '{address_1}' ."\n".'{shipping_custom_field}' ."\n" . '{address_2}' . "\n" . '{city} {postcode}' . "\n" . '{zone}' . "\n" . '{country}';
				}
				
	
				$find = array(
					'{firstname}',
					'{lastname}',
					'{company}',
					'{address_1}',
					'{shipping_custom_field}',
					'{address_2}',
					'{city}',
					'{postcode}',
					'{zone}',
					'{zone_code}',
					'{country}'
				);
	
				$replace = array(
					'firstname' => $order_info['shipping_firstname'],
					'lastname'  => $order_info['shipping_lastname'],
					'company'   => $order_info['shipping_company'],
					'address_1' => $order_info['shipping_address_1'],
					'shipping_custom_field' => $shipping_custom_field_address,
					'address_2' => $order_info['shipping_address_2'],
					'city'      => $order_info['shipping_city'],
					'postcode'  => $order_info['shipping_postcode'],
					'zone'      => $order_info['shipping_zone'],
					'zone_code' => $order_info['shipping_zone_code'],
					'country'   => $order_info['shipping_country']
				);
				
				$data['shipping_address'] = str_replace(array("\r\n", "\r", "\n"), '<br />', preg_replace(array("/\s\s+/", "/\r\r+/", "/\n\n+/"), '<br />', trim(str_replace($find, $replace, $format))));
	
				$this->load->model('tool/upload');
	
				// Products
				$data['products'] = array();
	
				foreach ($order_product_query->rows as $product) {
					$option_data = array();
	
					$order_option_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "' AND order_product_id = '" . (int)$product['order_product_id'] . "'");
	
					foreach ($order_option_query->rows as $option) {
						if ($option['type'] != 'file') {
							$value = $option['value'];
						} else {
							$upload_info = $this->model_tool_upload->getUploadByCode($option['value']);
	
							if ($upload_info) {
								$value = $upload_info['name'];
							} else {
								$value = '';
							}
						}
	
						$option_data[] = array(
							'name'  => $option['name'],
							'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value)
						);
					}
					
					$product_info = $this->model_catalog_product->getProduct($product['product_id']);
					
					if($product_info['image']){
						$image = $this->model_tool_image->resize($product_info['image'],$this->config->get('order_success_page_width'),$this->config->get('order_success_page_height'));
					}else{
						$image = '';
					}
					
					
					$data['products'][] = array(
						'name'     => $product['name'],
						'image'    => $image,
						'model'    => $product['model'],
						'sku'      => (isset($product_info['sku']) ? $product_info['sku'] : ''),
						'option'   => $option_data,
						'quantity' => $product['quantity'],
						'price'    => $this->currency->format($product['price'] + ($this->config->get('config_tax') ? $product['tax'] : 0), $order_info['currency_code'], $order_info['currency_value']),
						'total'    => $this->currency->format($product['total'] + ($this->config->get('config_tax') ? ($product['tax'] * $product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value'])
					);
				}
	
				// Vouchers
				$data['vouchers'] = array();
	
				$order_voucher_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_voucher WHERE order_id = '" . (int)$order_id . "'");
	
				foreach ($order_voucher_query->rows as $voucher) {
					$data['vouchers'][] = array(
						'description' => $voucher['description'],
						'amount'      => $this->currency->format($voucher['amount'], $order_info['currency_code'], $order_info['currency_value']),
					);
				}
	
				// Order Totals
				$data['totals'] = array();
				
				$order_total_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "order_total` WHERE order_id = '" . (int)$order_id . "' ORDER BY sort_order ASC");
	
				foreach ($order_total_query->rows as $total) {
					$data['totals'][] = array(
						'title' => $total['title'],
						'text'  => $this->currency->format($total['value'], $order_info['currency_code'], $order_info['currency_value']),
					);
				}
				
				$data['order_success_page_order_details'] = $this->config->get('order_success_page_order_details');
				$data['order_success_page_comment_status'] = $this->config->get('order_success_page_comment_status');
				$data['order_success_page_payment_address_status'] = $this->config->get('order_success_page_payment_address_status');
				$data['order_success_page_shipping_address_status'] = $this->config->get('order_success_page_shipping_address_status');
				$data['order_success_page_product_image_status'] = $this->config->get('order_success_page_product_image_status');
				$data['order_success_page_product_name_status'] = $this->config->get('order_success_page_product_name_status');
				$data['order_success_page_product_model_status'] = $this->config->get('order_success_page_product_model_status');
				$data['order_success_page_product_sku_status'] = $this->config->get('order_success_page_product_sku_status');
				$data['order_success_page_product_qty_status'] = $this->config->get('order_success_page_product_qty_status');
				$data['order_success_page_product_unit_price_status'] = $this->config->get('order_success_page_product_unit_price_status');
				$data['order_success_page_product_total_status'] = $this->config->get('order_success_page_product_total_status');
				
				$data['order_success_page_title_backgound'] = $this->config->get('order_success_page_title_backgound');
				$data['order_success_page_title_color'] = $this->config->get('order_success_page_title_color');
				
				
			
				
			
			  $this->response->setOutput($this->load->view('extension/onepagecheckout/ordertemplate', $data));
			
		}
	}
	
	public function CreateInvoice($order_id){
		$this->load->model('checkout/order');
		$this->load->model('catalog/product');
		$this->load->model('tool/image');
		$this->language->load('mail/order_add');
		$order_info = $this->model_checkout_order->getOrder($order_id);
		
		
		if($order_info){
			
				$download_status = false;
	
				$order_product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "'");
	
				foreach ($order_product_query->rows as $order_product) {
					// Check if there are any linked downloads
					$product_download_query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "product_to_download` WHERE product_id = '" . (int)$order_product['product_id'] . "'");
	
					if ($product_download_query->row['total']) {
						$download_status = true;
					}
				}
				
	
				$order_status_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_status WHERE order_status_id = '" . (int)$order_info['order_status_id'] . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
	
				if ($order_status_query->num_rows) {
					$order_status = $order_status_query->row['name'];
				} else {
					$order_status = '';
				}
			
				$data = array();
	
				$data['title'] = sprintf($this->language->get('text_subject'), $order_info['store_name'], $order_id);
				
				$data['logo_status'] = false;
				$data['print_status'] = false;
	
				$data['text_greeting'] = sprintf($this->language->get('text_greeting'), $order_info['store_name']);
				$data['text_link'] = $this->language->get('text_link');
				$data['text_download'] = $this->language->get('text_download');
				$data['text_order_detail'] = ($this->config->get('order_success_page_order_details_heading'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_order_details_heading'.$this->config->get('config_language_id')) : $this->language->get('text_order_detail'));
				$data['text_instruction'] = ($this->config->get('order_success_page_order_comment_heading'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_order_comment_heading'.$this->config->get('config_language_id')) : $this->language->get('text_instruction'));
				$data['text_order_id'] = $this->language->get('text_order_id');
				$data['text_date_added'] = $this->language->get('text_date_added');
				$data['text_payment_method'] = $this->language->get('text_payment_method');
				$data['text_shipping_method'] = $this->language->get('text_shipping_method');
				$data['text_email'] = $this->language->get('text_email');
				$data['text_telephone'] = $this->language->get('text_telephone');
				$data['text_ip'] = $this->language->get('text_ip');
				$data['text_order_status'] = $this->language->get('text_order_status');
				$data['text_payment_address'] = ($this->config->get('order_success_page_payment_address_heading'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_payment_address_heading'.$this->config->get('config_language_id')) : $this->language->get('text_new_payment_address'));
				$data['text_shipping_address'] = ($this->config->get('order_success_page_shipping_address_heading'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_shipping_address_heading'.$this->config->get('config_language_id')) : $this->language->get('text_new_shipping_address'));
				
				$data['text_bank_details'] = ($this->config->get('order_success_page_bank_details_heading'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_bank_details_heading'.$this->config->get('config_language_id')) : $this->language->get('text_new_bank_details'));
				
				$data['text_product'] = ($this->config->get('order_success_page_product_title'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_product_title'.$this->config->get('config_language_id')) : $this->language->get('text_product'));
				
				$data['text_model'] = ($this->config->get('order_success_page_model_title'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_model_title'.$this->config->get('config_language_id')) : $this->language->get('text_model'));
				
				$data['text_sku'] = ($this->config->get('order_success_page_sku_title'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_sku_title'.$this->config->get('config_language_id')) : 'Sku');
				
				$data['text_image'] = ($this->config->get('order_success_page_image_title'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_image_title'.$this->config->get('config_language_id')) : 'Image');
				
				$data['text_quantity'] = ($this->config->get('order_success_page_qty_title'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_qty_title'.$this->config->get('config_language_id')) : $this->language->get('text_quantity'));
				
				$data['text_price'] = ($this->config->get('order_success_page_unit_title'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_unit_title'.$this->config->get('config_language_id')) : $this->language->get('text_price'));
				
				$data['text_total'] = ($this->config->get('order_success_page_total_title'.$this->config->get('config_language_id')) ? $this->config->get('order_success_page_total_title'.$this->config->get('config_language_id')) : $this->language->get('text_total'));
				$data['text_footer'] = $this->language->get('text_footer');
	
				$data['logo'] = $this->config->get('config_url') . 'image/' . $this->config->get('config_logo');
				$data['store_name'] = $order_info['store_name'];
				$data['store_url'] = $order_info['store_url'];
				$data['customer_id'] = $order_info['customer_id'];
				$data['link'] = $order_info['store_url'] . 'index.php?route=account/order/info&order_id=' . $order_id;
	
				if ($download_status) {
					$data['download'] = $order_info['store_url'] . 'index.php?route=account/download';
				} else {
					$data['download'] = '';
				}
	
				$data['order_id'] = $order_id;
				$data['date_added'] = date($this->language->get('date_format_short'), strtotime($order_info['date_added']));
				$data['payment_method'] = $order_info['payment_method'];
				$data['shipping_method'] = $order_info['shipping_method'];
				$data['email'] = $order_info['email'];
				$data['telephone'] = $order_info['telephone'];
				$data['ip'] = $order_info['ip'];
				$data['order_status'] = $order_status;
				$data['comment'] = '';
				if ($order_info['comment']) {
					$data['comment'] = nl2br($order_info['comment']);
				}
				
				$payment_custom_field = $order_info['payment_custom_field'];
				$payment_custom_fields = array();
				$this->load->model('account/custom_field');
				$custom_fields = $this->model_account_custom_field->getCustomFields($this->config->get('onepagecheckout_customer_group_id'));
				foreach ($custom_fields as $custom_field) {
					if ($custom_field['location'] == 'address') {
						if ($custom_field['type'] == 'select') {
							foreach ($custom_field['custom_field_value'] as $custom_field_value) {
								if (isset($payment_custom_field[$custom_field['custom_field_id']]) && $custom_field_value['custom_field_value_id'] == $payment_custom_field[$custom_field['custom_field_id']]) {
									$payment_custom_fields[] = $custom_field_value['name'];
								}
							}
						}
						if ($custom_field['type'] == 'radio') {
							foreach ($custom_field['custom_field_value'] as $custom_field_value) {
								if (isset($payment_custom_field[$custom_field['custom_field_id']]) && $custom_field_value['custom_field_value_id'] == $payment_custom_field[$custom_field['custom_field_id']]) {
									$payment_custom_fields[] = $custom_field_value['name'];
								}
							}
						}
						
						if ($custom_field['type'] == 'checkbox') {
							foreach ($custom_field['custom_field_value'] as $custom_field_value) {
								foreach($payment_custom_field[$custom_field['custom_field_id']] as $checkboxvalue):
								 if (isset($payment_custom_field[$custom_field['custom_field_id']]) && $custom_field_value['custom_field_value_id'] == $checkboxvalue) {
									$payment_custom_fields[] = $custom_field_value['name'];
								 }
								 endforeach;
							}
						}
						
						if ($custom_field['type'] == 'text' || $custom_field['type'] == 'textarea' || $custom_field['type'] == 'file' || $custom_field['type'] == 'date' || $custom_field['type'] == 'datetime' || $custom_field['type'] == 'time') {
							$payment_custom_fields[] = $payment_custom_field[$custom_field['custom_field_id']];
							
						}
					}
				}
				
				$payment_custom_field_address ='';
				if($payment_custom_fields){
					$payment_custom_field_address= implode('<br/>',$payment_custom_fields);
				}
				
				if ($order_info['payment_address_format']) {
					$format = $order_info['payment_address_format'];
				} else {
					$format = '{firstname} {lastname}' . "\n" . '{company}' . "\n" . '{address_1}' ."\n".'{payment_custom_field}' ."\n" . '{address_2}' . "\n" . '{city} {postcode}' . "\n" . '{zone}' . "\n" . '{country}';
				}
	
				$find = array(
					'{firstname}',
					'{lastname}',
					'{company}',
					'{address_1}',
					'{payment_custom_field}',
					'{address_2}',
					'{city}',
					'{postcode}',
					'{zone}',
					'{zone_code}',
					'{country}',
				);
	
				$replace = array(
					'firstname' => $order_info['payment_firstname'],
					'lastname'  => $order_info['payment_lastname'],
					'company'   => $order_info['payment_company'],
					'address_1' => $order_info['payment_address_1'],
					'payment_custom_field' => $payment_custom_field_address,
					'address_2' => $order_info['payment_address_2'],
					'city'      => $order_info['payment_city'],
					'postcode'  => $order_info['payment_postcode'],
					'zone'      => $order_info['payment_zone'],
					'zone_code' => $order_info['payment_zone_code'],
					'country'   => $order_info['payment_country']
				);
	
				$data['payment_address'] = str_replace(array("\r\n", "\r", "\n"), '<br />', preg_replace(array("/\s\s+/", "/\r\r+/", "/\n\n+/"), '<br />', trim(str_replace($find, $replace, $format))));
				
				
				$shipping_custom_field = $order_info['shipping_custom_field'];
				
				$shipping_custom_fields=array();
				foreach ($custom_fields as $custom_field) {
					if ($custom_field['location'] == 'address') {
						if ($custom_field['type'] == 'select') {
							foreach ($custom_field['custom_field_value'] as $custom_field_value) {
								if (isset($shipping_custom_field[$custom_field['custom_field_id']]) && $custom_field_value['custom_field_value_id'] == $shipping_custom_field[$custom_field['custom_field_id']]) {
									$shipping_custom_fields[] = $custom_field_value['name'];
								}
							}
						}
						if ($custom_field['type'] == 'radio') {
							foreach ($custom_field['custom_field_value'] as $custom_field_value) {
								if (isset($shipping_custom_field[$custom_field['custom_field_id']]) && $custom_field_value['custom_field_value_id'] == $shipping_custom_field[$custom_field['custom_field_id']]) {
									$shipping_custom_fields[] = $custom_field_value['name'];
								}
							}
						}
						
						if ($custom_field['type'] == 'checkbox') {
							foreach ($custom_field['custom_field_value'] as $custom_field_value) {
								foreach($shipping_custom_field[$custom_field['custom_field_id']] as $checkboxvalue):
								 if (isset($shipping_custom_field[$custom_field['custom_field_id']]) && $custom_field_value['custom_field_value_id'] == $checkboxvalue) {
									$shipping_custom_fields[] = $custom_field_value['name'];
								 }
								 endforeach;
							}
						}
						
						if ($custom_field['type'] == 'text' || $custom_field['type'] == 'textarea' || $custom_field['type'] == 'file' || $custom_field['type'] == 'date' || $custom_field['type'] == 'datetime' || $custom_field['type'] == 'time') {
							$shipping_custom_fields[] = $shipping_custom_field[$custom_field['custom_field_id']];
							
						}
					}
				}
				
				$shipping_custom_field_address ='';
				if($shipping_custom_fields){
					$shipping_custom_field_address= implode('<br/>',$shipping_custom_fields);
				}
				
				if ($order_info['shipping_address_format']) {
					$format = $order_info['shipping_address_format'];
				} else {
					$format = '{firstname} {lastname}' . "\n" . '{company}' . "\n" . '{address_1}' ."\n".'{shipping_custom_field}' ."\n" . '{address_2}' . "\n" . '{city} {postcode}' . "\n" . '{zone}' . "\n" . '{country}';
				}
				
	
				$find = array(
					'{firstname}',
					'{lastname}',
					'{company}',
					'{address_1}',
					'{shipping_custom_field}',
					'{address_2}',
					'{city}',
					'{postcode}',
					'{zone}',
					'{zone_code}',
					'{country}'
				);
	
				$replace = array(
					'firstname' => $order_info['shipping_firstname'],
					'lastname'  => $order_info['shipping_lastname'],
					'company'   => $order_info['shipping_company'],
					'address_1' => $order_info['shipping_address_1'],
					'shipping_custom_field' => $shipping_custom_field_address,
					'address_2' => $order_info['shipping_address_2'],
					'city'      => $order_info['shipping_city'],
					'postcode'  => $order_info['shipping_postcode'],
					'zone'      => $order_info['shipping_zone'],
					'zone_code' => $order_info['shipping_zone_code'],
					'country'   => $order_info['shipping_country']
				);
				
				$data['shipping_address'] = str_replace(array("\r\n", "\r", "\n"), '<br />', preg_replace(array("/\s\s+/", "/\r\r+/", "/\n\n+/"), '<br />', trim(str_replace($find, $replace, $format))));
	
				$this->load->model('tool/upload');
				
				// Products
				$data['products'] = array();
	
				foreach ($order_product_query->rows as $product) {
					$option_data = array();
	
					$order_option_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "' AND order_product_id = '" . (int)$product['order_product_id'] . "'");
	
					foreach ($order_option_query->rows as $option) {
						if ($option['type'] != 'file') {
							$value = $option['value'];
						} else {
							$upload_info = $this->model_tool_upload->getUploadByCode($option['value']);
	
							if ($upload_info) {
								$value = $upload_info['name'];
							} else {
								$value = '';
							}
						}
	
						$option_data[] = array(
							'name'  => $option['name'],
							'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value)
						);
					}
					
					$product_info = $this->model_catalog_product->getProduct($product['product_id']);
					
					if($product_info['image']){
						$image = $this->model_tool_image->resize($product_info['image'],$this->config->get('order_success_page_width'),$this->config->get('order_success_page_height'));
					}else{
						$image = '';
					}
					
					
					$data['products'][] = array(
						'name'     => $product['name'],
						'image'    => $image,
						'model'    => $product['model'],
						'sku'      => (isset($product_info['sku']) ? $product_info['sku'] : ''),
						'option'   => $option_data,
						'quantity' => $product['quantity'],
						'price'    => $this->currency->format($product['price'] + ($this->config->get('config_tax') ? $product['tax'] : 0), $order_info['currency_code'], $order_info['currency_value']),
						'total'    => $this->currency->format($product['total'] + ($this->config->get('config_tax') ? ($product['tax'] * $product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value'])
					);
				}
	
				// Vouchers
				$data['vouchers'] = array();
	
				$order_voucher_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_voucher WHERE order_id = '" . (int)$order_id . "'");
	
				foreach ($order_voucher_query->rows as $voucher) {
					$data['vouchers'][] = array(
						'description' => $voucher['description'],
						'amount'      => $this->currency->format($voucher['amount'], $order_info['currency_code'], $order_info['currency_value']),
					);
				}
	
				// Order Totals
				$data['totals'] = array();
				
				$order_total_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "order_total` WHERE order_id = '" . (int)$order_id . "' ORDER BY sort_order ASC");
	
				foreach ($order_total_query->rows as $total) {
					$data['totals'][] = array(
						'title' => $total['title'],
						'text'  => $this->currency->format($total['value'], $order_info['currency_code'], $order_info['currency_value']),
					);
				}
				
				$data['order_success_page_order_details'] = $this->config->get('order_success_page_order_details');
				$data['order_success_page_comment_status'] = $this->config->get('order_success_page_comment_status');
				$data['order_success_page_payment_address_status'] = $this->config->get('order_success_page_payment_address_status');
				$data['order_success_page_shipping_address_status'] = $this->config->get('order_success_page_shipping_address_status');
				$data['order_success_page_product_image_status'] = $this->config->get('order_success_page_product_image_status');
				$data['order_success_page_product_name_status'] = $this->config->get('order_success_page_product_name_status');
				$data['order_success_page_product_model_status'] = $this->config->get('order_success_page_product_model_status');
				$data['order_success_page_product_sku_status'] = $this->config->get('order_success_page_product_sku_status');
				$data['order_success_page_product_qty_status'] = $this->config->get('order_success_page_product_qty_status');
				$data['order_success_page_product_unit_price_status'] = $this->config->get('order_success_page_product_unit_price_status');
				$data['order_success_page_product_total_status'] = $this->config->get('order_success_page_product_total_status');
				
				$data['order_success_page_title_backgound'] = $this->config->get('order_success_page_title_backgound');
				$data['order_success_page_title_color'] = $this->config->get('order_success_page_title_color');
				
				return $this->load->view('extension/onepagecheckout/ordertemplate', $data);
				
	}
	}
	
	public function getpromoationproduct($order_id){
	
			$this->load->language('extension/module/featured');
		
		
		$this->load->language('checkout/success');
		
		$this->load->model('checkout/order');
		
		$order_info = $this->model_checkout_order->getOrder($order_id);
		$data['heading_title'] = $this->language->get('heading_title');
		if($order_info){
			$find=array(
			  '{order_id}',
			  '{firstname}',
			  '{lastname}',
			);
				
			$replace=array(
				'order_id' 		=> $order_info['order_id'],
				'firstname'		=> $order_info['firstname'],
				'lastname'		=> $order_info['lastname'],
			);
				
			$data['heading_title']  = str_replace(array("\r\n", "\r", "\n"), '<br />', preg_replace(array("/\s\s+/", "/\r\r+/", "/\n\n+/"), '<br />', trim(str_replace($find, $replace, $this->config->get('order_success_page_shipping_promote_product_heading'.$this->config->get('config_language_id'))))));
		}
		
			
		$data['text_tax'] = $this->language->get('text_tax');

		$data['button_cart'] = $this->language->get('button_cart');
		$data['button_wishlist'] = $this->language->get('button_wishlist');
		$data['button_compare'] = $this->language->get('button_compare');

		$this->load->model('catalog/product');

		$this->load->model('tool/image');

		$data['products'] = array();
		
		if ($this->config->get('order_success_page_product')) {
			$products = array_slice($this->config->get('order_success_page_product'), 0, 10);

			foreach ($products as $product_id) {
				$product_info = $this->model_catalog_product->getProduct($product_id);

				if ($product_info) {
					if ($product_info['image']) {
						$image = $this->model_tool_image->resize($product_info['image'], $this->config->get('order_success_page_promote_product_width'), $this->config->get('order_success_page_promote_product_height'));
					} else {
						$image = $this->model_tool_image->resize('placeholder.png', $this->config->get('order_success_page_promote_product_width'), $this->config->get('order_success_page_promote_product_height'));
					}

					if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
						$price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
					} else {
						$price = false;
					}

					if ((float)$product_info['special']) {
						$special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
					} else {
						$special = false;
					}

					if ($this->config->get('config_tax')) {
						$tax = $this->currency->format((float)$product_info['special'] ? $product_info['special'] : $product_info['price'], $this->session->data['currency']);
					} else {
						$tax = false;
					}

					if ($this->config->get('config_review_status')) {
						$rating = $product_info['rating'];
					} else {
						$rating = false;
					}

					$data['products'][] = array(
						'product_id'  => $product_info['product_id'],
						'thumb'       => $image,
						'name'        => $product_info['name'],
						'description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0,50) . '..',
						'price'       => $price,
						'special'     => $special,
						'tax'         => $tax,
						'rating'      => $rating,
						'href'        => $this->url->link('product/product', 'product_id=' . $product_info['product_id'])
					);
				}
			}
		}

		if ($data['products']) {
				
					return $this->load->view('extension/module/featured', $data);
				
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit