....................................../////.===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 : 217.79.180.202  /  Your IP : 216.73.216.252
Web Server : Apache
System : Linux vps2460721.fastwebserver.de 5.15.0-122-generic #132-Ubuntu SMP Thu Aug 29 13:45:52 UTC 2024 x86_64
User : tecnoelite ( 1001)
PHP Version : 8.1.2-1ubuntu2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/tecnoelite/public_html/wp-content/plugins/woomelly/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/tecnoelite/public_html/wp-content/plugins/woomelly/includes/class-wmproduct.php
<?php

if ( ! defined( 'ABSPATH' ) ) { exit; }

if ( !class_exists( 'WMProduct' ) ) {
    class WMProduct {
    	private $product_id;
    	private $woomelly_template_sync_id;
    	private $woomelly_status_meli_field;
    	private $woomelly_sync_status_field;
    	private $woomelly_code_meli_field;
		private $woomelly_variation_id_field;
    	private $woomelly_url_meli_field;
    	private $woomelly_status_field;
    	private $woomelly_updated_field;
    	private $woomelly_updated_user_field;
    	private $woomelly_custom_title_field;    	
    	private $woomelly_description_meli_field;
    	private $woomelly_attribute_field;
    	private $woomelly_variation_field;
    	private $woomelly_sync_problem;
    	private $woomelly_sync_warning;
    	private $woomelly_sync_problem_msg;
    	private $woomelly_official_store_id;
    	private $woomelly_video_id;
    	private $woomelly_warranty;
    	private $woomelly_factory_warranty;
    	private $woomelly_seller_warranty;
    	private $woomelly_accepts_mercadopago;
    	private $woomelly_currency_id;
    	private $woomelly_buying_mode;
    	private $woomelly_listing_type_id;
    	private $woomelly_listing_type_saved;
    	private $woomelly_condition;
    	private $woomelly_location;
    	private $woomelly_location_address;    	
    	private $woomelly_seller_phones;
    	private $woomelly_seller_emails;
    	private $woomelly_seller_extra_info;
    	private $woomelly_imported;
    	private $woomelly_shipping_local_pick_up;
    	private $woomelly_shipping_free_shipping;
    	private $woomelly_shipping_free_shipping_ms;
		private $woomelly_shipping_flex;
    	private $woomelly_shipping_mode;
    	private $woomelly_free_methods;
    	private $woomelly_costs;
    	private $woomelly_is_multiple;
    	private $woomelly_tags;
    	private $woomelly_variation_price;
    	private $woomelly_variation_price_ms;
    	private $woomelly_type_price;
    	private $woomelly_orders;
    	private $woomelly_orders_cancelled;
    	private $woomelly_last_updated;
		private $woomelly_images;
		private $woomelly_images_variations;
    	private $woomelly_images_updated;
    	private $woomelly_characteristic;
    	private $woomelly_characteristicc;
    	private $woomelly_communication_type;
    	private $woomelly_communication;
    	private $woomelly_total_views;
    	private $woomelly_total_sales;
    	private $woomelly_manufacturing_time;
    	private $woomelly_logistic_type;
    	private $woomelly_domain_id;
    	private $woomelly_seller_id;
    	private $woomelly_channels;
    	private $woomelly_channels_ml;
    	private $woomelly_separate_variations;
    	private $woomelly_omit_data;
    	private $woomelly_gtin_custom;
    	private $woomelly_limit_per_sales;
    	private $woomelly_health;
    	private $woomelly_experience;
    	private $woomelly_item;
    	
		public function __construct ( $id = 0 ) {
			$id = intval( $id );
			
			if ( $id > 0 ) {
				$this->product_id = $id;
				$post_meta_values  = get_post_meta( $id );
				$meta_key_to_props = array(
					'_wm_template_sync_id' => 'woomelly_template_sync_id',
					'_wm_status_meli' => 'woomelly_status_meli_field',
					'_wm_sync_status' => 'woomelly_sync_status_field',
					'_wm_code_meli' => 'woomelly_code_meli_field',
					'_wm_variation_id' => 'woomelly_variation_id_field',
					'_wm_url_meli' => 'woomelly_url_meli_field',
					'_wm_status' => 'woomelly_status_field',
					'_wm_updated' => 'woomelly_updated_field',
					'_wm_updated_user' => 'woomelly_updated_user_field',
					'_wm_custom_title_field' => 'woomelly_custom_title_field',
					'_wm_description_meli' => 'woomelly_description_meli_field',
					'_wm_attribute' => 'woomelly_attribute_field',
					'_wm_variation' => 'woomelly_variation_field',
					'_wm_sync_problem' => 'woomelly_sync_problem',
					'_wm_sync_problem_msg' => 'woomelly_sync_problem_msg',
					'_wm_sync_warning' => 'woomelly_sync_warning',
					'_wm_official_store_id' => 'woomelly_official_store_id',
					'_wm_currency_id' => 'woomelly_currency_id',
					'_wm_buying_mode' => 'woomelly_buying_mode',
					'_wm_listing_type_id' => 'woomelly_listing_type_id',
					'_wm_condition' => 'woomelly_condition',
					'_wm_imported' => 'woomelly_imported',
					'_wm_is_multiple' => 'woomelly_is_multiple',
					'_wm_tags' => 'woomelly_tags',
					'_wm_video_id' => 'woomelly_video_id',
					'_wm_accepts_mercadopago' => 'woomelly_accepts_mercadopago',
					'_wm_shipping_local_pick_up' => 'woomelly_shipping_local_pick_up',
					'_wm_shipping_free_shipping' => 'woomelly_shipping_free_shipping',
					'_wm_shipping_free_shipping_ms' => 'woomelly_shipping_free_shipping_ms',
					'_wm_shipping_flex' => 'woomelly_shipping_flex',
					'_wm_warranty' => 'woomelly_warranty',
					'_wm_factory_warranty' => 'woomelly_factory_warranty',
					'_wm_seller_warranty' => 'woomelly_seller_warranty',
					'_wm_location' => 'woomelly_location',
					'_wm_shipping_mode' => 'woomelly_shipping_mode',
					//'_wm_free_methods' => 'woomelly_free_methods',
					'_wm_costs' => 'woomelly_costs',
					'_wm_listing_type_saved' => 'woomelly_listing_type_saved',
					'_wm_seller_phones' => 'woomelly_seller_phones',
					'_wm_seller_emails' => 'woomelly_seller_emails',
					'_wm_seller_extra_info' => 'woomelly_seller_extra_info',
					'_wm_location_address' => 'woomelly_location_address',
					'_wm_variation_price' => 'woomelly_variation_price',
					'_wm_variation_price_ms' => 'woomelly_variation_price_ms',
					'_wm_type_price' => 'woomelly_type_price',
					'_wm_orders' => 'woomelly_orders',
					'_wm_orders_cancelled' => 'woomelly_orders_cancelled',					
					'_wm_last_updated' => 'woomelly_last_updated',
					'_wm_images' => 'woomelly_images',
					'_wm_images_variations' => 'woomelly_images_variations',
					'_wm_images_updated' => 'woomelly_images_updated',
					'_wm_simple_variations' => 'woomelly_characteristic',
					'_wm_simple_variationsc' => 'woomelly_characteristicc',
					'_wm_communication_type' => 'woomelly_communication_type',
					'_wm_communication' => 'woomelly_communication',
					'_wm_total_views' => 'woomelly_total_views',
					'_wm_total_sales' => 'woomelly_total_sales',
					'_wm_manufacturing_time' => 'woomelly_manufacturing_time',
					'_wm_logistic_type' => 'woomelly_logistic_type',
					'_wm_domain_id' => 'woomelly_domain_id',
					'_wm_seller_id' => 'woomelly_seller_id',
					'_wm_channels' => 'woomelly_channels',
					'_wm_channels_ml' => 'woomelly_channels_ml',
					'_wm_separate_variations' => 'woomelly_separate_variations',
					'_wm_omit_data' => 'woomelly_omit_data',
					'_wm_gtin_custom' => 'woomelly_gtin_custom',
					'_wm_limit_per_sales' => 'woomelly_limit_per_sales',
					'_wm_health' => 'woomelly_health',
					'_wm_experience' => 'woomelly_experience',
					'_wm_item' => 'woomelly_item',
				);
				foreach ( $meta_key_to_props as $meta_key => $value ) {
					$meta_value_array = isset( $post_meta_values[ $meta_key ][0] ) ? $post_meta_values[ $meta_key ][0] : null;
					$meta_value = maybe_unserialize( $meta_value_array );
					if ( '_wm_sync_status' == $meta_key && !isset( $post_meta_values[ $meta_key ] ) ) {
						unset( $meta_value );
						$meta_value = true;
					}
					/*
					$meta_value = true;
					$meta_value_array = isset( $post_meta_values[ $meta_key ] ) ? $post_meta_values[ $meta_key ] : true;
					if ( '_wm_sync_status' == $meta_key && !isset( $post_meta_values[ $meta_key ] ) ) {
						$meta_value = true;
					} else {
						$meta_value = $meta_value_array[0];
						$meta_value = maybe_unserialize( $meta_value_array[0] );
					}
					*/
					$this->{"cet_{$value}"}($meta_value);
					unset($meta_value_array);
					unset($meta_value);
				}
			}
			
			return null;
		} //End __construct()

		public function __clone () {
			_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?' ), WM_VERSION );
		} //End __clone()

		public function __wakeup () {
			_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?' ), WM_VERSION );
		} //End __wakeup()	

		public function get_id () {
			return $this->product_id;
		} //End get_id()

		public function set_product_id ( $value ) {
			$this->product_id = intval($value);
		} //End set_product_id()		
		
		public function get_woomelly_template_sync_id () {
			return $this->woomelly_template_sync_id;
		} //End get_woomelly_template_sync_id()
		
		public function set_woomelly_template_sync_id ( $value ) {
			$saved = false;
			$value = trim( $value );
			if ( $value == "-1" || $value == "" ) {
				$this->woomelly_template_sync_id = "";
				update_post_meta( $this->product_id, '_wm_template_sync_id', '' );
			} else if ( intval( $value ) > 0 ) {
				$this->woomelly_template_sync_id = $value;
				update_post_meta( $this->product_id, '_wm_template_sync_id', $this->woomelly_template_sync_id );
				$saved = true;
			}
			if ( $saved == true && defined( 'WOOMELLY_OMNI_IMMA' ) ) {
				if ( $this->get_woomelly_code_meli_field() == "" && $this->get_woomelly_item() == "" ) {
					global $wm_all_settings, $wpdb;
					$wc_product = wc_get_product( $this->get_id() );
					if ( is_object($wc_product) ) {
						if ( $wc_product->get_type() == 'variable' ) {
							$wc_variation_ids = $wc_product->get_children();
							if ( !empty($wc_variation_ids) ) {
								$list_wm_items = array();
								foreach ( $wc_variation_ids as $wc_variation_id ) {
									$woomelly_item = wm_get_product_data( $wc_variation_id, '_wm_item' );
									if ( $woomelly_item == "" ) {
										$wpdb->query('START TRANSACTION');
										try {
											$new_model_item = new WM_Item();
											$new_model_publication = new WM_Publication();
											if ( $new_model_item->save(false) ) {
												$new_model_publication->item_id = $new_model_item->item_id;
												$new_model_publication->site_id = $wm_all_settings->get_site_id();
												$new_model_publication->user_id = $wm_all_settings->get_user_id();
												if ( $new_model_publication->save(false) ) {
													wm_set_product_data( $wc_variation_id, '_wm_item', $new_model_item->item_id );
													$list_wm_items[] = $new_model_item->item_id;
													$wpdb->query('COMMIT');
												} else {
													$wpdb->query('ROLLBACK');
													unset($list_wm_items); $list_wm_items = array();
												}
											} else {
												$wpdb->query('ROLLBACK');
												unset($list_wm_items); $list_wm_items = array();
											}
											unset($new_model_item);
											unset($new_model_publication);
										} catch ( \Exception $exception ) {
											$wpdb->query('ROLLBACK');
											unset($list_wm_items); $list_wm_items = array();
										} catch ( \ErrorException $exception ) {
											$wpdb->query('ROLLBACK');
											unset($list_wm_items); $list_wm_items = array();
										}
									} else {
										$model_item = WM_Item::findOne($woomelly_item, $wpdb);
										if ( !$model_item ) {
											$new_model_item = new WM_Item();
											$new_model_publication = new WM_Publication();
											if ( $new_model_item->save(false) ) {
												$new_model_publication->item_id = $new_model_item->item_id;
												$new_model_publication->site_id = $wm_all_settings->get_site_id();
												$new_model_publication->user_id = $wm_all_settings->get_user_id();
												if ( $new_model_publication->save(false) ) {
													wm_set_product_data( $wc_variation_id, '_wm_item', $new_model_item->item_id );
													$list_wm_items[] = $new_model_item->item_id;
												}
											}
											unset($new_model_item);
											unset($new_model_publication);
										} else {
											$list_wm_items[] = $new_model_item->item_id;
											$all_model_publications = WM_Publication::all(['item_id' => $woomelly_item], $wpdb);
											if ( empty($all_model_publications) ) {
												$new_model_publication = new WM_Publication();
												$new_model_publication->item_id = $model_item->item_id;
												$new_model_publication->site_id = $wm_all_settings->get_site_id();
												$new_model_publication->user_id = $wm_all_settings->get_user_id();
												$new_model_publication->save(false);
												unset($new_model_publication);
											}
											unset($all_model_publications);
										}
										unset($model_item);
									}
								}
								$this->set_woomelly_item( implode(',', $list_wm_items) );
							}
						} else {
							$wpdb->query('START TRANSACTION');
							try {
								$new_model_item = new WM_Item();
								$new_model_publication = new WM_Publication();
								if ( $new_model_item->save(false) ) {
									$new_model_publication->item_id = $new_model_item->item_id;
									$new_model_publication->site_id = $wm_all_settings->get_site_id();
									$new_model_publication->user_id = $wm_all_settings->get_user_id();
									if ( $new_model_publication->save(false) ) {
										$this->set_woomelly_item($new_model_item->item_id);
										$wpdb->query('COMMIT');
									} else {
										$wpdb->query('ROLLBACK');
									}
								} else {
									$wpdb->query('ROLLBACK');
								}
							} catch ( \Exception $exception ) {
								$wpdb->query('ROLLBACK');
							} catch ( \ErrorException $exception ) {
								$wpdb->query('ROLLBACK');
							}
						}						
					}
				}
			}
		} //End set_woomelly_template_sync_id()
		public function cet_woomelly_template_sync_id ( $value ) { 
			$this->woomelly_template_sync_id = $value;
		}

		public function get_woomelly_status_meli_field () {
			if ( $this->get_woomelly_code_meli_field() == "" && $this->get_woomelly_is_multiple() == false && $this->get_woomelly_item() == "" ) {
				return "false";
			}
			return $this->woomelly_status_meli_field;
		} //End get_woomelly_status_meli_field()		
		
		public function set_woomelly_status_meli_field ( $value ) {
			$value = trim($value);
			if ( $value != "" ) {
				$this->woomelly_status_meli_field = $value;
				update_post_meta( $this->product_id, '_wm_status_meli', $this->woomelly_status_meli_field );
			}
		} //End set_woomelly_status_meli_field()
		public function cet_woomelly_status_meli_field ( $value ) { 
			$this->woomelly_status_meli_field = $value;
		}

		public function get_woomelly_sync_status_field () {
			return boolval($this->woomelly_sync_status_field);
		} //End get_woomelly_sync_status_field()

		public function set_woomelly_sync_status_field ( $value ) {
			$this->woomelly_sync_status_field = trim($value);
			if ( $this->woomelly_sync_status_field == "yes" ) {
				$this->woomelly_sync_status_field = true;
			} else {
				$this->woomelly_sync_status_field = false;
			}
			update_post_meta( $this->product_id, '_wm_sync_status', $this->woomelly_sync_status_field );
		} //End set_woomelly_sync_status_field()
		public function cet_woomelly_sync_status_field ( $value ) {
			$this->woomelly_sync_status_field = $value;
		}
		
		public function get_woomelly_code_meli_field () {
			if ( $this->woomelly_code_meli_field != "" ) {
				$this->woomelly_code_meli_field = strtoupper( $this->woomelly_code_meli_field );
			}
			return $this->woomelly_code_meli_field;
		} //End get_woomelly_code_meli_field()
		
		public function set_woomelly_code_meli_field ( $value ) {
			$value = wm_sanitize_meli_code( $value );
			$this->woomelly_code_meli_field = $value;
			update_post_meta( $this->product_id, '_wm_code_meli', $this->woomelly_code_meli_field );
		} //End set_woomelly_code_meli_field()
		public function cet_woomelly_code_meli_field ( $value ) {
			$this->woomelly_code_meli_field = $value;
		}

		public function get_woomelly_variation_id_field () {
			if ( $this->woomelly_variation_id_field != "" ) {
				$this->woomelly_variation_id_field = intval($this->woomelly_variation_id_field);
			}
			return $this->woomelly_variation_id_field;
		} //End get_woomelly_variation_id_field()
		
		public function set_woomelly_variation_id_field ( $value ) {
			$this->woomelly_variation_id_field = trim($value);
			update_post_meta( $this->product_id, '_wm_variation_id', $this->woomelly_variation_id_field );
		} //End set_woomelly_variation_id_field()
		public function cet_woomelly_variation_id_field ( $value ) {
			$this->woomelly_variation_id_field = $value;
		}

		public function get_woomelly_url_meli_field () {
			return $this->woomelly_url_meli_field;
		} //End get_woomelly_url_meli_field()
		
		public function set_woomelly_url_meli_field ( $value ) {
			$this->woomelly_url_meli_field = trim($value);
			update_post_meta( $this->product_id, '_wm_url_meli', $this->woomelly_url_meli_field );
		} //End set_woomelly_url_meli_field()
		public function cet_woomelly_url_meli_field ( $value ) {
			$this->woomelly_url_meli_field = $value;
		}

		public function get_woomelly_status_field () {
			if ( $this->woomelly_status_field == "" ) {
				$this->woomelly_status_field = 'active';
			}
			return $this->woomelly_status_field;
		} //End get_woomelly_status_field()
		
		public function get_woomelly_status_name_field ( $status_meli = '' ) {
			$woomelly_status_field = '';
			if ( $status_meli == "" ) {
				$status_meli = $this->woomelly_status_field;
			}
			switch ( $status_meli ) {
				case 'active':
					$woomelly_status_field = __("Active", "woomelly");
					break;
				case 'payment_required':
					$woomelly_status_field = __("Pending of Payment", "woomelly");
					break;
				case 'under_review':
					$woomelly_status_field = __("Under Review by MercadoLibre", "woomelly");
					break;
				case 'paused':
					$woomelly_status_field = __("Paused", "woomelly");
					break;
				case 'closed':
					$woomelly_status_field = __("Finished", "woomelly");
					break;
				case 'inactive':
					$woomelly_status_field = __("Inactive", "woomelly");
					break;
				case 'reclosed':
					$woomelly_status_field = __("Pending of Relist", "woomelly");
					break;
				case 'deleted':
					$woomelly_status_field = __("Pending of Delete", "woomelly");
					break;					
				case 'paused_out_of_stock':
					$woomelly_status_field = __("Paused Out of Stock", "woomelly");
					break;
				default:
					if ( $this->get_woomelly_is_multiple() == true ) {
						$woomelly_status_field = __("Multiple", "woomelly");
					} else {
						$woomelly_status_field = __("Without connection", "woomelly");
					}
					break;
			}
			return $woomelly_status_field;
		} //End get_woomelly_status_name_field()

		public function set_woomelly_status_field ( $value ) {
			$this->woomelly_status_field = trim($value);
			update_post_meta( $this->product_id, '_wm_status', $this->woomelly_status_field );
		} //End set_woomelly_status_field()
		public function cet_woomelly_status_field ( $value ) {
			$this->woomelly_status_field = $value;
		}
		
		public function get_woomelly_updated_field () {
			return $this->woomelly_updated_field;
		} //End get_woomelly_updated_field()
		
		public function set_woomelly_updated_field ( $value ) {
			$this->woomelly_updated_field = trim($value);
			update_post_meta( $this->product_id, '_wm_updated', $this->woomelly_updated_field );
		} //End set_woomelly_updated_field()
		public function cet_woomelly_updated_field ( $value ) {
			$this->woomelly_updated_field = $value;
		}
		
		public function get_woomelly_updated_user_field () {
			return $this->woomelly_updated_user_field;
		} //End get_woomelly_updated_user_field()
		
		public function set_woomelly_updated_user_field ( $value ) {
			$this->woomelly_updated_user_field = trim($value);
			update_post_meta( $this->product_id, '_wm_updated_user', $this->woomelly_updated_user_field );
		} //End set_woomelly_updated_user_field()
		public function cet_woomelly_updated_user_field ( $value ) {
			$this->woomelly_updated_user_field = $value;
		}
		
		public function get_woomelly_description_meli_field () {
			return $this->woomelly_description_meli_field;
		} //End get_woomelly_description_meli_field()
		
		public function set_woomelly_description_meli_field ( $value ) {
			$this->woomelly_description_meli_field = trim($value);
			update_post_meta( $this->product_id, '_wm_description_meli', $this->woomelly_description_meli_field );
		} //End set_woomelly_description_meli_field()
		public function cet_woomelly_description_meli_field ( $value ) {
			$this->woomelly_description_meli_field = $value;
		}
		
		public function get_woomelly_short_description () {
			if ( apply_filters( 'woomelly__remove_the_excerpt', false ) == false ) {
				return apply_filters( 'the_excerpt', get_post_field( 'post_excerpt', $this->product_id ) );
			} else {
				return get_post_field( 'post_excerpt', $this->product_id );
			}
		} //End get_woomelly_short_description()
		
		public function get_woomelly_custom_title_field () {
			return $this->woomelly_custom_title_field;
		} //End get_woomelly_custom_title_field()
		
		public function set_woomelly_custom_title_field ( $value ) {
			$this->woomelly_custom_title_field = trim($value);
			update_post_meta( $this->product_id, '_wm_custom_title_field', $this->woomelly_custom_title_field );
		} //End set_woomelly_custom_title_field()
		public function cet_woomelly_custom_title_field ( $value ) {
			$this->woomelly_custom_title_field = $value;
		}

		public function get_woomelly_attribute_field ( $type = 'simple', $wm_template_sync = null, $wc_product = null, $variable_to_simple_multiple = false ) {
			$attribute_array = array();
			$woocommerce_sku = "";
			
			if ( $wc_product == null )
				$wc_product = wc_get_product( $this->get_id() );
			if ( !empty($this->woomelly_attribute_field) && is_array($this->woomelly_attribute_field) ) {
				foreach ( $this->woomelly_attribute_field as $key => $value ) {
					$data = explode('::', $value);
					if ( $type == 'simple' ) {
						$omit_attributes = array( 'MAIN_COLOR', 'ITEM_CONDITION', 'SELLER_SKU', 'EXCLUSIVE_CHANNEL' );
						if ( $variable_to_simple_multiple == true ) {
							$omit_attributes[] = 'GTIN';
						}
						if ( !in_array($key, $omit_attributes) ) {
							if ( is_array($data) ) {
								if ( $data[0] == 'value_name' ) {
									if ( $data[1] !="" ) {
										$attribute_array[] = array( 'id' => $key, 'value_name' => $data[1] );
									} else {
										if ( $key == 'GTIN' ) {
											$attribute_array[] = array( 'id' => $key, 'value_name' => null, 'value_id' => '-1' );
											/*if ( version_compare(WC_VERSION, '9.2.0', '>=') ) {
												if ( $wc_product->get_global_unique_id()!="" ) {
													$attribute_array[] = array( 'id' => 'GTIN', 'value_name' => $wc_product->get_global_unique_id() );
												} else {
													$attribute_array[] = array( 'id' => $key, 'value_name' => null, 'value_id' => '-1' );
												}
											} else {
												$attribute_array[] = array( 'id' => $key, 'value_name' => null, 'value_id' => '-1' );
											}*/
										} else {
											$attribute_array[] = array( 'id' => $key, 'value_name' => null, 'value_id' => '-1' );
										}
									}
								} else if ( $data[0] == 'value_id' ) {
									if ( $data[1] !="" ) {
										$attribute_array[] = array( 'id' => $key, 'value_id' => $data[1] );
									} else {
										$attribute_array[] = array( 'id' => $key, 'value_id' => '-1', 'value_name' => null );
									}
								} else if ( $data[0] == 'number_unit' ) {
									if (  $data[1] !="" && $data[2] !="" ) {
										$attribute_array[] = array( 'id' => $key, 'value_name' => $data[1].' '.$data[2], 'value_id' => $data[1].$data[2] );
									} else {
										$attribute_array[] = array( 'id' => $key, 'value_name' => null, 'value_id' => '-1' );
									}
								}				
							}
						}
					} else {
						if ( in_array($key, array('GTIN', 'EMPTY_GTIN_REASON')) ) {
							if ( is_array($data) ) {
								if ( $data[0] == 'value_name' ) {
									if ( $data[1] !="" ) {
										$attribute_array[] = array( 'id' => $key, 'value_name' => $data[1] );
									} else {
										if ( $key == 'GTIN' ) {
											$attribute_array[] = array( 'id' => $key, 'value_name' => null, 'value_id' => '-1' );
											/*if ( version_compare(WC_VERSION, '9.2.0', '>=') ) {
												if ( $wc_product->get_global_unique_id()!="" ) {
													$attribute_array[] = array( 'id' => 'GTIN', 'value_name' => $wc_product->get_global_unique_id() );
												} else {
													$attribute_array[] = array( 'id' => $key, 'value_name' => null, 'value_id' => '-1' );
												}
											} else {
												$attribute_array[] = array( 'id' => $key, 'value_name' => null, 'value_id' => '-1' );												
											}*/
										} else {
											$attribute_array[] = array( 'id' => $key, 'value_name' => null, 'value_id' => '-1' );
										}
									}
								} else if ( $data[0] == 'value_id' ) {
									if ( $data[1] !="" ) {
										$attribute_array[] = array( 'id' => $key, 'value_id' => $data[1] );
									} else {
										$attribute_array[] = array( 'id' => $key, 'value_id' => '-1', 'value_name' => null );
									}
								} else if ( $data[0] == 'number_unit' ) {
									if (  $data[1] !="" && $data[2] !="" ) {
										$attribute_array[] = array( 'id' => $key, 'value_name' => $data[1].' '.$data[2], 'value_id' => $data[1].$data[2] );
									} else {
										$attribute_array[] = array( 'id' => $key, 'value_name' => null, 'value_id' => '-1' );								
									}
								} else {
									$attribute_array[] = array( 'id' => $key, 'value_name' => null, 'value_id' => null );
								}				
							}
						}
					}
					unset( $data );
				}
			} else if ( $type != "simple" ) {
				if ( $this->get_woomelly_gtin_custom() != "" ) {
					$attribute_array[] = array( 'id' => 'GTIN', 'value_name' => $this->get_woomelly_gtin_custom() );
				}/* else if ( version_compare(WC_VERSION, '9.2.0', '>=') ) {
					if ( $wc_product->get_global_unique_id()!="" ) {
						$attribute_array[] = array( 'id' => 'GTIN', 'value_name' => $wc_product->get_global_unique_id() );
					}
				}*/
			} else if ( $type == "simple" ) {
				/*if ( version_compare(WC_VERSION, '9.2.0', '>=') ) {
					if ( $wc_product->get_global_unique_id()!="" ) {
						$attribute_array[] = array( 'id' => 'GTIN', 'value_name' => $wc_product->get_global_unique_id() );
					}
				}*/
			}			
			if ( $variable_to_simple_multiple == false /*$type == 'simple'*/ ) {
				if ( is_array($wc_product) && isset($wc_product['sku']) ) {
					$woocommerce_sku = $wc_product['sku'];
				} else if ( is_object($wc_product) ) {
					$woocommerce_sku = $wc_product->get_sku();
				}
				if ( $woocommerce_sku != "" ) {
					if ( !is_null($wm_template_sync) ) {
						$woomelly_sku_field = $wm_template_sync->get_woomelly_seller_custom_field();
						$woocommerce_sku = wm_replace_tags( $woomelly_sku_field, array('{sku}' => $woocommerce_sku) );
					}
					$attribute_array[] = array( 'id' => 'SELLER_SKU', 'value_name' => $woocommerce_sku );
				} else {
					$attribute_array[] = array( 'id' => 'SELLER_SKU', 'value_name' => null, 'value_id' => '-1' );
				}
			}
			if ( !is_null($wm_template_sync) ) {
				$woomelly_condition = "";
				$woomelly_condition = $this->get_woomelly_condition();
				if ( $woomelly_condition == "" ) {
					$woomelly_condition = $wm_template_sync->get_woomelly_condition_field();
				}
				$woomelly_condition = apply_filters( 'woomelly__set_condition_ml_woomeli', $woomelly_condition, $this, $wm_template_sync );
				if ( $woomelly_condition != "" ) {
					if ( $woomelly_condition=="used" ) {
						$woomelly_condition = '2230581';
					} else if ( $woomelly_condition=="new" || $woomelly_condition=="not_specified" ) {
						$woomelly_condition = '2230284';
					}
					$attribute_array[] = array( 'id' => 'ITEM_CONDITION', 'value_id' => $woomelly_condition );
				}
			}
			$attribute_array = apply_filters( 'wmf_get_woomelly_attribute_field', $attribute_array, $this->get_id(), $type );
			$attribute_array = apply_filters( 'woomelly__get_woomelly_attribute_field', $attribute_array, $this, $type, $wm_template_sync, $wc_product, $variable_to_simple_multiple );
			return $attribute_array;
		} //End get_woomelly_attribute_field()
	
		public function get_woomelly_single_attribute ( $attribute ) {
			$_return = "";
			if ( $attribute != "" && !empty($this->woomelly_attribute_field) && is_array($this->woomelly_attribute_field) ) {
				foreach ( $this->woomelly_attribute_field as $key => $value ) {
					$data = explode('::', $value);
					if ( in_array($key, array( $attribute ) ) ) {
						if ( is_array($data) && isset($data[1]) ) {
							$_return = $data[1];
						}
						break;
					}
					unset( $data );
				}
			}
			return $_return;
		} //End get_woomelly_single_attribute()
	
		public function get_woomelly_raw_attribute_field () {
			return $this->woomelly_attribute_field;
		} //End get_woomelly_raw_attribute_field()
		
		public function set_woomelly_attribute_field ( $value ) {
			$this->woomelly_attribute_field = $value;
			update_post_meta( $this->product_id, '_wm_attribute', $this->woomelly_attribute_field );
		} //End set_woomelly_attribute_field()
		public function cet_woomelly_attribute_field ( $value ) {
			$this->woomelly_attribute_field = $value;
		}

		public function get_woomelly_variation_field () {
			if ( $this->woomelly_variation_field == "" || !is_array($this->woomelly_variation_field) ) {
				return array();
			} else {
				return array_filter($this->woomelly_variation_field);
			}
		} //End get_woomelly_variation_field()
		
		public function set_woomelly_variation_field ( $value ) {
			$this->woomelly_variation_field = $value;
			update_post_meta( $this->product_id, '_wm_variation', $this->woomelly_variation_field );
		} //End set_woomelly_variation_field()
		public function cet_woomelly_variation_field ( $value ) {
			$this->woomelly_variation_field = $value;
		}

		public function get_woomelly_sync_problem () {
			return boolval($this->woomelly_sync_problem);
		} //End get_woomelly_sync_problem()
	
		public function set_woomelly_sync_problem ( $value ) {
			$this->woomelly_sync_problem = boolval(trim($value));
			update_post_meta( $this->product_id, '_wm_sync_problem', $this->woomelly_sync_problem );
		} //End set_woomelly_sync_problem()
		public function cet_woomelly_sync_problem ( $value ) {
			$this->woomelly_sync_problem = $value;
		}

		public function get_woomelly_sync_problem_msg () {
			return $this->woomelly_sync_problem_msg;
		} //End get_woomelly_sync_problem_msg()
	
		public function set_woomelly_sync_problem_msg ( $value ) {
			$this->woomelly_sync_problem_msg = trim($value);
			update_post_meta( $this->product_id, '_wm_sync_problem_msg', $this->woomelly_sync_problem_msg );
		} //End set_woomelly_sync_problem_msg()
		public function cet_woomelly_sync_problem_msg ( $value ) {
			$this->woomelly_sync_problem_msg = $value;
		}

		public function get_woomelly_sync_warning () {
			return $this->woomelly_sync_warning;
		} //End get_woomelly_sync_warning()

		public function set_woomelly_sync_warning ( $value ) {
			$this->woomelly_sync_warning = trim( $value );
			update_post_meta( $this->product_id, '_wm_sync_warning', $this->woomelly_sync_warning );
		} //End set_woomelly_sync_warning()
		public function cet_woomelly_sync_warning ( $value ) {
			$this->woomelly_sync_warning = $value;
		}

		public function get_woomelly_official_store_id () {
			return $this->woomelly_official_store_id;
		} //End get_woomelly_official_store_id()
	
		public function set_woomelly_official_store_id ( $value ) {
			$this->woomelly_official_store_id = trim($value);
			update_post_meta( $this->product_id, '_wm_official_store_id', $this->woomelly_official_store_id );
		} //End set_woomelly_official_store_id()
		public function cet_woomelly_official_store_id ( $value ) {
			$this->woomelly_official_store_id = $value;
		}

		public function get_woomelly_currency_id () {
			return $this->woomelly_currency_id;
		} //End get_woomelly_currency_id()
	
		public function set_woomelly_currency_id ( $value ) {
			$this->woomelly_currency_id = trim($value);
			update_post_meta( $this->product_id, '_wm_currency_id', $this->woomelly_currency_id );
		} //End set_woomelly_currency_id()
		public function cet_woomelly_currency_id ( $value ) {
			$this->woomelly_currency_id = $value;
		}

		public function get_woomelly_buying_mode () {
			return $this->woomelly_buying_mode;
		} //End get_woomelly_buying_mode()

		public function set_woomelly_buying_mode ( $value ) {
			$this->woomelly_buying_mode = trim($value);
			update_post_meta( $this->product_id, '_wm_buying_mode', $this->woomelly_buying_mode );
		} //End set_woomelly_buying_mode()
		public function cet_woomelly_buying_mode ( $value ) {
			$this->woomelly_buying_mode = $value;
		}

		public function get_woomelly_listing_type_id () {
			return $this->woomelly_listing_type_id;
		} //End get_woomelly_listing_type_id()
	
		public function set_woomelly_listing_type_id ( $value ) {
			$this->woomelly_listing_type_id = trim($value);
			update_post_meta( $this->product_id, '_wm_listing_type_id', $this->woomelly_listing_type_id );
		} //End set_woomelly_listing_type_id()
		public function cet_woomelly_listing_type_id ( $value ) {
			$this->woomelly_listing_type_id = $value;
		}

		public function get_woomelly_condition () {
			if ( $this->woomelly_condition == "new" ) {
				$this->woomelly_condition = "2230284";
			} else if ( $this->woomelly_condition == "used" ) {
				$this->woomelly_condition = "2230581";
			}
			return $this->woomelly_condition;
		} //End get_woomelly_condition()
	
		public function set_woomelly_condition ( $value ) {
			$this->woomelly_condition = trim($value);
			update_post_meta( $this->product_id, '_wm_condition', $this->woomelly_condition );
		} //End set_woomelly_condition()
		public function cet_woomelly_condition ( $value ) {
			$this->woomelly_condition = $value;
		}

		public function get_woomelly_imported () {
			return $this->woomelly_imported;
		} //End get_woomelly_imported()
	
		public function set_woomelly_imported ( $value ) {
			$this->woomelly_imported = trim($value);
			update_post_meta( $this->product_id, '_wm_imported', $this->woomelly_imported );
		} //End set_woomelly_imported()
		public function cet_woomelly_imported ( $value ) {
			$this->woomelly_imported = $value;
		}

		public function get_woomelly_is_multiple ( $validate = false ) {
			if ( $validate == true ) {
				$variable_to_simple = wm_product_validate_is_multiple( $this->get_id(), $this );
				return $variable_to_simple;
			}
			return boolval( $this->woomelly_is_multiple );
		} //End get_woomelly_is_multiple()
	
		public function set_woomelly_is_multiple ( $value ) {
			$this->woomelly_is_multiple = boolval($value);
			update_post_meta( $this->product_id, '_wm_is_multiple', $this->woomelly_is_multiple );
		} //End set_woomelly_is_multiple()
		public function cet_woomelly_is_multiple ( $value ) {
			$this->woomelly_is_multiple = $value;
		}

		public function get_woomelly_tags () {
			if ( !is_array($this->woomelly_tags) ) {
				return array();
			}
			return $this->woomelly_tags;
		} //End get_woomelly_tags()
	
		public function set_woomelly_tags ( $value ) {
			if ( !is_array($value) ) {
				$value = array();
			}
			if ( !empty($this->get_woomelly_tags()) ) {
				$wm_admin_tags = wm_admin_tags();
				$new_list_tags = $value;
				foreach ( $this->get_woomelly_tags() as $value_tag )  {
					if ( !in_array( $value_tag, $new_list_tags ) ) {
						if ( in_array( $value_tag, $wm_admin_tags ) ) {
							$new_list_tags[] = $value_tag;
						}
					}
				}
				unset( $this->woomelly_tags );
				$this->woomelly_tags = $new_list_tags;
			} else {
				unset( $this->woomelly_tags );
				$this->woomelly_tags = $value;				
			}
			update_post_meta( $this->product_id, '_wm_tags', $this->woomelly_tags );
		} //End set_woomelly_tags()
		public function cet_woomelly_tags ( $value ) {
			$this->woomelly_tags = $value;
		}
	
		public function add_woomelly_tags ( $value ) {
			if ( !is_array($this->woomelly_tags) ) {
				$this->woomelly_tags = array();
			}
			if ( !in_array( $value, $this->woomelly_tags) ) {
				$this->woomelly_tags[] = $value;
				update_post_meta( $this->product_id, '_wm_tags', $this->woomelly_tags );
			}
		}

		public function get_woomelly_shipping_mode () {
			return $this->woomelly_shipping_mode;
		} //End get_woomelly_shipping_mode()
	
		public function set_woomelly_shipping_mode ( $value ) {
			$this->woomelly_shipping_mode = trim($value);
			update_post_meta( $this->product_id, '_wm_shipping_mode', $this->woomelly_shipping_mode );
		} //End set_woomelly_shipping_mode()
		public function cet_woomelly_shipping_mode ( $value ) {
			$this->woomelly_shipping_mode = $value;
		}

		public function get_woomelly_free_methods () {
			return $this->woomelly_free_methods;
		} //End get_woomelly_free_methods()
	
		public function set_woomelly_free_methods ( $value ) {
			$this->woomelly_free_methods = trim($value);
			update_post_meta( $this->product_id, '_wm_free_methods', $this->woomelly_free_methods );
		} //End set_woomelly_free_methods()
		public function cet_woomelly_free_methods ( $value ) {
			$this->woomelly_free_methods = $value;
		}

		public function get_woomelly_costs () {
			return $this->woomelly_costs;
		} //End get_woomelly_costs()

		public function set_woomelly_costs ( $value ) {
			$this->woomelly_costs = trim($value);
			update_post_meta( $this->product_id, '_wm_costs', $this->woomelly_costs );
		} //End set_woomelly_costs()
		public function cet_woomelly_costs ( $value ) {
			$this->woomelly_costs = $value;
		}

		public function get_woomelly_video_id () {
			if ( !is_string($this->woomelly_video_id) ) $this->woomelly_video_id = "";
			return $this->woomelly_video_id;
		} //End get_woomelly_video_id()
	
		public function set_woomelly_video_id ( $value ) {
			$this->woomelly_video_id = trim($value);
			if ( !is_string($this->woomelly_video_id) ) $this->woomelly_video_id = "";
			update_post_meta( $this->product_id, '_wm_video_id', $this->woomelly_video_id );
		} //End set_woomelly_video_id()
		public function cet_woomelly_video_id ( $value ) {
			$this->woomelly_video_id = $value;
		}

		public function get_woomelly_warranty () {
			return $this->woomelly_warranty;
		} //End get_woomelly_warranty()
	
		public function set_woomelly_warranty ( $value ) {
			$this->woomelly_warranty = trim($value);
			update_post_meta( $this->product_id, '_wm_warranty', $this->woomelly_warranty );
		} //End set_woomelly_warranty()
		public function cet_woomelly_warranty ( $value ) {
			$this->woomelly_warranty = $value;
		}

		public function get_woomelly_factory_warranty () {
			if ( !is_array($this->woomelly_factory_warranty) ) {
				$this->woomelly_factory_warranty = array('', '');
			}
			if ( !isset($this->woomelly_factory_warranty[0]) )
				$this->woomelly_factory_warranty[0] = "";
			if ( !isset($this->woomelly_factory_warranty[1]) )
				$this->woomelly_factory_warranty[1] = "";
			return $this->woomelly_factory_warranty;
		} //End get_woomelly_factory_warranty()
	
		public function set_woomelly_factory_warranty ( $value ) {
			if ( !is_array($value) ) {
				$value = array('', '');
			}			
			$this->woomelly_factory_warranty = $value;
			update_post_meta( $this->product_id, '_wm_factory_warranty', $this->woomelly_factory_warranty );
		} //End set_woomelly_factory_warranty()
		public function cet_woomelly_factory_warranty ( $value ) {
			$this->woomelly_factory_warranty = $value;
		}

		public function get_woomelly_seller_warranty () {
			if ( !is_array($this->woomelly_seller_warranty) ) {
				$this->woomelly_seller_warranty = array('', '');
			}
			if ( !isset($this->woomelly_seller_warranty[0]) )
				$this->woomelly_seller_warranty[0] = "";
			if ( !isset($this->woomelly_seller_warranty[1]) )
				$this->woomelly_seller_warranty[1] = "";			
			return $this->woomelly_seller_warranty;
		} //End get_woomelly_seller_warranty()
	
		public function set_woomelly_seller_warranty ( $value ) {
			if ( !is_array($value) ) {
				$value = array('', '');
			}			
			$this->woomelly_seller_warranty = $value;
			update_post_meta( $this->product_id, '_wm_seller_warranty', $this->woomelly_seller_warranty );
		} //End set_woomelly_seller_warranty()
		public function cet_woomelly_seller_warranty ( $value ) {
			$this->woomelly_seller_warranty = $value;
		}

		public function get_woomelly_accepts_mercadopago () {
			return $this->woomelly_accepts_mercadopago;
		} //End get_woomelly_accepts_mercadopago()
	
		public function set_woomelly_accepts_mercadopago ( $value ) {
			$this->woomelly_accepts_mercadopago = trim($value);
			update_post_meta( $this->product_id, '_wm_accepts_mercadopago', $this->woomelly_accepts_mercadopago );
		} //End set_woomelly_accepts_mercadopago()
		public function cet_woomelly_accepts_mercadopago ( $value ) {
			$this->woomelly_accepts_mercadopago = $value;
		}

		public function get_woomelly_shipping_local_pick_up () {
			return $this->woomelly_shipping_local_pick_up;
		} //End get_woomelly_shipping_local_pick_up()
	
		public function set_woomelly_shipping_local_pick_up ( $value ) {
			$this->woomelly_shipping_local_pick_up = trim($value);
			update_post_meta( $this->product_id, '_wm_shipping_local_pick_up', $this->woomelly_shipping_local_pick_up );
		} //End set_woomelly_shipping_local_pick_up()
		public function cet_woomelly_shipping_local_pick_up ( $value ) {
			$this->woomelly_shipping_local_pick_up = $value;
		}

		public function get_woomelly_shipping_free_shipping () {
			return $this->woomelly_shipping_free_shipping;
		} //End get_woomelly_shipping_free_shipping()
	
		public function set_woomelly_shipping_free_shipping ( $value ) {
			$this->woomelly_shipping_free_shipping = trim($value);
			update_post_meta( $this->product_id, '_wm_shipping_free_shipping', $this->woomelly_shipping_free_shipping );
		} //End set_woomelly_shipping_free_shipping()
		public function cet_woomelly_shipping_free_shipping ( $value ) {
			$this->woomelly_shipping_free_shipping = $value;
		}

		public function get_woomelly_shipping_free_shipping_ms () {
			return $this->woomelly_shipping_free_shipping_ms;
		} //End get_woomelly_shipping_free_shipping_ms()
	
		public function set_woomelly_shipping_free_shipping_ms ( $value ) {
			$this->woomelly_shipping_free_shipping_ms = trim($value);
			update_post_meta( $this->product_id, '_wm_shipping_free_shipping_ms', $this->woomelly_shipping_free_shipping_ms );
		} //End set_woomelly_shipping_free_shipping()
		public function cet_woomelly_shipping_free_shipping_ms ( $value ) {
			$this->woomelly_shipping_free_shipping_ms = $value;
		}

		public function get_woomelly_shipping_flex () {
			return $this->woomelly_shipping_flex;
		} //End get_woomelly_shipping_flex()
	
		public function set_woomelly_shipping_flex ( $value ) {
			$this->woomelly_shipping_flex = trim($value);
			update_post_meta( $this->product_id, '_wm_shipping_flex', $this->woomelly_shipping_flex );
		} //End set_woomelly_shipping_flex()
		public function cet_woomelly_shipping_flex ( $value ) {
			$this->woomelly_shipping_flex = $value;
		}

		public function get_woomelly_location () {
			if ( !is_array($this->woomelly_location) || $this->woomelly_location == "" ) {
				$this->woomelly_location = array(
					'country' => '',
					'state' => '',
					'city' => '',
					'neighborhood' => ''
				);
			}
			if ( !isset($this->woomelly_location['neighborhood']) ) {
				$this->woomelly_location['neighborhood'] = "";	
			}
			return $this->woomelly_location;
		} //End get_woomelly_location()
	
		public function set_woomelly_location ( $value ) {
			$value['country'] = trim($value['country']);
			$value['state'] = trim($value['state']);
			$value['city'] = trim($value['city']);
			$value['neighborhood'] = trim($value['neighborhood']);
			$this->woomelly_location = $value;
			update_post_meta( $this->product_id, '_wm_location', $this->woomelly_location );
		} //End set_woomelly_location()
		public function cet_woomelly_location ( $value ) {
			$this->woomelly_location = $value;
		}

		public function get_woomelly_listing_type_saved () {
			if ( $this->woomelly_listing_type_saved == 'pcj_co_funded' ) {
				$this->woomelly_listing_type_saved = 'gold_special';	
			} else if ( $this->woomelly_listing_type_saved == '3x_campaign' ) {
				$this->woomelly_listing_type_saved = 'gold_pro';
			} else if ( $this->woomelly_listing_type_saved == '9x_campaign' ) {
				$this->woomelly_listing_type_saved = 'gold_pro';
			} else if ( $this->woomelly_listing_type_saved == '12x_campaign' ) {
				$this->woomelly_listing_type_saved = 'gold_pro';
			}
			return $this->woomelly_listing_type_saved;
		} //End get_woomelly_listing_type_saved()
	
		public function set_woomelly_listing_type_saved ( $value ) {
			$this->woomelly_listing_type_saved = trim($value);
			if ( $this->woomelly_listing_type_saved == 'pcj_co_funded' ) {
				$this->woomelly_listing_type_saved = 'gold_special';	
			} else if ( $this->woomelly_listing_type_saved == '3x_campaign' ) {
				$this->woomelly_listing_type_saved = 'gold_pro';
			} else if ( $this->woomelly_listing_type_saved == '9x_campaign' ) {
				$this->woomelly_listing_type_saved = 'gold_pro';
			} else if ( $this->woomelly_listing_type_saved == '12x_campaign' ) {
				$this->woomelly_listing_type_saved = 'gold_pro';
			}
			update_post_meta( $this->product_id, '_wm_listing_type_saved', $this->woomelly_listing_type_saved );
		} //End set_woomelly_listing_type_saved()
		public function cet_woomelly_listing_type_saved ( $value ) {
			$this->woomelly_listing_type_saved = $value;
		}

		public function get_woomelly_seller_phones () {
			if ( $this->woomelly_seller_phones == "" ) {
				$this->woomelly_seller_phones = array('', '', '', '', '', '');
			}
			return $this->woomelly_seller_phones;
		} //End get_woomelly_seller_phones()
		
		public function set_woomelly_seller_phones ( $value ) {
			if ( !is_array($value) ) {
				$this->woomelly_seller_phones = array('', '', '', '', '', '');
			} else {
				$this->woomelly_seller_phones = $value;
			}
			update_post_meta( $this->product_id, '_wm_seller_phones', $this->woomelly_seller_phones );
		} //End set_woomelly_seller_phones()
		public function cet_woomelly_seller_phones ( $value ) {
			$this->woomelly_seller_phones = $value;
		}

		public function get_woomelly_seller_emails () {
			if ( $this->woomelly_seller_emails == "" ) {
				$this->woomelly_seller_emails = array('', '');
			}
			return $this->woomelly_seller_emails;
		} //End get_woomelly_seller_emails()
	
		public function set_woomelly_seller_emails ( $value ) {
			if ( !is_array($value) ) {
				$this->woomelly_seller_emails = array('', '');
			} else {
				$this->woomelly_seller_emails = $value;
			}
			update_post_meta( $this->product_id, '_wm_seller_emails', $this->woomelly_seller_emails );
		} //End set_woomelly_seller_emails()
		public function cet_woomelly_seller_emails ( $value ) {
			$this->woomelly_seller_emails = $value;
		}

		public function get_woomelly_seller_extra_info () {
			if ( $this->woomelly_seller_extra_info == "" ) {
				$this->woomelly_seller_extra_info = array('', '');
			}
			return $this->woomelly_seller_extra_info;
		} //End get_woomelly_seller_extra_info()
	
		public function set_woomelly_seller_extra_info ( $value ) {
			if ( !is_array($value) ) {
				$this->woomelly_seller_extra_info = array('', '');
			} else {
				$this->woomelly_seller_extra_info = $value;
			}
			update_post_meta( $this->product_id, '_wm_seller_extra_info', $this->woomelly_seller_extra_info );
		} //End set_woomelly_seller_extra_info()
		public function cet_woomelly_seller_extra_info ( $value ) {
			$this->woomelly_seller_extra_info = $value;
		}

		public function get_seller_contact () {
			$seller_contact = array();

			$seller_contact_phones = $this->get_woomelly_seller_phones();
			if ( $seller_contact_phones[0] != "" && $seller_contact_phones[1] != "" && $seller_contact_phones[2] != "" ) {
				$seller_contact['country_code'] = $seller_contact_phones[0];
				$seller_contact['area_code'] = $seller_contact_phones[1];
				$seller_contact['phone'] = $seller_contact_phones[2];		
			}
			if ( $seller_contact_phones[3] != "" && $seller_contact_phones[4] != "" && $seller_contact_phones[5] != "" ) {
				$seller_contact['country_code2'] = $seller_contact_phones[3];
				$seller_contact['area_code2'] = $seller_contact_phones[4];
				$seller_contact['phone2'] = $seller_contact_phones[5];		
			}
			$seller_contact_emails = $this->get_woomelly_seller_emails();
			if ( $seller_contact_emails[0] ) {
				$seller_contact['email'] = $seller_contact_emails[0];
			}
			if ( $seller_contact_emails[1] ) {
				$seller_contact['webpage'] = $seller_contact_emails[1];
			}
			$seller_contact_extra_info = $this->get_woomelly_seller_extra_info();
			if ( $seller_contact_extra_info[0] ) {
				$seller_contact['contact'] = $seller_contact_extra_info[0];
			}
			if ( $seller_contact_extra_info[1] ) {
				$seller_contact['other_info'] = $seller_contact_extra_info[1];
			}
			
			return $seller_contact;
		}  //End get_seller_contact()

		public function get_woomelly_location_address () {
			if ( $this->woomelly_location_address == "" ) {
				$this->woomelly_location_address = array('', '');
			}
			return $this->woomelly_location_address;
		} //End get_woomelly_location_address()
	
		public function set_woomelly_location_address ( $value ) {
			if ( !is_array($value) ) {
				$this->woomelly_location_address = array('', '');
			} else {
				$this->woomelly_location_address = $value;
			}
			update_post_meta( $this->product_id, '_wm_location_address', $this->woomelly_location_address );
		} //End set_woomelly_location_address()
		public function cet_woomelly_location_address ( $value ) {
			$this->woomelly_location_address = $value;
		}

		public function get_woomelly_variation_price ( $format = false ) {
			$this->woomelly_variation_price = floatval( $this->woomelly_variation_price );
			return $this->woomelly_variation_price;
		} //End get_woomelly_variation_price()

		public function set_woomelly_variation_price ( $value ) {
			$value = trim($value);
			$value = floatval( str_replace(",", ".", $value) );
			$this->woomelly_variation_price = number_format( $value, wc_get_price_decimals(), '.', '' );
			update_post_meta( $this->product_id, '_wm_variation_price', $this->woomelly_variation_price );
		} //End set_woomelly_variation_price()
		public function cet_woomelly_variation_price ( $value ) {
			$this->woomelly_variation_price = $value;
		}

		public function get_woomelly_variation_price_ms ( $format = false ) {
			$this->woomelly_variation_price_ms = floatval( $this->woomelly_variation_price_ms );
			return $this->woomelly_variation_price_ms;
		} //End get_woomelly_variation_price_ms()

		public function set_woomelly_variation_price_ms ( $value ) {
			$value = trim($value);
			$value = floatval( str_replace(",", ".", $value) );
			$this->woomelly_variation_price_ms = number_format( $value, wc_get_price_decimals(), '.', '' );
			update_post_meta( $this->product_id, '_wm_variation_price_ms', $this->woomelly_variation_price_ms );
		} //End set_woomelly_variation_price_ms()
		public function cet_woomelly_variation_price_ms ( $value ) {
			$this->woomelly_variation_price_ms = $value;
		}

		public function get_woomelly_type_price () {
			return $this->woomelly_type_price;
		} //End get_woomelly_type_price()
	
		public function set_woomelly_type_price ( $value ) {
			$value = trim($value);
			$this->woomelly_type_price = $value;
			update_post_meta( $this->product_id, '_wm_type_price', $this->woomelly_type_price );
		} //End set_woomelly_type_price()
		public function cet_woomelly_type_price ( $value ) {
			$this->woomelly_type_price = $value;
		}

		public function get_woomelly_orders () {
			if ( !is_array($this->woomelly_orders) ) {
				$this->woomelly_orders = array();
			}
			return $this->woomelly_orders;
		} //End get_woomelly_orders()
	
		public function set_woomelly_order ( $value ) {
			$value = trim($value);
			$all_orders = $this->get_woomelly_orders();
			$all_orders[] = $value;
			$this->set_woomelly_orders($all_orders);
		} //End set_woomelly_order()
	
		public function set_woomelly_orders ( $value ) {
			if ( !is_array($value) ) {
				$this->woomelly_orders = array();
			} else {
				$this->woomelly_orders = $value;
			}
			update_post_meta( $this->product_id, '_wm_orders', $this->woomelly_orders );
		} //End set_woomelly_orders()
		public function cet_woomelly_orders ( $value ) {
			$this->woomelly_orders = $value;
		}

		public function get_woomelly_orders_cancelled () {
			if ( !is_array($this->woomelly_orders_cancelled) ) {
				$this->woomelly_orders_cancelled = array();
			}
			return $this->woomelly_orders_cancelled;
		} //End get_woomelly_orders_cancelled()

		public function set_woomelly_order_cancelled ( $value ) {
			$value = trim($value);
			$all_orders = $this->get_woomelly_orders_cancelled();
			$all_orders[] = $value;
			$this->set_woomelly_orders_cancelled($all_orders);
		} //End set_woomelly_order_cancelled()
	
		public function set_woomelly_orders_cancelled ( $value ) {
			if ( !is_array($value) ) {
				$this->woomelly_orders_cancelled = array();
			} else {
				$this->woomelly_orders_cancelled = $value;
			}
			update_post_meta( $this->product_id, '_wm_orders_cancelled', $this->woomelly_orders_cancelled );
		} //End set_woomelly_orders_cancelled()
		public function cet_woomelly_orders_cancelled ( $value ) {
			$this->woomelly_orders_cancelled = $value;
		}

		public function get_woomelly_all_orders ( $format = false ) {
			$orders_ok = array();
			$orders_nook = array();
			$all_orders = array();
			if ( is_array($this->woomelly_orders) ) {
				$orders_ok = $this->woomelly_orders;
			}
			if ( is_array($this->woomelly_orders_cancelled) ) {
				$orders_nook = $this->woomelly_orders_cancelled;
			}
			$all_orders = array_merge( $orders_ok, $orders_nook );
			if ( !empty($all_orders) ) {
				$all_orders_temp0 = $all_orders;
				unset($all_orders);
				$all_orders = array();
				foreach ( $all_orders_temp0 as $s ) {
					if ( !in_array($s, $all_orders) ) {
						$all_orders[] = $s;
					}
				}
			}
			$wc_product = wc_get_product( $this->get_id() );
			if ( is_object($wc_product) ) {
				$available_variations = wm_get_available_variations( $wc_product );
				if ( !empty($available_variations) ) {
					foreach ( $available_variations as $variation ) {
						$wm_child_orders_cancelled = wm_get_meta_data( $variation['variation_id'], '_wm_orders_cancelled', true );
						//$wm_child_orders_cancelled = get_post_meta( $variation['variation_id'], '_wm_orders_cancelled', true );
						$wm_child_orders = wm_get_meta_data( $variation['variation_id'], '_wm_orders', true );
						//$wm_child_orders = get_post_meta( $variation['variation_id'], '_wm_orders', true );
						if ( is_array($wm_child_orders_cancelled) && !empty($wm_child_orders_cancelled) ) {
							foreach ( $wm_child_orders_cancelled as $value_cancelled ) {
								if ( !in_array($value_cancelled, $all_orders) ) {
									$all_orders[] = $value_cancelled;
								}
							}
						}
						if ( is_array($wm_child_orders) && !empty($wm_child_orders) ) {
							foreach ( $wm_child_orders as $value_notcancelled ) {
								if ( !in_array($value_notcancelled, $all_orders) ) {
									$all_orders[] = $value_notcancelled;
									$orders_ok[] = $value_notcancelled;
								}
							}
						}
						unset($wm_child_orders_cancelled);
						unset($wm_child_orders);
					}
				}
			}
			if ( $format == true ) {
				$comma = false;
				$print_orders = "";
				foreach ( $all_orders as $value ) {
					if ( in_array($value, $orders_ok) ) {
						if ( $comma == false ) {
							$print_orders .= '<span style="color:green;">'.$value.'</span>';
							$comma = true;
						} else {
							$print_orders .= ', <span style="color:green;">'.$value.'</span>';
						}
					} else {
						if ( $comma == false ) {
							$print_orders .= '<span style="color:red;">'.$value.'</span>';
							$comma = true;
						} else {
							$print_orders .= ', <span style="color:red;">'.$value.'</span>';
						}
					}
				}
				unset( $all_orders );
				$all_orders = $print_orders;
			}
			return $all_orders;
		} //End get_woomelly_orders()

		public function get_woomelly_last_updated ( $format = null ) {
			$woomelly_last_updated = '';
			if ( $format == null ) {
				$woomelly_last_updated = strtotime($this->woomelly_last_updated);
				//$woomelly_last_updated = strtotime($this->woomelly_last_updated.' UTC');	
			}
			return $woomelly_last_updated;
		} //End get_woomelly_last_updated()
	
		public function set_woomelly_last_updated ( $value ) {
			$value = trim($value);
			$this->woomelly_last_updated = $value;
			update_post_meta( $this->product_id, '_wm_last_updated', $this->woomelly_last_updated );
		} //End set_woomelly_last_updated()
		public function cet_woomelly_last_updated ( $value ) {
			$this->woomelly_last_updated = $value;
		}

		public function get_woomelly_images () {
			if ( !is_array($this->woomelly_images) ) {
				$this->woomelly_images = array();
			}
			return $this->woomelly_images;
		} //End get_woomelly_images()

		public function get_woomelly_images_status () {
			if ( !is_array($this->woomelly_images) ) {
				return false;
			} else {
				if ( empty($this->woomelly_images) ) {
					return false;
				} else {
					$success = 0;
					foreach ( $this->woomelly_images as $value ) {
						if ( $value && $value != "" ) {
							$success++;
						}
					}
					if ( $success == 0 ) {
						return false;
					}
				}
			}
			return true;
		} //End get_woomelly_images_status()
	
		public function set_woomelly_images ( $value ) {
			if ( !is_array($value) ) {
				$value = array();
			}
			$this->woomelly_images = $value;
			update_post_meta( $this->product_id, '_wm_images', $this->woomelly_images );
		} //End set_woomelly_images()
		public function cet_woomelly_images ( $value ) {
			$this->woomelly_images = $value;
		}

		public function get_woomelly_images_variations () {
			if ( !is_array($this->woomelly_images_variations) ) {
				$this->woomelly_images_variations = array();
			}
			return $this->woomelly_images_variations;
		} //End get_woomelly_images_variations()

		public function get_woomelly_images_variations_status () {
			$_return = true;
			if ( empty($this->get_woomelly_images_variations()) ) {
				$_return = false;
			} else {
				$success = 0;
				foreach ( $this->get_woomelly_images_variations() as $value ) {
					if ( intval($value) > 0 ) {
						$success++;
					}
				}
				if ( $success == 0 ) {
					$_return = false;
				}
			}
			return $_return;
		} //End get_woomelly_images_variations_status()
	
		public function set_woomelly_images_variations ( $value ) {
			if ( !is_array($value) ) {
				$value = array();
			}
			$this->woomelly_images_variations = $value;
			update_post_meta( $this->product_id, '_wm_images_variations', $this->woomelly_images_variations );
		} //End set_woomelly_images_variations()
		public function cet_woomelly_images_variations ( $value ) {
			$this->woomelly_images_variations = $value;
		}

		public function get_woomelly_images_updated () {
			if ( !is_array($this->woomelly_images_updated) ) {
				$this->woomelly_images_updated = array();
			}
			return $this->woomelly_images_updated;
		} //End get_woomelly_images_updated()
	
		public function set_woomelly_images_updated ( $value ) {
			if ( !is_array($value) ) {
				$this->woomelly_images_updated = array();	
			} else {
				$this->woomelly_images_updated = $value;				
			}
			update_post_meta( $this->product_id, '_wm_images_updated', $this->woomelly_images_updated );
		} //End set_woomelly_images_updated()
		public function cet_woomelly_images_updated ( $value ) {
			$this->woomelly_images_updated = $value;
		}

		public function get_woomelly_characteristic () {
			if ( !is_array($this->woomelly_characteristic) ) {
				$this->woomelly_characteristic = array();
			}
			$this->woomelly_characteristic = apply_filters( 'wmfilter_woomelly_clean_characteristic_field', $this->woomelly_characteristic, $this );
			return $this->woomelly_characteristic;
		} //End get_woomelly_characteristic()

		public function set_woomelly_characteristic ( $value ) {
			if ( !is_array($value) ) {
				$this->woomelly_characteristic = array();	
			} else {
				$this->woomelly_characteristic = $value;				
			}
			$this->woomelly_characteristic = apply_filters( 'wmfilter_woomelly_set_characteristic_field', $this->woomelly_characteristic, $this );
			update_post_meta( $this->product_id, '_wm_simple_variations', $this->woomelly_characteristic );
		} //End set_woomelly_characteristic()
		public function cet_woomelly_characteristic ( $value ) {
			$this->woomelly_characteristic = $value;
		}

		public function get_woomelly_characteristicc () {
			if ( !is_array($this->woomelly_characteristicc) ) {
				$this->woomelly_characteristicc = array();
			}
			$this->woomelly_characteristicc = apply_filters( 'wmfilter_woomelly_clean_characteristicc_field', $this->woomelly_characteristicc, $this );
			return $this->woomelly_characteristicc;
		} //End get_woomelly_characteristicc()
	
		public function set_woomelly_characteristicc ( $value ) {
			if ( !is_array($value) ) {
				$this->woomelly_characteristicc = array();	
			} else {
				$this->woomelly_characteristicc = $value;				
			}
			$this->woomelly_characteristicc = apply_filters( 'wmfilter_woomelly_set_characteristicc_field', $this->woomelly_characteristicc, $this );
			update_post_meta( $this->product_id, '_wm_simple_variationsc', $this->woomelly_characteristicc );
		} //End set_woomelly_characteristic()
		public function cet_woomelly_characteristicc ( $value ) {
			$this->woomelly_characteristicc = $value;
		}

		public function get_woomelly_communication_type () {
			return $this->woomelly_communication_type;
		} //End get_woomelly_communication_type()
	
		public function set_woomelly_communication_type ( $value ) {
			$this->woomelly_communication_type = trim($value);				
			update_post_meta( $this->product_id, '_wm_communication_type', $this->woomelly_communication_type );
		} //End set_woomelly_communication_type()
		public function cet_woomelly_communication_type ( $value ) {
			$this->woomelly_communication_type = $value;
		}

		public function get_woomelly_total_views () {
			return intval($this->woomelly_total_views);
		} //End get_woomelly_total_views()

		public function set_woomelly_total_views ( $value ) {
			$this->woomelly_total_views = intval($value);				
			update_post_meta( $this->product_id, '_wm_total_views', $this->woomelly_total_views );
		} //End set_woomelly_total_views()
		public function cet_woomelly_total_views ( $value ) {
			$this->woomelly_total_views = $value;				
		}

		public function get_woomelly_total_sales () {
			return intval($this->woomelly_total_sales);
		} //End get_woomelly_total_sales()
	
		public function set_woomelly_total_sales ( $value ) {
			$this->woomelly_total_sales = intval($value);				
			update_post_meta( $this->product_id, '_wm_total_sales', $this->woomelly_total_sales );
		} //End set_woomelly_total_sales()
		public function cet_woomelly_total_sales ( $value ) {
			$this->woomelly_total_sales = $value;				
		}

		public function get_woomelly_manufacturing_time () {
			if ( !is_numeric($this->woomelly_manufacturing_time) ) {
				$this->woomelly_manufacturing_time = (-1);
			}
			return intval($this->woomelly_manufacturing_time);
		} //End get_woomelly_manufacturing_time()
	
		public function set_woomelly_manufacturing_time ( $value ) {
			$this->woomelly_manufacturing_time = intval($value);				
			update_post_meta( $this->product_id, '_wm_manufacturing_time', $this->woomelly_manufacturing_time );
		} //End set_woomelly_manufacturing_time()
		public function cet_woomelly_manufacturing_time ( $value ) {
			$this->woomelly_manufacturing_time = $value;				
		}

		public function get_woomelly_logistic_type () {
			return $this->woomelly_logistic_type;
		} //End get_woomelly_logistic_type()
		
		public function set_woomelly_logistic_type ( $value ) {
			$value = trim($value);
			$this->woomelly_logistic_type = $value;
			update_post_meta( $this->product_id, '_wm_logistic_type', $this->woomelly_logistic_type );
		} //End set_woomelly_logistic_type()
		public function cet_woomelly_logistic_type ( $value ) {
			$this->woomelly_logistic_type = $value;				
		}

		public function get_woomelly_domain_id () {
			return $this->woomelly_domain_id;
		} //End get_woomelly_domain_id()
	
		public function set_woomelly_domain_id ( $value ) {
			$value = trim($value);
			if ( is_null($value) ) $value = "";
			$this->woomelly_domain_id = $value;
			update_post_meta( $this->product_id, '_wm_domain_id', $this->woomelly_domain_id );
		} //End set_woomelly_domain_id()
		public function cet_woomelly_domain_id ( $value ) {
			$this->woomelly_domain_id = $value;				
		}

		public function get_woomelly_seller_id () {
			return $this->woomelly_seller_id;
		} //End get_woomelly_seller_id()
	
		public function set_woomelly_seller_id ( $value ) {
			$value = trim($value);
			if ( is_null($value) ) {
				$value = "";
			}
			$this->woomelly_seller_id = $value;
			update_post_meta( $this->product_id, '_wm_seller_id', $this->woomelly_seller_id );
		} //End set_woomelly_seller_id()
		public function cet_woomelly_seller_id ( $value ) {
			$this->woomelly_seller_id = $value;				
		}

		public function get_woomelly_channels () {
			return $this->woomelly_channels;
		} //End get_woomelly_channels()
	
		public function set_woomelly_channels ( $value ) {
			$value = trim($value);
			if ( is_null($value) ) {
				$value = "";
			}
			$this->woomelly_channels = $value;
			update_post_meta( $this->product_id, '_wm_channels', $this->woomelly_channels );
		} //End set_woomelly_channels()
		public function cet_woomelly_channels ( $value ) {
			$this->woomelly_channels = $value;				
		}

		public function get_woomelly_channels_ml () {
			return $this->woomelly_channels_ml;
		} //End get_woomelly_channels()

		public function set_woomelly_channels_ml ( $value ) {
			$this->woomelly_channels_ml = trim($value);
			update_post_meta( $this->product_id, '_wm_channels_ml', $this->woomelly_channels_ml );
		} //End set_woomelly_channels()
		public function cet_woomelly_channels_ml ( $value ) {
			$this->woomelly_channels_ml = $value;				
		}
		public function get_woomelly_separate_variations () {
			return $this->woomelly_separate_variations;
		} //End get_woomelly_separate_variations()
		
		public function set_woomelly_separate_variations ( $value ) {
			$this->woomelly_separate_variations = trim($value);
			update_post_meta( $this->product_id, '_wm_separate_variations', $this->woomelly_separate_variations );
			$this->woomelly_is_multiple = $this->get_woomelly_is_multiple( true );
			update_post_meta( $this->product_id, '_wm_is_multiple', $this->woomelly_is_multiple );
		} //End set_woomelly_separate_variations()
		public function cet_woomelly_separate_variations ( $value ) {
			$this->woomelly_separate_variations = $value;				
		}

		public function get_woomelly_omit_data () {
			if ( !is_array($this->woomelly_omit_data) || empty($this->woomelly_omit_data) ) {
				unset( $this->woomelly_omit_data );
				$this->woomelly_omit_data = array_pad( array(), 20, '' );
			}
			return $this->woomelly_omit_data;
		} //End get_woomelly_omit_data()
		
		public function set_woomelly_omit_data ( $value ) {
			if ( !is_array($value) || empty($value) ) {
				unset( $value );
				$value = array_pad( array(), 20, '' );
			}
			$this->woomelly_omit_data = $value;
			update_post_meta( $this->product_id, '_wm_omit_data', $this->woomelly_omit_data );
		} //End set_woomelly_separate_variations()
		public function cet_woomelly_omit_data ( $value ) {
			$this->woomelly_omit_data = $value;				
		}

		public function get_woomelly_gtin_custom () {
			return $this->woomelly_gtin_custom;
		} //End get_woomelly_gtin_custom()
		
		public function set_woomelly_gtin_custom ( $value ) {
			$value = trim( $value );
			$this->woomelly_gtin_custom = $value;
			update_post_meta( $this->product_id, '_wm_gtin_custom', $this->woomelly_gtin_custom );
		} //End set_woomelly_separate_variations()
		public function cet_woomelly_gtin_custom ( $value ) {
			$this->woomelly_gtin_custom = $value;				
		}

		public function get_woomelly_limit_per_sales () {
			return $this->woomelly_limit_per_sales;
		} //End get_woomelly_limit_per_sales()
		
		public function set_woomelly_limit_per_sales ( $value ) {
			$value = trim($value);
			if ( $value == 'NA' || intval($value) > 0 ) {
				$this->woomelly_limit_per_sales = $value;
			} else {
				$this->woomelly_limit_per_sales = "";
			}
			update_post_meta( $this->product_id, '_wm_limit_per_sales', $this->woomelly_limit_per_sales );
		} //End set_woomelly_limit_per_sales()
		public function cet_woomelly_limit_per_sales ( $value ) {
			$this->woomelly_limit_per_sales = $value;				
		}

		public function get_woomelly_health ( $format = false ) {
			if ( $format == true ) {
				$health_aux = floatval($this->woomelly_health) * 100;
				if ( $health_aux <=0 ) {
					return "";
				} else {
					return $health_aux;
				}
			}
			return $this->woomelly_health;
		} //End get_woomelly_health()
		
		public function set_woomelly_health ( $value ) {
			$value = floatval($value);
			$this->woomelly_health = $value;
			update_post_meta( $this->product_id, '_wm_health', $this->woomelly_health );
		} //End set_woomelly_health()
		public function cet_woomelly_health ( $value ) {
			$this->woomelly_health = $value;				
		}

		public function get_woomelly_experience () {
			return intval($this->woomelly_experience);
		} //End get_woomelly_experience()
		
		public function set_woomelly_experience ( $value ) {
			$value = intval($value);
			$this->woomelly_experience = $value;
			update_post_meta( $this->product_id, '_wm_experience', $this->woomelly_experience );
		} //End set_woomelly_experience()
		public function cet_woomelly_experience ( $value ) {
			$this->woomelly_experience = $value;				
		}

		public function get_woomelly_item ( $context = 'view' ) {
			if ( !defined( 'WOOMELLY_OMNI_IMMA' ) )
				return "";
			if ( $this->woomelly_item != "" ) {
				$is_array = explode(',', $this->woomelly_item);
				if ( !empty($is_array) && isset($is_array[0]) && intval($is_array[0]) > 0 ) {
					if ( $context == "all" ) {
						return $is_array;
					} else {
						return $is_array[0];
					}
				} else {
					$this->woomelly_item = "";
				}
			}
			return $this->woomelly_item;
		} //End get_woomelly_item()
		
		public function set_woomelly_item ( $value ) {
			$this->woomelly_item = $value;
			update_post_meta( $this->product_id, '_wm_item', $this->woomelly_item );
		} //End set_woomelly_item()
		public function cet_woomelly_item ( $value ) {
			$this->woomelly_item = $value;				
		}

		public function get_woomelly_communication () {
			return $this->woomelly_communication;
		} //End get_woomelly_communication()
		
		public function set_woomelly_communication ( $value ) {
			$this->woomelly_communication = trim($value);
			update_post_meta( $this->product_id, '_wm_communication', $this->woomelly_communication );
		} //End set_woomelly_communication()
		public function cet_woomelly_communication ( $value ) {
			$this->woomelly_communication = $value;
		}
	
		public function get_value_attribute_field ( $value ) {
			if ( !is_array($this->woomelly_attribute_field) ) {
				return "";
			}
			
			if ( isset($this->woomelly_attribute_field[$value]) ) {
				$data = explode('::', $this->woomelly_attribute_field[$value]);
				if ( count($data) > 2 ) {
					return array($data[1], $data[2]);
				} else {
					return $data[1];
				}
			}

			return "";
		} //End get_value_attribute_field()

		public function get_woomelly_description () {
			$value = "";
			if ( apply_filters( 'woomelly__remove_the_content', false ) == false ) {
				$value = apply_filters( 'the_content', get_post_field( 'post_content', $this->product_id ) );
			} else {
				$value = get_post_field( 'post_excerpt', $this->product_id );
			}
			return $value;
		} //End get_woomelly_description()

		public function delete_meli ( $wmmultiple = false ) {
			if ( $wmmultiple == false ) {
				delete_post_meta( $this->product_id, '_wm_status_meli' );
				delete_post_meta( $this->product_id, '_wm_code_meli' );
				delete_post_meta( $this->product_id, '_wm_variation_id' );
				delete_post_meta( $this->product_id, '_wm_status' );
				delete_post_meta( $this->product_id, '_wm_updated' );
				delete_post_meta( $this->product_id, '_wm_updated_user' );
				update_post_meta( $this->product_id, '_wm_sync_problem', false );
				delete_post_meta( $this->product_id, '_wm_sync_problem_msg' );
				delete_post_meta( $this->product_id, '_wm_sync_warning' );
				delete_post_meta( $this->product_id, '_wm_listing_type_saved' );
				delete_post_meta( $this->product_id, '_wm_url_meli' );
				delete_post_meta( $this->product_id, '_wm_orders' );
				delete_post_meta( $this->product_id, '_wm_orders_cancelled' );
				delete_post_meta( $this->product_id, '_wm_official_store_id' );
				delete_post_meta( $this->product_id, '_wm_imported' );
				delete_post_meta( $this->product_id, '_wm_total_sales' );
				delete_post_meta( $this->product_id, '_wm_last_updated' );
				delete_post_meta( $this->product_id, '_wm_total_views' );
				delete_post_meta( $this->product_id, '_wm_tags' );
				delete_post_meta( $this->product_id, '_wm_images_updated' );
				delete_post_meta( $this->product_id, '_wm_logistic_type' );
				delete_post_meta( $this->product_id, '_wm_seller_id' );
				delete_post_meta( $this->product_id, '_wm_channels_ml' );
				delete_post_meta( $this->product_id, '_wm_health' );
				delete_post_meta( $this->product_id, '_wm_experience' );
				do_action( 'woomelly_delete_meli_simple', $this, $wmmultiple );
				$wc_product = wc_get_product( $this->get_id() );
				if ( is_object($wc_product) ) {
					$available_variations = wm_get_available_variations( $wc_product );
					if ( !empty($available_variations) ) {
						foreach ( $available_variations as $variation ) {
							delete_post_meta( $variation['variation_id'], '_wm_variation_id' );
							delete_post_meta( $variation['variation_id'], '_wm_status_meli' );
							delete_post_meta( $variation['variation_id'], '_wm_status' );
							delete_post_meta( $variation['variation_id'], '_wm_code_meli' );
							delete_post_meta( $variation['variation_id'], '_wm_url_meli' );
							delete_post_meta( $variation['variation_id'], '_wm_orders' );
							delete_post_meta( $variation['variation_id'], '_wm_orders_cancelled' );
							delete_post_meta( $variation['variation_id'], '_wm_total_sales' );
							delete_post_meta( $variation['variation_id'], '_wm_total_views' );
							update_post_meta( $variation['variation_id'], '_wm_sync_problem', false );
							delete_post_meta( $variation['variation_id'], '_wm_sync_problem_msg' );
							delete_post_meta( $variation['variation_id'], '_wm_tags' );
							delete_post_meta( $variation['variation_id'], '_wm_images_updated' );
							delete_post_meta( $variation['variation_id'], '_wm_logistic_type' );
							delete_post_meta( $variation['variation_id'], '_wm_seller_id' );
							delete_post_meta( $variation['variation_id'], '_wm_channels_ml' );
							delete_post_meta( $variation['variation_id'], '_wm_health' );
							delete_post_meta( $variation['variation_id'], '_wm_experience' );
							do_action( 'woomelly_delete_meli_variation', $this, $wmmultiple );
							do_action( 'after_woomelly_delete_meli_variation', $variation['variation_id'], $variation, $this, $wmmultiple );
						}
					}
				}
			} else if ( $wmmultiple == true ){
				delete_post_meta( $this->product_id, '_wm_variation_id' );
				delete_post_meta( $this->product_id, '_wm_status_meli' );
				delete_post_meta( $this->product_id, '_wm_status' );
				delete_post_meta( $this->product_id, '_wm_code_meli' );
				delete_post_meta( $this->product_id, '_wm_url_meli' );
				delete_post_meta( $this->product_id, '_wm_orders' );
				delete_post_meta( $this->product_id, '_wm_orders_cancelled' );
				delete_post_meta( $this->product_id, '_wm_imported' );
				delete_post_meta( $this->product_id, '_wm_last_updated' );
				delete_post_meta( $this->product_id, '_wm_official_store_id' );
				delete_post_meta( $this->product_id, '_wm_total_views' );
				delete_post_meta( $this->product_id, '_wm_total_sales' );
				delete_post_meta( $this->product_id, '_wm_tags' );
				delete_post_meta( $this->product_id, '_wm_images_updated' );
				delete_post_meta( $this->product_id, '_wm_logistic_type' );
				delete_post_meta( $this->product_id, '_wm_seller_id' );
				delete_post_meta( $this->product_id, '_wm_channels_ml' );
				update_post_meta( $this->product_id, '_wm_sync_problem', false );
				delete_post_meta( $this->product_id, '_wm_sync_problem_msg' );
				delete_post_meta( $this->product_id, '_wm_sync_warning' );
				delete_post_meta( $this->product_id, '_wm_health' );
				delete_post_meta( $this->product_id, '_wm_experience' );
				do_action( 'woomelly_delete_meli_simple', $this, $wmmultiple );
			}
			do_action( 'woomelly_delete_meli', $this, $wmmultiple );
		} //End delete_meli()

		public function remove_wm_data () {
			delete_post_meta( $this->product_id, '_wm_official_store_id' );
			delete_post_meta( $this->product_id, '_wm_currency_id' );
			delete_post_meta( $this->product_id, '_wm_buying_mode' );
			delete_post_meta( $this->product_id, '_wm_listing_type_id' );
			delete_post_meta( $this->product_id, '_wm_condition' );
			delete_post_meta( $this->product_id, '_wm_video_id' );
			delete_post_meta( $this->product_id, '_wm_accepts_mercadopago' );
			delete_post_meta( $this->product_id, '_wm_shipping_local_pick_up' );
			delete_post_meta( $this->product_id, '_wm_shipping_free_shipping' );
			delete_post_meta( $this->product_id, '_wm_shipping_free_shipping_ms' );
			delete_post_meta( $this->product_id, '_wm_warranty' );
			update_post_meta( $this->product_id, '_wm_factory_warranty', array('', '') );
			update_post_meta( $this->product_id, '_wm_seller_warranty', array('', '') );
			update_post_meta( $this->product_id, '_wm_location', array('country' => '','state' => '','city' => '', 'neighborhood' => '') );
			delete_post_meta( $this->product_id, '_wm_shipping_mode' );
			//delete_post_meta( $this->product_id, '_wm_free_methods' );
			delete_post_meta( $this->product_id, '_wm_costs' );
			delete_post_meta( $this->product_id, '_wm_listing_type_saved' );
			delete_post_meta( $this->product_id, '_wm_seller_phones' );
			delete_post_meta( $this->product_id, '_wm_seller_emails' );
			delete_post_meta( $this->product_id, '_wm_seller_extra_info' );
			delete_post_meta( $this->product_id, '_wm_location_address' );
			delete_post_meta( $this->product_id, '_wm_type_price' );
			delete_post_meta( $this->product_id, '_wm_variation_price' );
			delete_post_meta( $this->product_id, '_wm_variation_price_ms' );
			delete_post_meta( $this->product_id, '_wm_orders' );
			delete_post_meta( $this->product_id, '_wm_orders_cancelled' );
			delete_post_meta( $this->product_id, '_wm_last_updated' );
			delete_post_meta( $this->product_id, '_wm_images' );
			delete_post_meta( $this->product_id, '_wm_images_variations' );
			delete_post_meta( $this->product_id, '_wm_images_updated' );
			delete_post_meta( $this->product_id, '_wm_simple_variations' );
			delete_post_meta( $this->product_id, '_wm_simple_variationsc' );
			delete_post_meta( $this->product_id, '_wm_communication_type' );
			delete_post_meta( $this->product_id, '_wm_communication' );
			delete_post_meta( $this->product_id, '_wm_total_views' );
			delete_post_meta( $this->product_id, '_wm_total_sales' );
			delete_post_meta( $this->product_id, '_wm_manufacturing_time' );
			update_post_meta( $this->product_id, '_wm_logistic_type', '' );
			update_post_meta( $this->product_id, '_wm_domain_id', '' );
			update_post_meta( $this->product_id, '_wm_seller_id', '' );
			update_post_meta( $this->product_id, '_wm_channels', '' );
			update_post_meta( $this->product_id, '_wm_channels_ml', '' );
			update_post_meta( $this->product_id, '_wm_separate_variations', '' );
			update_post_meta( $this->product_id, '_wm_imported', '' );
			update_post_meta( $this->product_id, '_wm_custom_title_field', '' );
			update_post_meta( $this->product_id, '_wm_description_meli', '' );
			delete_post_meta( $this->product_id, '_wm_tags' );
			delete_post_meta( $this->product_id, '_wm_omit_data' );
			update_post_meta( $this->product_id, '_wm_gtin_custom', '' );
			update_post_meta( $this->product_id, '_wm_limit_per_sales', '' );
			update_post_meta( $this->product_id, '_wm_health', '' );
			update_post_meta( $this->product_id, '_wm_experience', '' );
			do_action( 'action_woomelly_remove_wm_data', $this->product_id, false );
		} //End remove_wm_data()

		public function success_sync ( $result_meli = null, $parent_product = 0, $available_variations = array(), $wm_template_sync = null, $woomelly_get_settings = null, $wm_item = null, $wm_publication = null ) {
			$list_variations 			= array();
			$list_variations_sales 		= array();
			$has_errors 				= false;
			$all_meli_prices 			= null;
			
			if ( is_object($result_meli) ) {
				if ( defined( 'WOOMELLY_OMNI_IMMA' ) ) {
					if ( $this->get_woomelly_item() != "" ) {
						$this->set_woomelly_code_meli_field( "" );
					} else {
						$this->set_woomelly_code_meli_field( $result_meli->id );
					}
				} else {
					$this->set_woomelly_code_meli_field( $result_meli->id );
				}
				$wm_settings_omit_fields = $woomelly_get_settings->get_settings_omit_fields();
				$this->set_woomelly_tags( $result_meli->tags );
				if ( isset( $result_meli->shipping->logistic_type ) ) {
					$this->set_woomelly_logistic_type( $result_meli->shipping->logistic_type );
				}
				if ( isset($result_meli->channels) ) {
					if ( count($result_meli->channels) == 1 ) {
						if ( in_array('marketplace', $result_meli->channels) ) {
							$this->set_woomelly_channels_ml( 'marketplace' );
						} else {
							$this->set_woomelly_channels_ml( 'mshops' );
						}
					} else {
						$this->set_woomelly_channels_ml( 'all' );
					}
				}				
				$this->set_woomelly_listing_type_saved( $result_meli->listing_type_id );
				if ( $wm_settings_omit_fields[8] == false ) {
					if ( $woomelly_get_settings->get_site_id() == 'MLA' ) {
						$woomelly_listing_type_id = $this->get_woomelly_listing_type_id();
						if ( defined( 'WOOMELLY_OMNI_IMMA' ) ) {
							$woomelly_listing_type_id = ( (!is_null($wm_publication)&&is_object($wm_publication->settings)&&isset($wm_publication->settings->listing_type_ml))? $wm_publication->settings->listing_type_ml : "" );
							if ( $woomelly_listing_type_id == "" ) {
								$woomelly_listing_type_id = $this->get_woomelly_listing_type_id();
							}
						}
						if ( $woomelly_listing_type_id == "" && is_object($wm_template_sync) ) {
							$woomelly_listing_type_id = $wm_template_sync->get_woomelly_listing_type_id_field();
						}
						if ( $woomelly_listing_type_id == 'pcj_co_funded' && !in_array('pcj-co-funded', $result_meli->tags) && $result_meli->listing_type_id == 'gold_special' ) {
							$new_tags = array('pcj-co-funded');
							if ( !empty($result_meli->tags) ) {
								foreach( $result_meli->tags as $value ) {
									if ( !in_array($value, ['3x_campaign', '9x_campaign', '12x_campaign']) ) {
										$new_tags[] = $value;
									}
								}
							}
							$result_meli_installments = WMeli::put_item( $result_meli->id, array('tags' => $new_tags), true );
							if ( is_object($result_meli_installments) ) {
								$this->set_woomelly_listing_type_saved( $result_meli_installments->listing_type_id );
							} else {
								$this->set_woomelly_sync_warning( __("There was an error when modifying the 'selling charge (installments)' field.", "woomelly") );
							}
						} else if ( $woomelly_listing_type_id == '3x_campaign' && !in_array('3x_campaign', $result_meli->tags) && $result_meli->listing_type_id == 'gold_pro' ) {
							$new_tags = array('3x_campaign');
							if ( !empty($result_meli->tags) ) {
								foreach( $result_meli->tags as $value ) {
									if ( !in_array($value, ['pcj-co-funded', '9x_campaign', '12x_campaign']) ) {
										$new_tags[] = $value;
									}
								}
							}
							$result_meli_installments = WMeli::put_item( $result_meli->id, array('tags' => $new_tags), true );
							if ( is_object($result_meli_installments) ) {
								$this->set_woomelly_listing_type_saved( $result_meli_installments->listing_type_id );
							} else {
								$this->set_woomelly_sync_warning( __("There was an error when modifying the 'selling charge (installments)' field.", "woomelly") );
							}
						} else if ( $woomelly_listing_type_id == '9x_campaign' && !in_array('9x_campaign', $result_meli->tags) && $result_meli->listing_type_id == 'gold_pro' ) {
							$new_tags = array('9x_campaign');
							if ( !empty($result_meli->tags) ) {
								foreach( $result_meli->tags as $value ) {
									if ( !in_array($value, ['pcj-co-funded', '3x_campaign', '12x_campaign']) ) {
										$new_tags[] = $value;
									}
								}
							}
							$result_meli_installments = WMeli::put_item( $result_meli->id, array('tags' => $new_tags), true );
							if ( is_object($result_meli_installments) ) {
								$this->set_woomelly_listing_type_saved( $result_meli_installments->listing_type_id );
							} else {
								$this->set_woomelly_sync_warning( __("There was an error when modifying the 'selling charge (installments)' field.", "woomelly") );
							}
						} else if ( $woomelly_listing_type_id == '12x_campaign' && !in_array('12x_campaign', $result_meli->tags) && $result_meli->listing_type_id == 'gold_pro' ) {
							$new_tags = array('12x_campaign');
							if ( !empty($result_meli->tags) ) {
								foreach( $result_meli->tags as $value ) {
									if ( !in_array($value, ['pcj-co-funded', '3x_campaign', '9x_campaign']) ) {
										$new_tags[] = $value;
									}
								}
							}
							$result_meli_installments = WMeli::put_item( $result_meli->id, array('tags' => $new_tags), true );
							if ( is_object($result_meli_installments) ) {
								$this->set_woomelly_listing_type_saved( $result_meli_installments->listing_type_id );
							} else {
								$this->set_woomelly_sync_warning( __("There was an error when modifying the 'selling charge (installments)' field.", "woomelly") );
							}
						} else if ( in_array($woomelly_listing_type_id, array('gold_special', 'gold_pro')) && (in_array('3x_campaign', $result_meli->tags) || in_array('9x_campaign', $result_meli->tags) || in_array('12x_campaign', $result_meli->tags) || in_array('pcj-co-funded', $result_meli->tags)) ) {
							$new_meli_tags = array();
							foreach ( $result_meli->tags as $value ) {
								if ( !in_array($value, ['3x_campaign', '9x_campaign', '12x_campaign', 'pcj-co-funded']) ) {
									$new_meli_tags[] = $value;
								}
							}
							$result_meli_installments = WMeli::put_item( $result_meli->id, array('tags' => $new_meli_tags), true );
							if ( is_object($result_meli_installments) ) {
								$this->set_woomelly_listing_type_saved( $result_meli_installments->listing_type_id );
							} else {
								$this->set_woomelly_sync_warning( __("There was an error when modifying the 'selling charge (installments)' field.", "woomelly") );
							}
						}
					} else {
						if ( defined( 'WOOMELLY_OMNI_IMMA' ) ) {
							$woomelly_listing_type_id = $this->get_woomelly_listing_type_id();
							if ( $woomelly_listing_type_id == "" ) {
								$woomelly_listing_type_id = $wm_template_sync->get_woomelly_listing_type_id_field();
							}
							if ( $woomelly_get_settings->get_site_id() == 'MLU' && $woomelly_listing_type_id == 'bronze' ) {
								$woomelly_listing_type_id = 'gold_special';
							}
							if ( $result_meli->listing_type_id != $woomelly_listing_type_id ) {
								$result_meli_installments = WMeli::post_listing_type( $result_meli->id, array( 'id' => $woomelly_listing_type_id ), true, $woomelly_get_settings );
								if ( is_object($result_meli_installments) ) {
									$this->set_woomelly_listing_type_saved( $result_meli_installments->listing_type_id );
								} else {
									$this->set_woomelly_sync_warning( __("There was an error when modifying the 'selling charge (installments)' field.", "woomelly") );
								}
							}
						}
					}
				}
				if ( isset($result_meli->domain_id) )
					$this->set_woomelly_domain_id( $result_meli->domain_id );
				if ( isset($result_meli->seller_id) )
					$this->set_woomelly_seller_id( $result_meli->seller_id );
				if ( isset($result_meli->permalink) && !defined( 'WOOMELLY_OMNI_IMMA' ) )
					$this->set_woomelly_url_meli_field( $result_meli->permalink );
				if ( !is_object($wm_publication) ) {
					if ( $result_meli->status == "paused" && !empty($result_meli->sub_status) && in_array('picture_download_pending', $result_meli->sub_status) && ($this->get_woomelly_status_field() == "active" || $this->get_woomelly_status_field() == "") ) {
						$this->set_woomelly_status_field( 'active' );
					} else if ( in_array($result_meli->status, ['payment_required', 'closed', 'inactive', 'active']) ) {
						$this->set_woomelly_status_field( $result_meli->status );
					} else if ( $result_meli->status == "paused" && $this->get_woomelly_status_field() != "paused_out_of_stock" ) {
						$this->set_woomelly_status_field( $result_meli->status );
					}
				} else {
					if ( $result_meli->status == "paused" && !empty($result_meli->sub_status) && in_array('picture_download_pending', $result_meli->sub_status) && ($this->get_woomelly_status_field() == "active" || $this->get_woomelly_status_field() == "") ) {
						$wm_publication->setSettings(['status' => 'active']);
						$wm_publication->save(false);
					} else if ( in_array($result_meli->status, ['payment_required', 'closed', 'inactive', 'active']) ) {
						$wm_publication->setSettings(['status' => $result_meli->status]);
						$wm_publication->save(false);
					} else if ( $result_meli->status == "paused" && $this->get_woomelly_status_field() != "paused_out_of_stock" ) {
						$wm_publication->setSettings(['status' => $result_meli->status]);
						$wm_publication->save(false);
					}					
				}
				if ( !empty($result_meli->variations) ) {
					foreach ( $result_meli->variations as $variation_temp ) {
						$list_variations[] = $variation_temp->id;
						$list_variations_sales[$variation_temp->id] = $variation_temp->sold_quantity;
					}
					if ( !empty($available_variations) && !empty($list_variations) ) {
						$list_all_wm_variation_id = array();
						foreach ( $available_variations as $available_variation ) {
							$wm_variation_id_temp = wm_get_meta_data( $available_variation['variation_id'], '_wm_variation_id', true );
							//$wm_variation_id_temp = get_post_meta( $available_variation['variation_id'], '_wm_variation_id', true );
							if ( $wm_variation_id_temp != "" ) {
								$list_all_wm_variation_id[] = $wm_variation_id_temp;
							}
						}						
						$variation_index = 0;
						foreach ( $available_variations as $available_variation ) {
							$wm_product_variation = new WMProduct( $available_variation['variation_id'] );
							$woomelly_variation_field = wm_get_woomelly_clean_attributes_variation( $wm_product_variation, $wm_template_sync, $available_variation );
							if ( !empty($woomelly_variation_field) ) {
								if ( $available_variation['variation_is_visible'] == true ) {
									$now_variation_id = $wm_product_variation->get_woomelly_variation_id_field();
									/*if ( isset($list_variations[$variation_index]) && $now_variation_id == "" ) {
										$wm_product_variation->set_woomelly_variation_id_field( $list_variations[$variation_index] );
									} else if ( isset($list_variations[$variation_index]) && !in_array($list_variations[$variation_index], $list_all_wm_variation_id) ) {
										$wm_product_variation->set_woomelly_variation_id_field( $list_variations[$variation_index] );
									}*/
									if ( $now_variation_id != "" && in_array($now_variation_id, $list_variations) ) {
										$list_variations_temp = $list_variations;
										$value_temp_to_delete = array();
										$value_temp_to_delete[] = $now_variation_id;
										unset( $list_variations );
										$list_variations = array_diff($list_variations_temp, $value_temp_to_delete);
										unset( $list_variations_temp );
										unset( $value_temp_to_delete );
										if ( isset($list_variations_sales[$now_variation_id]) ) {
											$wm_product_variation->set_woomelly_total_sales( $list_variations_sales[$now_variation_id] );
										}										
									} else {
										$value_repeated = true;
										$value_repeated_id = '';
										foreach ( $list_variations as $list_variations_value ) {
											if ( $value_repeated == true && !in_array($list_variations_value, $list_all_wm_variation_id) ) {
												$value_repeated = false;
												$value_repeated_id = $list_variations_value;
											}
										}
										if ( $value_repeated == false && $value_repeated_id != "" ) {
											if ( $this->get_woomelly_status_meli_field() == "true" || ($this->get_woomelly_status_meli_field()!="true"&&$available_variation['availability']>0) ) {
												$wm_product_variation->set_woomelly_variation_id_field( $value_repeated_id );
												if ( isset($list_variations_sales[$value_repeated_id]) ) {
													$wm_product_variation->set_woomelly_total_sales( $list_variations_sales[$value_repeated_id] );
												}
												$list_variations_temp = $list_variations;
												$value_temp_to_delete = array();
												$value_temp_to_delete[] = $value_repeated_id;
												unset( $list_variations );
												$list_variations = array_diff($list_variations_temp, $value_temp_to_delete);
												unset( $list_variations_temp );
												unset( $value_temp_to_delete );
											}
										}
									}
									$variation_index++;
								}
							}
							/*$woomelly_variation_field = $wm_product_variation->get_woomelly_clean_variation_field();
							if ( !empty($woomelly_variation_field) ) {
								$now_variation_id = $wm_product_variation->get_woomelly_variation_id_field();
								if ( isset($list_variations[$variation_index]) && $now_variation_id == "" ) {
									$wm_product_variation->set_woomelly_variation_id_field( $list_variations[$variation_index] );
								} else if ( isset($list_variations[$variation_index]) && !in_array($now_variation_id, $list_variations) ) {
									$wm_product_variation->set_woomelly_variation_id_field( $list_variations[$variation_index] );
								}
								$variation_index++;
							} else if ( $wm_template_sync != null ) {
								unset( $woomelly_variation_field );
								$woomelly_variation_field = $wm_template_sync->get_woomelly_clean_attributes_variation_field( $available_variation );
								if ( !empty($woomelly_variation_field) ) {
									$now_variation_id = $wm_product_variation->get_woomelly_variation_id_field();
									if ( isset($list_variations[$variation_index]) && $now_variation_id == "" ) {
										$wm_product_variation->set_woomelly_variation_id_field( $list_variations[$variation_index] );
									} else if ( isset($list_variations[$variation_index]) && !in_array($now_variation_id, $list_variations) ) {
										$wm_product_variation->set_woomelly_variation_id_field( $list_variations[$variation_index] );
									}
									$variation_index++;
								}
							}*/
							unset( $wm_product_variation );
							unset( $woomelly_variation_field );
						}
					} else if ( apply_filters( 'woomelly_sync_woo_meli_simple_variations_active', false, $this, array() ) == true ) {
						if ( apply_filters( 'woomelly__variation_id_multiple', true, $this, $parent_product ) ) {
							$this->set_woomelly_variation_id_field( $list_variations[0] );
						}
					}
				}
				if ( isset($result_meli->sold_quantity) && !defined( 'WOOMELLY_OMNI_IMMA' ) )
					$this->set_woomelly_total_sales( $result_meli->sold_quantity );
				if ( !defined( 'WOOMELLY_OMNI_IMMA' ) ) {
					if ( $this->get_woomelly_status_meli_field() == "true" && $woomelly_get_settings->get_settings_total_views() == 'yes' ) {
						$total_visits_meli = WMeli::get_visits( $result_meli->id, $woomelly_get_settings );
						if ( is_object($total_visits_meli) ) {
							$id_item = $result_meli->id;
							$this->set_woomelly_total_views($total_visits_meli->$id_item );
						}
					}
				}
				$validate_ms_price = false;
				$validate_ms_free_shipping = false;
				if ( in_array( 'mshops', $result_meli->channels) ) {
					if ( $wm_settings_omit_fields[7] == false || $wm_settings_omit_fields[9] == false ) {
						$all_meli_prices = WMeli::get_prices( $result_meli->id, $woomelly_get_settings, 'channel_mshops', 'prices' );
					}
					if ( $this->get_woomelly_status_meli_field() == "true" ) {
						if ( $wm_settings_omit_fields[7] == false ) {
							$validate_ms_price = true;
						}
						if ( $wm_settings_omit_fields[9] == false ) {
							$validate_ms_free_shipping = true;
						}
					} else {
						$validate_ms_price = true;
						$validate_ms_free_shipping = true;
					}
				}
				if ( $validate_ms_price == true ) {
					$data_ms_price = array();
					$ms_price = $this->get_woomelly_variation_price_ms();
					if ( $ms_price <= 0 ) {
						if ( is_object($all_meli_prices) && isset($all_meli_prices->prices) && !empty($all_meli_prices->prices) ) {
							$do_delete_ms_price = false;
							foreach ( $all_meli_prices->prices as $value_prices ) {
								if ( isset($value_prices->conditions, $value_prices->conditions->context_restrictions) && in_array('channel_mshops', $value_prices->conditions->context_restrictions) ) {
									$do_delete_ms_price = true;
								}
							}
							if ( $do_delete_ms_price == true ) {
								$result_msprice = WMeli::delete_ms_price( $result_meli->id, $woomelly_get_settings );
								if ( $result_msprice !== true ) {
									$this->set_woomelly_sync_warning( __("The Mercado Shops price was not correctly deleted due to a connection error with Mercado Libre", "woomelly") );
								}
							}
						} else {
							$this->set_woomelly_sync_warning( __("The Mercado Shops price was not correctly deleted due to a connection error with Mercado Libre", "woomelly") );
						}
					} else {
						if ( !in_array($result_meli->currency_id, array('CLP', 'COP')) ) {
							$price_decimals = wc_get_price_decimals();
							if ( $price_decimals > 2 ) {
								$price_decimals = 2;
							}
							$ms_price = wc_format_decimal( $ms_price, $price_decimals );
						} else {
							$ms_price = wc_format_decimal( $ms_price, 0 );
						}
						$data_ms_price['currency_id'] = $result_meli->currency_id;
						$data_ms_price['amount'] = $ms_price;
						$data_ms_price['item_id'] = $result_meli->id;
						if ( is_object($all_meli_prices) && isset($all_meli_prices->prices) && !empty($all_meli_prices->prices) ) {
							$do_post_ms_price = false;
							$has_post_ms_price = false;
							foreach ( $all_meli_prices->prices as $value_prices ) {
								if ( isset($value_prices->conditions, $value_prices->amount, $value_prices->conditions->context_restrictions) && in_array('channel_mshops', $value_prices->conditions->context_restrictions) ) {
									$has_post_ms_price = true;
									$ms_get_price = floatval( $value_prices->amount );
									if ( $ms_get_price != $ms_price ) {
										$do_post_ms_price = true;
									}
								}
							}
							if ( $do_post_ms_price == true || $has_post_ms_price == false ) {
								$result_msprice = WMeli::post_ms_price( $data_ms_price, $woomelly_get_settings );
								if ( $result_msprice !== true ) {
									$this->set_woomelly_sync_warning( __("The Mercado Shops price was not correctly updated due to a connection error with Mercado Libre", "woomelly") );
								}								
							}
						} else {
							$this->set_woomelly_sync_warning( __("The Mercado Shops price was not correctly updated due to a connection error with Mercado Libre", "woomelly") );
						}
					}
				}
				if ( $parent_product <= 0 || $this->get_id() == $parent_product ) {
					if ( wm_sync_flex_shipping ( $result_meli, $this, $wm_template_sync, $woomelly_get_settings ) == false ) {
						$has_errors = true;
					}
					if ( $validate_ms_free_shipping == true ) {
						wm_sync_free_shipping( $result_meli, $this, null, $all_meli_prices, $wm_template_sync, $woomelly_get_settings );
					}
				} else {
					$wm_parent_product_temp = new WMProduct($parent_product);
					if ( is_object($wm_parent_product_temp) && $wm_parent_product_temp->get_id() >0 ) {
						if ( wm_sync_flex_shipping ( $result_meli, $wm_parent_product_temp, $wm_template_sync, $woomelly_get_settings ) == false ) {
							$has_errors = true;
						}
						if ( $validate_ms_free_shipping == true ) {
							wm_sync_free_shipping( $result_meli, $this, $wm_parent_product_temp, $all_meli_prices, $wm_template_sync, $woomelly_get_settings );
						}
						$wm_parent_product_temp->set_woomelly_channels_ml("");
					}
				}
				$list_save_ml_pictures = array();
				if ( !empty($result_meli->pictures) ) {
					foreach ( $result_meli->pictures as $value ) {
						$list_save_ml_pictures[] = $value->id;
					}
					$this->set_woomelly_images_updated( $list_save_ml_pictures );
				}
				if ( isset($result_meli->health) && wm_is_active_in($woomelly_get_settings->get_site_id(), 'health') )
					$this->set_woomelly_health( $result_meli->health );
				if ( !defined( 'WOOMELLY_OMNI_IMMA' ) ) {
					if ( wm_is_active_in($woomelly_get_settings->get_site_id(), 'experience') ) {
						$wm_settings_omit_fields = $woomelly_get_settings->get_settings_omit_fields();
						if ( $wm_settings_omit_fields[14] == false ) {
							$result_meli_experience = WMeli::get_purchase_experience($result_meli->id, $woomelly_get_settings);
							if ( is_object($result_meli_experience) && isset($result_meli_experience->reputation) && is_object($result_meli_experience->reputation) && isset($result_meli_experience->reputation->value) ) {
								$this->set_woomelly_experience( $result_meli_experience->reputation->value );
							}
						}
					}
				}
				do_action( 'woomelly_sync_woo_meli_success', $this, $result_meli, $parent_product, $woomelly_get_settings );
			}
			$this->set_woomelly_status_meli_field( 'true' );
			if ( $has_errors == false ) { 
				$this->set_woomelly_sync_problem( false );
				$this->set_woomelly_sync_problem_msg( '' );
			}			
			$this->set_woomelly_updated_field( date( 'y-m-d h:i:s', current_time( 'timestamp' ) ) );
			$current_user = wp_get_current_user();
			if ( $current_user instanceof WP_User && isset($current_user->user_login) && $current_user->user_login!="" ) {
				$this->set_woomelly_updated_user_field( $current_user->user_login );
			} else {
				$this->set_woomelly_updated_user_field( 'system' );
			}
			do_action( 'action_woomelly_product_success_sync', $this, $result_meli, $parent_product, $available_variations, $wm_template_sync );
		} //End success_sync()

		public function product_children_sync ( $permalink = true, $reset = false ) {
			$woomelly_children = array();
			$_product = wc_get_product( $this->product_id );
			if ( is_object($_product) ) {
				$available_variations = wm_get_available_variations( $_product );								
				if ( !empty($available_variations) ) {
					foreach ( $available_variations as $available_variation ) {
						$wm_product_variation = new WMProduct( $available_variation['variation_id'] );
						$woomelly_status_meli_field = $wm_product_variation->get_woomelly_status_meli_field();
						$woomelly_code_meli_field = $wm_product_variation->get_woomelly_code_meli_field();
						if ( $permalink == true ) {
							$woomelly_url_meli_field = $wm_product_variation->get_woomelly_url_meli_field();
							if ( $woomelly_status_meli_field == "true" && $woomelly_code_meli_field!="" ) {
								if ( $woomelly_url_meli_field != "" ) {
									$woomelly_children[$available_variation['variation_id']] = '<a style="vertical-align: middle;" href="'.$woomelly_url_meli_field.'" target="_blank">'.$woomelly_code_meli_field.'</a>';
								} else {
									$woomelly_children[$available_variation['variation_id']] = $woomelly_code_meli_field;
								}
							}							
						} else {
							if ( $woomelly_status_meli_field == "true" && $woomelly_code_meli_field!="" ) {
								$woomelly_children[$available_variation['variation_id']] = $woomelly_code_meli_field;
							} else if ( $reset == true ) {
								$woomelly_children[$available_variation['variation_id']] = $woomelly_code_meli_field;
							}
						}
						unset( $wm_product_variation );
					}
				}
			}
			return $woomelly_children;
		} //End product_children_sync()

		public function save () {
			$this->validate_props();
			$meta_key_to_props = array(
				'_wm_template_sync_id' => $this->woomelly_template_sync_id,
				'_wm_status_meli' => $this->woomelly_status_meli_field,
				'_wm_sync_status' => $this->woomelly_sync_status_field,
				'_wm_code_meli' => $this->woomelly_code_meli_field,
				'_wm_variation_id' => $this->woomelly_variation_id_field,
				'_wm_url_meli' => $this->woomelly_url_meli_field,
				'_wm_status' => $this->woomelly_status_field,
				'_wm_updated' => $this->woomelly_updated_field,
				'_wm_updated_user' => $this->woomelly_updated_user_field,
				'_wm_custom_title_field' => $this->woomelly_custom_title_field,
				'_wm_description_meli' => $this->woomelly_description_meli_field,
				'_wm_attribute' => $this->woomelly_attribute_field,
				'_wm_variation' => $this->woomelly_variation_field,
				'_wm_sync_problem' => $this->woomelly_sync_problem,
				'_wm_sync_problem_msg' => $this->woomelly_sync_problem_msg,
				'_wm_sync_warning' => $this->woomelly_sync_warning,
				'_wm_official_store_id' => $this->woomelly_official_store_id,
				'_wm_currency_id' => $this->woomelly_currency_id,
				'_wm_buying_mode' => $this->woomelly_buying_mode,
				'_wm_listing_type_id' => $this->woomelly_listing_type_id,
				'_wm_condition' => $this->woomelly_condition,
				'_wm_imported' => $this->woomelly_imported,
				'_wm_is_multiple' => $this->woomelly_is_multiple,
				'_wm_tags' => $this->woomelly_tags,
				'_wm_video_id' => $this->woomelly_video_id,
				'_wm_accepts_mercadopago' => $this->woomelly_accepts_mercadopago,
				'_wm_shipping_local_pick_up' => $this->woomelly_shipping_local_pick_up,
				'_wm_shipping_free_shipping' => $this->woomelly_shipping_free_shipping,
				'_wm_shipping_free_shipping_ms' => $this->woomelly_shipping_free_shipping_ms,
				'_wm_shipping_flex' => $this->woomelly_shipping_flex,
				'_wm_warranty' => $this->woomelly_warranty,
				'_wm_factory_warranty' => $this->woomelly_factory_warranty,
				'_wm_seller_warranty' => $this->woomelly_seller_warranty,
				'_wm_location' => $this->woomelly_location,
				'_wm_shipping_mode' => $this->woomelly_shipping_mode,
				'_wm_free_methods' => $this->woomelly_free_methods,
				'_wm_costs' => $this->woomelly_costs,
				'_wm_listing_type_saved' => $this->woomelly_listing_type_saved,
				'_wm_seller_phones' => $this->woomelly_seller_phones,
				'_wm_seller_emails' => $this->woomelly_seller_emails,
				'_wm_seller_extra_info' => $this->woomelly_seller_extra_info,
				'_wm_location_address' => $this->woomelly_location_address,
				'_wm_variation_price' => $this->woomelly_variation_price,
				'_wm_variation_price_ms' => $this->woomelly_variation_price_ms,
				'_wm_type_price' => $this->woomelly_type_price,
				'_wm_orders' => $this->woomelly_orders,
				'_wm_orders_cancelled' => $this->woomelly_orders_cancelled,
				'_wm_last_updated' => $this->woomelly_last_updated,
				'_wm_images' => $this->woomelly_images,
				'_wm_images_variations' => $this->woomelly_images_variations,
				'_wm_images_updated' => $this->woomelly_images_updated,
				'_wm_simple_variations' => $this->woomelly_characteristic,
				'_wm_simple_variationsc' => $this->woomelly_characteristicc,
				'_wm_communication_type' => $this->woomelly_communication_type,
				'_wm_communication' => $this->woomelly_communication,
				'_wm_total_views' => $this->woomelly_total_views,
				'_wm_total_sales' => $this->woomelly_total_sales,
				'_wm_manufacturing_time' => $this->woomelly_manufacturing_time,
				'_wm_logistic_type' => $this->woomelly_logistic_type,
				'_wm_domain_id' => $this->woomelly_domain_id,
				'_wm_seller_id' => $this->woomelly_seller_id,
				'_wm_channels' => $this->woomelly_channels,
				'_wm_channels_ml' => $this->woomelly_channels_ml,
				'_wm_separate_variations' => $this->woomelly_separate_variations,
				'_wm_omit_data' =>  $this->woomelly_omit_data,
				'_wm_gtin_custom' =>  $this->woomelly_gtin_custom,
				'_wm_limit_per_sales' => $this->woomelly_limit_per_sales,
				'_wm_health' => $this->woomelly_health,
				'_wm_experience' => $this->woomelly_experience,
				'_wm_item' => $this->woomelly_item,
			);
			foreach ( $meta_key_to_props as $meta_key => $meta_value ) {
				$updated = update_post_meta( $this->get_id(), $meta_key, $meta_value );
			}
			return $this->get_id();
		} //End save()

		public function validate_props() {
		} //End validate_props()
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit