Borderfree - Version 1.1.1

Version Notes

Borderfree enables U.S. retailers to transact with customers in more than 100 countries and in more than 60 currencies worldwide. From marketing and localization to customs and fraud, Borderfree gets your products into the hands of your global fans.

Download this release

Release Info

Developer Borderfree
Extension Borderfree
Version 1.1.1
Comparing to
See all releases


Version 1.1.1

Files changed (418) hide show
  1. app/code/local/Borderfree/.DS_Store +0 -0
  2. app/code/local/Borderfree/Api/Helper/Data.php +30 -0
  3. app/code/local/Borderfree/Api/Model/Webservice.php +126 -0
  4. app/code/local/Borderfree/Api/etc/config.xml +22 -0
  5. app/code/local/Borderfree/Catalog/Helper/Data.php +25 -0
  6. app/code/local/Borderfree/Catalog/Model/Export.php +1080 -0
  7. app/code/local/Borderfree/Catalog/Model/Log.php +9 -0
  8. app/code/local/Borderfree/Catalog/Model/Mysql4/Log.php +9 -0
  9. app/code/local/Borderfree/Catalog/Model/Mysql4/Log/Collection.php +9 -0
  10. app/code/local/Borderfree/Catalog/Model/Mysql4/Products.php +10 -0
  11. app/code/local/Borderfree/Catalog/Model/Mysql4/Products/Collection.php +9 -0
  12. app/code/local/Borderfree/Catalog/Model/Mysql4/Stores.php +10 -0
  13. app/code/local/Borderfree/Catalog/Model/Mysql4/Stores/Collection.php +9 -0
  14. app/code/local/Borderfree/Catalog/Model/Products.php +9 -0
  15. app/code/local/Borderfree/Catalog/Model/Stores.php +9 -0
  16. app/code/local/Borderfree/Catalog/etc/config.xml +61 -0
  17. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-install-1.0.0.php +38 -0
  18. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.0-1.0.1.php +39 -0
  19. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.1-1.0.2.php +37 -0
  20. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.10-1.0.11.php +6 -0
  21. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.11-1.0.12.php +188 -0
  22. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.12-1.0.13.php +102 -0
  23. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.13-1.0.14.php +530 -0
  24. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.14-1.0.15.php +2154 -0
  25. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.15-1.0.16.php +29 -0
  26. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.16-1.0.17.php +825 -0
  27. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.17-1.0.18.php +36 -0
  28. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.18-1.0.19.php +388 -0
  29. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.19-1.0.20.php +7 -0
  30. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.2-1.0.3.php +53 -0
  31. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.20-1.0.21.php +7 -0
  32. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.21-1.0.22.php +7 -0
  33. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.22-1.0.23.php +7 -0
  34. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.23-1.0.24.php +7 -0
  35. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.24-1.0.25.php +7 -0
  36. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.3-1.0.4.php +208 -0
  37. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.4-1.0.5.php +211 -0
  38. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.5-1.0.6.php +168 -0
  39. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.6-1.0.7.php +182 -0
  40. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.7-1.0.8.php +66 -0
  41. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.8-1.0.9.php +37 -0
  42. app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.9-1.0.10.php +879 -0
  43. app/code/local/Borderfree/Checkout/Helper/Data.php +6 -0
  44. app/code/local/Borderfree/Checkout/Model/Shipping.php +45 -0
  45. app/code/local/Borderfree/Checkout/controllers/EnvoyController.php +463 -0
  46. app/code/local/Borderfree/Checkout/etc/config.xml +58 -0
  47. app/code/local/Borderfree/Crontab/.DS_Store +0 -0
  48. app/code/local/Borderfree/Crontab/Block/Adminhtml/Cronjobs.php +15 -0
  49. app/code/local/Borderfree/Crontab/Block/Adminhtml/Cronjobs/Grid.php +111 -0
  50. app/code/local/Borderfree/Crontab/Helper/Data.php +24 -0
  51. app/code/local/Borderfree/Crontab/Model/Log.php +9 -0
  52. app/code/local/Borderfree/Crontab/Model/Mysql4/Log.php +10 -0
  53. app/code/local/Borderfree/Crontab/Model/Mysql4/Log/Collection.php +9 -0
  54. app/code/local/Borderfree/Crontab/controllers/Adminhtml/CronjobsController.php +59 -0
  55. app/code/local/Borderfree/Crontab/etc/.DS_Store +0 -0
  56. app/code/local/Borderfree/Crontab/etc/adminhtml.xml +35 -0
  57. app/code/local/Borderfree/Crontab/etc/config.xml +125 -0
  58. app/code/local/Borderfree/Crontab/sql/borderfreecrontab_setup/mysql4-install-1.0.0.php +8 -0
  59. app/code/local/Borderfree/Crontab/sql/borderfreecrontab_setup/mysql4-upgrade-1.0.0-1.0.1.php +9 -0
  60. app/code/local/Borderfree/Localization/Block/Country.php +103 -0
  61. app/code/local/Borderfree/Localization/Block/Switch.php +64 -0
  62. app/code/local/Borderfree/Localization/Block/Welcomemat.php +68 -0
  63. app/code/local/Borderfree/Localization/Helper/Data.php +430 -0
  64. app/code/local/Borderfree/Localization/Helper/Url.php +52 -0
  65. app/code/local/Borderfree/Localization/Helper/Wishlist.php +37 -0
  66. app/code/local/Borderfree/Localization/Model/Cache.php +9 -0
  67. app/code/local/Borderfree/Localization/Model/Convert.php +27 -0
  68. app/code/local/Borderfree/Localization/Model/Country.php +158 -0
  69. app/code/local/Borderfree/Localization/Model/Currency.php +9 -0
  70. app/code/local/Borderfree/Localization/Model/Discount.php +33 -0
  71. app/code/local/Borderfree/Localization/Model/Fxrate.php +9 -0
  72. app/code/local/Borderfree/Localization/Model/Import.php +360 -0
  73. app/code/local/Borderfree/Localization/Model/Ip.php +81 -0
  74. app/code/local/Borderfree/Localization/Model/Lcp.php +9 -0
  75. app/code/local/Borderfree/Localization/Model/Mysql4/Cache.php +9 -0
  76. app/code/local/Borderfree/Localization/Model/Mysql4/Cache/Collection.php +9 -0
  77. app/code/local/Borderfree/Localization/Model/Mysql4/Country.php +9 -0
  78. app/code/local/Borderfree/Localization/Model/Mysql4/Country/Collection.php +9 -0
  79. app/code/local/Borderfree/Localization/Model/Mysql4/Currency.php +9 -0
  80. app/code/local/Borderfree/Localization/Model/Mysql4/Currency/Collection.php +9 -0
  81. app/code/local/Borderfree/Localization/Model/Mysql4/Fxrate.php +10 -0
  82. app/code/local/Borderfree/Localization/Model/Mysql4/Fxrate/Collection.php +9 -0
  83. app/code/local/Borderfree/Localization/Model/Mysql4/Ip.php +9 -0
  84. app/code/local/Borderfree/Localization/Model/Mysql4/Ip/Collection.php +9 -0
  85. app/code/local/Borderfree/Localization/Model/Mysql4/Lcp.php +9 -0
  86. app/code/local/Borderfree/Localization/Model/Mysql4/Lcp/Collection.php +9 -0
  87. app/code/local/Borderfree/Localization/Model/Mysql4/Payment.php +9 -0
  88. app/code/local/Borderfree/Localization/Model/Mysql4/Payment/Collection.php +9 -0
  89. app/code/local/Borderfree/Localization/Model/Mysql4/Region.php +9 -0
  90. app/code/local/Borderfree/Localization/Model/Mysql4/Region/Collection.php +9 -0
  91. app/code/local/Borderfree/Localization/Model/Mysql4/Rounding.php +9 -0
  92. app/code/local/Borderfree/Localization/Model/Mysql4/Rounding/Collection.php +9 -0
  93. app/code/local/Borderfree/Localization/Model/Observer.php +368 -0
  94. app/code/local/Borderfree/Localization/Model/Payment.php +9 -0
  95. app/code/local/Borderfree/Localization/Model/Region.php +9 -0
  96. app/code/local/Borderfree/Localization/Model/Rounding.php +9 -0
  97. app/code/local/Borderfree/Localization/Model/Store.php +50 -0
  98. app/code/local/Borderfree/Localization/Model/Tax.php +38 -0
  99. app/code/local/Borderfree/Localization/controllers/CountryController.php +33 -0
  100. app/code/local/Borderfree/Localization/etc/config.xml +275 -0
  101. app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-install-1.0.0.php +6 -0
  102. app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.0-1.0.1.php +6 -0
  103. app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.1-1.0.2.php +6 -0
  104. app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.2-1.0.3.php +6 -0
  105. app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.3-1.0.4.php +6 -0
  106. app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.4-1.0.5.php +7 -0
  107. app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.5-1.0.6.php +6 -0
  108. app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.6-1.0.7.php +6 -0
  109. app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.7-1.0.8.php +7 -0
  110. app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.8-1.0.9.php +9 -0
  111. app/code/local/Borderfree/Marketing/Helper/Data.php +6 -0
  112. app/code/local/Borderfree/Marketing/Model/Mysql4/Marketing/Collection.php +9 -0
  113. app/code/local/Borderfree/Marketing/Model/Mysql4/Record.php +10 -0
  114. app/code/local/Borderfree/Marketing/Model/Record.php +9 -0
  115. app/code/local/Borderfree/Marketing/etc/config.xml +56 -0
  116. app/code/local/Borderfree/Marketing/sql/borderfreemarketing_setup/mysql4-install-1.0.0.php +19 -0
  117. app/code/local/Borderfree/Order/Helper/Data.php +6 -0
  118. app/code/local/Borderfree/Order/Model/Import.php +422 -0
  119. app/code/local/Borderfree/Order/Model/Observer.php +65 -0
  120. app/code/local/Borderfree/Order/Model/Track.php +155 -0
  121. app/code/local/Borderfree/Order/etc/config.xml +79 -0
  122. app/code/local/Borderfree/Order/sql/borderfreeorder_setup/mysql4-install-1.0.0.php +20 -0
  123. app/code/local/Borderfree/Settings/Block/Adminhtml/Payment.php +67 -0
  124. app/code/local/Borderfree/Settings/Block/Adminhtml/Shipping/Merchant.php +102 -0
  125. app/code/local/Borderfree/Settings/Block/Adminhtml/Shipping/State.php +106 -0
  126. app/code/local/Borderfree/Settings/Helper/Data.php +134 -0
  127. app/code/local/Borderfree/Settings/Model/Days.php +13 -0
  128. app/code/local/Borderfree/Settings/Model/Handling.php +14 -0
  129. app/code/local/Borderfree/Settings/Model/Insurance.php +14 -0
  130. app/code/local/Borderfree/Settings/Model/Lengthunit.php +12 -0
  131. app/code/local/Borderfree/Settings/Model/Rate.php +17 -0
  132. app/code/local/Borderfree/Settings/Model/Weightunit.php +12 -0
  133. app/code/local/Borderfree/Settings/Model/Zip.php +19 -0
  134. app/code/local/Borderfree/Settings/etc/config.xml +90 -0
  135. app/code/local/Borderfree/Settings/etc/system.xml +450 -0
  136. app/code/local/Borderfree/Shipping/Helper/Data.php +33 -0
  137. app/code/local/Borderfree/Shipping/Model/Shipping.php +46 -0
  138. app/code/local/Borderfree/Shipping/controllers/TrackController.php +31 -0
  139. app/code/local/Borderfree/Shipping/etc/config.xml +58 -0
  140. app/code/local/Borderfree/Shipping/etc/system.xml +69 -0
  141. app/design/adminhtml/default/default/layout/borderfreecrontab.xml +10 -0
  142. app/design/frontend/base/default/layout/borderfreecheckout.xml +30 -0
  143. app/design/frontend/base/default/layout/borderfreelocalization.xml +41 -0
  144. app/design/frontend/base/default/layout/borderfreeshipping.xml +21 -0
  145. app/design/frontend/base/default/template/borderfree/.DS_Store +0 -0
  146. app/design/frontend/base/default/template/borderfree/country.phtml +63 -0
  147. app/design/frontend/base/default/template/borderfree/currency.phtml +29 -0
  148. app/design/frontend/base/default/template/borderfree/envoy.phtml +20 -0
  149. app/design/frontend/base/default/template/borderfree/envoyhead.phtml +7 -0
  150. app/design/frontend/base/default/template/borderfree/language.phtml +26 -0
  151. app/design/frontend/base/default/template/borderfree/track.phtml +28 -0
  152. app/design/frontend/base/default/template/borderfree/welcomemat.phtml +48 -0
  153. app/etc/modules/Borderfree_Api.xml +10 -0
  154. app/etc/modules/Borderfree_Catalog.xml +10 -0
  155. app/etc/modules/Borderfree_Chcekout.xml +10 -0
  156. app/etc/modules/Borderfree_Crontab.xml +10 -0
  157. app/etc/modules/Borderfree_Localization.xml +10 -0
  158. app/etc/modules/Borderfree_Marketing.xml +10 -0
  159. app/etc/modules/Borderfree_Order.xml +10 -0
  160. app/etc/modules/Borderfree_Settings.xml +10 -0
  161. app/etc/modules/Borderfree_Shipping.xml +10 -0
  162. package.xml +18 -0
  163. skin/frontend/base/default/css/borderfree.css +6 -0
  164. skin/frontend/base/default/images/borderfree/AD.gif +0 -0
  165. skin/frontend/base/default/images/borderfree/AE.gif +0 -0
  166. skin/frontend/base/default/images/borderfree/AF.gif +0 -0
  167. skin/frontend/base/default/images/borderfree/AG.gif +0 -0
  168. skin/frontend/base/default/images/borderfree/AI.gif +0 -0
  169. skin/frontend/base/default/images/borderfree/AL.gif +0 -0
  170. skin/frontend/base/default/images/borderfree/AM.gif +0 -0
  171. skin/frontend/base/default/images/borderfree/AN.gif +0 -0
  172. skin/frontend/base/default/images/borderfree/AO.gif +0 -0
  173. skin/frontend/base/default/images/borderfree/AQ.gif +0 -0
  174. skin/frontend/base/default/images/borderfree/AR.gif +0 -0
  175. skin/frontend/base/default/images/borderfree/AS.gif +0 -0
  176. skin/frontend/base/default/images/borderfree/AT.gif +0 -0
  177. skin/frontend/base/default/images/borderfree/AU.gif +0 -0
  178. skin/frontend/base/default/images/borderfree/AW.gif +0 -0
  179. skin/frontend/base/default/images/borderfree/AX.gif +0 -0
  180. skin/frontend/base/default/images/borderfree/AZ.gif +0 -0
  181. skin/frontend/base/default/images/borderfree/BA.gif +0 -0
  182. skin/frontend/base/default/images/borderfree/BB.gif +0 -0
  183. skin/frontend/base/default/images/borderfree/BD.gif +0 -0
  184. skin/frontend/base/default/images/borderfree/BE.gif +0 -0
  185. skin/frontend/base/default/images/borderfree/BF.gif +0 -0
  186. skin/frontend/base/default/images/borderfree/BG.gif +0 -0
  187. skin/frontend/base/default/images/borderfree/BH.gif +0 -0
  188. skin/frontend/base/default/images/borderfree/BI.gif +0 -0
  189. skin/frontend/base/default/images/borderfree/BJ.gif +0 -0
  190. skin/frontend/base/default/images/borderfree/BL.gif +0 -0
  191. skin/frontend/base/default/images/borderfree/BM.gif +0 -0
  192. skin/frontend/base/default/images/borderfree/BN.gif +0 -0
  193. skin/frontend/base/default/images/borderfree/BO.gif +0 -0
  194. skin/frontend/base/default/images/borderfree/BQ.gif +0 -0
  195. skin/frontend/base/default/images/borderfree/BR.gif +0 -0
  196. skin/frontend/base/default/images/borderfree/BS.gif +0 -0
  197. skin/frontend/base/default/images/borderfree/BT.gif +0 -0
  198. skin/frontend/base/default/images/borderfree/BV.gif +0 -0
  199. skin/frontend/base/default/images/borderfree/BW.gif +0 -0
  200. skin/frontend/base/default/images/borderfree/BY.gif +0 -0
  201. skin/frontend/base/default/images/borderfree/BZ.gif +0 -0
  202. skin/frontend/base/default/images/borderfree/CA.gif +0 -0
  203. skin/frontend/base/default/images/borderfree/CC.gif +0 -0
  204. skin/frontend/base/default/images/borderfree/CD.gif +0 -0
  205. skin/frontend/base/default/images/borderfree/CF.gif +0 -0
  206. skin/frontend/base/default/images/borderfree/CG.gif +0 -0
  207. skin/frontend/base/default/images/borderfree/CH.gif +0 -0
  208. skin/frontend/base/default/images/borderfree/CI.gif +0 -0
  209. skin/frontend/base/default/images/borderfree/CK.gif +0 -0
  210. skin/frontend/base/default/images/borderfree/CL.gif +0 -0
  211. skin/frontend/base/default/images/borderfree/CM.gif +0 -0
  212. skin/frontend/base/default/images/borderfree/CN.gif +0 -0
  213. skin/frontend/base/default/images/borderfree/CO.gif +0 -0
  214. skin/frontend/base/default/images/borderfree/CR.gif +0 -0
  215. skin/frontend/base/default/images/borderfree/CS.gif +0 -0
  216. skin/frontend/base/default/images/borderfree/CU.gif +0 -0
  217. skin/frontend/base/default/images/borderfree/CV.gif +0 -0
  218. skin/frontend/base/default/images/borderfree/CW.gif +0 -0
  219. skin/frontend/base/default/images/borderfree/CX.gif +0 -0
  220. skin/frontend/base/default/images/borderfree/CY.gif +0 -0
  221. skin/frontend/base/default/images/borderfree/CZ.gif +0 -0
  222. skin/frontend/base/default/images/borderfree/DE.gif +0 -0
  223. skin/frontend/base/default/images/borderfree/DJ.gif +0 -0
  224. skin/frontend/base/default/images/borderfree/DK.gif +0 -0
  225. skin/frontend/base/default/images/borderfree/DM.gif +0 -0
  226. skin/frontend/base/default/images/borderfree/DO.gif +0 -0
  227. skin/frontend/base/default/images/borderfree/DZ.gif +0 -0
  228. skin/frontend/base/default/images/borderfree/EC.gif +0 -0
  229. skin/frontend/base/default/images/borderfree/EE.gif +0 -0
  230. skin/frontend/base/default/images/borderfree/EG.gif +0 -0
  231. skin/frontend/base/default/images/borderfree/EH.gif +0 -0
  232. skin/frontend/base/default/images/borderfree/ER.gif +0 -0
  233. skin/frontend/base/default/images/borderfree/ES.gif +0 -0
  234. skin/frontend/base/default/images/borderfree/ET.gif +0 -0
  235. skin/frontend/base/default/images/borderfree/EU.gif +0 -0
  236. skin/frontend/base/default/images/borderfree/FI.gif +0 -0
  237. skin/frontend/base/default/images/borderfree/FJ.gif +0 -0
  238. skin/frontend/base/default/images/borderfree/FK.gif +0 -0
  239. skin/frontend/base/default/images/borderfree/FM.gif +0 -0
  240. skin/frontend/base/default/images/borderfree/FO.gif +0 -0
  241. skin/frontend/base/default/images/borderfree/FR.gif +0 -0
  242. skin/frontend/base/default/images/borderfree/GA.gif +0 -0
  243. skin/frontend/base/default/images/borderfree/GB.gif +0 -0
  244. skin/frontend/base/default/images/borderfree/GD.gif +0 -0
  245. skin/frontend/base/default/images/borderfree/GE.gif +0 -0
  246. skin/frontend/base/default/images/borderfree/GF.gif +0 -0
  247. skin/frontend/base/default/images/borderfree/GG.gif +0 -0
  248. skin/frontend/base/default/images/borderfree/GH.gif +0 -0
  249. skin/frontend/base/default/images/borderfree/GI.gif +0 -0
  250. skin/frontend/base/default/images/borderfree/GL.gif +0 -0
  251. skin/frontend/base/default/images/borderfree/GM.gif +0 -0
  252. skin/frontend/base/default/images/borderfree/GN.gif +0 -0
  253. skin/frontend/base/default/images/borderfree/GP.gif +0 -0
  254. skin/frontend/base/default/images/borderfree/GQ.gif +0 -0
  255. skin/frontend/base/default/images/borderfree/GR.gif +0 -0
  256. skin/frontend/base/default/images/borderfree/GS.gif +0 -0
  257. skin/frontend/base/default/images/borderfree/GT.gif +0 -0
  258. skin/frontend/base/default/images/borderfree/GU.gif +0 -0
  259. skin/frontend/base/default/images/borderfree/GW.gif +0 -0
  260. skin/frontend/base/default/images/borderfree/GY.gif +0 -0
  261. skin/frontend/base/default/images/borderfree/HK.gif +0 -0
  262. skin/frontend/base/default/images/borderfree/HM.gif +0 -0
  263. skin/frontend/base/default/images/borderfree/HN.gif +0 -0
  264. skin/frontend/base/default/images/borderfree/HR.gif +0 -0
  265. skin/frontend/base/default/images/borderfree/HT.gif +0 -0
  266. skin/frontend/base/default/images/borderfree/HU.gif +0 -0
  267. skin/frontend/base/default/images/borderfree/IC.gif +0 -0
  268. skin/frontend/base/default/images/borderfree/ID.gif +0 -0
  269. skin/frontend/base/default/images/borderfree/IE.gif +0 -0
  270. skin/frontend/base/default/images/borderfree/IL.gif +0 -0
  271. skin/frontend/base/default/images/borderfree/IM.gif +0 -0
  272. skin/frontend/base/default/images/borderfree/IN.gif +0 -0
  273. skin/frontend/base/default/images/borderfree/IO.gif +0 -0
  274. skin/frontend/base/default/images/borderfree/IQ.gif +0 -0
  275. skin/frontend/base/default/images/borderfree/IR.gif +0 -0
  276. skin/frontend/base/default/images/borderfree/IS.gif +0 -0
  277. skin/frontend/base/default/images/borderfree/IT.gif +0 -0
  278. skin/frontend/base/default/images/borderfree/JE.gif +0 -0
  279. skin/frontend/base/default/images/borderfree/JM.gif +0 -0
  280. skin/frontend/base/default/images/borderfree/JO.gif +0 -0
  281. skin/frontend/base/default/images/borderfree/JP.gif +0 -0
  282. skin/frontend/base/default/images/borderfree/KE.gif +0 -0
  283. skin/frontend/base/default/images/borderfree/KG.gif +0 -0
  284. skin/frontend/base/default/images/borderfree/KH.gif +0 -0
  285. skin/frontend/base/default/images/borderfree/KI.gif +0 -0
  286. skin/frontend/base/default/images/borderfree/KM.gif +0 -0
  287. skin/frontend/base/default/images/borderfree/KN.gif +0 -0
  288. skin/frontend/base/default/images/borderfree/KP.gif +0 -0
  289. skin/frontend/base/default/images/borderfree/KR.gif +0 -0
  290. skin/frontend/base/default/images/borderfree/KW.gif +0 -0
  291. skin/frontend/base/default/images/borderfree/KY.gif +0 -0
  292. skin/frontend/base/default/images/borderfree/KZ.gif +0 -0
  293. skin/frontend/base/default/images/borderfree/LA.gif +0 -0
  294. skin/frontend/base/default/images/borderfree/LB.gif +0 -0
  295. skin/frontend/base/default/images/borderfree/LC.gif +0 -0
  296. skin/frontend/base/default/images/borderfree/LI.gif +0 -0
  297. skin/frontend/base/default/images/borderfree/LK.gif +0 -0
  298. skin/frontend/base/default/images/borderfree/LR.gif +0 -0
  299. skin/frontend/base/default/images/borderfree/LS.gif +0 -0
  300. skin/frontend/base/default/images/borderfree/LT.gif +0 -0
  301. skin/frontend/base/default/images/borderfree/LU.gif +0 -0
  302. skin/frontend/base/default/images/borderfree/LV.gif +0 -0
  303. skin/frontend/base/default/images/borderfree/LY.gif +0 -0
  304. skin/frontend/base/default/images/borderfree/MA.gif +0 -0
  305. skin/frontend/base/default/images/borderfree/MC.gif +0 -0
  306. skin/frontend/base/default/images/borderfree/MD.gif +0 -0
  307. skin/frontend/base/default/images/borderfree/ME.gif +0 -0
  308. skin/frontend/base/default/images/borderfree/MF.gif +0 -0
  309. skin/frontend/base/default/images/borderfree/MG.gif +0 -0
  310. skin/frontend/base/default/images/borderfree/MH.gif +0 -0
  311. skin/frontend/base/default/images/borderfree/MK.gif +0 -0
  312. skin/frontend/base/default/images/borderfree/ML.gif +0 -0
  313. skin/frontend/base/default/images/borderfree/MM.gif +0 -0
  314. skin/frontend/base/default/images/borderfree/MN.gif +0 -0
  315. skin/frontend/base/default/images/borderfree/MO.gif +0 -0
  316. skin/frontend/base/default/images/borderfree/MP.gif +0 -0
  317. skin/frontend/base/default/images/borderfree/MQ.gif +0 -0
  318. skin/frontend/base/default/images/borderfree/MR.gif +0 -0
  319. skin/frontend/base/default/images/borderfree/MS.gif +0 -0
  320. skin/frontend/base/default/images/borderfree/MT.gif +0 -0
  321. skin/frontend/base/default/images/borderfree/MU.gif +0 -0
  322. skin/frontend/base/default/images/borderfree/MV.gif +0 -0
  323. skin/frontend/base/default/images/borderfree/MW.gif +0 -0
  324. skin/frontend/base/default/images/borderfree/MX.gif +0 -0
  325. skin/frontend/base/default/images/borderfree/MY.gif +0 -0
  326. skin/frontend/base/default/images/borderfree/MZ.gif +0 -0
  327. skin/frontend/base/default/images/borderfree/NA.gif +0 -0
  328. skin/frontend/base/default/images/borderfree/NC.gif +0 -0
  329. skin/frontend/base/default/images/borderfree/NE.gif +0 -0
  330. skin/frontend/base/default/images/borderfree/NF.gif +0 -0
  331. skin/frontend/base/default/images/borderfree/NG.gif +0 -0
  332. skin/frontend/base/default/images/borderfree/NI.gif +0 -0
  333. skin/frontend/base/default/images/borderfree/NL.gif +0 -0
  334. skin/frontend/base/default/images/borderfree/NO.gif +0 -0
  335. skin/frontend/base/default/images/borderfree/NP.gif +0 -0
  336. skin/frontend/base/default/images/borderfree/NR.gif +0 -0
  337. skin/frontend/base/default/images/borderfree/NU.gif +0 -0
  338. skin/frontend/base/default/images/borderfree/NZ.gif +0 -0
  339. skin/frontend/base/default/images/borderfree/OM.gif +0 -0
  340. skin/frontend/base/default/images/borderfree/PA.gif +0 -0
  341. skin/frontend/base/default/images/borderfree/PE.gif +0 -0
  342. skin/frontend/base/default/images/borderfree/PF.gif +0 -0
  343. skin/frontend/base/default/images/borderfree/PG.gif +0 -0
  344. skin/frontend/base/default/images/borderfree/PH.gif +0 -0
  345. skin/frontend/base/default/images/borderfree/PK.gif +0 -0
  346. skin/frontend/base/default/images/borderfree/PL.gif +0 -0
  347. skin/frontend/base/default/images/borderfree/PM.gif +0 -0
  348. skin/frontend/base/default/images/borderfree/PN.gif +0 -0
  349. skin/frontend/base/default/images/borderfree/PR.gif +0 -0
  350. skin/frontend/base/default/images/borderfree/PS.gif +0 -0
  351. skin/frontend/base/default/images/borderfree/PT.gif +0 -0
  352. skin/frontend/base/default/images/borderfree/PW.gif +0 -0
  353. skin/frontend/base/default/images/borderfree/PY.gif +0 -0
  354. skin/frontend/base/default/images/borderfree/QA.gif +0 -0
  355. skin/frontend/base/default/images/borderfree/RE.gif +0 -0
  356. skin/frontend/base/default/images/borderfree/RO.gif +0 -0
  357. skin/frontend/base/default/images/borderfree/RS.gif +0 -0
  358. skin/frontend/base/default/images/borderfree/RU.gif +0 -0
  359. skin/frontend/base/default/images/borderfree/RW.gif +0 -0
  360. skin/frontend/base/default/images/borderfree/SA.gif +0 -0
  361. skin/frontend/base/default/images/borderfree/SB.gif +0 -0
  362. skin/frontend/base/default/images/borderfree/SC.gif +0 -0
  363. skin/frontend/base/default/images/borderfree/SD.gif +0 -0
  364. skin/frontend/base/default/images/borderfree/SE.gif +0 -0
  365. skin/frontend/base/default/images/borderfree/SG.gif +0 -0
  366. skin/frontend/base/default/images/borderfree/SH.gif +0 -0
  367. skin/frontend/base/default/images/borderfree/SI.gif +0 -0
  368. skin/frontend/base/default/images/borderfree/SJ.gif +0 -0
  369. skin/frontend/base/default/images/borderfree/SK.gif +0 -0
  370. skin/frontend/base/default/images/borderfree/SL.gif +0 -0
  371. skin/frontend/base/default/images/borderfree/SM.gif +0 -0
  372. skin/frontend/base/default/images/borderfree/SN.gif +0 -0
  373. skin/frontend/base/default/images/borderfree/SO.gif +0 -0
  374. skin/frontend/base/default/images/borderfree/SR.gif +0 -0
  375. skin/frontend/base/default/images/borderfree/ST.gif +0 -0
  376. skin/frontend/base/default/images/borderfree/SV.gif +0 -0
  377. skin/frontend/base/default/images/borderfree/SX.gif +0 -0
  378. skin/frontend/base/default/images/borderfree/SY.gif +0 -0
  379. skin/frontend/base/default/images/borderfree/SZ.gif +0 -0
  380. skin/frontend/base/default/images/borderfree/TC.gif +0 -0
  381. skin/frontend/base/default/images/borderfree/TD.gif +0 -0
  382. skin/frontend/base/default/images/borderfree/TF.gif +0 -0
  383. skin/frontend/base/default/images/borderfree/TG.gif +0 -0
  384. skin/frontend/base/default/images/borderfree/TH.gif +0 -0
  385. skin/frontend/base/default/images/borderfree/TJ.gif +0 -0
  386. skin/frontend/base/default/images/borderfree/TK.gif +0 -0
  387. skin/frontend/base/default/images/borderfree/TL.gif +0 -0
  388. skin/frontend/base/default/images/borderfree/TM.gif +0 -0
  389. skin/frontend/base/default/images/borderfree/TN.gif +0 -0
  390. skin/frontend/base/default/images/borderfree/TO.gif +0 -0
  391. skin/frontend/base/default/images/borderfree/TP.gif +0 -0
  392. skin/frontend/base/default/images/borderfree/TR.gif +0 -0
  393. skin/frontend/base/default/images/borderfree/TT.gif +0 -0
  394. skin/frontend/base/default/images/borderfree/TV.gif +0 -0
  395. skin/frontend/base/default/images/borderfree/TW.gif +0 -0
  396. skin/frontend/base/default/images/borderfree/TZ.gif +0 -0
  397. skin/frontend/base/default/images/borderfree/UA.gif +0 -0
  398. skin/frontend/base/default/images/borderfree/UG.gif +0 -0
  399. skin/frontend/base/default/images/borderfree/UM.gif +0 -0
  400. skin/frontend/base/default/images/borderfree/US.gif +0 -0
  401. skin/frontend/base/default/images/borderfree/UY.gif +0 -0
  402. skin/frontend/base/default/images/borderfree/UZ.gif +0 -0
  403. skin/frontend/base/default/images/borderfree/VA.gif +0 -0
  404. skin/frontend/base/default/images/borderfree/VC.gif +0 -0
  405. skin/frontend/base/default/images/borderfree/VE.gif +0 -0
  406. skin/frontend/base/default/images/borderfree/VG.gif +0 -0
  407. skin/frontend/base/default/images/borderfree/VI.gif +0 -0
  408. skin/frontend/base/default/images/borderfree/VN.gif +0 -0
  409. skin/frontend/base/default/images/borderfree/VU.gif +0 -0
  410. skin/frontend/base/default/images/borderfree/WF.gif +0 -0
  411. skin/frontend/base/default/images/borderfree/WS.gif +0 -0
  412. skin/frontend/base/default/images/borderfree/YE.gif +0 -0
  413. skin/frontend/base/default/images/borderfree/YT.gif +0 -0
  414. skin/frontend/base/default/images/borderfree/YU.gif +0 -0
  415. skin/frontend/base/default/images/borderfree/ZA.gif +0 -0
  416. skin/frontend/base/default/images/borderfree/ZM.gif +0 -0
  417. skin/frontend/base/default/images/borderfree/ZW.gif +0 -0
  418. skin/frontend/base/default/images/borderfree/ZZ.gif +0 -0
app/code/local/Borderfree/.DS_Store ADDED
Binary file
app/code/local/Borderfree/Api/Helper/Data.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Api
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * Borderfree API Helper Class
15
+ *
16
+ * Observes the following events:
17
+ *
18
+ * fiftonelocalization_predispatch_observer
19
+ * controller_action_layout_load_before
20
+ *
21
+ * @category Borderfree
22
+ * @package Borderfree_Api
23
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
24
+ *
25
+ */
26
+ class Borderfree_Api_Helper_Data extends Mage_Core_Helper_Abstract
27
+ {
28
+
29
+ }
30
+ ?>
app/code/local/Borderfree/Api/Model/Webservice.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Api
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * Borderfree Webservice API
15
+ *
16
+ * This Model creates and sends XML requests to the Borderfree API
17
+ *
18
+ * @category Borderfree
19
+ * @package Borderfree_Api
20
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
21
+ * @see XMLWriter
22
+ */
23
+ class Borderfree_Api_Model_Webservice extends XMLWriter
24
+ {
25
+
26
+ /**
27
+ * Initalizes the XML document for the Borderfree API
28
+ */
29
+ public function __construct()
30
+ {
31
+ $this->openMemory();
32
+ $this->setIndent(true);
33
+ $this->setIndentString(' ');
34
+ $this->startDocument('1.0', 'UTF-8');
35
+
36
+ $this->startElement('message');
37
+ $this->startElement('payload');
38
+ }
39
+
40
+ /**
41
+ * Sets the API request Type
42
+ *
43
+ * @param string $request API Request Type
44
+ */
45
+ public function startRequest($request)
46
+ {
47
+ $this->startElement($request);
48
+ $this->writeAttribute("id", uniqid('', true));
49
+ }
50
+
51
+ /**
52
+ * Starts an XML element with an optional array of attributes in kay => value form.
53
+ *
54
+ * @param $name string XML Element Name
55
+ * @param $attributes array An array of attribute key value pairs.
56
+ * @see XMLWriter::startElement()
57
+ */
58
+ public function startElement($name, $attributes = NULL)
59
+ {
60
+ parent::startElement($name);
61
+
62
+ if($attributes != null)
63
+ {
64
+ foreach($attributes as $attributeName => $value)
65
+ {
66
+ $this->writeAttribute($attributeName, $value);
67
+ }
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Writes an XML element to the request.
73
+ *
74
+ * @param $name string Name of the XML Element
75
+ * @param $content string The XML element text.
76
+ * @param $strip boolean Strip HTML from element text.
77
+ * @see XMLWriter::writeElement()
78
+ */
79
+ public function writeElement($name, $content = null, $strip = false)
80
+ {
81
+ if($strip)
82
+ $content = html_entity_decode(strip_tags($content), ENT_COMPAT, "UTF-8");
83
+
84
+ parent::writeElement($name, $content);
85
+ }
86
+
87
+ /**
88
+ * Submits the API request to Borderfree
89
+ *
90
+ * @param $endpoint string The Borderfree Endpoint for this request.
91
+ * @return string The result received from the Borderfree API request
92
+ */
93
+ public function submitRequest($endpoint)
94
+ {
95
+ $credentials = Mage::helper('borderfreesettings')->getApiCredentials();
96
+
97
+ $ch = curl_init();
98
+ curl_setopt($ch, CURLOPT_URL, $endpoint);
99
+ curl_setopt($ch, CURLOPT_HEADER, false);
100
+ curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/xml; charset=utf-8"));
101
+ curl_setopt($ch, CURLOPT_USERPWD, $credentials);
102
+ curl_setopt($ch, CURLOPT_POST, 1);
103
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $this->getDocument());
104
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
105
+
106
+ $result = curl_exec($ch);
107
+ $info = curl_getinfo($ch);
108
+ curl_close($ch);
109
+
110
+ return $result;
111
+ }
112
+
113
+ /**
114
+ * Returns the complete XML API request;
115
+ *
116
+ * @return string
117
+ */
118
+ public function getDocument()
119
+ {
120
+ $this->endElement();
121
+ $this->endElement();
122
+ $this->endElement();
123
+ $this->endDocument();
124
+ return $this->outputMemory(false);
125
+ }
126
+ }
app/code/local/Borderfree/Api/etc/config.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Borderfree_Api>
5
+ <version>1.0.1</version>
6
+ </Borderfree_Api>
7
+ </modules>
8
+
9
+ <global>
10
+ <helpers>
11
+ <borderfreeapi>
12
+ <class>Borderfree_Api_Helper</class>
13
+ </borderfreeapi>
14
+ </helpers>
15
+ <models>
16
+ <borderfreeapi>
17
+ <class>Borderfree_Api_Model</class>
18
+ </borderfreeapi>
19
+ </models>
20
+ </global>
21
+ </config>
22
+
app/code/local/Borderfree/Catalog/Helper/Data.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Catalog
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * Borderfree Catalog Helper Model
15
+ *
16
+ * @category Borderfree
17
+ * @package Borderfree_Catahog
18
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
19
+ *
20
+ */
21
+ class Borderfree_Catalog_Helper_Data extends Mage_Core_Helper_Abstract
22
+ {
23
+
24
+ }
25
+ ?>
app/code/local/Borderfree/Catalog/Model/Export.php ADDED
@@ -0,0 +1,1080 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Catalog
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * This model exports full and incremental catalog data to Fifty one and checks for catalog error logs.
15
+ *
16
+ * Observes the following events:
17
+ *
18
+ * fiftonelocalization_predispatch_observer
19
+ * controller_action_layout_load_before
20
+ *
21
+ * @category Borderfree
22
+ * @package Borderfree_Catalog
23
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
24
+ *
25
+ */
26
+ class Borderfree_Catalog_Model_Export extends Mage_Core_Model_Abstract
27
+ {
28
+ /**
29
+ * The catalog export directory
30
+ *
31
+ * @var string
32
+ */
33
+ private $dir = "";
34
+ private $file = NULL;
35
+ private $requestId = 0;
36
+ private $recordsOut = 0;
37
+ private $rootcatId = 2;
38
+ private $request = "";
39
+ private $type = "";
40
+ private $filenum = 0;
41
+ private $batchId;
42
+ private $outStr = "";
43
+ private $indent = 1;
44
+ private $strIndent = 0;
45
+ private $errors = "";
46
+ private $lastRequest = "";
47
+ private $pageSize = 1000;
48
+ private $zip= NULL;
49
+ private $filename = "";
50
+ private $merchantIds = array();
51
+ private $stores = array();
52
+ private $subject = "Borderfree Catalog Export Error";
53
+ private $batchComplete = false;
54
+
55
+ private $localizationHelper;
56
+
57
+ /**
58
+ * Creates directory structure needed for Borderfree Catalog Export,
59
+ * cleans the export directory of old files, and sets the batch ID.
60
+ */
61
+ function __construct()
62
+ {
63
+ gc_enable();
64
+
65
+ parent::__construct();
66
+
67
+ $this->localizationHelper = Mage::Helper("borderfreelocalization");
68
+
69
+ $this->dir = Mage::getBaseDir('var') . DS . "Borderfree" . DS;
70
+ umask(0);
71
+ $this->batchId = date("mdyHis");
72
+
73
+ if(!is_dir($this->dir))
74
+ {
75
+ mkdir($this->dir);
76
+ }
77
+
78
+ if(!is_dir($this->dir . "incoming_borderfree_catalog_error_logs" . DS))
79
+ {
80
+ mkdir($this->dir . "incoming_borderfree_catalog_error_logs" . DS);
81
+ }
82
+
83
+ if(!is_dir($this->dir . "catalog_export_archive" . DS))
84
+ {
85
+ mkdir($this->dir . "catalog_export_archive" . DS);
86
+ }
87
+ }
88
+
89
+ private function sendZipFile()
90
+ {
91
+ $dir = opendir($this->dir);
92
+ $this->zip = new ZipArchive();
93
+ $filename = $this->dir . $this->batchId .".zip";
94
+
95
+ if ($this->zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE)
96
+ {
97
+ throw new Exception("Cannot creare zip archive $filename");
98
+ }
99
+
100
+ while($file = readdir($dir))
101
+ {
102
+ if(!is_dir($this->dir. $file) || strpos(".xml", $file) > 0)
103
+ $this->zip->addFile($this->dir . $file, $file);
104
+ }
105
+
106
+ closedir($dir);
107
+ $this->zip->close();
108
+
109
+ $server = Mage::getStoreConfig('borderfree_options/settings/staging') ? Mage::getStoreConfig('borderfree_options/catalog/ftpstage') : Mage::getStoreConfig('borderfree_options/catalog/ftpprod');
110
+ $username = Mage::getStoreConfig('borderfree_options/catalog/ftpuser');
111
+ $password = Mage::helper('core')->decrypt(Mage::getStoreConfig('borderfree_options/catalog/ftppassword'));
112
+
113
+ $conn_id = ftp_ssl_connect($server);
114
+ if (!$conn_id)
115
+ throw new Exception("Unable to connect to FTP server: $server");
116
+
117
+ $login_result = ftp_login($conn_id, $username, $password);
118
+ if (!$login_result)
119
+ throw new Exception("Login to FTP server $server failed for user $username");
120
+
121
+ ftp_pasv($conn_id, true);
122
+ $upload = ftp_put($conn_id, '/Inbox/Catalog/' . $this->batchId .".zip", $this->dir . $this->batchId .".zip", FTP_BINARY);
123
+ if (!$upload)
124
+ throw new Exception("Failed to upload file" . $this->batchId . ".zip to server " .$server . ".");
125
+
126
+ $mrk = fopen($this->dir . $this->batchId .".zip.mrk", "w");
127
+ fputs($mrk, "mrk");
128
+ fclose($mrk);
129
+
130
+ $upload = ftp_put($conn_id, '/Inbox/Catalog/' . $this->batchId .".zip.mrk", $this->dir . $this->batchId .".zip.mrk", FTP_BINARY);
131
+ if (!$upload)
132
+ throw new Exception("Failed to upload file" . $this->batchId . ".zip.mrk to server " .$server . ".");
133
+
134
+ rename( $this->dir . $this->batchId .".zip", $this->dir . "catalog_export_archive" . DS . $this->batchId .".zip");
135
+
136
+ ftp_close($conn_id);
137
+ }
138
+
139
+ public function getErrorLogs()
140
+ {
141
+ $model = Mage::getModel('borderfreecrontab/log');
142
+ $model->setType("Get Catalog Error Logs");
143
+ $model->setLastRun(time());
144
+ $model->save();
145
+
146
+ $allStores = Mage::app()->getStores();
147
+ foreach ($allStores as $_eachStoreId => $val)
148
+ {
149
+ $store = Mage::app()->getStore($_eachStoreId)->getId();
150
+ Mage::app()->setCurrentStore($store);
151
+ if(Mage::getStoreConfig('borderfree_options/settings/enabled'))
152
+ {
153
+ if(!in_array(Mage::getStoreConfig('borderfree_options/settings/merchantid'), $this->merchantIds))
154
+ {
155
+ try
156
+ {
157
+ $this->subject = "Borderfree Get Catalog Error Logs";
158
+ $server = Mage::getStoreConfig('borderfree_options/settings/staging') ? Mage::getStoreConfig('borderfree_options/catalog/ftpstage') : Mage::getStoreConfig('borderfree_options/catalog/ftpprod');
159
+ $username = Mage::getStoreConfig('borderfree_options/catalog/ftpuser');
160
+ $password = Mage::helper('core')->decrypt(Mage::getStoreConfig('borderfree_options/catalog/ftppassword'));
161
+
162
+ $conn_id = ftp_ssl_connect($server);
163
+ if(!$conn_id)
164
+ throw new Exception("Unable to connect to FTP server: $server");
165
+
166
+ $login_result = ftp_login($conn_id, $username, $password);
167
+ if(!$login_result)
168
+ throw new Exception("Login to FTP server $server failed for user $username");
169
+
170
+ ftp_pasv($conn_id, true);
171
+
172
+ $chdir = ftp_chdir($conn_id, "/Inbox/Catalog");
173
+ if(!$chdir)
174
+ throw new Exception("Unable to change directory to /Inbox/Catalog on server $server");
175
+
176
+ $files = ftp_nlist($conn_id, ".");
177
+ foreach($files as $file)
178
+ {
179
+ if(strpos($file, "err") > 0)
180
+ {
181
+ $get = ftp_get($conn_id, $this->dir . "incoming_borderfree_catalog_error_logs" . DS . $file, $file, FTP_BINARY);
182
+
183
+ if($get)
184
+ $del = ftp_delete($conn_id, $file);
185
+ else
186
+ throw new Exception("Unable to download $file from server $server");
187
+
188
+ if(!$del)
189
+ throw new Exception("Unable to delete $file from server $server");
190
+
191
+ $message = $file . ":\n\n" . file_get_contents($this->dir . "incoming_borderfree_catalog_error_logs" . DS . $file);
192
+ mail(Mage::getStoreConfig('borderfree_options/settings/erroremail'), "Borderfree Catalog Import Error", $message);
193
+ }
194
+ }
195
+ }
196
+ catch(Exception $e)
197
+ {
198
+ $this->logError("Get Error logs: " . $e->getMessage(), Zend_Log::ERR);
199
+ }
200
+ if($conn_id) {
201
+ ftp_close($conn_id);
202
+ }
203
+ }
204
+ }
205
+ }
206
+ $this->sendErrorLog();
207
+ }
208
+
209
+
210
+ public function fullExport($updated_at = NULL)
211
+ {
212
+ if(Mage::getModel("borderfreecatalog/stores")->getCollection()->count() > 0)
213
+ return;
214
+
215
+ $model = Mage::getModel('borderfreecatalog/log');
216
+ $model->setType($updated_at == NULL ? "full" : "incremental");
217
+ $model->setStartTime(time());
218
+ $model->save();
219
+
220
+ $model = Mage::getModel('borderfreecrontab/log');
221
+ $model->setType($updated_at == NULL ? "Full Catalog Export" : "Incremental Catalog Export");
222
+ $model->setLastRun(time());
223
+ $model->save();
224
+
225
+ $dir = opendir($this->dir);
226
+ while($file = readdir($dir))
227
+ {
228
+ if(!is_dir($this->dir. $file))
229
+ unlink($this->dir. $file);
230
+ }
231
+ closedir($dir);
232
+
233
+ $allStores = Mage::app()->getStores();
234
+ foreach ($allStores as $_eachStoreId => $val)
235
+ {
236
+ $store = Mage::app()->getStore($_eachStoreId)->getId();
237
+ Mage::app()->setCurrentStore($store);
238
+
239
+ if(Mage::getStoreConfig('borderfree_options/settings/enabled'))
240
+ {
241
+ if(!in_array(Mage::getStoreConfig('borderfree_options/settings/merchantid'), $this->merchantIds))
242
+ {
243
+ $this->merchantIds[] = Mage::getStoreConfig('borderfree_options/settings/merchantid');
244
+
245
+ $stores = Mage::getModel("borderfreecatalog/stores")->load($_eachStoreId);
246
+ $stores->setStoreId($_eachStoreId);
247
+ $stores->setStatus(1);
248
+ $stores->setStartTime($updated_at);
249
+ $stores->setFilenum(0);
250
+ $stores->setRequestId(0);
251
+ $stores->setBatchId(date("mdyHis"));
252
+ $stores->save();
253
+ }
254
+ }
255
+ }
256
+
257
+ $this->resumeExport();
258
+ }
259
+
260
+ private function sendErrorLog()
261
+ {
262
+ if(empty($this->errors))
263
+ return;
264
+
265
+ mail(Mage::getStoreConfig('borderfree_options/settings/erroremail'), $this->subject, $this->errors);
266
+ $this->errors = "";
267
+ }
268
+
269
+ public function incrementalExport()
270
+ {
271
+ $collection = Mage::getModel("borderfreecatalog/log")->getCollection();
272
+ $last = $collection->getLastItem();
273
+ if($last == null)
274
+ $this->fullExport();
275
+ else
276
+ $this->fullExport($last->getStartTime());
277
+ }
278
+
279
+
280
+
281
+ private function exportAllCategories($updated_at = null)
282
+ {
283
+ $this->rootcatId = Mage::app()->getStore()->getRootCategoryId();
284
+ $cat = Mage::getModel('catalog/category')->load($this->rootcatId);
285
+
286
+ $this->writeCategory($cat, $updated_at);
287
+ $this->writeCategories($cat->getChildrenCategories(), $updated_at);
288
+ $this->closeFile();
289
+
290
+ $cat->clearInstance();
291
+ unset($cat);
292
+ }
293
+
294
+ private function getProductIDs($page, $updated_at = NULL)
295
+ {
296
+ $productIDs = Mage::getModel("catalog/product")->getCollection();
297
+
298
+ if($updated_at != NULL)
299
+ $productIDs->addFieldToFilter("updated_at", array("from" => $updated_at));
300
+
301
+ $productIDs->setPageSize($this->pageSize)->setCurPage($page);
302
+
303
+ return $productIDs;
304
+ }
305
+
306
+ private function exportAllProducts($updated_at = NULL, $kits = false)
307
+ {
308
+ $page = 1;
309
+ $num = 1;
310
+
311
+ $products = Mage::getModel("borderfreecatalog/products")->getCollection()->addFieldToFilter("status", 1)->setPageSize($this->pageSize)->setCurPage(1);
312
+ if($products->count() == 0)
313
+ {
314
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
315
+ $connection->query("truncate table borderfree_catalog_export_products");
316
+
317
+ $sql = "insert into borderfree_catalog_export_products select product_id, 1 from catalog_product_entity, catalog_product_website where product_id = entity_id ". ($kits ? "and type_id = 'bundle'": "") . "and website_id = " . Mage::app()->getWebsite()->getId();
318
+ if($updated_at != NULL)
319
+ $sql .= " and updated_at >= '" . $updated_at . "'";
320
+ $connection->query($sql);
321
+
322
+ $products = Mage::getModel("borderfreecatalog/products")->getCollection()->addFieldToFilter("status", 1)->setPageSize($this->pageSize)->setCurPage(1);
323
+ if($products->count() == 0)
324
+ {
325
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
326
+ $connection->query("truncate table borderfree_catalog_export_products");
327
+
328
+ $this->batchComplete = true;
329
+ $this->closeFile();
330
+ }
331
+ return;
332
+ }
333
+
334
+ while($products->count() > 0)
335
+ {
336
+ foreach($products as $product)
337
+ {
338
+ try
339
+ {
340
+ $product->setStatus(0)->save();
341
+
342
+ $p = Mage::getModel("catalog/product");
343
+ $p->load($product->getProductId());
344
+ if($kits)
345
+ $this->writeKit($p);
346
+ else
347
+ $this->writeProduct($p);
348
+
349
+ $p->clearInstance();
350
+ unset($p);
351
+
352
+ if($this->file == NULL)
353
+ return;
354
+ }
355
+ catch(Exception $e)
356
+ {
357
+ $this->resetStrIndent();
358
+ $this->logError("Product ". $p->getName() . ":" . $e->getMessage() . " - Skipping Product");
359
+ $p->clearInstance();
360
+ unset($p);
361
+ }
362
+ }
363
+
364
+ $products = Mage::getModel("borderfreecatalog/products")->getCollection()->addFieldToFilter("status", 1)->setPageSize($this->pageSize)->setCurPage(1);
365
+ }
366
+
367
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
368
+ $connection->query("truncate table borderfree_catalog_export_products");
369
+
370
+ $this->batchComplete = true;
371
+ $this->closeFile();
372
+ }
373
+
374
+ private function resetStrIndent()
375
+ {
376
+ $this->indent -= $this->strIndent;
377
+ $this->strIndent = 0;
378
+ }
379
+
380
+ private function writeGroupedProduct($product)
381
+ {
382
+ $category = $this->getCategory($product);
383
+
384
+ $childProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);
385
+ foreach($childProducts as $p)
386
+ {
387
+ $pp = Mage::getModel("catalog/product")->load($p->getId());
388
+ $p->clearInstance();
389
+ unset($p);
390
+ $this->writeProduct($pp, true, $category);
391
+ $pp->clearInstance();
392
+ unset($pp);
393
+ }
394
+ unset($category);
395
+ unset($childProducts);
396
+ }
397
+
398
+ private function getCategory($product)
399
+ {
400
+ $level = 0;
401
+ $category = NULL;
402
+
403
+ $categories = $product->getCategoryIds();
404
+ foreach ($categories as $category_id)
405
+ {
406
+ $cat = Mage::getModel('catalog/category')->load($category_id);
407
+ if($cat->getLevel() > $level)
408
+ {
409
+ $level = $cat->getLevel();
410
+ $category = $category_id;
411
+ }
412
+ $cat->clearInstance();
413
+ unset($cat);
414
+ }
415
+ unset($categories);
416
+
417
+ return $category;
418
+ }
419
+
420
+ private function writeKit($product)
421
+ {
422
+ $this->getFile("submitKitRequest", "kits");
423
+
424
+ $this->startElement("kit", array("sku" => $product->getSku()), true);
425
+
426
+ $selectionCollection = $product->getTypeInstance(true)->getSelectionsCollection(
427
+ $product->getTypeInstance(true)->getOptionsIds($product), $product
428
+ );
429
+ $bundled_items = array();
430
+ foreach($selectionCollection as $option)
431
+ {
432
+ //print_r($option);
433
+ $this->writeElement("qty", 1, $option->getSelectionQty(), false, true, array("sku" => $option->getSku()));
434
+ }
435
+
436
+
437
+ $this->closeElement("kit", true);
438
+ $this->writeRecord();
439
+ }
440
+
441
+
442
+ private function writeProduct($product, $grouped = false, $category = NULL)
443
+ {
444
+ $this->getFile("submitProductRequest", "products");
445
+
446
+ $productType = $product->getTypeId();
447
+ if(!in_array($productType, array("simple", "grouped", "configurable", "bundle")))
448
+ return;
449
+
450
+ if($productType == "grouped")
451
+ {
452
+ $this->writeGroupedProduct($product);
453
+ return;
454
+ }
455
+
456
+ //@todo RETHINK THIS, Check gurouped sub products for category assignment, DO WE ALSO NEED TO CHECK FOR SEARCH?
457
+ $visibility = $product->getAttributeText('visibility');
458
+ if(strpos($visibility, "Catalog") === FALSE && !$grouped )
459
+ return;
460
+ if(!(strpos($visibility, "Catalog") === FALSE) && $grouped)
461
+ return;
462
+
463
+
464
+ if($category == NULL)
465
+ $category = $this->getCategory($product);
466
+ else
467
+ {
468
+ $cat = $this->getCategory($product);
469
+ if($cat != NULL)
470
+ $category = $cat;
471
+ unset($cat);
472
+ }
473
+
474
+ if($category == NULL)
475
+ throw new Exception("No categories assigned.");
476
+
477
+ $this->startElement("product", array("id" => $product->getId(), "merchantId" => Mage::getStoreConfig('borderfree_options/settings/merchantid'), "categoryId" => $category), true);
478
+ $this->writeElement("name", $product->getName(), 255, false, true);
479
+ $this->writeElement("description", $product->getDescription(), 1024, true, true);
480
+
481
+ $associatedProducts = NULL;
482
+ if($productType == "configurable")
483
+ {
484
+ $associatedProducts = $product->getTypeInstance()->getUsedProducts();
485
+ if(count($associatedProducts) == 0)
486
+ throw new Exception("No simple products defined for this configurable product.");
487
+ $this->writeElement("primarySku", $associatedProducts[0]->getSku(), 50);
488
+ }
489
+ else
490
+ $this->writeElement("primarySku", $product->getSku(), 50);
491
+
492
+ $this->writeElement("isActive", $product->isSaleable() ? "true" : "false", 5);
493
+ $this->writeElement("shortDescription", $product->getShortDescription(), 255, true);
494
+ $this->writeElement("keywords", $product->getMetaKeyword(), 1024);
495
+ $this->writeElement("url", $product->getProductUrl(), 1024, false, true);
496
+ $this->writeElement("sizeChartUrl", $product->getSizeChartUrl(), 1024);
497
+ $this->writeElement("isExclusive", $product->getIsExclusive() ? "true" : "false", 5);
498
+ $this->writeElement("isPersonalizable", $product->hasOptions() ? "true" : "false", 5);
499
+ $this->writeElement("manufacturer", $product->getAttributeText('manufacturer'), 256);
500
+ $this->writeElement("brand", $product->getAttributeText('brand'), 256);
501
+ $this->writeElement("collection", $product->getAttributeText('collection'), 256);
502
+ $this->writeElement("gender", $product->getAttributeText('gender'), 256);
503
+ $this->writeMultiselect("ages", "age", $product->getAttributeText("age"));
504
+ $this->writeMultiselect("seasons", "season", $product->getAttributeText("season"));
505
+
506
+ $this->startElement("skus", null, true);
507
+
508
+ if($productType == "simple" || $productType == "bundle")
509
+ $this->writeSku($product);
510
+ elseif($productType == "configurable")
511
+ $this->writeSkus($product, $associatedProducts);
512
+
513
+ $this->closeElement("skus", true);
514
+
515
+ $this->closeElement("product", true);
516
+ $this->writeRecord();
517
+ }
518
+
519
+ //continue clearInstance/unset
520
+ private function writeSkus($product, $associatedProducts)
521
+ {
522
+ foreach($associatedProducts as $p)
523
+ {
524
+ $pp = Mage::getModel("catalog/product")->load($p->getId());
525
+ $p->clearInstance();
526
+ unset($p);
527
+ $this->writeSku($pp, $product);
528
+ $pp->clearInstance();
529
+ unset($pp);
530
+ }
531
+ unset($associatedProducts);
532
+ }
533
+
534
+ private function writeSku($product, $parent = NULL)
535
+ {
536
+ $this->startElement("sku", array("id" => $product->getSku()), true);
537
+ $this->writeElement("isActive", $product->isSaleable() ? "true" : "false", 5);
538
+
539
+ $this->startElement("uids", null, true);
540
+ $this->writeElement("gtin", $product->getGtin(), 100);
541
+ $this->writeElement("upc", $product->getUpc(), 100);
542
+ $this->writeElement("ean", $product->getEan(), 100);
543
+ $this->writeElement("apn", $product->getApn(), 100);
544
+ $this->writeElement("jan", $product->getJan(), 100);
545
+ $this->writeElement("eccn", $product->getEccn(), 100);
546
+ $this->writeElement("mpn", $product->getMpn(), 100);
547
+ $this->closeElement("uids", true);
548
+
549
+ if($parent != null)
550
+ {
551
+ $attributes = $parent->getTypeInstance()->getConfigurableAttributesAsArray($parent);
552
+ $attribs = array();
553
+ foreach($attributes as $attribute)
554
+ {
555
+ $attribs[] = $attribute["attribute_code"];
556
+ }
557
+ if(count($attribs) > 0)
558
+ {
559
+ $this->startElement("variants", null, true);
560
+
561
+ if(in_array("color", $attribs))
562
+ $this->writeElement("color", $product->getAttributeText('color'), 128);
563
+
564
+ if(in_array("size", $attribs))
565
+ $this->writeElement("size", $product->getAttributeText('size'), 128);
566
+
567
+ if(in_array("condition", $attribs))
568
+ $this->writeElement("condition", $product->getAttributeText('condition'), 128);
569
+
570
+ foreach($attribs as $attrib)
571
+ {
572
+ if($attrib != "color" && $attrib != "size" && $attrib != "condition")
573
+ $this->writeElement("custom", "$attrib:{$product->getAttributeText($attrib)}", 128);
574
+ }
575
+
576
+ $this->closeElement("variants", true);
577
+ }
578
+ }
579
+
580
+ $media = $product->getMediaGalleryImages();
581
+ if($media == NULL || count($media->getItems()) == 0)
582
+ {
583
+ if($parent != NULL)
584
+ $media = $parent->getMediaGalleryImages();
585
+
586
+ if($media == null)
587
+ throw new Exception("no images found.");
588
+ }
589
+ $images = $media->getItems();
590
+ if(count($images) > 0)
591
+ {
592
+ $this->startElement("imageUrls", null, true);
593
+
594
+ $imageName = "primary";
595
+ foreach($images as $image)
596
+ {
597
+ $this->writeElement($imageName, $image->getUrl(), 1024, false, true);
598
+
599
+ if($imageName == "alternate")
600
+ break;
601
+
602
+ $imageName = "alternate";
603
+ }
604
+
605
+ $swatchImage = $product->getMediaGalleryImages()->getItemByColumnValue('label', 'swatch');
606
+ if($swatchImage != null)
607
+ $this->writeElement("swatch", $swatchImage->getUrl(), 1024);
608
+
609
+
610
+ $this->closeElement("imageUrls", true);
611
+ }
612
+ else
613
+ throw new Exception("{$product->getName()} no images found.");
614
+
615
+ $this->writeElement("dutiablePrice", $product->getPrice(), 100);
616
+ /**
617
+ * @todo from here down get data from parent if empty
618
+ */
619
+ $this->writeElement("care", $product->getCare(), 1024, true);
620
+ $this->writeElement("contents", $product->getContents(), 1024, true);
621
+
622
+ $com = $product->getAttributeText('country_of_manufacture');
623
+ if(!empty($com))
624
+ {
625
+ $coo = $this->localizationHelper->countryToCode($com);
626
+ $this->writeElement("coo", $coo, 2);
627
+ $this->writeElement("isImported", $coo != "US" ? "true" : "false", 5);
628
+ }
629
+
630
+ $this->writeHsCodes($product->getHsCodes());
631
+ $this->writeElement("isOrmd", $product->getIsOrmd() ? "true" : "false", 5);
632
+
633
+ $commonName = $product->getFwsCommonName();
634
+ $scientificName = $product->getFwsScientificName();
635
+
636
+ if(!empty($commonName) || !empty($scientificName))
637
+ {
638
+ $this->startElement("fishAndWildlife", null, true);
639
+ $this->writeElement("commonName", $commonName, 128);
640
+ $this->writeElement("scientificName", $scientificName, 128);
641
+ $this->writeElement("color", $product->getAttributeText('fws_source'), 1);
642
+ $coo = $product->getAttributeText('fws_country_of_origin');
643
+ if(!empty($coo))
644
+ {
645
+ $coo = $this->localizationHelper->countryToCode($com);
646
+ $this->writeElement("coo", $coo, 2);
647
+ }
648
+ $this->closeElement("fishAndWildlife", true);
649
+ }
650
+
651
+ $weight = $product->getWeight();
652
+ if(!empty($weight) && !($weight > 0))
653
+ $this->writeElement("weight", $weight, 100, false, false, array("unit" => Mage::getStoreConfig('borderfree_options/catalog/weightunit')));
654
+
655
+ $this->startElement("boxDimensions", array("unit" => Mage::getStoreConfig('borderfree_options/catalog/lengthunit')), true);
656
+ $this->writeDimension("width", $product->getBoxWidth(), 100);
657
+ $this->writeDimension("length", $product->getBoxLength(), 100);
658
+ $this->writeDimension("height", $product->getBoxHeight(), 100);
659
+ $this->closeElement("boxDimensions", true);
660
+
661
+ $this->startElement("productDimensions", array("unit" => Mage::getStoreConfig('borderfree_options/catalog/lengthunit')), true);
662
+ $this->writeDimension("width", $product->getProductWidth(), 100);
663
+ $this->writeDimension("length", $product->getProductLength(), 100);
664
+ $this->writeDimension("height", $product->getProductHeight(), 100);
665
+ $this->closeElement("productDimensions", true);
666
+
667
+ $restrictions = $product->getAttributeText("country_restrictions");
668
+ if($product->getBorderfreeRestricted())
669
+ {
670
+ $this->startElement("restrictions", null, true);
671
+ $this->writeElement("restriction", "All", 3, false, false, array("type" => "Country"));
672
+ $this->closeElement("restrictions", true);
673
+ }
674
+ else if($restrictions != NULL)
675
+ {
676
+ $this->startElement("restrictions", null, true);
677
+ if(is_array($restrictions))
678
+ {
679
+ foreach($restrictions as $r)
680
+ {
681
+ $cc = $this->localizationHelper->countryToCode($r);
682
+ $this->writeElement("restriction", $cc, 3, false, false, array("type" => "Country"));
683
+ }
684
+ }
685
+ else
686
+ {
687
+ $cc = $this->localizationHelper->countryToCode($restrictions);
688
+ $this->writeElement("restriction", $cc, 3, false, false, array("type" => "Country"));
689
+ }
690
+ $this->closeElement("restrictions", true);
691
+ }
692
+ unset($restrictions);
693
+
694
+ $this->closeElement("sku", true);
695
+ }
696
+
697
+ private function writeDimension($type, $value)
698
+ {
699
+ if(empty($value))
700
+ return;
701
+
702
+ if(!is_numeric($value))
703
+ throw new Exception('$type dimension must be numeric.');
704
+
705
+ if(!($value > 0))
706
+ throw new Exception('$type dimension must greater than zero.');
707
+
708
+ $this->writeElement($type, $value, 100);
709
+ }
710
+
711
+ private function writeMultiselect($setName, $name, $values)
712
+ {
713
+ if($values == NULL)
714
+ return;
715
+
716
+ $values = explode(",", $values);
717
+
718
+ $this->startElement($setName, NULL, true);
719
+ foreach($values as $value)
720
+ {
721
+ $this->writeElement($name, strtoupper($value), 256);
722
+ }
723
+ $this->closeElement($setName, true);
724
+ }
725
+
726
+ public function resumeExport()
727
+ {
728
+ ini_set("memory_limit","2560M");
729
+ ini_set('max_execution_time', 3600);
730
+ try
731
+ {
732
+ $stores = Mage::getModel("borderfreecatalog/stores")->getCollection()->addFieldToFilter("status", array('neq' => 0));
733
+ if($stores->count() == 0)
734
+ {
735
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
736
+ $connection->query("truncate table borderfree_catalog_export_stores");
737
+ return;
738
+ }
739
+
740
+ $stores = Mage::getModel("borderfreecatalog/stores")->getCollection()->addFieldToFilter("status", 2);
741
+ if($stores->count() > 0)
742
+ {
743
+ $store = $stores->getFirstItem();
744
+ Mage::app()->setCurrentStore($store->getStoreId());
745
+
746
+ $this->lastRequest = "submitProductRequest";
747
+ $this->request = "submitProductRequest";
748
+ $this->type = "products";
749
+ $this->filenum = $store->getFilenum();
750
+ $this->requestId = $store->getRequestId();
751
+ $this->batchId = $store->getBatchId();
752
+
753
+ $this->fileExists();
754
+ $this->exportAllProducts($store->getStartTime());
755
+
756
+ $store->setFilenum($this->filenum);
757
+ $store->setRequestId($this->requestId);
758
+ $store->setBatchId($this->batchId);
759
+ $store->save();
760
+
761
+ if($this->batchComplete)
762
+ {
763
+ $store->setStatus(3)->save();
764
+ $this->exportAllProducts($store->getStartTime(), true);
765
+ }
766
+
767
+ $this->sendErrorLog();
768
+ return;
769
+ }
770
+
771
+ $stores = Mage::getModel("borderfreecatalog/stores")->getCollection()->addFieldToFilter("status", 3);
772
+ if($stores->count() > 0)
773
+ {
774
+ $store = $stores->getFirstItem();
775
+ Mage::app()->setCurrentStore($store->getStoreId());
776
+
777
+ $this->lastRequest = "submitProductRequest";
778
+ $this->request = "submitKitRequest";
779
+ $this->type = "kits";
780
+ $this->filenum = 0;
781
+ $this->requestId = $store->getRequestId();
782
+ $this->batchId = $store->getBatchId();
783
+
784
+ $this->fileExists();
785
+ $this->exportAllProducts($store->getStartTime(), true);
786
+
787
+ $store->setFilenum($this->filenum);
788
+ $store->setRequestId($this->requestId);
789
+ $store->setBatchId($this->batchId);
790
+ $store->save();
791
+
792
+ if($this->batchComplete)
793
+ {
794
+ $store->setStatus(0)->save();
795
+ $this->sendZipFile();
796
+ }
797
+
798
+ $this->sendErrorLog();
799
+ return;
800
+ }
801
+
802
+
803
+ $stores = Mage::getModel("borderfreecatalog/stores")->getCollection()->addFieldToFilter("status", 1);
804
+ if($stores->count() > 0)
805
+ {
806
+ $this->lastRequest = "";
807
+ $this->request = "";
808
+ $this->type = "";
809
+ $this->filenum = 0;
810
+ $this->requestId = 0;
811
+ $this->batchId = date("mdyHis");
812
+
813
+ $store = $stores->getFirstItem();
814
+ $store->setStatus(2)->save();
815
+
816
+ Mage::app()->setCurrentStore($store->getStoreId());
817
+
818
+ $this->exportAllCategories($store->getStartTime());
819
+ $this->exportAllProducts($store->getStartTime());
820
+
821
+ $store->setFilenum($this->filenum);
822
+ $store->setRequestId($this->requestId);
823
+ $store->setBatchId($this->batchId);
824
+ $store->save();
825
+
826
+ if($this->batchComplete)
827
+ {
828
+ $store->setStatus(3)->save();
829
+ }
830
+ }
831
+ }
832
+ catch(Exception $e)
833
+ {
834
+ $this->logError($e->getMessage(), Zend_Log::ERR);
835
+ }
836
+
837
+ $this->sendErrorLog();
838
+
839
+ }
840
+
841
+ private function getFile($request, $type)
842
+ {
843
+ unset($this->outStr);
844
+
845
+ $this->outStr = "";
846
+ $this->request = $request;
847
+ $this->type = $type;
848
+
849
+ if($this->file != NULL)
850
+ return $this->file;
851
+
852
+ if($this->lastRequest != $this->request)
853
+ $this->filenum = 0;
854
+
855
+ $filenum = str_pad($this->filenum, 5, "0", STR_PAD_LEFT);
856
+ $this->filename = $type . "_$filenum.xml";
857
+ $this->file = fopen($this->dir .$this->filename, "w");
858
+
859
+ $this->lastRequest = $this->request;
860
+ $this->requestId += 1;
861
+ $this->startElement($this->request, array("id" => $this->requestId, "batchId" => $this->batchId));
862
+ $this->startElement($this->type);
863
+
864
+ return $this->file;
865
+ }
866
+
867
+ private function startElement($name, $attributes = NULL, $useStr = FALSE)
868
+ {
869
+ $data = str_pad("<", $this->indent, " ", STR_PAD_LEFT) . $name;
870
+
871
+ if($attributes)
872
+ {
873
+ foreach($attributes as $attribute => $value)
874
+ {
875
+ $data .= " $attribute=\"$value\"";
876
+ }
877
+ }
878
+
879
+ $data .= ">\n";
880
+
881
+ if($useStr)
882
+ {
883
+ $this->outStr .= $data;
884
+ $this->strIndent += 4;
885
+ }
886
+ else
887
+ fputs($this->file, $data);
888
+
889
+ $this->indent += 4;
890
+ }
891
+
892
+ private function closeElement($name, $useStr = false)
893
+ {
894
+ $this->indent -= 4;
895
+
896
+ $data = str_pad("<", $this->indent, " ", STR_PAD_LEFT) . "/" . $name . ">\n";
897
+
898
+ if($useStr)
899
+ {
900
+ $this->outStr .= $data;
901
+ $this->strIndent -= 4;
902
+ }
903
+ else
904
+ fputs($this->file, $data);
905
+ }
906
+
907
+ private function closeFile()
908
+ {
909
+ if($this->file == NULL)
910
+ return;
911
+
912
+ $this->closeElement($this->type);
913
+ $this->closeElement($this->request);
914
+ fclose($this->file);
915
+ $this->file = NULL;
916
+ $this->filenum += 1;
917
+ $this->recordsOut = 0;
918
+ $this->indent = 1;
919
+ }
920
+
921
+ private function writeElement($name, $data, $maxLength, $strip = FALSE, $required = FALSE, $attributes = NULL)
922
+ {
923
+ if(empty($data))
924
+ {
925
+ if($required)
926
+ throw new Exception($name . " - Value Required");
927
+
928
+ return;
929
+ }
930
+
931
+ $this->outStr .= str_pad("<", $this->indent, " ", STR_PAD_LEFT) . $name;
932
+
933
+ if($attributes)
934
+ {
935
+ foreach($attributes as $attribute => $value)
936
+ {
937
+ $this->outStr .= " $attribute=\"$value\"";
938
+ }
939
+ }
940
+
941
+ $this->outStr .= ">";
942
+
943
+ if($strip)
944
+ $data = html_entity_decode(strip_tags($data), ENT_COMPAT, "UTF-8");
945
+
946
+ if(strlen($data) > $maxLength) {
947
+ if(Mage::getStoreConfig('borderfree_options/catalog/truncate') && $name != 'url' && $name != 'primarySku') {
948
+ $data = substr($data, 0, $maxLength);
949
+ }
950
+ }
951
+
952
+ if ($name == 'primarySku' && !preg_match("/^[A-Za-z0-9@#~|*_.\/-]+$/", trim($data))) {
953
+ throw new Exception(" SKU contain illegal characters.");
954
+ }
955
+
956
+ if(strlen($data) > $maxLength)
957
+ throw new Exception($name . " - exceeds max length of $maxLength characters.");
958
+
959
+ $this->outStr .= "<![CDATA[$data]]>";
960
+
961
+
962
+ $this->outStr .= "</$name>\n";
963
+ }
964
+
965
+ private function writeHsCodes($hscodes)
966
+ {
967
+ if(!empty($hscodes))
968
+ {
969
+ $this->startElement("hscodes", null, true);
970
+
971
+ $codes = explode(",", $hscodes);
972
+ foreach($codes as $code)
973
+ {
974
+ if(!is_numeric($code) || !is_int($code + 0))
975
+ throw new Exception("Invalid hscode - $code");
976
+
977
+ $this->writeElement("hscode", $code, 20);
978
+ }
979
+
980
+ $this->closeElement("hscodes", true);
981
+ }
982
+ }
983
+
984
+ private function writeCategory($category, $updated_at = null)
985
+ {
986
+ try
987
+ {
988
+ if($updated_at != NULL)
989
+ {
990
+ $lastdate = strtotime($updated_at);
991
+ $catdate = strtotime($category->getUpdatedAt());
992
+
993
+ if($catdate < $lastdate)
994
+ return;
995
+ }
996
+
997
+ $file = $this->getFile("submitCategoryRequest", "categories");
998
+
999
+ $this->startElement("category", array("id" => $category->getId(), "merchantId" => Mage::getStoreConfig('borderfree_options/settings/merchantid'), "parentId" => ($category->getId() == $this->rootcatId ? "NULL" : $category->getParentId())), true);
1000
+ $this->writeElement("name", $category->getName(), 255, false, true);
1001
+ $this->writeElement("description", $category->getDescription(), 1024, true);
1002
+ $this->writeElement("url", $category->getUrl(), 1024);
1003
+
1004
+ $this->writeHsCodes($category->getHsCodes());
1005
+
1006
+ $name = $category->getName();
1007
+ $restrictions = $category->getResource()->getAttribute('category_country_restrictions')->getFrontend()->getValue($category);
1008
+ if($category->getBorderfreeRestricted())
1009
+ {
1010
+ $this->startElement("restrictions", null, true);
1011
+ $this->writeElement("restriction", "All", 3, false, false, array("type" => "Country"));
1012
+ $this->closeElement("restrictions", true);
1013
+ }
1014
+ else if($restrictions != NULL)
1015
+ {
1016
+ $countries = explode(",", $restrictions);
1017
+ $this->startElement("restrictions", null, true);
1018
+ foreach($countries as $r)
1019
+ {
1020
+ $cc = $this->localizationHelper->countryToCode($r);
1021
+ $this->writeElement("restriction", $cc, 3, false, false, array("type" => "Country"));
1022
+ }
1023
+ $this->closeElement("restrictions", true);
1024
+ }
1025
+
1026
+ $this->closeElement("category", true);
1027
+
1028
+ $this->writeRecord();
1029
+ }
1030
+ catch(Exception $e)
1031
+ {
1032
+ $this->resetStrIndent();
1033
+ $this->logError("Category ". $category->getName() . ":" . $e->getMessage() . "Skipping Category");
1034
+ }
1035
+ }
1036
+
1037
+ private function writeRecord()
1038
+ {
1039
+ fputs($this->file, $this->outStr);
1040
+
1041
+ $this->recordsOut += 1;
1042
+ if($this->recordsOut == Mage::getStoreConfig('borderfree_options/catalog/filerecords'))
1043
+ $this->closeFile();
1044
+ }
1045
+
1046
+ private function writeCategories($categories, $updated_at = null)
1047
+ {
1048
+ foreach($categories as $c)
1049
+ {
1050
+ $category = Mage::getModel('catalog/category')->load($c->getId());
1051
+
1052
+ $this->writeCategory($category, $updated_at);
1053
+ if($category->hasChildren())
1054
+ {
1055
+ $children = $category->getChildrenCategories();
1056
+ $this->writeCategories($children, $updated_at);
1057
+ unset($children);
1058
+ }
1059
+
1060
+ $c->clearInstance();
1061
+ unset($c);
1062
+ $category->clearInstance();
1063
+ unset($category);
1064
+ }
1065
+ }
1066
+
1067
+ private function logError($message, $level = Zend_Log::WARN)
1068
+ {
1069
+ $this->errors .= "Batch #" . $this->batchId . ": " . $message . "\n";
1070
+ }
1071
+
1072
+ private function fileExists(){
1073
+ $filenum = str_pad($this->filenum, 5, "0", STR_PAD_LEFT);
1074
+ $filename = $this->type . "_$filenum.xml";
1075
+ $path = $this->dir . $filename;
1076
+ if (file_exists($path)) {
1077
+ exit();
1078
+ }
1079
+ }
1080
+ }
app/code/local/Borderfree/Catalog/Model/Log.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Catalog_Model_Log extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreecatalog/log');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Catalog/Model/Mysql4/Log.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Catalog_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreecatalog/log', 'id');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Catalog/Model/Mysql4/Log/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Catalog_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreecatalog/log');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Catalog/Model/Mysql4/Products.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Catalog_Model_Mysql4_Products extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreecatalog/products', 'product_id');
7
+ $this->_isPkAutoIncrement = false;
8
+ }
9
+ }
10
+ ?>
app/code/local/Borderfree/Catalog/Model/Mysql4/Products/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Catalog_Model_Mysql4_Products_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreecatalog/products');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Catalog/Model/Mysql4/Stores.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Catalog_Model_Mysql4_Stores extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreecatalog/stores', 'store_id');
7
+ $this->_isPkAutoIncrement = false;
8
+ }
9
+ }
10
+ ?>
app/code/local/Borderfree/Catalog/Model/Mysql4/Stores/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Catalog_Model_Mysql4_Stores_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreecatalog/stores');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Catalog/Model/Products.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Catalog_Model_Products extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreecatalog/products');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Catalog/Model/Stores.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Catalog_Model_Stores extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreecatalog/stores');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Catalog/etc/config.xml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+
4
+ <modules>
5
+ <Borderfree_Catalog>
6
+ <version>1.0.25</version>
7
+ </Borderfree_Catalog>
8
+ </modules>
9
+
10
+ <global>
11
+ <helpers>
12
+ <borderfreecatalog>
13
+ <class>Borderfree_Catalog_Helper</class>
14
+ </borderfreecatalog>
15
+ </helpers>
16
+
17
+ <models>
18
+ <borderfreecatalog>
19
+ <class>Borderfree_Catalog_Model</class>
20
+ <resourceModel>borderfreecatalog_mysql4</resourceModel>
21
+ </borderfreecatalog>
22
+ <borderfreecatalog_mysql4>
23
+ <class>Borderfree_Catalog_Model_Mysql4</class>
24
+ <entities>
25
+ <log>
26
+ <table>borderfree_catalog_export_log</table>
27
+ </log>
28
+ <stores>
29
+ <table>borderfree_catalog_export_stores</table>
30
+ </stores>
31
+ <products>
32
+ <table>borderfree_catalog_export_products</table>
33
+ </products>
34
+ </entities>
35
+ </borderfreecatalog_mysql4>
36
+ </models>
37
+
38
+ <resources>
39
+ <borderfreecatalog_write>
40
+ <connection>
41
+ <use>core_write</use>
42
+ </connection>
43
+ </borderfreecatalog_write>
44
+ <borderfreecatalog_read>
45
+ <connection>
46
+ <use>core_read</use>
47
+ </connection>
48
+ </borderfreecatalog_read>
49
+ <borderfreecatalog_setup>
50
+ <setup>
51
+ <module>Borderfree_Catalog</module>
52
+ <class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
53
+ </setup>
54
+ <connection>
55
+ <use>core_setup</use>
56
+ </connection>
57
+ </borderfreecatalog_setup>
58
+ </resources>
59
+ </global>
60
+ </config>
61
+
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $entityTypeId = $installer->getEntityTypeId('catalog_category');
6
+ $installer->addAttributeSet($entityTypeId, "Borderfree", $sortOrder = null);
7
+ $attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
8
+ $installer->addAttributeGroup($entityTypeId, $attributeSetId, "Borderfree", 3);
9
+ $attributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, "Borderfree");
10
+
11
+ $installer->addAttribute('catalog_category', 'hs_codes', array(
12
+ 'type' => 'varchar',
13
+ 'label' => 'Harmonized System (HS) codes',
14
+ 'input' => 'text',
15
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
16
+ 'visible' => true,
17
+ 'required' => false,
18
+ 'user_defined' => true,
19
+ 'default' => "",
20
+ 'note' => 'Comma Separated List'
21
+ ));
22
+
23
+ $installer->addAttributeToGroup(
24
+ $entityTypeId,
25
+ $attributeSetId,
26
+ $attributeGroupId,
27
+ 'hs_codes',
28
+ '1'
29
+ );
30
+ /*$attributeId = $installer->getAttributeId($entityTypeId, 'hs_codes');
31
+ $installer->run("
32
+ INSERT INTO `{$installer->getTable('catalog_category_entity_varchar')}`
33
+ (`entity_type_id`, `attribute_id`, `entity_id`, `value`)
34
+ SELECT '{$entityTypeId}', '{$attributeId}', `entity_id`, ''
35
+ FROM `{$installer->getTable('catalog_category_entity')}`;
36
+ ");*/
37
+ $installer->endSetup();
38
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.0-1.0.1.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $entityTypeId = $installer->getEntityTypeId('catalog_category');
6
+ $installer->addAttributeSet($entityTypeId, "Borderfree", $sortOrder = null);
7
+ $attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
8
+ $installer->addAttributeGroup($entityTypeId, $attributeSetId, "Borderfree", 3);
9
+ $attributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, "Borderfree");
10
+
11
+ $installer->addAttribute('catalog_category', 'borderfree_restricted', array(
12
+ 'type' => 'int',
13
+ 'label' => 'Borderfree Restricted',
14
+ 'input' => 'select',
15
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
16
+ 'visible' => true,
17
+ 'required' => false,
18
+ 'user_defined' => true,
19
+ 'default' => 0,
20
+ 'source' => "eav/entity_attribute_source_boolean",
21
+ 'note' => 'This category and all children will be restricted from the Borderfree catalog.'
22
+ ));
23
+
24
+ $installer->addAttributeToGroup(
25
+ $entityTypeId,
26
+ $attributeSetId,
27
+ $attributeGroupId,
28
+ 'borderfree_restricted',
29
+ '1'
30
+ );
31
+ /*$attributeId = $installer->getAttributeId($entityTypeId, 'borderfree_restricted');
32
+ $installer->run("
33
+ INSERT INTO `{$installer->getTable('catalog_category_entity_int')}`
34
+ (`entity_type_id`, `attribute_id`, `entity_id`, `value`)
35
+ SELECT '{$entityTypeId}', '{$attributeId}', `entity_id`, '0'
36
+ FROM `{$installer->getTable('catalog_category_entity')}`;
37
+ ");*/
38
+ $installer->endSetup();
39
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.1-1.0.2.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
6
+
7
+ $installer->addAttribute('catalog_product', 'borderfree_restricted', array(
8
+ 'group' => 'Borderfree',
9
+ 'sort_order' => 1,
10
+ 'type' => 'int',
11
+ 'backend' => '',
12
+ 'frontend' => '',
13
+ 'label' => 'Borderfree Restricted',
14
+ 'note' => 'This product will be restricted from the Borderfree catalog.',
15
+ 'input' => 'select',
16
+ 'class' => '',
17
+ 'source' => 'eav/entity_attribute_source_boolean',
18
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
19
+ 'visible' => true,
20
+ 'required' => false,
21
+ 'user_defined' => true,
22
+ 'default' => '0',
23
+ 'visible_on_front' => false,
24
+ 'unique' => false,
25
+ 'is_configurable' => false,
26
+ 'used_for_promo_rules' => false
27
+ ));
28
+
29
+ /*$attributeId = $installer->getAttributeId($entityTypeId, 'borderfree_restricted');
30
+ $installer->run("
31
+ INSERT INTO `{$installer->getTable('catalog_product_entity_int')}`
32
+ (`entity_type_id`, `attribute_id`, `entity_id`, `value`)
33
+ SELECT '{$entityTypeId}', '{$attributeId}', `entity_id`, '0'
34
+ FROM `{$installer->getTable('catalog_product_entity')}`;
35
+ ");*/
36
+ $installer->endSetup();
37
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.10-1.0.11.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("CREATE TABLE borderfree_catalog_export_log (id int(8) NOT NULL AUTO_INCREMENT, type char(15) NOT NULL, merchant_id char(20) NOT NULL, start_time datetime, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
5
+ $installer->endSetup();
6
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.11-1.0.12.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
6
+
7
+ $installer->addAttribute('catalog_product', 'box_width', array(
8
+ 'group' => 'Borderfree',
9
+ 'sort_order' => 23,
10
+ 'type' => 'varchar',
11
+ 'backend' => '',
12
+ 'frontend' => '',
13
+ 'frontend_class' => "validate-number",
14
+ 'label' => 'Box Width',
15
+ 'note' => '',
16
+ 'input' => 'text',
17
+ 'class' => '',
18
+ 'source' => '',
19
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
20
+ 'visible' => true,
21
+ 'required' => false,
22
+ 'user_defined' => true,
23
+ 'default' => '',
24
+ 'visible_on_front' => false,
25
+ 'unique' => false,
26
+ 'is_configurable' => false,
27
+ 'used_for_promo_rules' => false,
28
+ 'apply_to' => '',
29
+ 'searchable' => false,
30
+ 'filterable' => 0,
31
+ 'comparable' => false,
32
+ 'visible_in_advanced_search' => false,
33
+ 'used_for_price_rules' => false,
34
+ 'filterable_in_search' => false
35
+ ));
36
+
37
+ $installer->addAttribute('catalog_product', 'box_length', array(
38
+ 'group' => 'Borderfree',
39
+ 'sort_order' => 24,
40
+ 'type' => 'varchar',
41
+ 'backend' => '',
42
+ 'frontend' => '',
43
+ 'frontend_class' => "validate-number",
44
+ 'label' => 'Box Length',
45
+ 'note' => '',
46
+ 'input' => 'text',
47
+ 'class' => '',
48
+ 'source' => '',
49
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
50
+ 'visible' => true,
51
+ 'required' => false,
52
+ 'user_defined' => true,
53
+ 'default' => '',
54
+ 'visible_on_front' => false,
55
+ 'unique' => false,
56
+ 'is_configurable' => false,
57
+ 'used_for_promo_rules' => false,
58
+ 'apply_to' => '',
59
+ 'searchable' => false,
60
+ 'filterable' => 0,
61
+ 'comparable' => false,
62
+ 'visible_in_advanced_search' => false,
63
+ 'used_for_price_rules' => false,
64
+ 'filterable_in_search' => false
65
+ ));
66
+
67
+ $installer->addAttribute('catalog_product', 'box_height', array(
68
+ 'group' => 'Borderfree',
69
+ 'sort_order' => 25,
70
+ 'type' => 'varchar',
71
+ 'backend' => '',
72
+ 'frontend' => '',
73
+ 'frontend_class' => "validate-number",
74
+ 'label' => 'Box Height',
75
+ 'note' => '',
76
+ 'input' => 'text',
77
+ 'class' => '',
78
+ 'source' => '',
79
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
80
+ 'visible' => true,
81
+ 'required' => false,
82
+ 'user_defined' => true,
83
+ 'default' => '',
84
+ 'visible_on_front' => false,
85
+ 'unique' => false,
86
+ 'is_configurable' => false,
87
+ 'used_for_promo_rules' => false,
88
+ 'apply_to' => '',
89
+ 'searchable' => false,
90
+ 'filterable' => 0,
91
+ 'comparable' => false,
92
+ 'visible_in_advanced_search' => false,
93
+ 'used_for_price_rules' => false,
94
+ 'filterable_in_search' => false
95
+ ));
96
+
97
+ $installer->addAttribute('catalog_product', 'product_width', array(
98
+ 'group' => 'Borderfree',
99
+ 'sort_order' => 26,
100
+ 'type' => 'varchar',
101
+ 'backend' => '',
102
+ 'frontend' => '',
103
+ 'frontend_class' => "validate-number",
104
+ 'label' => 'Product Width',
105
+ 'note' => '',
106
+ 'input' => 'text',
107
+ 'class' => '',
108
+ 'source' => '',
109
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
110
+ 'visible' => true,
111
+ 'required' => false,
112
+ 'user_defined' => true,
113
+ 'default' => '',
114
+ 'visible_on_front' => false,
115
+ 'unique' => false,
116
+ 'is_configurable' => false,
117
+ 'used_for_promo_rules' => false,
118
+ 'apply_to' => '',
119
+ 'searchable' => false,
120
+ 'filterable' => 0,
121
+ 'comparable' => false,
122
+ 'visible_in_advanced_search' => false,
123
+ 'used_for_price_rules' => false,
124
+ 'filterable_in_search' => false
125
+ ));
126
+
127
+ $installer->addAttribute('catalog_product', 'product_length', array(
128
+ 'group' => 'Borderfree',
129
+ 'sort_order' => 27,
130
+ 'type' => 'varchar',
131
+ 'backend' => '',
132
+ 'frontend' => '',
133
+ 'frontend_class' => "validate-number",
134
+ 'label' => 'Product Length',
135
+ 'note' => '',
136
+ 'input' => 'text',
137
+ 'class' => '',
138
+ 'source' => '',
139
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
140
+ 'visible' => true,
141
+ 'required' => false,
142
+ 'user_defined' => true,
143
+ 'default' => '',
144
+ 'visible_on_front' => false,
145
+ 'unique' => false,
146
+ 'is_configurable' => false,
147
+ 'used_for_promo_rules' => false,
148
+ 'apply_to' => '',
149
+ 'searchable' => false,
150
+ 'filterable' => 0,
151
+ 'comparable' => false,
152
+ 'visible_in_advanced_search' => false,
153
+ 'used_for_price_rules' => false,
154
+ 'filterable_in_search' => false
155
+ ));
156
+
157
+ $installer->addAttribute('catalog_product', 'product_height', array(
158
+ 'group' => 'Borderfree',
159
+ 'sort_order' => 28,
160
+ 'type' => 'varchar',
161
+ 'backend' => '',
162
+ 'frontend' => '',
163
+ 'frontend_class' => "validate-number",
164
+ 'label' => 'Product Height',
165
+ 'note' => '',
166
+ 'input' => 'text',
167
+ 'class' => '',
168
+ 'source' => '',
169
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
170
+ 'visible' => true,
171
+ 'required' => false,
172
+ 'user_defined' => true,
173
+ 'default' => '',
174
+ 'visible_on_front' => false,
175
+ 'unique' => false,
176
+ 'is_configurable' => false,
177
+ 'used_for_promo_rules' => false,
178
+ 'apply_to' => '',
179
+ 'searchable' => false,
180
+ 'filterable' => 0,
181
+ 'comparable' => false,
182
+ 'visible_in_advanced_search' => false,
183
+ 'used_for_price_rules' => false,
184
+ 'filterable_in_search' => false
185
+ ));
186
+
187
+ $installer->endSetup();
188
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.12-1.0.13.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
6
+
7
+ $installer->addAttribute('catalog_product', 'care', array(
8
+ 'group' => 'Borderfree',
9
+ 'sort_order' => 17,
10
+ 'type' => 'varchar',
11
+ 'backend' => '',
12
+ 'frontend' => '',
13
+ 'label' => 'Care Instructions',
14
+ 'note' => '',
15
+ 'input' => 'textarea',
16
+ 'class' => '',
17
+ 'source' => '',
18
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
19
+ 'visible' => true,
20
+ 'required' => false,
21
+ 'user_defined' => true,
22
+ 'default' => '',
23
+ 'visible_on_front' => false,
24
+ 'unique' => false,
25
+ 'is_configurable' => false,
26
+ 'used_for_promo_rules' => false,
27
+ 'apply_to' => '',
28
+ 'searchable' => false,
29
+ 'filterable' => 0,
30
+ 'comparable' => false,
31
+ 'visible_in_advanced_search' => false,
32
+ 'used_for_price_rules' => false,
33
+ 'filterable_in_search' => false,
34
+ 'is_html_allowed_on_front' => true,
35
+ "wysiwyg_enabled" => true
36
+ ));
37
+
38
+ $installer->addAttribute('catalog_product', 'contents', array(
39
+ 'group' => 'Borderfree',
40
+ 'sort_order' => 18,
41
+ 'type' => 'varchar',
42
+ 'backend' => '',
43
+ 'frontend' => '',
44
+ 'label' => 'Contents and/or Materials',
45
+ 'note' => '(e.g., 60% cotton, 40% rayon). Use commas to separate values in this field.',
46
+ 'input' => 'textarea',
47
+ 'class' => '',
48
+ 'source' => '',
49
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
50
+ 'visible' => true,
51
+ 'required' => false,
52
+ 'user_defined' => true,
53
+ 'default' => '',
54
+ 'visible_on_front' => false,
55
+ 'unique' => false,
56
+ 'is_configurable' => false,
57
+ 'used_for_promo_rules' => false,
58
+ 'apply_to' => '',
59
+ 'searchable' => true,
60
+ 'filterable' => 0,
61
+ 'is_html_allowed_on_front' => true,
62
+ 'comparable' => false,
63
+ 'visible_in_advanced_search' => false,
64
+ 'used_for_price_rules' => false,
65
+ 'filterable_in_search' => false,
66
+ "wysiwyg_enabled" => true
67
+ ));
68
+
69
+ $installer->addAttribute('catalog_product', 'extra_shipping', array(
70
+ 'group' => 'Borderfree',
71
+ 'sort_order' => 34,
72
+ 'type' => 'varchar',
73
+ 'backend' => '',
74
+ 'frontend' => '',
75
+ 'frontend_class' => 'validate-number',
76
+ 'label' => 'Additional Shipping Charge',
77
+ 'note' => '',
78
+ 'input' => 'text',
79
+ 'class' => '',
80
+ 'source' => '',
81
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
82
+ 'visible' => true,
83
+ 'required' => false,
84
+ 'user_defined' => true,
85
+ 'default' => '',
86
+ 'visible_on_front' => false,
87
+ 'unique' => false,
88
+ 'is_configurable' => false,
89
+ 'used_for_promo_rules' => false,
90
+ 'apply_to' => '',
91
+ 'searchable' => false,
92
+ 'filterable' => 0,
93
+ 'is_html_allowed_on_front' => false,
94
+ 'comparable' => false,
95
+ 'visible_in_advanced_search' => false,
96
+ 'used_for_price_rules' => false,
97
+ 'filterable_in_search' => false,
98
+ "wysiwyg_enabled" => false
99
+ ));
100
+
101
+ $installer->endSetup();
102
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.13-1.0.14.php ADDED
@@ -0,0 +1,530 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->addAttribute('catalog_product', 'borderfree_restricted', array(
6
+ 'group' => 'Borderfree',
7
+ 'sort_order' => 1,
8
+ 'type' => 'int',
9
+ 'backend' => '',
10
+ 'frontend' => '',
11
+ 'label' => 'Borderfree Restricted',
12
+ 'note' => 'This product will be restricted from the Borderfree catalog.',
13
+ 'input' => 'select',
14
+ 'class' => '',
15
+ 'source' => 'eav/entity_attribute_source_boolean',
16
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
17
+ 'visible' => true,
18
+ 'required' => false,
19
+ 'user_defined' => true,
20
+ 'default' => '0',
21
+ 'visible_on_front' => false,
22
+ 'unique' => false,
23
+ 'is_configurable' => false,
24
+ 'used_for_promo_rules' => false
25
+ ));
26
+
27
+ $installer->addAttribute('catalog_product', 'gtin', array(
28
+ 'group' => 'Borderfree',
29
+ 'sort_order' => 10,
30
+ 'type' => 'varchar',
31
+ 'backend' => '',
32
+ 'frontend' => '',
33
+ 'label' => 'Global Trade Item Number',
34
+ 'note' => '',
35
+ 'input' => 'text',
36
+ 'class' => '',
37
+ 'source' => '',
38
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
39
+ 'visible' => true,
40
+ 'required' => false,
41
+ 'user_defined' => true,
42
+ 'default' => '',
43
+ 'visible_on_front' => false,
44
+ 'unique' => false,
45
+ 'is_configurable' => false,
46
+ 'used_for_promo_rules' => false,
47
+ 'apply_to' => 'simple',
48
+ 'searchable' => true,
49
+ 'filterable' => 1,
50
+ 'comparable' => false,
51
+ 'visible_in_advanced_search' => false,
52
+ 'used_for_price_rules' => false,
53
+ 'filterable_in_search' => false
54
+ ));
55
+
56
+ $installer->addAttribute('catalog_product', 'upc', array(
57
+ 'group' => 'Borderfree',
58
+ 'sort_order' => 11,
59
+ 'type' => 'varchar',
60
+ 'backend' => '',
61
+ 'frontend' => '',
62
+ 'label' => 'Universal Product Code',
63
+ 'note' => '',
64
+ 'input' => 'text',
65
+ 'class' => '',
66
+ 'source' => '',
67
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
68
+ 'visible' => true,
69
+ 'required' => false,
70
+ 'user_defined' => true,
71
+ 'default' => '',
72
+ 'visible_on_front' => false,
73
+ 'unique' => false,
74
+ 'is_configurable' => false,
75
+ 'used_for_promo_rules' => false,
76
+ 'apply_to' => 'simple',
77
+ 'searchable' => true,
78
+ 'filterable' => 1,
79
+ 'comparable' => false,
80
+ 'visible_in_advanced_search' => false,
81
+ 'used_for_price_rules' => false,
82
+ 'filterable_in_search' => false
83
+ ));
84
+
85
+ $installer->addAttribute('catalog_product', 'ean', array(
86
+ 'group' => 'Borderfree',
87
+ 'sort_order' => 12,
88
+ 'type' => 'varchar',
89
+ 'backend' => '',
90
+ 'frontend' => '',
91
+ 'label' => 'European Article Number',
92
+ 'note' => '',
93
+ 'input' => 'text',
94
+ 'class' => '',
95
+ 'source' => '',
96
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
97
+ 'visible' => true,
98
+ 'required' => false,
99
+ 'user_defined' => true,
100
+ 'default' => '',
101
+ 'visible_on_front' => false,
102
+ 'unique' => false,
103
+ 'is_configurable' => false,
104
+ 'used_for_promo_rules' => false,
105
+ 'apply_to' => 'simple',
106
+ 'searchable' => true,
107
+ 'filterable' => 1,
108
+ 'comparable' => false,
109
+ 'visible_in_advanced_search' => false,
110
+ 'used_for_price_rules' => false,
111
+ 'filterable_in_search' => false
112
+ ));
113
+
114
+ $installer->addAttribute('catalog_product', 'apn', array(
115
+ 'group' => 'Borderfree',
116
+ 'sort_order' => 13,
117
+ 'type' => 'varchar',
118
+ 'backend' => '',
119
+ 'frontend' => '',
120
+ 'label' => 'Australian Product Number',
121
+ 'note' => '',
122
+ 'input' => 'text',
123
+ 'class' => '',
124
+ 'source' => '',
125
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
126
+ 'visible' => true,
127
+ 'required' => false,
128
+ 'user_defined' => true,
129
+ 'default' => '',
130
+ 'visible_on_front' => false,
131
+ 'unique' => false,
132
+ 'is_configurable' => false,
133
+ 'used_for_promo_rules' => false,
134
+ 'apply_to' => 'simple',
135
+ 'searchable' => true,
136
+ 'filterable' => 1,
137
+ 'comparable' => false,
138
+ 'visible_in_advanced_search' => false,
139
+ 'used_for_price_rules' => false,
140
+ 'filterable_in_search' => false
141
+ ));
142
+
143
+ $installer->addAttribute('catalog_product', 'jan', array(
144
+ 'group' => 'Borderfree',
145
+ 'sort_order' => 14,
146
+ 'type' => 'varchar',
147
+ 'backend' => '',
148
+ 'frontend' => '',
149
+ 'label' => 'Japanese Article Number',
150
+ 'note' => '',
151
+ 'input' => 'text',
152
+ 'class' => '',
153
+ 'source' => '',
154
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
155
+ 'visible' => true,
156
+ 'required' => false,
157
+ 'user_defined' => true,
158
+ 'default' => '',
159
+ 'visible_on_front' => false,
160
+ 'unique' => false,
161
+ 'is_configurable' => false,
162
+ 'used_for_promo_rules' => false,
163
+ 'apply_to' => 'simple',
164
+ 'searchable' => true,
165
+ 'filterable' => 1,
166
+ 'comparable' => false,
167
+ 'visible_in_advanced_search' => false,
168
+ 'used_for_price_rules' => false,
169
+ 'filterable_in_search' => false
170
+ ));
171
+
172
+ $installer->addAttribute('catalog_product', 'eccn', array(
173
+ 'group' => 'Borderfree',
174
+ 'sort_order' => 15,
175
+ 'type' => 'varchar',
176
+ 'backend' => '',
177
+ 'frontend' => '',
178
+ 'label' => 'Export Control Classification Number',
179
+ 'note' => '',
180
+ 'input' => 'text',
181
+ 'class' => '',
182
+ 'source' => '',
183
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
184
+ 'visible' => true,
185
+ 'required' => false,
186
+ 'user_defined' => true,
187
+ 'default' => '',
188
+ 'visible_on_front' => false,
189
+ 'unique' => false,
190
+ 'is_configurable' => false,
191
+ 'used_for_promo_rules' => false,
192
+ 'apply_to' => 'simple',
193
+ 'searchable' => true,
194
+ 'filterable' => 1,
195
+ 'comparable' => false,
196
+ 'visible_in_advanced_search' => false,
197
+ 'used_for_price_rules' => false,
198
+ 'filterable_in_search' => false
199
+ ));
200
+
201
+ $installer->addAttribute('catalog_product', 'mpn', array(
202
+ 'group' => 'Borderfree',
203
+ 'sort_order' => 16,
204
+ 'type' => 'varchar',
205
+ 'backend' => '',
206
+ 'frontend' => '',
207
+ 'label' => 'Manufacturer Part Number',
208
+ 'note' => '',
209
+ 'input' => 'text',
210
+ 'class' => '',
211
+ 'source' => '',
212
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
213
+ 'visible' => true,
214
+ 'required' => false,
215
+ 'user_defined' => true,
216
+ 'default' => '',
217
+ 'visible_on_front' => false,
218
+ 'unique' => false,
219
+ 'is_configurable' => false,
220
+ 'used_for_promo_rules' => false,
221
+ 'apply_to' => 'simple',
222
+ 'searchable' => true,
223
+ 'filterable' => 1,
224
+ 'comparable' => false,
225
+ 'visible_in_advanced_search' => false,
226
+ 'used_for_price_rules' => false,
227
+ 'filterable_in_search' => false
228
+ ));
229
+
230
+ $installer->addAttribute('catalog_product', 'manufacturer', array(
231
+ 'group' => 'Borderfree',
232
+ 'sort_order' => 4,
233
+ 'type' => 'varchar',
234
+ 'backend' => '',
235
+ 'frontend' => '',
236
+ 'label' => 'Manufacturer',
237
+ 'note' => '',
238
+ 'input' => 'select',
239
+ 'class' => '',
240
+ 'source' => '',
241
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
242
+ 'visible' => true,
243
+ 'required' => false,
244
+ 'user_defined' => true,
245
+ 'default' => '',
246
+ 'visible_on_front' => true,
247
+ 'unique' => false,
248
+ 'is_configurable' => false,
249
+ 'used_for_promo_rules' => true,
250
+ 'apply_to' => '',
251
+ 'searchable' => true,
252
+ 'filterable' => 1,
253
+ 'comparable' => true,
254
+ 'visible_in_advanced_search' => true,
255
+ 'used_for_price_rules' => true,
256
+ 'filterable_in_search' => true
257
+ ));
258
+
259
+ $installer->addAttribute('catalog_product', 'brand', array(
260
+ 'group' => 'Borderfree',
261
+ 'sort_order' => 5,
262
+ 'type' => 'varchar',
263
+ 'backend' => '',
264
+ 'frontend' => '',
265
+ 'label' => 'Brand',
266
+ 'note' => '',
267
+ 'input' => 'select',
268
+ 'class' => '',
269
+ 'source' => '',
270
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
271
+ 'visible' => true,
272
+ 'required' => false,
273
+ 'user_defined' => true,
274
+ 'default' => '',
275
+ 'visible_on_front' => true,
276
+ 'unique' => false,
277
+ 'is_configurable' => false,
278
+ 'used_for_promo_rules' => true,
279
+ 'apply_to' => '',
280
+ 'searchable' => true,
281
+ 'filterable' => 1,
282
+ 'comparable' => true,
283
+ 'visible_in_advanced_search' => true,
284
+ 'used_for_price_rules' => true,
285
+ 'filterable_in_search' => true
286
+ ));
287
+
288
+ $installer->addAttribute('catalog_product', 'collection', array(
289
+ 'group' => 'Borderfree',
290
+ 'sort_order' => 6,
291
+ 'type' => 'varchar',
292
+ 'backend' => '',
293
+ 'frontend' => '',
294
+ 'label' => 'Collection',
295
+ 'note' => '',
296
+ 'input' => 'select',
297
+ 'class' => '',
298
+ 'source' => '',
299
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
300
+ 'visible' => true,
301
+ 'required' => false,
302
+ 'user_defined' => true,
303
+ 'default' => '',
304
+ 'visible_on_front' => true,
305
+ 'unique' => false,
306
+ 'is_configurable' => false,
307
+ 'used_for_promo_rules' => true,
308
+ 'apply_to' => '',
309
+ 'searchable' => true,
310
+ 'filterable' => 1,
311
+ 'comparable' => true,
312
+ 'visible_in_advanced_search' => true,
313
+ 'used_for_price_rules' => true,
314
+ 'filterable_in_search' => true
315
+ ));
316
+
317
+ $installer->addAttribute('catalog_product', 'gender', array(
318
+ 'group' => 'Borderfree',
319
+ 'sort_order' => 7,
320
+ 'type' => 'varchar',
321
+ 'backend' => '',
322
+ 'frontend' => '',
323
+ 'label' => 'Gender',
324
+ 'note' => '',
325
+ 'input' => 'select',
326
+ 'class' => '',
327
+ 'source' => '',
328
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
329
+ 'visible' => true,
330
+ 'required' => false,
331
+ 'user_defined' => true,
332
+ 'default' => '',
333
+ 'visible_on_front' => true,
334
+ 'unique' => false,
335
+ 'is_configurable' => false,
336
+ 'used_for_promo_rules' => true,
337
+ 'apply_to' => '',
338
+ 'searchable' => true,
339
+ 'filterable' => 1,
340
+ 'comparable' => true,
341
+ 'visible_in_advanced_search' => true,
342
+ 'used_for_price_rules' => true,
343
+ 'filterable_in_search' => true
344
+ ));
345
+
346
+ $installer->addAttribute('catalog_product', 'age', array(
347
+ 'group' => 'Borderfree',
348
+ 'sort_order' => 8,
349
+ 'type' => 'varchar',
350
+ 'backend' => 'eav/entity_attribute_backend_array',
351
+ 'frontend' => '',
352
+ 'label' => 'Age',
353
+ 'note' => '',
354
+ 'input' => 'multiselect',
355
+ 'class' => '',
356
+ 'source' => '',
357
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
358
+ 'visible' => true,
359
+ 'required' => false,
360
+ 'user_defined' => true,
361
+ 'default' => '',
362
+ 'visible_on_front' => true,
363
+ 'unique' => false,
364
+ 'is_configurable' => false,
365
+ 'used_for_promo_rules' => true,
366
+ 'apply_to' => '',
367
+ 'searchable' => true,
368
+ 'filterable' => 1,
369
+ 'comparable' => true,
370
+ 'visible_in_advanced_search' => true,
371
+ 'used_for_price_rules' => true,
372
+ 'filterable_in_search' => true
373
+ ));
374
+
375
+ $installer->addAttribute('catalog_product', 'season', array(
376
+ 'group' => 'Borderfree',
377
+ 'sort_order' => 9,
378
+ 'type' => 'varchar',
379
+ 'backend' => 'eav/entity_attribute_backend_array',
380
+ 'frontend' => '',
381
+ 'label' => 'Season',
382
+ 'note' => '',
383
+ 'input' => 'multiselect',
384
+ 'class' => '',
385
+ 'source' => '',
386
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
387
+ 'visible' => true,
388
+ 'required' => false,
389
+ 'user_defined' => true,
390
+ 'default' => '',
391
+ 'visible_on_front' => true,
392
+ 'unique' => false,
393
+ 'is_configurable' => false,
394
+ 'used_for_promo_rules' => true,
395
+ 'apply_to' => '',
396
+ 'searchable' => true,
397
+ 'filterable' => 1,
398
+ 'comparable' => true,
399
+ 'visible_in_advanced_search' => true,
400
+ 'used_for_price_rules' => true,
401
+ 'filterable_in_search' => true
402
+ ));
403
+
404
+ $installer->addAttribute('catalog_product', 'is_exclusive', array(
405
+ 'group' => 'Borderfree',
406
+ 'sort_order' => 3,
407
+ 'type' => 'int',
408
+ 'backend' => '',
409
+ 'frontend' => '',
410
+ 'label' => 'Is Exclusive',
411
+ 'note' => 'Indicates whether the Product is exclusive to your catalog.',
412
+ 'input' => 'select',
413
+ 'class' => '',
414
+ 'source' => 'eav/entity_attribute_source_boolean',
415
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
416
+ 'visible' => true,
417
+ 'required' => false,
418
+ 'user_defined' => true,
419
+ 'default' => '0',
420
+ 'visible_on_front' => false,
421
+ 'unique' => false,
422
+ 'is_configurable' => false,
423
+ 'used_for_promo_rules' => false
424
+ ));
425
+
426
+ $installer->addAttribute('catalog_product', 'hs_codes', array(
427
+ 'group' => 'Borderfree',
428
+ 'sort_order' => 19,
429
+ 'type' => 'varchar',
430
+ 'backend' => '',
431
+ 'frontend' => '',
432
+ 'label' => 'Harmonized System (HS) codes',
433
+ 'note' => 'Comma Separated List',
434
+ 'input' => 'text',
435
+ 'class' => '',
436
+ 'source' => '',
437
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
438
+ 'visible' => true,
439
+ 'required' => false,
440
+ 'user_defined' => true,
441
+ 'default' => '',
442
+ 'visible_on_front' => false,
443
+ 'unique' => false,
444
+ 'is_configurable' => false,
445
+ 'used_for_promo_rules' => false,
446
+ 'apply_to' => '',
447
+ 'searchable' => false,
448
+ 'filterable' => 0,
449
+ 'comparable' => false,
450
+ 'visible_in_advanced_search' => false,
451
+ 'used_for_price_rules' => false,
452
+ 'filterable_in_search' => false
453
+ ));
454
+
455
+ $installer->addAttribute('catalog_product', 'is_ormd', array(
456
+ 'group' => 'Borderfree',
457
+ 'sort_order' => 20,
458
+ 'type' => 'int',
459
+ 'backend' => '',
460
+ 'frontend' => '',
461
+ 'label' => 'Is ORM-D',
462
+ 'note' => 'Indicates if the SKU has the "Other Regulated Materials for Domestic transport only"',
463
+ 'input' => 'select',
464
+ 'class' => '',
465
+ 'source' => 'eav/entity_attribute_source_boolean',
466
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
467
+ 'visible' => true,
468
+ 'required' => false,
469
+ 'user_defined' => true,
470
+ 'default' => '0',
471
+ 'visible_on_front' => false,
472
+ 'unique' => false,
473
+ 'is_configurable' => false,
474
+ 'used_for_promo_rules' => false
475
+ ));
476
+
477
+ $installer->addAttribute('catalog_product', 'is_fws_permit_req', array(
478
+ 'group' => 'Borderfree',
479
+ 'sort_order' => 21,
480
+ 'type' => 'int',
481
+ 'backend' => '',
482
+ 'frontend' => '',
483
+ 'label' => 'Fish and Wildlife Services permit required',
484
+ 'note' => '',
485
+ 'input' => 'select',
486
+ 'class' => '',
487
+ 'source' => 'eav/entity_attribute_source_boolean',
488
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
489
+ 'visible' => true,
490
+ 'required' => false,
491
+ 'user_defined' => true,
492
+ 'default' => '0',
493
+ 'visible_on_front' => false,
494
+ 'unique' => false,
495
+ 'is_configurable' => false,
496
+ 'used_for_promo_rules' => false
497
+ ));
498
+
499
+ $installer->addAttribute('catalog_product', 'fws_permit_details', array(
500
+ 'group' => 'Borderfree',
501
+ 'sort_order' => 22,
502
+ 'type' => 'varchar',
503
+ 'backend' => '',
504
+ 'frontend' => '',
505
+ 'label' => "Item's description for the FWS permit",
506
+ 'note' => '',
507
+ 'input' => 'text',
508
+ 'class' => '',
509
+ 'source' => '',
510
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
511
+ 'visible' => true,
512
+ 'required' => false,
513
+ 'user_defined' => true,
514
+ 'default' => '',
515
+ 'visible_on_front' => false,
516
+ 'unique' => false,
517
+ 'is_configurable' => false,
518
+ 'used_for_promo_rules' => false,
519
+ 'apply_to' => '',
520
+ 'searchable' => false,
521
+ 'filterable' => 0,
522
+ 'comparable' => false,
523
+ 'visible_in_advanced_search' => false,
524
+ 'used_for_price_rules' => false,
525
+ 'filterable_in_search' => false
526
+ ));
527
+
528
+
529
+ $installer->endSetup();
530
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.14-1.0.15.php ADDED
@@ -0,0 +1,2154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->run("DROP TABLE IF EXISTS borderfree_catalog_export_log;");
6
+ $installer->run("CREATE TABLE borderfree_catalog_export_log (id int(8) NOT NULL AUTO_INCREMENT, type char(15) NOT NULL, merchant_id char(20) NOT NULL, start_time datetime, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
7
+
8
+ /*
9
+ * Category Attributes
10
+ */
11
+
12
+ $entityTypeId = $installer->getEntityTypeId('catalog_category');
13
+ $installer->addAttributeSet($entityTypeId, "Borderfree", $sortOrder = null);
14
+ $attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
15
+ $installer->addAttributeGroup($entityTypeId, $attributeSetId, "Borderfree", 3);
16
+ $attributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, "Borderfree");
17
+
18
+ $installer->addAttribute('catalog_category', 'borderfree_restricted', array(
19
+ 'type' => 'int',
20
+ 'label' => 'Borderfree Restricted',
21
+ 'sort_order' => 1,
22
+ 'input' => 'select',
23
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
24
+ 'visible' => true,
25
+ 'required' => false,
26
+ 'user_defined' => true,
27
+ 'default' => 0,
28
+ 'source' => "eav/entity_attribute_source_boolean",
29
+ 'note' => 'This category and all children will be restricted from the Borderfree catalog.'
30
+ ));
31
+
32
+ $installer->removeAttribute('catalog_category', 'category_country_restrictions');
33
+ $installer->addAttribute('catalog_category', 'category_country_restrictions', array(
34
+ 'type' => 'varchar',
35
+ 'label' => 'Country Restrictions',
36
+ 'input' => 'multiselect',
37
+ 'backend' => 'eav/entity_attribute_backend_array',
38
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
39
+ 'visible' => true,
40
+ 'required' => false,
41
+ 'user_defined' => true,
42
+ 'default' => "",
43
+ 'note' => '',
44
+ 'option' => array (
45
+ 'value' => array(
46
+ "ALL" => array("All"),
47
+ "AF" => array("Afghanistan"),
48
+ "AX" => array("Ã…land Islands"),
49
+ "AL" => array("Albania"),
50
+ "DZ" => array("Algeria"),
51
+ "AS" => array("American Samoa"),
52
+ "AD" => array("Andorra"),
53
+ "AO" => array("Angola"),
54
+ "AI" => array("Anguilla"),
55
+ "AQ" => array("Antarctica"),
56
+ "AG" => array("Antigua and Barbuda"),
57
+ "AR" => array("Argentina"),
58
+ "AM" => array("Armenia"),
59
+ "AW" => array("Aruba"),
60
+ "AU" => array("Australia"),
61
+ "AT" => array("Austria"),
62
+ "AZ" => array("Azerbaijan"),
63
+ "BS" => array("Bahamas"),
64
+ "BH" => array("Bahrain"),
65
+ "BD" => array("Bangladesh"),
66
+ "BB" => array("Barbados"),
67
+ "BY" => array("Belarus"),
68
+ "BE" => array("Belgium"),
69
+ "BZ" => array("Belize"),
70
+ "BJ" => array("Benin"),
71
+ "BM" => array("Bermuda"),
72
+ "BT" => array("Bhutan"),
73
+ "BO" => array("Bolivia"),
74
+ "BA" => array("Bosnia and Herzegovina"),
75
+ "BW" => array("Botswana"),
76
+ "BV" => array("Bouvet Island"),
77
+ "BR" => array("Brazil"),
78
+ "IO" => array("British Indian Ocean Territory"),
79
+ "BN" => array("Brunei Darussalam"),
80
+ "BG" => array("Bulgaria"),
81
+ "BF" => array("Burkina Faso"),
82
+ "BI" => array("Burundi"),
83
+ "KH" => array("Cambodia"),
84
+ "CM" => array("Cameroon"),
85
+ "CA" => array("Canada"),
86
+ "CV" => array("Cape Verde"),
87
+ "KY" => array("Cayman Islands"),
88
+ "CF" => array("Central African Republic"),
89
+ "TD" => array("Chad"),
90
+ "CL" => array("Chile"),
91
+ "CN" => array("China"),
92
+ "CX" => array("Christmas Island"),
93
+ "CC" => array("Cocos (Keeling) Islands"),
94
+ "CO" => array("Colombia"),
95
+ "KM" => array("Comoros"),
96
+ "CG" => array("Congo"),
97
+ "CD" => array("Congo, The Democratic Republic of The"),
98
+ "CK" => array("Cook Islands"),
99
+ "CR" => array("Costa Rica"),
100
+ "CI" => array("Cote D'ivoire"),
101
+ "HR" => array("Croatia"),
102
+ "CU" => array("Cuba"),
103
+ "CY" => array("Cyprus"),
104
+ "CZ" => array("Czech Republic"),
105
+ "DK" => array("Denmark"),
106
+ "DJ" => array("Djibouti"),
107
+ "DM" => array("Dominica"),
108
+ "DO" => array("Dominican Republic"),
109
+ "EC" => array("Ecuador"),
110
+ "EG" => array("Egypt"),
111
+ "SV" => array("El Salvador"),
112
+ "GQ" => array("Equatorial Guinea"),
113
+ "ER" => array("Eritrea"),
114
+ "EE" => array("Estonia"),
115
+ "ET" => array("Ethiopia"),
116
+ "FK" => array("Falkland Islands (Malvinas)"),
117
+ "FO" => array("Faroe Islands"),
118
+ "FJ" => array("Fiji"),
119
+ "FI" => array("Finland"),
120
+ "FR" => array("France"),
121
+ "GF" => array("French Guiana"),
122
+ "PF" => array("French Polynesia"),
123
+ "TF" => array("French Southern Territories"),
124
+ "GA" => array("Gabon"),
125
+ "GM" => array("Gambia"),
126
+ "GE" => array("Georgia"),
127
+ "DE" => array("Germany"),
128
+ "GH" => array("Ghana"),
129
+ "GI" => array("Gibraltar"),
130
+ "GR" => array("Greece"),
131
+ "GL" => array("Greenland"),
132
+ "GD" => array("Grenada"),
133
+ "GP" => array("Guadeloupe"),
134
+ "GU" => array("Guam"),
135
+ "GT" => array("Guatemala"),
136
+ "GG" => array("Guernsey"),
137
+ "GN" => array("Guinea"),
138
+ "GW" => array("Guinea-bissau"),
139
+ "GY" => array("Guyana"),
140
+ "HT" => array("Haiti"),
141
+ "HM" => array("Heard Island and Mcdonald Islands"),
142
+ "VA" => array("Holy See (Vatican City State)"),
143
+ "HN" => array("Honduras"),
144
+ "HK" => array("Hong Kong"),
145
+ "HU" => array("Hungary"),
146
+ "IS" => array("Iceland"),
147
+ "IN" => array("India"),
148
+ "ID" => array("Indonesia"),
149
+ "IR" => array("Iran, Islamic Republic of"),
150
+ "IQ" => array("Iraq"),
151
+ "IE" => array("Ireland"),
152
+ "IM" => array("Isle of Man"),
153
+ "IL" => array("Israel"),
154
+ "IT" => array("Italy"),
155
+ "JM" => array("Jamaica"),
156
+ "JP" => array("Japan"),
157
+ "JE" => array("Jersey"),
158
+ "JO" => array("Jordan"),
159
+ "KZ" => array("Kazakhstan"),
160
+ "KE" => array("Kenya"),
161
+ "KI" => array("Kiribati"),
162
+ "KP" => array("Korea, Democratic People's Republic of"),
163
+ "KR" => array("Korea, Republic of"),
164
+ "KW" => array("Kuwait"),
165
+ "KG" => array("Kyrgyzstan"),
166
+ "LA" => array("Lao People's Democratic Republic"),
167
+ "LV" => array("Latvia"),
168
+ "LB" => array("Lebanon"),
169
+ "LS" => array("Lesotho"),
170
+ "LR" => array("Liberia"),
171
+ "LY" => array("Libyan Arab Jamahiriya"),
172
+ "LI" => array("Liechtenstein"),
173
+ "LT" => array("Lithuania"),
174
+ "LU" => array("Luxembourg"),
175
+ "MO" => array("Macao"),
176
+ "MK" => array("Macedonia, The Former Yugoslav Republic of"),
177
+ "MG" => array("Madagascar"),
178
+ "MW" => array("Malawi"),
179
+ "MY" => array("Malaysia"),
180
+ "MV" => array("Maldives"),
181
+ "ML" => array("Mali"),
182
+ "MT" => array("Malta"),
183
+ "MH" => array("Marshall Islands"),
184
+ "MQ" => array("Martinique"),
185
+ "MR" => array("Mauritania"),
186
+ "MU" => array("Mauritius"),
187
+ "YT" => array("Mayotte"),
188
+ "MX" => array("Mexico"),
189
+ "FM" => array("Micronesia, Federated States of"),
190
+ "MD" => array("Moldova, Republic of"),
191
+ "MC" => array("Monaco"),
192
+ "MN" => array("Mongolia"),
193
+ "ME" => array("Montenegro"),
194
+ "MS" => array("Montserrat"),
195
+ "MA" => array("Morocco"),
196
+ "MZ" => array("Mozambique"),
197
+ "MM" => array("Myanmar"),
198
+ "NA" => array("Namibia"),
199
+ "NR" => array("Nauru"),
200
+ "NP" => array("Nepal"),
201
+ "NL" => array("Netherlands"),
202
+ "AN" => array("Netherlands Antilles"),
203
+ "NC" => array("New Caledonia"),
204
+ "NZ" => array("New Zealand"),
205
+ "NI" => array("Nicaragua"),
206
+ "NE" => array("Niger"),
207
+ "NG" => array("Nigeria"),
208
+ "NU" => array("Niue"),
209
+ "NF" => array("Norfolk Island"),
210
+ "MP" => array("Northern Mariana Islands"),
211
+ "NO" => array("Norway"),
212
+ "OM" => array("Oman"),
213
+ "PK" => array("Pakistan"),
214
+ "PW" => array("Palau"),
215
+ "PS" => array("Palestinian Territory, Occupied"),
216
+ "PA" => array("Panama"),
217
+ "PG" => array("Papua New Guinea"),
218
+ "PY" => array("Paraguay"),
219
+ "PE" => array("Peru"),
220
+ "PH" => array("Philippines"),
221
+ "PN" => array("Pitcairn"),
222
+ "PL" => array("Poland"),
223
+ "PT" => array("Portugal"),
224
+ "PR" => array("Puerto Rico"),
225
+ "QA" => array("Qatar"),
226
+ "RE" => array("Reunion"),
227
+ "RO" => array("Romania"),
228
+ "RU" => array("Russian Federation"),
229
+ "RW" => array("Rwanda"),
230
+ "SH" => array("Saint Helena"),
231
+ "KN" => array("Saint Kitts and Nevis"),
232
+ "LC" => array("Saint Lucia"),
233
+ "PM" => array("Saint Pierre and Miquelon"),
234
+ "VC" => array("Saint Vincent and The Grenadines"),
235
+ "WS" => array("Samoa"),
236
+ "SM" => array("San Marino"),
237
+ "ST" => array("Sao Tome and Principe"),
238
+ "SA" => array("Saudi Arabia"),
239
+ "SN" => array("Senegal"),
240
+ "RS" => array("Serbia"),
241
+ "SC" => array("Seychelles"),
242
+ "SL" => array("Sierra Leone"),
243
+ "SG" => array("Singapore"),
244
+ "SK" => array("Slovakia"),
245
+ "SI" => array("Slovenia"),
246
+ "SB" => array("Solomon Islands"),
247
+ "SO" => array("Somalia"),
248
+ "ZA" => array("South Africa"),
249
+ "GS" => array("South Georgia and The South Sandwich Islands"),
250
+ "ES" => array("Spain"),
251
+ "LK" => array("Sri Lanka"),
252
+ "SD" => array("Sudan"),
253
+ "SR" => array("Suriname"),
254
+ "SJ" => array("Svalbard and Jan Mayen"),
255
+ "SZ" => array("Swaziland"),
256
+ "SE" => array("Sweden"),
257
+ "CH" => array("Switzerland"),
258
+ "SY" => array("Syrian Arab Republic"),
259
+ "TW" => array("Taiwan, Province of China"),
260
+ "TJ" => array("Tajikistan"),
261
+ "TZ" => array("Tanzania, United Republic of"),
262
+ "TH" => array("Thailand"),
263
+ "TL" => array("Timor-leste"),
264
+ "TG" => array("Togo"),
265
+ "TK" => array("Tokelau"),
266
+ "TO" => array("Tonga"),
267
+ "TT" => array("Trinidad and Tobago"),
268
+ "TN" => array("Tunisia"),
269
+ "TR" => array("Turkey"),
270
+ "TM" => array("Turkmenistan"),
271
+ "TC" => array("Turks and Caicos Islands"),
272
+ "TV" => array("Tuvalu"),
273
+ "UG" => array("Uganda"),
274
+ "UA" => array("Ukraine"),
275
+ "AE" => array("United Arab Emirates"),
276
+ "GB" => array("United Kingdom"),
277
+ "US" => array("United States"),
278
+ "UM" => array("United States Minor Outlying Islands"),
279
+ "UY" => array("Uruguay"),
280
+ "UZ" => array("Uzbekistan"),
281
+ "VU" => array("Vanuatu"),
282
+ "VE" => array("Venezuela"),
283
+ "VN" => array("Viet Nam"),
284
+ "VG" => array("Virgin Islands, British"),
285
+ "VI" => array("Virgin Islands, U.S."),
286
+ "WF" => array("Wallis and Futuna"),
287
+ "EH" => array("Western Sahara"),
288
+ "YE" => array("Yemen"),
289
+ "ZM" => array("Zambia"),
290
+ "ZW" => array("Zimbabwe"),
291
+ )
292
+ )
293
+
294
+ ));
295
+
296
+ $installer->addAttribute('catalog_category', 'hs_codes', array(
297
+ 'type' => 'varchar',
298
+ 'sort_order' => 3,
299
+ 'label' => 'Harmonized System (HS) codes',
300
+ 'input' => 'text',
301
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
302
+ 'visible' => true,
303
+ 'required' => false,
304
+ 'user_defined' => true,
305
+ 'default' => "",
306
+ 'note' => 'Comma Separated List'
307
+ ));
308
+
309
+
310
+ $installer->addAttributeToGroup(
311
+ $entityTypeId,
312
+ $attributeSetId,
313
+ $attributeGroupId,
314
+ 'borderfree_restricted',
315
+ 1
316
+ );
317
+
318
+ $installer->addAttributeToGroup(
319
+ $entityTypeId,
320
+ $attributeSetId,
321
+ $attributeGroupId,
322
+ 'category_country_restrictions',
323
+ 2
324
+ );
325
+
326
+ $installer->addAttributeToGroup(
327
+ $entityTypeId,
328
+ $attributeSetId,
329
+ $attributeGroupId,
330
+ 'hs_codes',
331
+ 3
332
+ );
333
+
334
+ /*
335
+ * Product Attributes
336
+ */
337
+
338
+ $installer->addAttribute('catalog_product', 'borderfree_restricted', array(
339
+ 'group' => 'Borderfree',
340
+ 'sort_order' => 1,
341
+ 'type' => 'int',
342
+ 'backend' => '',
343
+ 'frontend' => '',
344
+ 'label' => 'Borderfree Restricted',
345
+ 'note' => 'This product will be restricted from the Borderfree catalog.',
346
+ 'input' => 'select',
347
+ 'class' => '',
348
+ 'source' => 'eav/entity_attribute_source_boolean',
349
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
350
+ 'visible' => true,
351
+ 'required' => false,
352
+ 'user_defined' => true,
353
+ 'default' => '0',
354
+ 'visible_on_front' => false,
355
+ 'unique' => false,
356
+ 'is_configurable' => false,
357
+ 'used_for_promo_rules' => false
358
+ ));
359
+
360
+ $installer->removeAttribute('catalog_product', 'country_restrictions');
361
+ $installer->addAttribute('catalog_product', 'country_restrictions', array(
362
+ 'group' => 'Borderfree',
363
+ 'sort_order' => 2,
364
+ 'type' => 'varchar',
365
+ 'backend' => 'eav/entity_attribute_backend_array',
366
+ 'frontend' => '',
367
+ 'label' => 'Country Restrictions',
368
+ 'note' => '',
369
+ 'input' => 'multiselect',
370
+ 'class' => '',
371
+ 'source' => '',
372
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
373
+ 'visible' => true,
374
+ 'required' => false,
375
+ 'user_defined' => true,
376
+ 'default' => '',
377
+ 'visible_on_front' => false,
378
+ 'unique' => false,
379
+ 'is_configurable' => false,
380
+ 'used_for_promo_rules' => false,
381
+ 'apply_to' => '',
382
+ 'searchable' => false,
383
+ 'filterable' => 0,
384
+ 'comparable' => false,
385
+ 'visible_in_advanced_search' => true,
386
+ 'used_for_price_rules' => false,
387
+ 'filterable_in_search' => false,
388
+ 'option' => array (
389
+ 'value' => array(
390
+ "ALL" => array("All"),
391
+ "AF" => array("Afghanistan"),
392
+ "AX" => array("Ã…land Islands"),
393
+ "AL" => array("Albania"),
394
+ "DZ" => array("Algeria"),
395
+ "AS" => array("American Samoa"),
396
+ "AD" => array("Andorra"),
397
+ "AO" => array("Angola"),
398
+ "AI" => array("Anguilla"),
399
+ "AQ" => array("Antarctica"),
400
+ "AG" => array("Antigua and Barbuda"),
401
+ "AR" => array("Argentina"),
402
+ "AM" => array("Armenia"),
403
+ "AW" => array("Aruba"),
404
+ "AU" => array("Australia"),
405
+ "AT" => array("Austria"),
406
+ "AZ" => array("Azerbaijan"),
407
+ "BS" => array("Bahamas"),
408
+ "BH" => array("Bahrain"),
409
+ "BD" => array("Bangladesh"),
410
+ "BB" => array("Barbados"),
411
+ "BY" => array("Belarus"),
412
+ "BE" => array("Belgium"),
413
+ "BZ" => array("Belize"),
414
+ "BJ" => array("Benin"),
415
+ "BM" => array("Bermuda"),
416
+ "BT" => array("Bhutan"),
417
+ "BO" => array("Bolivia"),
418
+ "BA" => array("Bosnia and Herzegovina"),
419
+ "BW" => array("Botswana"),
420
+ "BV" => array("Bouvet Island"),
421
+ "BR" => array("Brazil"),
422
+ "IO" => array("British Indian Ocean Territory"),
423
+ "BN" => array("Brunei Darussalam"),
424
+ "BG" => array("Bulgaria"),
425
+ "BF" => array("Burkina Faso"),
426
+ "BI" => array("Burundi"),
427
+ "KH" => array("Cambodia"),
428
+ "CM" => array("Cameroon"),
429
+ "CA" => array("Canada"),
430
+ "CV" => array("Cape Verde"),
431
+ "KY" => array("Cayman Islands"),
432
+ "CF" => array("Central African Republic"),
433
+ "TD" => array("Chad"),
434
+ "CL" => array("Chile"),
435
+ "CN" => array("China"),
436
+ "CX" => array("Christmas Island"),
437
+ "CC" => array("Cocos (Keeling) Islands"),
438
+ "CO" => array("Colombia"),
439
+ "KM" => array("Comoros"),
440
+ "CG" => array("Congo"),
441
+ "CD" => array("Congo, The Democratic Republic of The"),
442
+ "CK" => array("Cook Islands"),
443
+ "CR" => array("Costa Rica"),
444
+ "CI" => array("Cote D'ivoire"),
445
+ "HR" => array("Croatia"),
446
+ "CU" => array("Cuba"),
447
+ "CY" => array("Cyprus"),
448
+ "CZ" => array("Czech Republic"),
449
+ "DK" => array("Denmark"),
450
+ "DJ" => array("Djibouti"),
451
+ "DM" => array("Dominica"),
452
+ "DO" => array("Dominican Republic"),
453
+ "EC" => array("Ecuador"),
454
+ "EG" => array("Egypt"),
455
+ "SV" => array("El Salvador"),
456
+ "GQ" => array("Equatorial Guinea"),
457
+ "ER" => array("Eritrea"),
458
+ "EE" => array("Estonia"),
459
+ "ET" => array("Ethiopia"),
460
+ "FK" => array("Falkland Islands (Malvinas)"),
461
+ "FO" => array("Faroe Islands"),
462
+ "FJ" => array("Fiji"),
463
+ "FI" => array("Finland"),
464
+ "FR" => array("France"),
465
+ "GF" => array("French Guiana"),
466
+ "PF" => array("French Polynesia"),
467
+ "TF" => array("French Southern Territories"),
468
+ "GA" => array("Gabon"),
469
+ "GM" => array("Gambia"),
470
+ "GE" => array("Georgia"),
471
+ "DE" => array("Germany"),
472
+ "GH" => array("Ghana"),
473
+ "GI" => array("Gibraltar"),
474
+ "GR" => array("Greece"),
475
+ "GL" => array("Greenland"),
476
+ "GD" => array("Grenada"),
477
+ "GP" => array("Guadeloupe"),
478
+ "GU" => array("Guam"),
479
+ "GT" => array("Guatemala"),
480
+ "GG" => array("Guernsey"),
481
+ "GN" => array("Guinea"),
482
+ "GW" => array("Guinea-bissau"),
483
+ "GY" => array("Guyana"),
484
+ "HT" => array("Haiti"),
485
+ "HM" => array("Heard Island and Mcdonald Islands"),
486
+ "VA" => array("Holy See (Vatican City State)"),
487
+ "HN" => array("Honduras"),
488
+ "HK" => array("Hong Kong"),
489
+ "HU" => array("Hungary"),
490
+ "IS" => array("Iceland"),
491
+ "IN" => array("India"),
492
+ "ID" => array("Indonesia"),
493
+ "IR" => array("Iran, Islamic Republic of"),
494
+ "IQ" => array("Iraq"),
495
+ "IE" => array("Ireland"),
496
+ "IM" => array("Isle of Man"),
497
+ "IL" => array("Israel"),
498
+ "IT" => array("Italy"),
499
+ "JM" => array("Jamaica"),
500
+ "JP" => array("Japan"),
501
+ "JE" => array("Jersey"),
502
+ "JO" => array("Jordan"),
503
+ "KZ" => array("Kazakhstan"),
504
+ "KE" => array("Kenya"),
505
+ "KI" => array("Kiribati"),
506
+ "KP" => array("Korea, Democratic People's Republic of"),
507
+ "KR" => array("Korea, Republic of"),
508
+ "KW" => array("Kuwait"),
509
+ "KG" => array("Kyrgyzstan"),
510
+ "LA" => array("Lao People's Democratic Republic"),
511
+ "LV" => array("Latvia"),
512
+ "LB" => array("Lebanon"),
513
+ "LS" => array("Lesotho"),
514
+ "LR" => array("Liberia"),
515
+ "LY" => array("Libyan Arab Jamahiriya"),
516
+ "LI" => array("Liechtenstein"),
517
+ "LT" => array("Lithuania"),
518
+ "LU" => array("Luxembourg"),
519
+ "MO" => array("Macao"),
520
+ "MK" => array("Macedonia, The Former Yugoslav Republic of"),
521
+ "MG" => array("Madagascar"),
522
+ "MW" => array("Malawi"),
523
+ "MY" => array("Malaysia"),
524
+ "MV" => array("Maldives"),
525
+ "ML" => array("Mali"),
526
+ "MT" => array("Malta"),
527
+ "MH" => array("Marshall Islands"),
528
+ "MQ" => array("Martinique"),
529
+ "MR" => array("Mauritania"),
530
+ "MU" => array("Mauritius"),
531
+ "YT" => array("Mayotte"),
532
+ "MX" => array("Mexico"),
533
+ "FM" => array("Micronesia, Federated States of"),
534
+ "MD" => array("Moldova, Republic of"),
535
+ "MC" => array("Monaco"),
536
+ "MN" => array("Mongolia"),
537
+ "ME" => array("Montenegro"),
538
+ "MS" => array("Montserrat"),
539
+ "MA" => array("Morocco"),
540
+ "MZ" => array("Mozambique"),
541
+ "MM" => array("Myanmar"),
542
+ "NA" => array("Namibia"),
543
+ "NR" => array("Nauru"),
544
+ "NP" => array("Nepal"),
545
+ "NL" => array("Netherlands"),
546
+ "AN" => array("Netherlands Antilles"),
547
+ "NC" => array("New Caledonia"),
548
+ "NZ" => array("New Zealand"),
549
+ "NI" => array("Nicaragua"),
550
+ "NE" => array("Niger"),
551
+ "NG" => array("Nigeria"),
552
+ "NU" => array("Niue"),
553
+ "NF" => array("Norfolk Island"),
554
+ "MP" => array("Northern Mariana Islands"),
555
+ "NO" => array("Norway"),
556
+ "OM" => array("Oman"),
557
+ "PK" => array("Pakistan"),
558
+ "PW" => array("Palau"),
559
+ "PS" => array("Palestinian Territory, Occupied"),
560
+ "PA" => array("Panama"),
561
+ "PG" => array("Papua New Guinea"),
562
+ "PY" => array("Paraguay"),
563
+ "PE" => array("Peru"),
564
+ "PH" => array("Philippines"),
565
+ "PN" => array("Pitcairn"),
566
+ "PL" => array("Poland"),
567
+ "PT" => array("Portugal"),
568
+ "PR" => array("Puerto Rico"),
569
+ "QA" => array("Qatar"),
570
+ "RE" => array("Reunion"),
571
+ "RO" => array("Romania"),
572
+ "RU" => array("Russian Federation"),
573
+ "RW" => array("Rwanda"),
574
+ "SH" => array("Saint Helena"),
575
+ "KN" => array("Saint Kitts and Nevis"),
576
+ "LC" => array("Saint Lucia"),
577
+ "PM" => array("Saint Pierre and Miquelon"),
578
+ "VC" => array("Saint Vincent and The Grenadines"),
579
+ "WS" => array("Samoa"),
580
+ "SM" => array("San Marino"),
581
+ "ST" => array("Sao Tome and Principe"),
582
+ "SA" => array("Saudi Arabia"),
583
+ "SN" => array("Senegal"),
584
+ "RS" => array("Serbia"),
585
+ "SC" => array("Seychelles"),
586
+ "SL" => array("Sierra Leone"),
587
+ "SG" => array("Singapore"),
588
+ "SK" => array("Slovakia"),
589
+ "SI" => array("Slovenia"),
590
+ "SB" => array("Solomon Islands"),
591
+ "SO" => array("Somalia"),
592
+ "ZA" => array("South Africa"),
593
+ "GS" => array("South Georgia and The South Sandwich Islands"),
594
+ "ES" => array("Spain"),
595
+ "LK" => array("Sri Lanka"),
596
+ "SD" => array("Sudan"),
597
+ "SR" => array("Suriname"),
598
+ "SJ" => array("Svalbard and Jan Mayen"),
599
+ "SZ" => array("Swaziland"),
600
+ "SE" => array("Sweden"),
601
+ "CH" => array("Switzerland"),
602
+ "SY" => array("Syrian Arab Republic"),
603
+ "TW" => array("Taiwan, Province of China"),
604
+ "TJ" => array("Tajikistan"),
605
+ "TZ" => array("Tanzania, United Republic of"),
606
+ "TH" => array("Thailand"),
607
+ "TL" => array("Timor-leste"),
608
+ "TG" => array("Togo"),
609
+ "TK" => array("Tokelau"),
610
+ "TO" => array("Tonga"),
611
+ "TT" => array("Trinidad and Tobago"),
612
+ "TN" => array("Tunisia"),
613
+ "TR" => array("Turkey"),
614
+ "TM" => array("Turkmenistan"),
615
+ "TC" => array("Turks and Caicos Islands"),
616
+ "TV" => array("Tuvalu"),
617
+ "UG" => array("Uganda"),
618
+ "UA" => array("Ukraine"),
619
+ "AE" => array("United Arab Emirates"),
620
+ "GB" => array("United Kingdom"),
621
+ "US" => array("United States"),
622
+ "UM" => array("United States Minor Outlying Islands"),
623
+ "UY" => array("Uruguay"),
624
+ "UZ" => array("Uzbekistan"),
625
+ "VU" => array("Vanuatu"),
626
+ "VE" => array("Venezuela"),
627
+ "VN" => array("Viet Nam"),
628
+ "VG" => array("Virgin Islands, British"),
629
+ "VI" => array("Virgin Islands, U.S."),
630
+ "WF" => array("Wallis and Futuna"),
631
+ "EH" => array("Western Sahara"),
632
+ "YE" => array("Yemen"),
633
+ "ZM" => array("Zambia"),
634
+ "ZW" => array("Zimbabwe"),
635
+ )
636
+ ),
637
+
638
+ ));
639
+ /*
640
+ $installer->removeAttribute('catalog_product', 'country_of_manufacture');
641
+ $installer->addAttribute('catalog_product', 'country_of_manufacture', array(
642
+ 'group' => 'Borderfree',
643
+ 'sort_order' => 3,
644
+ 'type' => 'varchar',
645
+ 'backend' => '',
646
+ 'frontend' => '',
647
+ 'label' => 'Country of Origin',
648
+ 'note' => '',
649
+ 'input' => 'select',
650
+ 'class' => '',
651
+ 'source' => '',
652
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
653
+ 'visible' => true,
654
+ 'required' => false,
655
+ 'user_defined' => true,
656
+ 'default' => '',
657
+ 'visible_on_front' => false,
658
+ 'unique' => false,
659
+ 'is_configurable' => false,
660
+ 'used_for_promo_rules' => false,
661
+ 'apply_to' => '',
662
+ 'searchable' => false,
663
+ 'filterable' => 0,
664
+ 'comparable' => false,
665
+ 'visible_in_advanced_search' => true,
666
+ 'used_for_price_rules' => false,
667
+ 'filterable_in_search' => false,
668
+ 'option' => array (
669
+ 'value' => array(
670
+ "AF" => array("Afghanistan"),
671
+ "AX" => array("Ã…land Islands"),
672
+ "AL" => array("Albania"),
673
+ "DZ" => array("Algeria"),
674
+ "AS" => array("American Samoa"),
675
+ "AD" => array("Andorra"),
676
+ "AO" => array("Angola"),
677
+ "AI" => array("Anguilla"),
678
+ "AQ" => array("Antarctica"),
679
+ "AG" => array("Antigua and Barbuda"),
680
+ "AR" => array("Argentina"),
681
+ "AM" => array("Armenia"),
682
+ "AW" => array("Aruba"),
683
+ "AU" => array("Australia"),
684
+ "AT" => array("Austria"),
685
+ "AZ" => array("Azerbaijan"),
686
+ "BS" => array("Bahamas"),
687
+ "BH" => array("Bahrain"),
688
+ "BD" => array("Bangladesh"),
689
+ "BB" => array("Barbados"),
690
+ "BY" => array("Belarus"),
691
+ "BE" => array("Belgium"),
692
+ "BZ" => array("Belize"),
693
+ "BJ" => array("Benin"),
694
+ "BM" => array("Bermuda"),
695
+ "BT" => array("Bhutan"),
696
+ "BO" => array("Bolivia"),
697
+ "BA" => array("Bosnia and Herzegovina"),
698
+ "BW" => array("Botswana"),
699
+ "BV" => array("Bouvet Island"),
700
+ "BR" => array("Brazil"),
701
+ "IO" => array("British Indian Ocean Territory"),
702
+ "BN" => array("Brunei Darussalam"),
703
+ "BG" => array("Bulgaria"),
704
+ "BF" => array("Burkina Faso"),
705
+ "BI" => array("Burundi"),
706
+ "KH" => array("Cambodia"),
707
+ "CM" => array("Cameroon"),
708
+ "CA" => array("Canada"),
709
+ "CV" => array("Cape Verde"),
710
+ "KY" => array("Cayman Islands"),
711
+ "CF" => array("Central African Republic"),
712
+ "TD" => array("Chad"),
713
+ "CL" => array("Chile"),
714
+ "CN" => array("China"),
715
+ "CX" => array("Christmas Island"),
716
+ "CC" => array("Cocos (Keeling) Islands"),
717
+ "CO" => array("Colombia"),
718
+ "KM" => array("Comoros"),
719
+ "CG" => array("Congo"),
720
+ "CD" => array("Congo, The Democratic Republic of The"),
721
+ "CK" => array("Cook Islands"),
722
+ "CR" => array("Costa Rica"),
723
+ "CI" => array("Cote D'ivoire"),
724
+ "HR" => array("Croatia"),
725
+ "CU" => array("Cuba"),
726
+ "CY" => array("Cyprus"),
727
+ "CZ" => array("Czech Republic"),
728
+ "DK" => array("Denmark"),
729
+ "DJ" => array("Djibouti"),
730
+ "DM" => array("Dominica"),
731
+ "DO" => array("Dominican Republic"),
732
+ "EC" => array("Ecuador"),
733
+ "EG" => array("Egypt"),
734
+ "SV" => array("El Salvador"),
735
+ "GQ" => array("Equatorial Guinea"),
736
+ "ER" => array("Eritrea"),
737
+ "EE" => array("Estonia"),
738
+ "ET" => array("Ethiopia"),
739
+ "FK" => array("Falkland Islands (Malvinas)"),
740
+ "FO" => array("Faroe Islands"),
741
+ "FJ" => array("Fiji"),
742
+ "FI" => array("Finland"),
743
+ "FR" => array("France"),
744
+ "GF" => array("French Guiana"),
745
+ "PF" => array("French Polynesia"),
746
+ "TF" => array("French Southern Territories"),
747
+ "GA" => array("Gabon"),
748
+ "GM" => array("Gambia"),
749
+ "GE" => array("Georgia"),
750
+ "DE" => array("Germany"),
751
+ "GH" => array("Ghana"),
752
+ "GI" => array("Gibraltar"),
753
+ "GR" => array("Greece"),
754
+ "GL" => array("Greenland"),
755
+ "GD" => array("Grenada"),
756
+ "GP" => array("Guadeloupe"),
757
+ "GU" => array("Guam"),
758
+ "GT" => array("Guatemala"),
759
+ "GG" => array("Guernsey"),
760
+ "GN" => array("Guinea"),
761
+ "GW" => array("Guinea-bissau"),
762
+ "GY" => array("Guyana"),
763
+ "HT" => array("Haiti"),
764
+ "HM" => array("Heard Island and Mcdonald Islands"),
765
+ "VA" => array("Holy See (Vatican City State)"),
766
+ "HN" => array("Honduras"),
767
+ "HK" => array("Hong Kong"),
768
+ "HU" => array("Hungary"),
769
+ "IS" => array("Iceland"),
770
+ "IN" => array("India"),
771
+ "ID" => array("Indonesia"),
772
+ "IR" => array("Iran, Islamic Republic of"),
773
+ "IQ" => array("Iraq"),
774
+ "IE" => array("Ireland"),
775
+ "IM" => array("Isle of Man"),
776
+ "IL" => array("Israel"),
777
+ "IT" => array("Italy"),
778
+ "JM" => array("Jamaica"),
779
+ "JP" => array("Japan"),
780
+ "JE" => array("Jersey"),
781
+ "JO" => array("Jordan"),
782
+ "KZ" => array("Kazakhstan"),
783
+ "KE" => array("Kenya"),
784
+ "KI" => array("Kiribati"),
785
+ "KP" => array("Korea, Democratic People's Republic of"),
786
+ "KR" => array("Korea, Republic of"),
787
+ "KW" => array("Kuwait"),
788
+ "KG" => array("Kyrgyzstan"),
789
+ "LA" => array("Lao People's Democratic Republic"),
790
+ "LV" => array("Latvia"),
791
+ "LB" => array("Lebanon"),
792
+ "LS" => array("Lesotho"),
793
+ "LR" => array("Liberia"),
794
+ "LY" => array("Libyan Arab Jamahiriya"),
795
+ "LI" => array("Liechtenstein"),
796
+ "LT" => array("Lithuania"),
797
+ "LU" => array("Luxembourg"),
798
+ "MO" => array("Macao"),
799
+ "MK" => array("Macedonia, The Former Yugoslav Republic of"),
800
+ "MG" => array("Madagascar"),
801
+ "MW" => array("Malawi"),
802
+ "MY" => array("Malaysia"),
803
+ "MV" => array("Maldives"),
804
+ "ML" => array("Mali"),
805
+ "MT" => array("Malta"),
806
+ "MH" => array("Marshall Islands"),
807
+ "MQ" => array("Martinique"),
808
+ "MR" => array("Mauritania"),
809
+ "MU" => array("Mauritius"),
810
+ "YT" => array("Mayotte"),
811
+ "MX" => array("Mexico"),
812
+ "FM" => array("Micronesia, Federated States of"),
813
+ "MD" => array("Moldova, Republic of"),
814
+ "MC" => array("Monaco"),
815
+ "MN" => array("Mongolia"),
816
+ "ME" => array("Montenegro"),
817
+ "MS" => array("Montserrat"),
818
+ "MA" => array("Morocco"),
819
+ "MZ" => array("Mozambique"),
820
+ "MM" => array("Myanmar"),
821
+ "NA" => array("Namibia"),
822
+ "NR" => array("Nauru"),
823
+ "NP" => array("Nepal"),
824
+ "NL" => array("Netherlands"),
825
+ "AN" => array("Netherlands Antilles"),
826
+ "NC" => array("New Caledonia"),
827
+ "NZ" => array("New Zealand"),
828
+ "NI" => array("Nicaragua"),
829
+ "NE" => array("Niger"),
830
+ "NG" => array("Nigeria"),
831
+ "NU" => array("Niue"),
832
+ "NF" => array("Norfolk Island"),
833
+ "MP" => array("Northern Mariana Islands"),
834
+ "NO" => array("Norway"),
835
+ "OM" => array("Oman"),
836
+ "PK" => array("Pakistan"),
837
+ "PW" => array("Palau"),
838
+ "PS" => array("Palestinian Territory, Occupied"),
839
+ "PA" => array("Panama"),
840
+ "PG" => array("Papua New Guinea"),
841
+ "PY" => array("Paraguay"),
842
+ "PE" => array("Peru"),
843
+ "PH" => array("Philippines"),
844
+ "PN" => array("Pitcairn"),
845
+ "PL" => array("Poland"),
846
+ "PT" => array("Portugal"),
847
+ "PR" => array("Puerto Rico"),
848
+ "QA" => array("Qatar"),
849
+ "RE" => array("Reunion"),
850
+ "RO" => array("Romania"),
851
+ "RU" => array("Russian Federation"),
852
+ "RW" => array("Rwanda"),
853
+ "SH" => array("Saint Helena"),
854
+ "KN" => array("Saint Kitts and Nevis"),
855
+ "LC" => array("Saint Lucia"),
856
+ "PM" => array("Saint Pierre and Miquelon"),
857
+ "VC" => array("Saint Vincent and The Grenadines"),
858
+ "WS" => array("Samoa"),
859
+ "SM" => array("San Marino"),
860
+ "ST" => array("Sao Tome and Principe"),
861
+ "SA" => array("Saudi Arabia"),
862
+ "SN" => array("Senegal"),
863
+ "RS" => array("Serbia"),
864
+ "SC" => array("Seychelles"),
865
+ "SL" => array("Sierra Leone"),
866
+ "SG" => array("Singapore"),
867
+ "SK" => array("Slovakia"),
868
+ "SI" => array("Slovenia"),
869
+ "SB" => array("Solomon Islands"),
870
+ "SO" => array("Somalia"),
871
+ "ZA" => array("South Africa"),
872
+ "GS" => array("South Georgia and The South Sandwich Islands"),
873
+ "ES" => array("Spain"),
874
+ "LK" => array("Sri Lanka"),
875
+ "SD" => array("Sudan"),
876
+ "SR" => array("Suriname"),
877
+ "SJ" => array("Svalbard and Jan Mayen"),
878
+ "SZ" => array("Swaziland"),
879
+ "SE" => array("Sweden"),
880
+ "CH" => array("Switzerland"),
881
+ "SY" => array("Syrian Arab Republic"),
882
+ "TW" => array("Taiwan, Province of China"),
883
+ "TJ" => array("Tajikistan"),
884
+ "TZ" => array("Tanzania, United Republic of"),
885
+ "TH" => array("Thailand"),
886
+ "TL" => array("Timor-leste"),
887
+ "TG" => array("Togo"),
888
+ "TK" => array("Tokelau"),
889
+ "TO" => array("Tonga"),
890
+ "TT" => array("Trinidad and Tobago"),
891
+ "TN" => array("Tunisia"),
892
+ "TR" => array("Turkey"),
893
+ "TM" => array("Turkmenistan"),
894
+ "TC" => array("Turks and Caicos Islands"),
895
+ "TV" => array("Tuvalu"),
896
+ "UG" => array("Uganda"),
897
+ "UA" => array("Ukraine"),
898
+ "AE" => array("United Arab Emirates"),
899
+ "GB" => array("United Kingdom"),
900
+ "US" => array("United States"),
901
+ "UM" => array("United States Minor Outlying Islands"),
902
+ "UY" => array("Uruguay"),
903
+ "UZ" => array("Uzbekistan"),
904
+ "VU" => array("Vanuatu"),
905
+ "VE" => array("Venezuela"),
906
+ "VN" => array("Viet Nam"),
907
+ "VG" => array("Virgin Islands, British"),
908
+ "VI" => array("Virgin Islands, U.S."),
909
+ "WF" => array("Wallis and Futuna"),
910
+ "EH" => array("Western Sahara"),
911
+ "YE" => array("Yemen"),
912
+ "ZM" => array("Zambia"),
913
+ "ZW" => array("Zimbabwe"),
914
+ "ZZ" => array("Multi-Sourced"),
915
+ )
916
+ ),
917
+
918
+ ));
919
+ */
920
+ $installer->addAttribute('catalog_product', 'product_width', array(
921
+ 'group' => 'Borderfree',
922
+ 'sort_order' => 5,
923
+ 'type' => 'varchar',
924
+ 'backend' => '',
925
+ 'frontend' => '',
926
+ 'label' => 'Product Width',
927
+ 'note' => '',
928
+ 'input' => 'text',
929
+ 'class' => '',
930
+ 'source' => '',
931
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
932
+ 'visible' => true,
933
+ 'required' => false,
934
+ 'user_defined' => true,
935
+ 'default' => '',
936
+ 'visible_on_front' => false,
937
+ 'unique' => false,
938
+ 'is_configurable' => false,
939
+ 'used_for_promo_rules' => false,
940
+ 'apply_to' => '',
941
+ 'searchable' => false,
942
+ 'filterable' => 0,
943
+ 'comparable' => false,
944
+ 'visible_in_advanced_search' => false,
945
+ 'used_for_price_rules' => false,
946
+ 'filterable_in_search' => false
947
+ ));
948
+
949
+ $installer->addAttribute('catalog_product', 'product_length', array(
950
+ 'group' => 'Borderfree',
951
+ 'sort_order' => 6,
952
+ 'type' => 'varchar',
953
+ 'backend' => '',
954
+ 'frontend' => '',
955
+ 'label' => 'Product Length',
956
+ 'note' => '',
957
+ 'input' => 'text',
958
+ 'class' => '',
959
+ 'source' => '',
960
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
961
+ 'visible' => true,
962
+ 'required' => false,
963
+ 'user_defined' => true,
964
+ 'default' => '',
965
+ 'visible_on_front' => false,
966
+ 'unique' => false,
967
+ 'is_configurable' => false,
968
+ 'used_for_promo_rules' => false,
969
+ 'apply_to' => '',
970
+ 'searchable' => false,
971
+ 'filterable' => 0,
972
+ 'comparable' => false,
973
+ 'visible_in_advanced_search' => false,
974
+ 'used_for_price_rules' => false,
975
+ 'filterable_in_search' => false
976
+ ));
977
+
978
+ $installer->addAttribute('catalog_product', 'product_height', array(
979
+ 'group' => 'Borderfree',
980
+ 'sort_order' => 7,
981
+ 'type' => 'varchar',
982
+ 'backend' => '',
983
+ 'frontend' => '',
984
+ 'label' => 'Product Height',
985
+ 'note' => '',
986
+ 'input' => 'text',
987
+ 'class' => '',
988
+ 'source' => '',
989
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
990
+ 'visible' => true,
991
+ 'required' => false,
992
+ 'user_defined' => true,
993
+ 'default' => '',
994
+ 'visible_on_front' => false,
995
+ 'unique' => false,
996
+ 'is_configurable' => false,
997
+ 'used_for_promo_rules' => false,
998
+ 'apply_to' => '',
999
+ 'searchable' => false,
1000
+ 'filterable' => 0,
1001
+ 'comparable' => false,
1002
+ 'visible_in_advanced_search' => false,
1003
+ 'used_for_price_rules' => false,
1004
+ 'filterable_in_search' => false
1005
+ ));
1006
+
1007
+ $installer->addAttribute('catalog_product', 'box_width', array(
1008
+ 'group' => 'Borderfree',
1009
+ 'sort_order' => 8,
1010
+ 'type' => 'varchar',
1011
+ 'backend' => '',
1012
+ 'frontend' => '',
1013
+ 'label' => 'Box Width',
1014
+ 'note' => '',
1015
+ 'input' => 'text',
1016
+ 'class' => '',
1017
+ 'source' => '',
1018
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
1019
+ 'visible' => true,
1020
+ 'required' => false,
1021
+ 'user_defined' => true,
1022
+ 'default' => '',
1023
+ 'visible_on_front' => false,
1024
+ 'unique' => false,
1025
+ 'is_configurable' => false,
1026
+ 'used_for_promo_rules' => false,
1027
+ 'apply_to' => '',
1028
+ 'searchable' => false,
1029
+ 'filterable' => 0,
1030
+ 'comparable' => false,
1031
+ 'visible_in_advanced_search' => false,
1032
+ 'used_for_price_rules' => false,
1033
+ 'filterable_in_search' => false
1034
+ ));
1035
+
1036
+ $installer->addAttribute('catalog_product', 'box_length', array(
1037
+ 'group' => 'Borderfree',
1038
+ 'sort_order' => 9,
1039
+ 'type' => 'varchar',
1040
+ 'backend' => '',
1041
+ 'frontend' => '',
1042
+ 'label' => 'Box Length',
1043
+ 'note' => '',
1044
+ 'input' => 'text',
1045
+ 'class' => '',
1046
+ 'source' => '',
1047
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
1048
+ 'visible' => true,
1049
+ 'required' => false,
1050
+ 'user_defined' => true,
1051
+ 'default' => '',
1052
+ 'visible_on_front' => false,
1053
+ 'unique' => false,
1054
+ 'is_configurable' => false,
1055
+ 'used_for_promo_rules' => false,
1056
+ 'apply_to' => '',
1057
+ 'searchable' => false,
1058
+ 'filterable' => 0,
1059
+ 'comparable' => false,
1060
+ 'visible_in_advanced_search' => false,
1061
+ 'used_for_price_rules' => false,
1062
+ 'filterable_in_search' => false
1063
+ ));
1064
+
1065
+ $installer->addAttribute('catalog_product', 'box_height', array(
1066
+ 'group' => 'Borderfree',
1067
+ 'sort_order' => 10,
1068
+ 'type' => 'varchar',
1069
+ 'backend' => '',
1070
+ 'frontend' => '',
1071
+ 'label' => 'Box Height',
1072
+ 'note' => '',
1073
+ 'input' => 'text',
1074
+ 'class' => '',
1075
+ 'source' => '',
1076
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
1077
+ 'visible' => true,
1078
+ 'required' => false,
1079
+ 'user_defined' => true,
1080
+ 'default' => '',
1081
+ 'visible_on_front' => false,
1082
+ 'unique' => false,
1083
+ 'is_configurable' => false,
1084
+ 'used_for_promo_rules' => false,
1085
+ 'apply_to' => '',
1086
+ 'searchable' => false,
1087
+ 'filterable' => 0,
1088
+ 'comparable' => false,
1089
+ 'visible_in_advanced_search' => false,
1090
+ 'used_for_price_rules' => false,
1091
+ 'filterable_in_search' => false
1092
+ ));
1093
+
1094
+ $installer->addAttribute('catalog_product', 'extra_shipping', array(
1095
+ 'group' => 'Borderfree',
1096
+ 'sort_order' => 11,
1097
+ 'type' => 'varchar',
1098
+ 'backend' => '',
1099
+ 'frontend' => '',
1100
+ 'frontend_class' => 'validate-number',
1101
+ 'label' => 'Additional Shipping Charge',
1102
+ 'note' => '',
1103
+ 'input' => 'text',
1104
+ 'class' => '',
1105
+ 'source' => '',
1106
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
1107
+ 'visible' => true,
1108
+ 'required' => false,
1109
+ 'user_defined' => true,
1110
+ 'default' => '',
1111
+ 'visible_on_front' => false,
1112
+ 'unique' => false,
1113
+ 'is_configurable' => false,
1114
+ 'used_for_promo_rules' => false,
1115
+ 'apply_to' => '',
1116
+ 'searchable' => false,
1117
+ 'filterable' => 0,
1118
+ 'is_html_allowed_on_front' => false,
1119
+ 'comparable' => false,
1120
+ 'visible_in_advanced_search' => false,
1121
+ 'used_for_price_rules' => false,
1122
+ 'filterable_in_search' => false,
1123
+ "wysiwyg_enabled" => false
1124
+ ));
1125
+
1126
+ $installer->addAttribute('catalog_product', 'hs_codes', array(
1127
+ 'group' => 'Borderfree',
1128
+ 'sort_order' => 12,
1129
+ 'type' => 'varchar',
1130
+ 'backend' => '',
1131
+ 'frontend' => '',
1132
+ 'label' => 'Harmonized System Code',
1133
+ 'note' => '',
1134
+ 'input' => 'text',
1135
+ 'class' => '',
1136
+ 'source' => '',
1137
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1138
+ 'visible' => true,
1139
+ 'required' => false,
1140
+ 'user_defined' => true,
1141
+ 'default' => '',
1142
+ 'visible_on_front' => false,
1143
+ 'unique' => false,
1144
+ 'is_configurable' => false,
1145
+ 'used_for_promo_rules' => false,
1146
+ 'apply_to' => '',
1147
+ 'searchable' => false,
1148
+ 'filterable' => 0,
1149
+ 'comparable' => false,
1150
+ 'visible_in_advanced_search' => false,
1151
+ 'used_for_price_rules' => false,
1152
+ 'filterable_in_search' => false
1153
+ ));
1154
+
1155
+ $installer->addAttribute('catalog_product', 'is_ormd', array(
1156
+ 'group' => 'Borderfree',
1157
+ 'sort_order' => 13,
1158
+ 'type' => 'int',
1159
+ 'backend' => '',
1160
+ 'frontend' => '',
1161
+ 'label' => 'Is ORM-D',
1162
+ 'note' => 'Indicates if the SKU has the "Other Regulated Materials for Domestic transport only"',
1163
+ 'input' => 'select',
1164
+ 'class' => '',
1165
+ 'source' => 'eav/entity_attribute_source_boolean',
1166
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1167
+ 'visible' => true,
1168
+ 'required' => false,
1169
+ 'user_defined' => true,
1170
+ 'default' => '0',
1171
+ 'visible_on_front' => false,
1172
+ 'unique' => false,
1173
+ 'is_configurable' => false,
1174
+ 'used_for_promo_rules' => false
1175
+ ));
1176
+
1177
+ $installer->addAttribute('catalog_product', 'size_chart_url', array(
1178
+ 'group' => 'Borderfree',
1179
+ 'sort_order' => 14,
1180
+ 'type' => 'int',
1181
+ 'backend' => '',
1182
+ 'frontend' => '',
1183
+ 'label' => 'Size chart URL',
1184
+ 'note' => '',
1185
+ 'input' => 'text',
1186
+ 'class' => '',
1187
+ 'source' => '',
1188
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
1189
+ 'visible' => true,
1190
+ 'required' => false,
1191
+ 'user_defined' => true,
1192
+ 'default' => '0',
1193
+ 'visible_on_front' => false,
1194
+ 'unique' => false,
1195
+ 'is_configurable' => false,
1196
+ 'used_for_promo_rules' => false
1197
+ ));
1198
+
1199
+ $installer->addAttribute('catalog_product', 'is_exclusive', array(
1200
+ 'group' => 'Borderfree',
1201
+ 'sort_order' => 15,
1202
+ 'type' => 'int',
1203
+ 'backend' => '',
1204
+ 'frontend' => '',
1205
+ 'label' => 'Is Exclusive',
1206
+ 'note' => 'Indicates whether the Product is exclusive to your catalog.',
1207
+ 'input' => 'select',
1208
+ 'class' => '',
1209
+ 'source' => 'eav/entity_attribute_source_boolean',
1210
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1211
+ 'visible' => true,
1212
+ 'required' => false,
1213
+ 'user_defined' => true,
1214
+ 'default' => '0',
1215
+ 'visible_on_front' => false,
1216
+ 'unique' => false,
1217
+ 'is_configurable' => false,
1218
+ 'used_for_promo_rules' => false
1219
+ ));
1220
+
1221
+ $installer->addAttribute('catalog_product', 'manufacturer', array(
1222
+ 'group' => 'Borderfree',
1223
+ 'sort_order' => 16,
1224
+ 'type' => 'varchar',
1225
+ 'backend' => '',
1226
+ 'frontend' => '',
1227
+ 'label' => 'Manufacturer',
1228
+ 'note' => '',
1229
+ 'input' => 'select',
1230
+ 'class' => '',
1231
+ 'source' => '',
1232
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1233
+ 'visible' => true,
1234
+ 'required' => false,
1235
+ 'user_defined' => true,
1236
+ 'default' => '',
1237
+ 'visible_on_front' => true,
1238
+ 'unique' => false,
1239
+ 'is_configurable' => false,
1240
+ 'used_for_promo_rules' => true,
1241
+ 'apply_to' => '',
1242
+ 'searchable' => true,
1243
+ 'filterable' => 1,
1244
+ 'comparable' => true,
1245
+ 'visible_in_advanced_search' => true,
1246
+ 'used_for_price_rules' => true,
1247
+ 'filterable_in_search' => true
1248
+ ));
1249
+
1250
+ $installer->addAttribute('catalog_product', 'brand', array(
1251
+ 'group' => 'Borderfree',
1252
+ 'sort_order' => 17,
1253
+ 'type' => 'varchar',
1254
+ 'backend' => '',
1255
+ 'frontend' => '',
1256
+ 'label' => 'Brand',
1257
+ 'note' => '',
1258
+ 'input' => 'select',
1259
+ 'class' => '',
1260
+ 'source' => '',
1261
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1262
+ 'visible' => true,
1263
+ 'required' => false,
1264
+ 'user_defined' => true,
1265
+ 'default' => '',
1266
+ 'visible_on_front' => true,
1267
+ 'unique' => false,
1268
+ 'is_configurable' => false,
1269
+ 'used_for_promo_rules' => true,
1270
+ 'apply_to' => '',
1271
+ 'searchable' => true,
1272
+ 'filterable' => 1,
1273
+ 'comparable' => true,
1274
+ 'visible_in_advanced_search' => true,
1275
+ 'used_for_price_rules' => true,
1276
+ 'filterable_in_search' => true
1277
+ ));
1278
+
1279
+ $installer->addAttribute('catalog_product', 'collection', array(
1280
+ 'group' => 'Borderfree',
1281
+ 'sort_order' => 18,
1282
+ 'type' => 'varchar',
1283
+ 'backend' => '',
1284
+ 'frontend' => '',
1285
+ 'label' => 'Collection',
1286
+ 'note' => '',
1287
+ 'input' => 'select',
1288
+ 'class' => '',
1289
+ 'source' => '',
1290
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1291
+ 'visible' => true,
1292
+ 'required' => false,
1293
+ 'user_defined' => true,
1294
+ 'default' => '',
1295
+ 'visible_on_front' => true,
1296
+ 'unique' => false,
1297
+ 'is_configurable' => false,
1298
+ 'used_for_promo_rules' => true,
1299
+ 'apply_to' => '',
1300
+ 'searchable' => true,
1301
+ 'filterable' => 1,
1302
+ 'comparable' => true,
1303
+ 'visible_in_advanced_search' => true,
1304
+ 'used_for_price_rules' => true,
1305
+ 'filterable_in_search' => true
1306
+ ));
1307
+
1308
+ $installer->addAttribute('catalog_product', 'color', array(
1309
+ 'group' => 'Borderfree',
1310
+ 'sort_order' => 19,
1311
+ 'type' => 'varchar',
1312
+ 'backend' => '',
1313
+ 'frontend' => '',
1314
+ 'label' => 'Color',
1315
+ 'note' => '',
1316
+ 'input' => 'select',
1317
+ 'class' => '',
1318
+ 'source' => '',
1319
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1320
+ 'visible' => true,
1321
+ 'required' => false,
1322
+ 'user_defined' => true,
1323
+ 'default' => '',
1324
+ 'visible_on_front' => false,
1325
+ 'unique' => false,
1326
+ 'is_configurable' => true,
1327
+ 'used_for_promo_rules' => false,
1328
+ 'apply_to' => 'simple',
1329
+ 'searchable' => true,
1330
+ 'filterable' => 1,
1331
+ 'comparable' => true,
1332
+ 'visible_in_advanced_search' => true,
1333
+ 'used_for_price_rules' => false,
1334
+ 'filterable_in_search' => true
1335
+ ));
1336
+
1337
+ $installer->addAttribute('catalog_product', 'size', array(
1338
+ 'group' => 'Borderfree',
1339
+ 'sort_order' => 20,
1340
+ 'type' => 'varchar',
1341
+ 'backend' => '',
1342
+ 'frontend' => '',
1343
+ 'label' => 'Size',
1344
+ 'note' => '',
1345
+ 'input' => 'select',
1346
+ 'class' => '',
1347
+ 'source' => '',
1348
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1349
+ 'visible' => true,
1350
+ 'required' => false,
1351
+ 'user_defined' => true,
1352
+ 'default' => '',
1353
+ 'visible_on_front' => false,
1354
+ 'unique' => false,
1355
+ 'is_configurable' => true,
1356
+ 'used_for_promo_rules' => false,
1357
+ 'apply_to' => 'simple',
1358
+ 'searchable' => true,
1359
+ 'filterable' => 1,
1360
+ 'comparable' => true,
1361
+ 'visible_in_advanced_search' => true,
1362
+ 'used_for_price_rules' => false,
1363
+ 'filterable_in_search' => true
1364
+ ));
1365
+
1366
+
1367
+ $installer->removeAttribute('catalog_product', 'gender');
1368
+ $installer->addAttribute('catalog_product', 'gender', array(
1369
+ 'group' => 'Borderfree',
1370
+ 'sort_order' => 21,
1371
+ 'type' => 'varchar',
1372
+ 'backend' => '',
1373
+ 'frontend' => '',
1374
+ 'label' => 'Gender',
1375
+ 'note' => '',
1376
+ 'input' => 'select',
1377
+ 'class' => '',
1378
+ 'source' => '',
1379
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1380
+ 'visible' => true,
1381
+ 'required' => false,
1382
+ 'user_defined' => true,
1383
+ 'default' => '',
1384
+ 'visible_on_front' => true,
1385
+ 'unique' => false,
1386
+ 'is_configurable' => false,
1387
+ 'used_for_promo_rules' => true,
1388
+ 'apply_to' => '',
1389
+ 'searchable' => true,
1390
+ 'filterable' => 1,
1391
+ 'comparable' => true,
1392
+ 'visible_in_advanced_search' => true,
1393
+ 'used_for_price_rules' => true,
1394
+ 'option' => array (
1395
+ 'value' => array(
1396
+ 'MALE' => array('Male'),
1397
+ 'FEMALE' => array('Female'),
1398
+ 'UNISEX' => array('Unisex'),
1399
+ )
1400
+ ),
1401
+ 'filterable_in_search' => true
1402
+ ));
1403
+
1404
+ $installer->removeAttribute('catalog_product', 'age');
1405
+ $installer->addAttribute('catalog_product', 'age', array(
1406
+ 'group' => 'Borderfree',
1407
+ 'sort_order' => 22,
1408
+ 'type' => 'varchar',
1409
+ 'backend' => 'eav/entity_attribute_backend_array',
1410
+ 'frontend' => '',
1411
+ 'label' => 'Age',
1412
+ 'note' => '',
1413
+ 'input' => 'multiselect',
1414
+ 'class' => '',
1415
+ 'source' => '',
1416
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1417
+ 'visible' => true,
1418
+ 'required' => false,
1419
+ 'user_defined' => true,
1420
+ 'default' => '',
1421
+ 'visible_on_front' => true,
1422
+ 'unique' => false,
1423
+ 'is_configurable' => false,
1424
+ 'used_for_promo_rules' => true,
1425
+ 'apply_to' => '',
1426
+ 'searchable' => true,
1427
+ 'filterable' => 1,
1428
+ 'comparable' => true,
1429
+ 'visible_in_advanced_search' => true,
1430
+ 'used_for_price_rules' => true,
1431
+ 'option' => array (
1432
+ 'value' => array(
1433
+ 'NEWBORN' => array('Newborn'),
1434
+ 'INFANT' => array('Infant'),
1435
+ 'TODDLER' => array('Toddler'),
1436
+ 'CHILD' => array('Child'),
1437
+ 'JUNIOR' => array('Junior'),
1438
+ 'TEEN' => array('Teen'),
1439
+ 'ADULT' => array('Adult'),
1440
+ )
1441
+ ),
1442
+ 'filterable_in_search' => true
1443
+ ));
1444
+
1445
+ $installer->removeAttribute('catalog_product', 'season');
1446
+ $installer->addAttribute('catalog_product', 'season', array(
1447
+ 'group' => 'Borderfree',
1448
+ 'sort_order' => 23,
1449
+ 'type' => 'varchar',
1450
+ 'backend' => 'eav/entity_attribute_backend_array',
1451
+ 'frontend' => '',
1452
+ 'label' => 'Season',
1453
+ 'note' => '',
1454
+ 'input' => 'multiselect',
1455
+ 'class' => '',
1456
+ 'source' => '',
1457
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1458
+ 'visible' => true,
1459
+ 'required' => false,
1460
+ 'user_defined' => true,
1461
+ 'default' => '',
1462
+ 'visible_on_front' => true,
1463
+ 'unique' => false,
1464
+ 'is_configurable' => false,
1465
+ 'used_for_promo_rules' => true,
1466
+ 'apply_to' => '',
1467
+ 'searchable' => true,
1468
+ 'filterable' => 1,
1469
+ 'comparable' => true,
1470
+ 'visible_in_advanced_search' => true,
1471
+ 'used_for_price_rules' => true,
1472
+ 'option' => array (
1473
+ 'value' => array(
1474
+ 'SPRING' => array('Spring'),
1475
+ 'SUMMER' => array('Summer'),
1476
+ 'FALL' => array('Fall'),
1477
+ 'WINTER' => array('Winter'),
1478
+ )
1479
+ ),
1480
+ 'filterable_in_search' => true
1481
+ ));
1482
+
1483
+ $installer->removeAttribute('catalog_product', 'condition');
1484
+ $installer->addAttribute('catalog_product', 'condition', array(
1485
+ 'group' => 'Borderfree',
1486
+ 'sort_order' => 24,
1487
+ 'type' => 'varchar',
1488
+ 'backend' => '',
1489
+ 'frontend' => '',
1490
+ 'label' => 'Condition',
1491
+ 'note' => 'e.g., "New", "Refurbished"',
1492
+ 'input' => 'select',
1493
+ 'class' => '',
1494
+ 'source' => '',
1495
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1496
+ 'visible' => true,
1497
+ 'required' => false,
1498
+ 'user_defined' => true,
1499
+ 'default' => '',
1500
+ 'visible_on_front' => false,
1501
+ 'unique' => false,
1502
+ 'is_configurable' => true,
1503
+ 'used_for_promo_rules' => false,
1504
+ 'apply_to' => '',
1505
+ 'searchable' => true,
1506
+ 'filterable' => 1,
1507
+ 'comparable' => true,
1508
+ 'visible_in_advanced_search' => true,
1509
+ 'used_for_price_rules' => false,
1510
+ 'filterable_in_search' => true,
1511
+ 'option' => array (
1512
+ 'value' => array(
1513
+ 'New' => array('New'),
1514
+ 'Refurbished' => array('Refurbished'),
1515
+ )
1516
+ )
1517
+ ));
1518
+
1519
+ $installer->addAttribute('catalog_product', 'care', array(
1520
+ 'group' => 'Borderfree',
1521
+ 'sort_order' => 25,
1522
+ 'type' => 'varchar',
1523
+ 'backend' => '',
1524
+ 'frontend' => '',
1525
+ 'label' => 'Care Instructions',
1526
+ 'note' => '',
1527
+ 'input' => 'textarea',
1528
+ 'class' => '',
1529
+ 'source' => '',
1530
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
1531
+ 'visible' => true,
1532
+ 'required' => false,
1533
+ 'user_defined' => true,
1534
+ 'default' => '',
1535
+ 'visible_on_front' => false,
1536
+ 'unique' => false,
1537
+ 'is_configurable' => false,
1538
+ 'used_for_promo_rules' => false,
1539
+ 'apply_to' => '',
1540
+ 'searchable' => false,
1541
+ 'filterable' => 0,
1542
+ 'comparable' => false,
1543
+ 'visible_in_advanced_search' => false,
1544
+ 'used_for_price_rules' => false,
1545
+ 'filterable_in_search' => false,
1546
+ 'is_html_allowed_on_front' => true,
1547
+ "wysiwyg_enabled" => true
1548
+ ));
1549
+
1550
+ $installer->addAttribute('catalog_product', 'contents', array(
1551
+ 'group' => 'Borderfree',
1552
+ 'sort_order' => 26,
1553
+ 'type' => 'varchar',
1554
+ 'backend' => '',
1555
+ 'frontend' => '',
1556
+ 'label' => 'Contents and/or Materials',
1557
+ 'note' => '(e.g., 60% cotton, 40% rayon). Use commas to separate values in this field.',
1558
+ 'input' => 'textarea',
1559
+ 'class' => '',
1560
+ 'source' => '',
1561
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
1562
+ 'visible' => true,
1563
+ 'required' => false,
1564
+ 'user_defined' => true,
1565
+ 'default' => '',
1566
+ 'visible_on_front' => false,
1567
+ 'unique' => false,
1568
+ 'is_configurable' => false,
1569
+ 'used_for_promo_rules' => false,
1570
+ 'apply_to' => '',
1571
+ 'searchable' => true,
1572
+ 'filterable' => 0,
1573
+ 'is_html_allowed_on_front' => false,
1574
+ 'comparable' => false,
1575
+ 'visible_in_advanced_search' => false,
1576
+ 'used_for_price_rules' => false,
1577
+ 'filterable_in_search' => false,
1578
+ "wysiwyg_enabled" => false
1579
+ ));
1580
+
1581
+ $installer->addAttribute('catalog_product', 'mpn', array(
1582
+ 'group' => 'Borderfree',
1583
+ 'sort_order' => 27,
1584
+ 'type' => 'varchar',
1585
+ 'backend' => '',
1586
+ 'frontend' => '',
1587
+ 'label' => 'Manufacturer Part Number',
1588
+ 'note' => '',
1589
+ 'input' => 'text',
1590
+ 'class' => '',
1591
+ 'source' => '',
1592
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1593
+ 'visible' => true,
1594
+ 'required' => false,
1595
+ 'user_defined' => true,
1596
+ 'default' => '',
1597
+ 'visible_on_front' => false,
1598
+ 'unique' => false,
1599
+ 'is_configurable' => false,
1600
+ 'used_for_promo_rules' => false,
1601
+ 'apply_to' => 'simple',
1602
+ 'searchable' => true,
1603
+ 'filterable' => 1,
1604
+ 'comparable' => false,
1605
+ 'visible_in_advanced_search' => false,
1606
+ 'used_for_price_rules' => false,
1607
+ 'filterable_in_search' => false
1608
+ ));
1609
+
1610
+ $installer->addAttribute('catalog_product', 'gtin', array(
1611
+ 'group' => 'Borderfree',
1612
+ 'sort_order' => 28,
1613
+ 'type' => 'varchar',
1614
+ 'backend' => '',
1615
+ 'frontend' => '',
1616
+ 'label' => 'Global Trade Item Number',
1617
+ 'note' => '',
1618
+ 'input' => 'text',
1619
+ 'class' => '',
1620
+ 'source' => '',
1621
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1622
+ 'visible' => true,
1623
+ 'required' => false,
1624
+ 'user_defined' => true,
1625
+ 'default' => '',
1626
+ 'visible_on_front' => false,
1627
+ 'unique' => false,
1628
+ 'is_configurable' => false,
1629
+ 'used_for_promo_rules' => false,
1630
+ 'apply_to' => 'simple',
1631
+ 'searchable' => true,
1632
+ 'filterable' => 1,
1633
+ 'comparable' => false,
1634
+ 'visible_in_advanced_search' => false,
1635
+ 'used_for_price_rules' => false,
1636
+ 'filterable_in_search' => false
1637
+ ));
1638
+
1639
+ $installer->addAttribute('catalog_product', 'upc', array(
1640
+ 'group' => 'Borderfree',
1641
+ 'sort_order' => 29,
1642
+ 'type' => 'varchar',
1643
+ 'backend' => '',
1644
+ 'frontend' => '',
1645
+ 'label' => 'Universal Product Code',
1646
+ 'note' => '',
1647
+ 'input' => 'text',
1648
+ 'class' => '',
1649
+ 'source' => '',
1650
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1651
+ 'visible' => true,
1652
+ 'required' => false,
1653
+ 'user_defined' => true,
1654
+ 'default' => '',
1655
+ 'visible_on_front' => false,
1656
+ 'unique' => false,
1657
+ 'is_configurable' => false,
1658
+ 'used_for_promo_rules' => false,
1659
+ 'apply_to' => 'simple',
1660
+ 'searchable' => true,
1661
+ 'filterable' => 1,
1662
+ 'comparable' => false,
1663
+ 'visible_in_advanced_search' => false,
1664
+ 'used_for_price_rules' => false,
1665
+ 'filterable_in_search' => false
1666
+ ));
1667
+
1668
+ $installer->addAttribute('catalog_product', 'ean', array(
1669
+ 'group' => 'Borderfree',
1670
+ 'sort_order' => 30,
1671
+ 'type' => 'varchar',
1672
+ 'backend' => '',
1673
+ 'frontend' => '',
1674
+ 'label' => 'European Article Number',
1675
+ 'note' => '',
1676
+ 'input' => 'text',
1677
+ 'class' => '',
1678
+ 'source' => '',
1679
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1680
+ 'visible' => true,
1681
+ 'required' => false,
1682
+ 'user_defined' => true,
1683
+ 'default' => '',
1684
+ 'visible_on_front' => false,
1685
+ 'unique' => false,
1686
+ 'is_configurable' => false,
1687
+ 'used_for_promo_rules' => false,
1688
+ 'apply_to' => 'simple',
1689
+ 'searchable' => true,
1690
+ 'filterable' => 1,
1691
+ 'comparable' => false,
1692
+ 'visible_in_advanced_search' => false,
1693
+ 'used_for_price_rules' => false,
1694
+ 'filterable_in_search' => false
1695
+ ));
1696
+
1697
+ $installer->addAttribute('catalog_product', 'apn', array(
1698
+ 'group' => 'Borderfree',
1699
+ 'sort_order' => 31,
1700
+ 'type' => 'varchar',
1701
+ 'backend' => '',
1702
+ 'frontend' => '',
1703
+ 'label' => 'Australian Product Number',
1704
+ 'note' => '',
1705
+ 'input' => 'text',
1706
+ 'class' => '',
1707
+ 'source' => '',
1708
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1709
+ 'visible' => true,
1710
+ 'required' => false,
1711
+ 'user_defined' => true,
1712
+ 'default' => '',
1713
+ 'visible_on_front' => false,
1714
+ 'unique' => false,
1715
+ 'is_configurable' => false,
1716
+ 'used_for_promo_rules' => false,
1717
+ 'apply_to' => 'simple',
1718
+ 'searchable' => true,
1719
+ 'filterable' => 1,
1720
+ 'comparable' => false,
1721
+ 'visible_in_advanced_search' => false,
1722
+ 'used_for_price_rules' => false,
1723
+ 'filterable_in_search' => false
1724
+ ));
1725
+
1726
+ $installer->addAttribute('catalog_product', 'jan', array(
1727
+ 'group' => 'Borderfree',
1728
+ 'sort_order' => 32,
1729
+ 'type' => 'varchar',
1730
+ 'backend' => '',
1731
+ 'frontend' => '',
1732
+ 'label' => 'Japanese Article Number',
1733
+ 'note' => '',
1734
+ 'input' => 'text',
1735
+ 'class' => '',
1736
+ 'source' => '',
1737
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1738
+ 'visible' => true,
1739
+ 'required' => false,
1740
+ 'user_defined' => true,
1741
+ 'default' => '',
1742
+ 'visible_on_front' => false,
1743
+ 'unique' => false,
1744
+ 'is_configurable' => false,
1745
+ 'used_for_promo_rules' => false,
1746
+ 'apply_to' => 'simple',
1747
+ 'searchable' => true,
1748
+ 'filterable' => 1,
1749
+ 'comparable' => false,
1750
+ 'visible_in_advanced_search' => false,
1751
+ 'used_for_price_rules' => false,
1752
+ 'filterable_in_search' => false
1753
+ ));
1754
+
1755
+ $installer->addAttribute('catalog_product', 'eccn', array(
1756
+ 'group' => 'Borderfree',
1757
+ 'sort_order' => 33,
1758
+ 'type' => 'varchar',
1759
+ 'backend' => '',
1760
+ 'frontend' => '',
1761
+ 'label' => 'Export Control Classification Number',
1762
+ 'note' => '',
1763
+ 'input' => 'text',
1764
+ 'class' => '',
1765
+ 'source' => '',
1766
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1767
+ 'visible' => true,
1768
+ 'required' => false,
1769
+ 'user_defined' => true,
1770
+ 'default' => '',
1771
+ 'visible_on_front' => false,
1772
+ 'unique' => false,
1773
+ 'is_configurable' => false,
1774
+ 'used_for_promo_rules' => false,
1775
+ 'apply_to' => 'simple',
1776
+ 'searchable' => true,
1777
+ 'filterable' => 1,
1778
+ 'comparable' => false,
1779
+ 'visible_in_advanced_search' => false,
1780
+ 'used_for_price_rules' => false,
1781
+ 'filterable_in_search' => false
1782
+ ));
1783
+
1784
+ $installer->removeAttribute('catalog_product', 'is_fws_permit_req');
1785
+ $installer->removeAttribute('catalog_product', 'fws_permit_details');
1786
+
1787
+ $installer->addAttribute('catalog_product', 'fws_common_name', array(
1788
+ 'group' => 'Borderfree',
1789
+ 'sort_order' => 34,
1790
+ 'type' => 'int',
1791
+ 'backend' => '',
1792
+ 'frontend' => '',
1793
+ 'label' => 'Fish and Wildlife Common Name',
1794
+ 'note' => '',
1795
+ 'input' => 'test',
1796
+ 'class' => '',
1797
+ 'source' => '',
1798
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1799
+ 'visible' => true,
1800
+ 'required' => false,
1801
+ 'user_defined' => true,
1802
+ 'default' => '0',
1803
+ 'visible_on_front' => false,
1804
+ 'unique' => false,
1805
+ 'is_configurable' => false,
1806
+ 'used_for_promo_rules' => false
1807
+ ));
1808
+
1809
+ $installer->addAttribute('catalog_product', 'fws_scientific_name', array(
1810
+ 'group' => 'Borderfree',
1811
+ 'sort_order' => 35,
1812
+ 'type' => 'varchar',
1813
+ 'backend' => '',
1814
+ 'frontend' => '',
1815
+ 'label' => "Fish and Wildlife Scientific Name",
1816
+ 'note' => 'The genus and species of the plant or animal being sold in the SKU',
1817
+ 'input' => 'text',
1818
+ 'class' => '',
1819
+ 'source' => '',
1820
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1821
+ 'visible' => true,
1822
+ 'required' => false,
1823
+ 'user_defined' => true,
1824
+ 'default' => '',
1825
+ 'visible_on_front' => false,
1826
+ 'unique' => false,
1827
+ 'is_configurable' => false,
1828
+ 'used_for_promo_rules' => false,
1829
+ 'apply_to' => '',
1830
+ 'searchable' => false,
1831
+ 'filterable' => 0,
1832
+ 'comparable' => false,
1833
+ 'visible_in_advanced_search' => false,
1834
+ 'used_for_price_rules' => false,
1835
+ 'filterable_in_search' => false
1836
+ ));
1837
+
1838
+ $installer->addAttribute('catalog_product', 'fws_source', array(
1839
+ 'group' => 'Borderfree',
1840
+ 'sort_order' => 36,
1841
+ 'type' => 'varchar',
1842
+ 'backend' => '',
1843
+ 'frontend' => '',
1844
+ 'label' => 'Fish and Wildlife Source',
1845
+ 'note' => '',
1846
+ 'input' => 'select',
1847
+ 'class' => '',
1848
+ 'source' => '',
1849
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1850
+ 'visible' => true,
1851
+ 'required' => false,
1852
+ 'user_defined' => true,
1853
+ 'default' => '',
1854
+ 'visible_on_front' => false,
1855
+ 'unique' => false,
1856
+ 'is_configurable' => true,
1857
+ 'used_for_promo_rules' => false,
1858
+ 'apply_to' => '',
1859
+ 'searchable' => true,
1860
+ 'filterable' => 1,
1861
+ 'comparable' => true,
1862
+ 'visible_in_advanced_search' => true,
1863
+ 'used_for_price_rules' => false,
1864
+ 'filterable_in_search' => true,
1865
+ 'option' => array (
1866
+ 'value' => array(
1867
+ 'C' => array('Animals bred in captivity'),
1868
+ 'F' => array('Animals born in captivity'),
1869
+ 'W' => array('Animals taken from the wild')
1870
+ )
1871
+ )
1872
+ ));
1873
+
1874
+ $installer->addAttribute('catalog_product', 'fws_country_of_origin', array(
1875
+ 'group' => 'Borderfree',
1876
+ 'sort_order' => 37,
1877
+ 'type' => 'varchar',
1878
+ 'backend' => '',
1879
+ 'frontend' => '',
1880
+ 'label' => 'Fish and Wildlife Country of Origin',
1881
+ 'note' => '',
1882
+ 'input' => 'select',
1883
+ 'class' => '',
1884
+ 'source' => '',
1885
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
1886
+ 'visible' => true,
1887
+ 'required' => false,
1888
+ 'user_defined' => true,
1889
+ 'default' => '',
1890
+ 'visible_on_front' => false,
1891
+ 'unique' => false,
1892
+ 'is_configurable' => false,
1893
+ 'used_for_promo_rules' => false,
1894
+ 'apply_to' => '',
1895
+ 'searchable' => false,
1896
+ 'filterable' => 0,
1897
+ 'comparable' => false,
1898
+ 'visible_in_advanced_search' => true,
1899
+ 'used_for_price_rules' => false,
1900
+ 'filterable_in_search' => false,
1901
+ 'option' => array (
1902
+ 'value' => array(
1903
+ "AF" => array("Afghanistan"),
1904
+ "AX" => array("Ã…land Islands"),
1905
+ "AL" => array("Albania"),
1906
+ "DZ" => array("Algeria"),
1907
+ "AS" => array("American Samoa"),
1908
+ "AD" => array("Andorra"),
1909
+ "AO" => array("Angola"),
1910
+ "AI" => array("Anguilla"),
1911
+ "AQ" => array("Antarctica"),
1912
+ "AG" => array("Antigua and Barbuda"),
1913
+ "AR" => array("Argentina"),
1914
+ "AM" => array("Armenia"),
1915
+ "AW" => array("Aruba"),
1916
+ "AU" => array("Australia"),
1917
+ "AT" => array("Austria"),
1918
+ "AZ" => array("Azerbaijan"),
1919
+ "BS" => array("Bahamas"),
1920
+ "BH" => array("Bahrain"),
1921
+ "BD" => array("Bangladesh"),
1922
+ "BB" => array("Barbados"),
1923
+ "BY" => array("Belarus"),
1924
+ "BE" => array("Belgium"),
1925
+ "BZ" => array("Belize"),
1926
+ "BJ" => array("Benin"),
1927
+ "BM" => array("Bermuda"),
1928
+ "BT" => array("Bhutan"),
1929
+ "BO" => array("Bolivia"),
1930
+ "BA" => array("Bosnia and Herzegovina"),
1931
+ "BW" => array("Botswana"),
1932
+ "BV" => array("Bouvet Island"),
1933
+ "BR" => array("Brazil"),
1934
+ "IO" => array("British Indian Ocean Territory"),
1935
+ "BN" => array("Brunei Darussalam"),
1936
+ "BG" => array("Bulgaria"),
1937
+ "BF" => array("Burkina Faso"),
1938
+ "BI" => array("Burundi"),
1939
+ "KH" => array("Cambodia"),
1940
+ "CM" => array("Cameroon"),
1941
+ "CA" => array("Canada"),
1942
+ "CV" => array("Cape Verde"),
1943
+ "KY" => array("Cayman Islands"),
1944
+ "CF" => array("Central African Republic"),
1945
+ "TD" => array("Chad"),
1946
+ "CL" => array("Chile"),
1947
+ "CN" => array("China"),
1948
+ "CX" => array("Christmas Island"),
1949
+ "CC" => array("Cocos (Keeling) Islands"),
1950
+ "CO" => array("Colombia"),
1951
+ "KM" => array("Comoros"),
1952
+ "CG" => array("Congo"),
1953
+ "CD" => array("Congo, The Democratic Republic of The"),
1954
+ "CK" => array("Cook Islands"),
1955
+ "CR" => array("Costa Rica"),
1956
+ "CI" => array("Cote D'ivoire"),
1957
+ "HR" => array("Croatia"),
1958
+ "CU" => array("Cuba"),
1959
+ "CY" => array("Cyprus"),
1960
+ "CZ" => array("Czech Republic"),
1961
+ "DK" => array("Denmark"),
1962
+ "DJ" => array("Djibouti"),
1963
+ "DM" => array("Dominica"),
1964
+ "DO" => array("Dominican Republic"),
1965
+ "EC" => array("Ecuador"),
1966
+ "EG" => array("Egypt"),
1967
+ "SV" => array("El Salvador"),
1968
+ "GQ" => array("Equatorial Guinea"),
1969
+ "ER" => array("Eritrea"),
1970
+ "EE" => array("Estonia"),
1971
+ "ET" => array("Ethiopia"),
1972
+ "FK" => array("Falkland Islands (Malvinas)"),
1973
+ "FO" => array("Faroe Islands"),
1974
+ "FJ" => array("Fiji"),
1975
+ "FI" => array("Finland"),
1976
+ "FR" => array("France"),
1977
+ "GF" => array("French Guiana"),
1978
+ "PF" => array("French Polynesia"),
1979
+ "TF" => array("French Southern Territories"),
1980
+ "GA" => array("Gabon"),
1981
+ "GM" => array("Gambia"),
1982
+ "GE" => array("Georgia"),
1983
+ "DE" => array("Germany"),
1984
+ "GH" => array("Ghana"),
1985
+ "GI" => array("Gibraltar"),
1986
+ "GR" => array("Greece"),
1987
+ "GL" => array("Greenland"),
1988
+ "GD" => array("Grenada"),
1989
+ "GP" => array("Guadeloupe"),
1990
+ "GU" => array("Guam"),
1991
+ "GT" => array("Guatemala"),
1992
+ "GG" => array("Guernsey"),
1993
+ "GN" => array("Guinea"),
1994
+ "GW" => array("Guinea-bissau"),
1995
+ "GY" => array("Guyana"),
1996
+ "HT" => array("Haiti"),
1997
+ "HM" => array("Heard Island and Mcdonald Islands"),
1998
+ "VA" => array("Holy See (Vatican City State)"),
1999
+ "HN" => array("Honduras"),
2000
+ "HK" => array("Hong Kong"),
2001
+ "HU" => array("Hungary"),
2002
+ "IS" => array("Iceland"),
2003
+ "IN" => array("India"),
2004
+ "ID" => array("Indonesia"),
2005
+ "IR" => array("Iran, Islamic Republic of"),
2006
+ "IQ" => array("Iraq"),
2007
+ "IE" => array("Ireland"),
2008
+ "IM" => array("Isle of Man"),
2009
+ "IL" => array("Israel"),
2010
+ "IT" => array("Italy"),
2011
+ "JM" => array("Jamaica"),
2012
+ "JP" => array("Japan"),
2013
+ "JE" => array("Jersey"),
2014
+ "JO" => array("Jordan"),
2015
+ "KZ" => array("Kazakhstan"),
2016
+ "KE" => array("Kenya"),
2017
+ "KI" => array("Kiribati"),
2018
+ "KP" => array("Korea, Democratic People's Republic of"),
2019
+ "KR" => array("Korea, Republic of"),
2020
+ "KW" => array("Kuwait"),
2021
+ "KG" => array("Kyrgyzstan"),
2022
+ "LA" => array("Lao People's Democratic Republic"),
2023
+ "LV" => array("Latvia"),
2024
+ "LB" => array("Lebanon"),
2025
+ "LS" => array("Lesotho"),
2026
+ "LR" => array("Liberia"),
2027
+ "LY" => array("Libyan Arab Jamahiriya"),
2028
+ "LI" => array("Liechtenstein"),
2029
+ "LT" => array("Lithuania"),
2030
+ "LU" => array("Luxembourg"),
2031
+ "MO" => array("Macao"),
2032
+ "MK" => array("Macedonia, The Former Yugoslav Republic of"),
2033
+ "MG" => array("Madagascar"),
2034
+ "MW" => array("Malawi"),
2035
+ "MY" => array("Malaysia"),
2036
+ "MV" => array("Maldives"),
2037
+ "ML" => array("Mali"),
2038
+ "MT" => array("Malta"),
2039
+ "MH" => array("Marshall Islands"),
2040
+ "MQ" => array("Martinique"),
2041
+ "MR" => array("Mauritania"),
2042
+ "MU" => array("Mauritius"),
2043
+ "YT" => array("Mayotte"),
2044
+ "MX" => array("Mexico"),
2045
+ "FM" => array("Micronesia, Federated States of"),
2046
+ "MD" => array("Moldova, Republic of"),
2047
+ "MC" => array("Monaco"),
2048
+ "MN" => array("Mongolia"),
2049
+ "ME" => array("Montenegro"),
2050
+ "MS" => array("Montserrat"),
2051
+ "MA" => array("Morocco"),
2052
+ "MZ" => array("Mozambique"),
2053
+ "MM" => array("Myanmar"),
2054
+ "NA" => array("Namibia"),
2055
+ "NR" => array("Nauru"),
2056
+ "NP" => array("Nepal"),
2057
+ "NL" => array("Netherlands"),
2058
+ "AN" => array("Netherlands Antilles"),
2059
+ "NC" => array("New Caledonia"),
2060
+ "NZ" => array("New Zealand"),
2061
+ "NI" => array("Nicaragua"),
2062
+ "NE" => array("Niger"),
2063
+ "NG" => array("Nigeria"),
2064
+ "NU" => array("Niue"),
2065
+ "NF" => array("Norfolk Island"),
2066
+ "MP" => array("Northern Mariana Islands"),
2067
+ "NO" => array("Norway"),
2068
+ "OM" => array("Oman"),
2069
+ "PK" => array("Pakistan"),
2070
+ "PW" => array("Palau"),
2071
+ "PS" => array("Palestinian Territory, Occupied"),
2072
+ "PA" => array("Panama"),
2073
+ "PG" => array("Papua New Guinea"),
2074
+ "PY" => array("Paraguay"),
2075
+ "PE" => array("Peru"),
2076
+ "PH" => array("Philippines"),
2077
+ "PN" => array("Pitcairn"),
2078
+ "PL" => array("Poland"),
2079
+ "PT" => array("Portugal"),
2080
+ "PR" => array("Puerto Rico"),
2081
+ "QA" => array("Qatar"),
2082
+ "RE" => array("Reunion"),
2083
+ "RO" => array("Romania"),
2084
+ "RU" => array("Russian Federation"),
2085
+ "RW" => array("Rwanda"),
2086
+ "SH" => array("Saint Helena"),
2087
+ "KN" => array("Saint Kitts and Nevis"),
2088
+ "LC" => array("Saint Lucia"),
2089
+ "PM" => array("Saint Pierre and Miquelon"),
2090
+ "VC" => array("Saint Vincent and The Grenadines"),
2091
+ "WS" => array("Samoa"),
2092
+ "SM" => array("San Marino"),
2093
+ "ST" => array("Sao Tome and Principe"),
2094
+ "SA" => array("Saudi Arabia"),
2095
+ "SN" => array("Senegal"),
2096
+ "RS" => array("Serbia"),
2097
+ "SC" => array("Seychelles"),
2098
+ "SL" => array("Sierra Leone"),
2099
+ "SG" => array("Singapore"),
2100
+ "SK" => array("Slovakia"),
2101
+ "SI" => array("Slovenia"),
2102
+ "SB" => array("Solomon Islands"),
2103
+ "SO" => array("Somalia"),
2104
+ "ZA" => array("South Africa"),
2105
+ "GS" => array("South Georgia and The South Sandwich Islands"),
2106
+ "ES" => array("Spain"),
2107
+ "LK" => array("Sri Lanka"),
2108
+ "SD" => array("Sudan"),
2109
+ "SR" => array("Suriname"),
2110
+ "SJ" => array("Svalbard and Jan Mayen"),
2111
+ "SZ" => array("Swaziland"),
2112
+ "SE" => array("Sweden"),
2113
+ "CH" => array("Switzerland"),
2114
+ "SY" => array("Syrian Arab Republic"),
2115
+ "TW" => array("Taiwan, Province of China"),
2116
+ "TJ" => array("Tajikistan"),
2117
+ "TZ" => array("Tanzania, United Republic of"),
2118
+ "TH" => array("Thailand"),
2119
+ "TL" => array("Timor-leste"),
2120
+ "TG" => array("Togo"),
2121
+ "TK" => array("Tokelau"),
2122
+ "TO" => array("Tonga"),
2123
+ "TT" => array("Trinidad and Tobago"),
2124
+ "TN" => array("Tunisia"),
2125
+ "TR" => array("Turkey"),
2126
+ "TM" => array("Turkmenistan"),
2127
+ "TC" => array("Turks and Caicos Islands"),
2128
+ "TV" => array("Tuvalu"),
2129
+ "UG" => array("Uganda"),
2130
+ "UA" => array("Ukraine"),
2131
+ "AE" => array("United Arab Emirates"),
2132
+ "GB" => array("United Kingdom"),
2133
+ "US" => array("United States"),
2134
+ "UM" => array("United States Minor Outlying Islands"),
2135
+ "UY" => array("Uruguay"),
2136
+ "UZ" => array("Uzbekistan"),
2137
+ "VU" => array("Vanuatu"),
2138
+ "VE" => array("Venezuela"),
2139
+ "VN" => array("Viet Nam"),
2140
+ "VG" => array("Virgin Islands, British"),
2141
+ "VI" => array("Virgin Islands, U.S."),
2142
+ "WF" => array("Wallis and Futuna"),
2143
+ "EH" => array("Western Sahara"),
2144
+ "YE" => array("Yemen"),
2145
+ "ZM" => array("Zambia"),
2146
+ "ZW" => array("Zimbabwe"),
2147
+ )
2148
+ ),
2149
+
2150
+ ));
2151
+
2152
+
2153
+ $installer->endSetup();
2154
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.15-1.0.16.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->addAttribute('catalog_product', 'fws_common_name', array(
6
+ 'group' => 'Borderfree',
7
+ 'sort_order' => 34,
8
+ 'type' => 'int',
9
+ 'backend' => '',
10
+ 'frontend' => '',
11
+ 'label' => 'Fish and Wildlife Common Name',
12
+ 'note' => '',
13
+ 'input' => 'text',
14
+ 'class' => '',
15
+ 'source' => '',
16
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
17
+ 'visible' => true,
18
+ 'required' => false,
19
+ 'user_defined' => true,
20
+ 'default' => '0',
21
+ 'visible_on_front' => false,
22
+ 'unique' => false,
23
+ 'is_configurable' => false,
24
+ 'used_for_promo_rules' => false
25
+ ));
26
+
27
+
28
+ $installer->endSetup();
29
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.16-1.0.17.php ADDED
@@ -0,0 +1,825 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->run("delete eav_entity_attribute from eav_entity_attribute LEFT JOIN eav_attribute on eav_attribute.attribute_id = eav_entity_attribute.attribute_id where eav_attribute.attribute_id is null;");
6
+ $installer->run("delete catalog_category_entity_varchar from catalog_category_entity_varchar LEFT JOIN eav_entity_attribute on eav_entity_attribute.attribute_id = catalog_category_entity_varchar.attribute_id where eav_entity_attribute.attribute_id is null;");
7
+ $installer->run("delete catalog_product_entity_varchar from catalog_product_entity_varchar LEFT JOIN eav_entity_attribute on eav_entity_attribute.attribute_id = catalog_product_entity_varchar.attribute_id where eav_entity_attribute.attribute_id is null;");
8
+
9
+ $installer->addAttribute('catalog_product', 'color', array(
10
+ 'group' => 'Borderfree',
11
+ 'sort_order' => 19,
12
+ 'type' => 'varchar',
13
+ 'backend' => '',
14
+ 'frontend' => '',
15
+ 'label' => 'Color',
16
+ 'note' => '',
17
+ 'input' => 'int',
18
+ 'class' => '',
19
+ 'source' => 'eav/entity_attribute_source_table',
20
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
21
+ 'visible' => true,
22
+ 'required' => false,
23
+ 'user_defined' => true,
24
+ 'default' => '',
25
+ 'visible_on_front' => false,
26
+ 'unique' => false,
27
+ 'is_configurable' => true,
28
+ 'used_for_promo_rules' => false,
29
+ 'apply_to' => 'simple',
30
+ 'searchable' => true,
31
+ 'filterable' => 1,
32
+ 'comparable' => true,
33
+ 'visible_in_advanced_search' => true,
34
+ 'used_for_price_rules' => false,
35
+ 'filterable_in_search' => true
36
+ ));
37
+
38
+ $installer->addAttribute('catalog_product', 'size', array(
39
+ 'group' => 'Borderfree',
40
+ 'sort_order' => 20,
41
+ 'type' => 'int',
42
+ 'backend' => '',
43
+ 'frontend' => '',
44
+ 'label' => 'Size',
45
+ 'note' => '',
46
+ 'input' => 'select',
47
+ 'class' => '',
48
+ 'source' => 'eav/entity_attribute_source_table',
49
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
50
+ 'visible' => true,
51
+ 'required' => false,
52
+ 'user_defined' => true,
53
+ 'default' => '',
54
+ 'visible_on_front' => false,
55
+ 'unique' => false,
56
+ 'is_configurable' => true,
57
+ 'used_for_promo_rules' => false,
58
+ 'apply_to' => 'simple',
59
+ 'searchable' => true,
60
+ 'filterable' => 1,
61
+ 'comparable' => true,
62
+ 'visible_in_advanced_search' => true,
63
+ 'used_for_price_rules' => false,
64
+ 'filterable_in_search' => true
65
+ ));
66
+ $installer->removeAttribute('catalog_product', 'condition');
67
+ $installer->addAttribute('catalog_product', 'condition', array(
68
+ 'group' => 'Borderfree',
69
+ 'sort_order' => 24,
70
+ 'type' => 'int',
71
+ 'backend' => '',
72
+ 'frontend' => '',
73
+ 'label' => 'Condition',
74
+ 'note' => 'e.g., "New", "Refurbished"',
75
+ 'input' => 'select',
76
+ 'class' => '',
77
+ 'source' => 'eav/entity_attribute_source_table',
78
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
79
+ 'visible' => true,
80
+ 'required' => false,
81
+ 'user_defined' => true,
82
+ 'default' => '',
83
+ 'visible_on_front' => false,
84
+ 'unique' => false,
85
+ 'is_configurable' => true,
86
+ 'used_for_promo_rules' => false,
87
+ 'apply_to' => '',
88
+ 'searchable' => true,
89
+ 'filterable' => 1,
90
+ 'comparable' => true,
91
+ 'visible_in_advanced_search' => true,
92
+ 'used_for_price_rules' => false,
93
+ 'filterable_in_search' => true,
94
+ 'option' => array (
95
+ 'value' => array(
96
+ 'New' => array('New'),
97
+ 'Refurbished' => array('Refurbished'),
98
+ )
99
+ )
100
+ ));
101
+
102
+ $installer->addAttribute('catalog_product', 'manufacturer', array(
103
+ 'group' => 'Borderfree',
104
+ 'sort_order' => 16,
105
+ 'type' => 'int',
106
+ 'backend' => '',
107
+ 'frontend' => '',
108
+ 'label' => 'Manufacturer',
109
+ 'note' => '',
110
+ 'input' => 'select',
111
+ 'class' => '',
112
+ 'source' => 'eav/entity_attribute_source_table',
113
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
114
+ 'visible' => true,
115
+ 'required' => false,
116
+ 'user_defined' => true,
117
+ 'default' => '',
118
+ 'visible_on_front' => true,
119
+ 'unique' => false,
120
+ 'is_configurable' => false,
121
+ 'used_for_promo_rules' => true,
122
+ 'apply_to' => '',
123
+ 'searchable' => true,
124
+ 'filterable' => 1,
125
+ 'comparable' => true,
126
+ 'visible_in_advanced_search' => true,
127
+ 'used_for_price_rules' => true,
128
+ 'filterable_in_search' => true
129
+ ));
130
+
131
+ $installer->addAttribute('catalog_product', 'brand', array(
132
+ 'group' => 'Borderfree',
133
+ 'sort_order' => 17,
134
+ 'type' => 'int',
135
+ 'backend' => '',
136
+ 'frontend' => '',
137
+ 'label' => 'Brand',
138
+ 'note' => '',
139
+ 'input' => 'select',
140
+ 'class' => '',
141
+ 'source' => 'eav/entity_attribute_source_table',
142
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
143
+ 'visible' => true,
144
+ 'required' => false,
145
+ 'user_defined' => true,
146
+ 'default' => '',
147
+ 'visible_on_front' => true,
148
+ 'unique' => false,
149
+ 'is_configurable' => false,
150
+ 'used_for_promo_rules' => true,
151
+ 'apply_to' => '',
152
+ 'searchable' => true,
153
+ 'filterable' => 1,
154
+ 'comparable' => true,
155
+ 'visible_in_advanced_search' => true,
156
+ 'used_for_price_rules' => true,
157
+ 'filterable_in_search' => true
158
+ ));
159
+
160
+ $installer->addAttribute('catalog_product', 'collection', array(
161
+ 'group' => 'Borderfree',
162
+ 'sort_order' => 18,
163
+ 'type' => 'varchar',
164
+ 'backend' => '',
165
+ 'frontend' => '',
166
+ 'label' => 'Collection',
167
+ 'note' => '',
168
+ 'input' => 'select',
169
+ 'class' => '',
170
+ 'source' => 'eav/entity_attribute_source_table',
171
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
172
+ 'visible' => true,
173
+ 'required' => false,
174
+ 'user_defined' => true,
175
+ 'default' => '',
176
+ 'visible_on_front' => true,
177
+ 'unique' => false,
178
+ 'is_configurable' => false,
179
+ 'used_for_promo_rules' => true,
180
+ 'apply_to' => '',
181
+ 'searchable' => true,
182
+ 'filterable' => 1,
183
+ 'comparable' => true,
184
+ 'visible_in_advanced_search' => true,
185
+ 'used_for_price_rules' => true,
186
+ 'filterable_in_search' => true
187
+ ));
188
+
189
+ $installer->removeAttribute('catalog_product', 'gender');
190
+ $installer->addAttribute('catalog_product', 'gender', array(
191
+ 'group' => 'Borderfree',
192
+ 'sort_order' => 21,
193
+ 'type' => 'int',
194
+ 'backend' => '',
195
+ 'frontend' => '',
196
+ 'label' => 'Gender',
197
+ 'note' => '',
198
+ 'input' => 'select',
199
+ 'class' => '',
200
+ 'source' => 'eav/entity_attribute_source_table',
201
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
202
+ 'visible' => true,
203
+ 'required' => false,
204
+ 'user_defined' => true,
205
+ 'default' => '',
206
+ 'visible_on_front' => true,
207
+ 'unique' => false,
208
+ 'is_configurable' => false,
209
+ 'used_for_promo_rules' => true,
210
+ 'apply_to' => '',
211
+ 'searchable' => true,
212
+ 'filterable' => 1,
213
+ 'comparable' => true,
214
+ 'visible_in_advanced_search' => true,
215
+ 'used_for_price_rules' => true,
216
+ 'option' => array (
217
+ 'value' => array(
218
+ 'MALE' => array('Male'),
219
+ 'FEMALE' => array('Female'),
220
+ 'UNISEX' => array('Unisex'),
221
+ )
222
+ ),
223
+ 'filterable_in_search' => true
224
+ ));
225
+
226
+ $installer->removeAttribute('catalog_product', 'fws_source');
227
+ $installer->addAttribute('catalog_product', 'fws_source', array(
228
+ 'group' => 'Borderfree',
229
+ 'sort_order' => 36,
230
+ 'type' => 'varchar',
231
+ 'backend' => '',
232
+ 'frontend' => '',
233
+ 'label' => 'Fish and Wildlife Source',
234
+ 'note' => '',
235
+ 'input' => 'select',
236
+ 'class' => '',
237
+ 'source' => 'eav/entity_attribute_source_table',
238
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
239
+ 'visible' => true,
240
+ 'required' => false,
241
+ 'user_defined' => true,
242
+ 'default' => '',
243
+ 'visible_on_front' => false,
244
+ 'unique' => false,
245
+ 'is_configurable' => true,
246
+ 'used_for_promo_rules' => false,
247
+ 'apply_to' => '',
248
+ 'searchable' => true,
249
+ 'filterable' => 1,
250
+ 'comparable' => true,
251
+ 'visible_in_advanced_search' => true,
252
+ 'used_for_price_rules' => false,
253
+ 'filterable_in_search' => true,
254
+ 'option' => array (
255
+ 'value' => array(
256
+ 'C' => array('Animals bred in captivity'),
257
+ 'F' => array('Animals born in captivity'),
258
+ 'W' => array('Animals taken from the wild')
259
+ )
260
+ )
261
+ ));
262
+
263
+ $installer->removeAttribute("catalog_product", "fws_country_of_origin");
264
+ $installer->addAttribute('catalog_product', 'fws_country_of_origin', array(
265
+ 'group' => 'Borderfree',
266
+ 'sort_order' => 37,
267
+ 'type' => 'varchar',
268
+ 'backend' => '',
269
+ 'frontend' => '',
270
+ 'label' => 'Fish and Wildlife Country of Origin',
271
+ 'note' => '',
272
+ 'input' => 'select',
273
+ 'class' => '',
274
+ 'source' => 'eav/entity_attribute_source_table',
275
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
276
+ 'visible' => true,
277
+ 'required' => false,
278
+ 'user_defined' => true,
279
+ 'default' => '',
280
+ 'visible_on_front' => false,
281
+ 'unique' => false,
282
+ 'is_configurable' => false,
283
+ 'used_for_promo_rules' => false,
284
+ 'apply_to' => '',
285
+ 'searchable' => false,
286
+ 'filterable' => 0,
287
+ 'comparable' => false,
288
+ 'visible_in_advanced_search' => true,
289
+ 'used_for_price_rules' => false,
290
+ 'filterable_in_search' => false,
291
+ 'option' => array (
292
+ 'value' => array(
293
+ "AF" => array("Afghanistan"),
294
+ "AX" => array("Ã…land Islands"),
295
+ "AL" => array("Albania"),
296
+ "DZ" => array("Algeria"),
297
+ "AS" => array("American Samoa"),
298
+ "AD" => array("Andorra"),
299
+ "AO" => array("Angola"),
300
+ "AI" => array("Anguilla"),
301
+ "AQ" => array("Antarctica"),
302
+ "AG" => array("Antigua and Barbuda"),
303
+ "AR" => array("Argentina"),
304
+ "AM" => array("Armenia"),
305
+ "AW" => array("Aruba"),
306
+ "AU" => array("Australia"),
307
+ "AT" => array("Austria"),
308
+ "AZ" => array("Azerbaijan"),
309
+ "BS" => array("Bahamas"),
310
+ "BH" => array("Bahrain"),
311
+ "BD" => array("Bangladesh"),
312
+ "BB" => array("Barbados"),
313
+ "BY" => array("Belarus"),
314
+ "BE" => array("Belgium"),
315
+ "BZ" => array("Belize"),
316
+ "BJ" => array("Benin"),
317
+ "BM" => array("Bermuda"),
318
+ "BT" => array("Bhutan"),
319
+ "BO" => array("Bolivia"),
320
+ "BA" => array("Bosnia and Herzegovina"),
321
+ "BW" => array("Botswana"),
322
+ "BV" => array("Bouvet Island"),
323
+ "BR" => array("Brazil"),
324
+ "IO" => array("British Indian Ocean Territory"),
325
+ "BN" => array("Brunei Darussalam"),
326
+ "BG" => array("Bulgaria"),
327
+ "BF" => array("Burkina Faso"),
328
+ "BI" => array("Burundi"),
329
+ "KH" => array("Cambodia"),
330
+ "CM" => array("Cameroon"),
331
+ "CA" => array("Canada"),
332
+ "CV" => array("Cape Verde"),
333
+ "KY" => array("Cayman Islands"),
334
+ "CF" => array("Central African Republic"),
335
+ "TD" => array("Chad"),
336
+ "CL" => array("Chile"),
337
+ "CN" => array("China"),
338
+ "CX" => array("Christmas Island"),
339
+ "CC" => array("Cocos (Keeling) Islands"),
340
+ "CO" => array("Colombia"),
341
+ "KM" => array("Comoros"),
342
+ "CG" => array("Congo"),
343
+ "CD" => array("Congo, The Democratic Republic of The"),
344
+ "CK" => array("Cook Islands"),
345
+ "CR" => array("Costa Rica"),
346
+ "CI" => array("Cote D'ivoire"),
347
+ "HR" => array("Croatia"),
348
+ "CU" => array("Cuba"),
349
+ "CY" => array("Cyprus"),
350
+ "CZ" => array("Czech Republic"),
351
+ "DK" => array("Denmark"),
352
+ "DJ" => array("Djibouti"),
353
+ "DM" => array("Dominica"),
354
+ "DO" => array("Dominican Republic"),
355
+ "EC" => array("Ecuador"),
356
+ "EG" => array("Egypt"),
357
+ "SV" => array("El Salvador"),
358
+ "GQ" => array("Equatorial Guinea"),
359
+ "ER" => array("Eritrea"),
360
+ "EE" => array("Estonia"),
361
+ "ET" => array("Ethiopia"),
362
+ "FK" => array("Falkland Islands (Malvinas)"),
363
+ "FO" => array("Faroe Islands"),
364
+ "FJ" => array("Fiji"),
365
+ "FI" => array("Finland"),
366
+ "FR" => array("France"),
367
+ "GF" => array("French Guiana"),
368
+ "PF" => array("French Polynesia"),
369
+ "TF" => array("French Southern Territories"),
370
+ "GA" => array("Gabon"),
371
+ "GM" => array("Gambia"),
372
+ "GE" => array("Georgia"),
373
+ "DE" => array("Germany"),
374
+ "GH" => array("Ghana"),
375
+ "GI" => array("Gibraltar"),
376
+ "GR" => array("Greece"),
377
+ "GL" => array("Greenland"),
378
+ "GD" => array("Grenada"),
379
+ "GP" => array("Guadeloupe"),
380
+ "GU" => array("Guam"),
381
+ "GT" => array("Guatemala"),
382
+ "GG" => array("Guernsey"),
383
+ "GN" => array("Guinea"),
384
+ "GW" => array("Guinea-bissau"),
385
+ "GY" => array("Guyana"),
386
+ "HT" => array("Haiti"),
387
+ "HM" => array("Heard Island and Mcdonald Islands"),
388
+ "VA" => array("Holy See (Vatican City State)"),
389
+ "HN" => array("Honduras"),
390
+ "HK" => array("Hong Kong"),
391
+ "HU" => array("Hungary"),
392
+ "IS" => array("Iceland"),
393
+ "IN" => array("India"),
394
+ "ID" => array("Indonesia"),
395
+ "IR" => array("Iran, Islamic Republic of"),
396
+ "IQ" => array("Iraq"),
397
+ "IE" => array("Ireland"),
398
+ "IM" => array("Isle of Man"),
399
+ "IL" => array("Israel"),
400
+ "IT" => array("Italy"),
401
+ "JM" => array("Jamaica"),
402
+ "JP" => array("Japan"),
403
+ "JE" => array("Jersey"),
404
+ "JO" => array("Jordan"),
405
+ "KZ" => array("Kazakhstan"),
406
+ "KE" => array("Kenya"),
407
+ "KI" => array("Kiribati"),
408
+ "KP" => array("Korea, Democratic People's Republic of"),
409
+ "KR" => array("Korea, Republic of"),
410
+ "KW" => array("Kuwait"),
411
+ "KG" => array("Kyrgyzstan"),
412
+ "LA" => array("Lao People's Democratic Republic"),
413
+ "LV" => array("Latvia"),
414
+ "LB" => array("Lebanon"),
415
+ "LS" => array("Lesotho"),
416
+ "LR" => array("Liberia"),
417
+ "LY" => array("Libyan Arab Jamahiriya"),
418
+ "LI" => array("Liechtenstein"),
419
+ "LT" => array("Lithuania"),
420
+ "LU" => array("Luxembourg"),
421
+ "MO" => array("Macao"),
422
+ "MK" => array("Macedonia, The Former Yugoslav Republic of"),
423
+ "MG" => array("Madagascar"),
424
+ "MW" => array("Malawi"),
425
+ "MY" => array("Malaysia"),
426
+ "MV" => array("Maldives"),
427
+ "ML" => array("Mali"),
428
+ "MT" => array("Malta"),
429
+ "MH" => array("Marshall Islands"),
430
+ "MQ" => array("Martinique"),
431
+ "MR" => array("Mauritania"),
432
+ "MU" => array("Mauritius"),
433
+ "YT" => array("Mayotte"),
434
+ "MX" => array("Mexico"),
435
+ "FM" => array("Micronesia, Federated States of"),
436
+ "MD" => array("Moldova, Republic of"),
437
+ "MC" => array("Monaco"),
438
+ "MN" => array("Mongolia"),
439
+ "ME" => array("Montenegro"),
440
+ "MS" => array("Montserrat"),
441
+ "MA" => array("Morocco"),
442
+ "MZ" => array("Mozambique"),
443
+ "MM" => array("Myanmar"),
444
+ "NA" => array("Namibia"),
445
+ "NR" => array("Nauru"),
446
+ "NP" => array("Nepal"),
447
+ "NL" => array("Netherlands"),
448
+ "AN" => array("Netherlands Antilles"),
449
+ "NC" => array("New Caledonia"),
450
+ "NZ" => array("New Zealand"),
451
+ "NI" => array("Nicaragua"),
452
+ "NE" => array("Niger"),
453
+ "NG" => array("Nigeria"),
454
+ "NU" => array("Niue"),
455
+ "NF" => array("Norfolk Island"),
456
+ "MP" => array("Northern Mariana Islands"),
457
+ "NO" => array("Norway"),
458
+ "OM" => array("Oman"),
459
+ "PK" => array("Pakistan"),
460
+ "PW" => array("Palau"),
461
+ "PS" => array("Palestinian Territory, Occupied"),
462
+ "PA" => array("Panama"),
463
+ "PG" => array("Papua New Guinea"),
464
+ "PY" => array("Paraguay"),
465
+ "PE" => array("Peru"),
466
+ "PH" => array("Philippines"),
467
+ "PN" => array("Pitcairn"),
468
+ "PL" => array("Poland"),
469
+ "PT" => array("Portugal"),
470
+ "PR" => array("Puerto Rico"),
471
+ "QA" => array("Qatar"),
472
+ "RE" => array("Reunion"),
473
+ "RO" => array("Romania"),
474
+ "RU" => array("Russian Federation"),
475
+ "RW" => array("Rwanda"),
476
+ "SH" => array("Saint Helena"),
477
+ "KN" => array("Saint Kitts and Nevis"),
478
+ "LC" => array("Saint Lucia"),
479
+ "PM" => array("Saint Pierre and Miquelon"),
480
+ "VC" => array("Saint Vincent and The Grenadines"),
481
+ "WS" => array("Samoa"),
482
+ "SM" => array("San Marino"),
483
+ "ST" => array("Sao Tome and Principe"),
484
+ "SA" => array("Saudi Arabia"),
485
+ "SN" => array("Senegal"),
486
+ "RS" => array("Serbia"),
487
+ "SC" => array("Seychelles"),
488
+ "SL" => array("Sierra Leone"),
489
+ "SG" => array("Singapore"),
490
+ "SK" => array("Slovakia"),
491
+ "SI" => array("Slovenia"),
492
+ "SB" => array("Solomon Islands"),
493
+ "SO" => array("Somalia"),
494
+ "ZA" => array("South Africa"),
495
+ "GS" => array("South Georgia and The South Sandwich Islands"),
496
+ "ES" => array("Spain"),
497
+ "LK" => array("Sri Lanka"),
498
+ "SD" => array("Sudan"),
499
+ "SR" => array("Suriname"),
500
+ "SJ" => array("Svalbard and Jan Mayen"),
501
+ "SZ" => array("Swaziland"),
502
+ "SE" => array("Sweden"),
503
+ "CH" => array("Switzerland"),
504
+ "SY" => array("Syrian Arab Republic"),
505
+ "TW" => array("Taiwan, Province of China"),
506
+ "TJ" => array("Tajikistan"),
507
+ "TZ" => array("Tanzania, United Republic of"),
508
+ "TH" => array("Thailand"),
509
+ "TL" => array("Timor-leste"),
510
+ "TG" => array("Togo"),
511
+ "TK" => array("Tokelau"),
512
+ "TO" => array("Tonga"),
513
+ "TT" => array("Trinidad and Tobago"),
514
+ "TN" => array("Tunisia"),
515
+ "TR" => array("Turkey"),
516
+ "TM" => array("Turkmenistan"),
517
+ "TC" => array("Turks and Caicos Islands"),
518
+ "TV" => array("Tuvalu"),
519
+ "UG" => array("Uganda"),
520
+ "UA" => array("Ukraine"),
521
+ "AE" => array("United Arab Emirates"),
522
+ "GB" => array("United Kingdom"),
523
+ "US" => array("United States"),
524
+ "UM" => array("United States Minor Outlying Islands"),
525
+ "UY" => array("Uruguay"),
526
+ "UZ" => array("Uzbekistan"),
527
+ "VU" => array("Vanuatu"),
528
+ "VE" => array("Venezuela"),
529
+ "VN" => array("Viet Nam"),
530
+ "VG" => array("Virgin Islands, British"),
531
+ "VI" => array("Virgin Islands, U.S."),
532
+ "WF" => array("Wallis and Futuna"),
533
+ "EH" => array("Western Sahara"),
534
+ "YE" => array("Yemen"),
535
+ "ZM" => array("Zambia"),
536
+ "ZW" => array("Zimbabwe"),
537
+ )
538
+ ),
539
+
540
+ ));
541
+ /*
542
+ $installer->removeAttribute('catalog_product', 'country_of_manufacture');
543
+ $installer->addAttribute('catalog_product', 'country_of_manufacture', array(
544
+ 'group' => 'Borderfree',
545
+ 'sort_order' => 3,
546
+ 'type' => 'int',
547
+ 'backend' => '',
548
+ 'frontend' => '',
549
+ 'label' => 'Country of Origin',
550
+ 'note' => '',
551
+ 'input' => 'select',
552
+ 'class' => '',
553
+ 'source' => 'eav/entity_attribute_source_table',
554
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
555
+ 'visible' => true,
556
+ 'required' => false,
557
+ 'user_defined' => true,
558
+ 'default' => '',
559
+ 'visible_on_front' => false,
560
+ 'unique' => false,
561
+ 'is_configurable' => false,
562
+ 'used_for_promo_rules' => false,
563
+ 'apply_to' => '',
564
+ 'searchable' => false,
565
+ 'filterable' => 0,
566
+ 'comparable' => false,
567
+ 'visible_in_advanced_search' => true,
568
+ 'used_for_price_rules' => false,
569
+ 'filterable_in_search' => false,
570
+ 'option' => array (
571
+ 'value' => array(
572
+ "AF" => array("Afghanistan"),
573
+ "AX" => array("Ã…land Islands"),
574
+ "AL" => array("Albania"),
575
+ "DZ" => array("Algeria"),
576
+ "AS" => array("American Samoa"),
577
+ "AD" => array("Andorra"),
578
+ "AO" => array("Angola"),
579
+ "AI" => array("Anguilla"),
580
+ "AQ" => array("Antarctica"),
581
+ "AG" => array("Antigua and Barbuda"),
582
+ "AR" => array("Argentina"),
583
+ "AM" => array("Armenia"),
584
+ "AW" => array("Aruba"),
585
+ "AU" => array("Australia"),
586
+ "AT" => array("Austria"),
587
+ "AZ" => array("Azerbaijan"),
588
+ "BS" => array("Bahamas"),
589
+ "BH" => array("Bahrain"),
590
+ "BD" => array("Bangladesh"),
591
+ "BB" => array("Barbados"),
592
+ "BY" => array("Belarus"),
593
+ "BE" => array("Belgium"),
594
+ "BZ" => array("Belize"),
595
+ "BJ" => array("Benin"),
596
+ "BM" => array("Bermuda"),
597
+ "BT" => array("Bhutan"),
598
+ "BO" => array("Bolivia"),
599
+ "BA" => array("Bosnia and Herzegovina"),
600
+ "BW" => array("Botswana"),
601
+ "BV" => array("Bouvet Island"),
602
+ "BR" => array("Brazil"),
603
+ "IO" => array("British Indian Ocean Territory"),
604
+ "BN" => array("Brunei Darussalam"),
605
+ "BG" => array("Bulgaria"),
606
+ "BF" => array("Burkina Faso"),
607
+ "BI" => array("Burundi"),
608
+ "KH" => array("Cambodia"),
609
+ "CM" => array("Cameroon"),
610
+ "CA" => array("Canada"),
611
+ "CV" => array("Cape Verde"),
612
+ "KY" => array("Cayman Islands"),
613
+ "CF" => array("Central African Republic"),
614
+ "TD" => array("Chad"),
615
+ "CL" => array("Chile"),
616
+ "CN" => array("China"),
617
+ "CX" => array("Christmas Island"),
618
+ "CC" => array("Cocos (Keeling) Islands"),
619
+ "CO" => array("Colombia"),
620
+ "KM" => array("Comoros"),
621
+ "CG" => array("Congo"),
622
+ "CD" => array("Congo, The Democratic Republic of The"),
623
+ "CK" => array("Cook Islands"),
624
+ "CR" => array("Costa Rica"),
625
+ "CI" => array("Cote D'ivoire"),
626
+ "HR" => array("Croatia"),
627
+ "CU" => array("Cuba"),
628
+ "CY" => array("Cyprus"),
629
+ "CZ" => array("Czech Republic"),
630
+ "DK" => array("Denmark"),
631
+ "DJ" => array("Djibouti"),
632
+ "DM" => array("Dominica"),
633
+ "DO" => array("Dominican Republic"),
634
+ "EC" => array("Ecuador"),
635
+ "EG" => array("Egypt"),
636
+ "SV" => array("El Salvador"),
637
+ "GQ" => array("Equatorial Guinea"),
638
+ "ER" => array("Eritrea"),
639
+ "EE" => array("Estonia"),
640
+ "ET" => array("Ethiopia"),
641
+ "FK" => array("Falkland Islands (Malvinas)"),
642
+ "FO" => array("Faroe Islands"),
643
+ "FJ" => array("Fiji"),
644
+ "FI" => array("Finland"),
645
+ "FR" => array("France"),
646
+ "GF" => array("French Guiana"),
647
+ "PF" => array("French Polynesia"),
648
+ "TF" => array("French Southern Territories"),
649
+ "GA" => array("Gabon"),
650
+ "GM" => array("Gambia"),
651
+ "GE" => array("Georgia"),
652
+ "DE" => array("Germany"),
653
+ "GH" => array("Ghana"),
654
+ "GI" => array("Gibraltar"),
655
+ "GR" => array("Greece"),
656
+ "GL" => array("Greenland"),
657
+ "GD" => array("Grenada"),
658
+ "GP" => array("Guadeloupe"),
659
+ "GU" => array("Guam"),
660
+ "GT" => array("Guatemala"),
661
+ "GG" => array("Guernsey"),
662
+ "GN" => array("Guinea"),
663
+ "GW" => array("Guinea-bissau"),
664
+ "GY" => array("Guyana"),
665
+ "HT" => array("Haiti"),
666
+ "HM" => array("Heard Island and Mcdonald Islands"),
667
+ "VA" => array("Holy See (Vatican City State)"),
668
+ "HN" => array("Honduras"),
669
+ "HK" => array("Hong Kong"),
670
+ "HU" => array("Hungary"),
671
+ "IS" => array("Iceland"),
672
+ "IN" => array("India"),
673
+ "ID" => array("Indonesia"),
674
+ "IR" => array("Iran, Islamic Republic of"),
675
+ "IQ" => array("Iraq"),
676
+ "IE" => array("Ireland"),
677
+ "IM" => array("Isle of Man"),
678
+ "IL" => array("Israel"),
679
+ "IT" => array("Italy"),
680
+ "JM" => array("Jamaica"),
681
+ "JP" => array("Japan"),
682
+ "JE" => array("Jersey"),
683
+ "JO" => array("Jordan"),
684
+ "KZ" => array("Kazakhstan"),
685
+ "KE" => array("Kenya"),
686
+ "KI" => array("Kiribati"),
687
+ "KP" => array("Korea, Democratic People's Republic of"),
688
+ "KR" => array("Korea, Republic of"),
689
+ "KW" => array("Kuwait"),
690
+ "KG" => array("Kyrgyzstan"),
691
+ "LA" => array("Lao People's Democratic Republic"),
692
+ "LV" => array("Latvia"),
693
+ "LB" => array("Lebanon"),
694
+ "LS" => array("Lesotho"),
695
+ "LR" => array("Liberia"),
696
+ "LY" => array("Libyan Arab Jamahiriya"),
697
+ "LI" => array("Liechtenstein"),
698
+ "LT" => array("Lithuania"),
699
+ "LU" => array("Luxembourg"),
700
+ "MO" => array("Macao"),
701
+ "MK" => array("Macedonia, The Former Yugoslav Republic of"),
702
+ "MG" => array("Madagascar"),
703
+ "MW" => array("Malawi"),
704
+ "MY" => array("Malaysia"),
705
+ "MV" => array("Maldives"),
706
+ "ML" => array("Mali"),
707
+ "MT" => array("Malta"),
708
+ "MH" => array("Marshall Islands"),
709
+ "MQ" => array("Martinique"),
710
+ "MR" => array("Mauritania"),
711
+ "MU" => array("Mauritius"),
712
+ "YT" => array("Mayotte"),
713
+ "MX" => array("Mexico"),
714
+ "FM" => array("Micronesia, Federated States of"),
715
+ "MD" => array("Moldova, Republic of"),
716
+ "MC" => array("Monaco"),
717
+ "MN" => array("Mongolia"),
718
+ "ME" => array("Montenegro"),
719
+ "MS" => array("Montserrat"),
720
+ "MA" => array("Morocco"),
721
+ "MZ" => array("Mozambique"),
722
+ "MM" => array("Myanmar"),
723
+ "NA" => array("Namibia"),
724
+ "NR" => array("Nauru"),
725
+ "NP" => array("Nepal"),
726
+ "NL" => array("Netherlands"),
727
+ "AN" => array("Netherlands Antilles"),
728
+ "NC" => array("New Caledonia"),
729
+ "NZ" => array("New Zealand"),
730
+ "NI" => array("Nicaragua"),
731
+ "NE" => array("Niger"),
732
+ "NG" => array("Nigeria"),
733
+ "NU" => array("Niue"),
734
+ "NF" => array("Norfolk Island"),
735
+ "MP" => array("Northern Mariana Islands"),
736
+ "NO" => array("Norway"),
737
+ "OM" => array("Oman"),
738
+ "PK" => array("Pakistan"),
739
+ "PW" => array("Palau"),
740
+ "PS" => array("Palestinian Territory, Occupied"),
741
+ "PA" => array("Panama"),
742
+ "PG" => array("Papua New Guinea"),
743
+ "PY" => array("Paraguay"),
744
+ "PE" => array("Peru"),
745
+ "PH" => array("Philippines"),
746
+ "PN" => array("Pitcairn"),
747
+ "PL" => array("Poland"),
748
+ "PT" => array("Portugal"),
749
+ "PR" => array("Puerto Rico"),
750
+ "QA" => array("Qatar"),
751
+ "RE" => array("Reunion"),
752
+ "RO" => array("Romania"),
753
+ "RU" => array("Russian Federation"),
754
+ "RW" => array("Rwanda"),
755
+ "SH" => array("Saint Helena"),
756
+ "KN" => array("Saint Kitts and Nevis"),
757
+ "LC" => array("Saint Lucia"),
758
+ "PM" => array("Saint Pierre and Miquelon"),
759
+ "VC" => array("Saint Vincent and The Grenadines"),
760
+ "WS" => array("Samoa"),
761
+ "SM" => array("San Marino"),
762
+ "ST" => array("Sao Tome and Principe"),
763
+ "SA" => array("Saudi Arabia"),
764
+ "SN" => array("Senegal"),
765
+ "RS" => array("Serbia"),
766
+ "SC" => array("Seychelles"),
767
+ "SL" => array("Sierra Leone"),
768
+ "SG" => array("Singapore"),
769
+ "SK" => array("Slovakia"),
770
+ "SI" => array("Slovenia"),
771
+ "SB" => array("Solomon Islands"),
772
+ "SO" => array("Somalia"),
773
+ "ZA" => array("South Africa"),
774
+ "GS" => array("South Georgia and The South Sandwich Islands"),
775
+ "ES" => array("Spain"),
776
+ "LK" => array("Sri Lanka"),
777
+ "SD" => array("Sudan"),
778
+ "SR" => array("Suriname"),
779
+ "SJ" => array("Svalbard and Jan Mayen"),
780
+ "SZ" => array("Swaziland"),
781
+ "SE" => array("Sweden"),
782
+ "CH" => array("Switzerland"),
783
+ "SY" => array("Syrian Arab Republic"),
784
+ "TW" => array("Taiwan, Province of China"),
785
+ "TJ" => array("Tajikistan"),
786
+ "TZ" => array("Tanzania, United Republic of"),
787
+ "TH" => array("Thailand"),
788
+ "TL" => array("Timor-leste"),
789
+ "TG" => array("Togo"),
790
+ "TK" => array("Tokelau"),
791
+ "TO" => array("Tonga"),
792
+ "TT" => array("Trinidad and Tobago"),
793
+ "TN" => array("Tunisia"),
794
+ "TR" => array("Turkey"),
795
+ "TM" => array("Turkmenistan"),
796
+ "TC" => array("Turks and Caicos Islands"),
797
+ "TV" => array("Tuvalu"),
798
+ "UG" => array("Uganda"),
799
+ "UA" => array("Ukraine"),
800
+ "AE" => array("United Arab Emirates"),
801
+ "GB" => array("United Kingdom"),
802
+ "US" => array("United States"),
803
+ "UM" => array("United States Minor Outlying Islands"),
804
+ "UY" => array("Uruguay"),
805
+ "UZ" => array("Uzbekistan"),
806
+ "VU" => array("Vanuatu"),
807
+ "VE" => array("Venezuela"),
808
+ "VN" => array("Viet Nam"),
809
+ "VG" => array("Virgin Islands, British"),
810
+ "VI" => array("Virgin Islands, U.S."),
811
+ "WF" => array("Wallis and Futuna"),
812
+ "EH" => array("Western Sahara"),
813
+ "YE" => array("Yemen"),
814
+ "ZM" => array("Zambia"),
815
+ "ZW" => array("Zimbabwe"),
816
+ "ZZ" => array("Multi-Sourced"),
817
+ )
818
+ ),
819
+
820
+ ));
821
+ */
822
+
823
+
824
+ $installer->endSetup();
825
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.17-1.0.18.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->addAttribute('catalog_product', 'color', array(
6
+ 'group' => 'Borderfree',
7
+ 'sort_order' => 19,
8
+ 'type' => 'int',
9
+ 'backend' => '',
10
+ 'frontend' => '',
11
+ 'label' => 'Color',
12
+ 'note' => '',
13
+ 'input' => 'select',
14
+ 'class' => '',
15
+ 'source' => 'eav/entity_attribute_source_table',
16
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
17
+ 'visible' => true,
18
+ 'required' => false,
19
+ 'user_defined' => true,
20
+ 'default' => '',
21
+ 'visible_on_front' => false,
22
+ 'unique' => false,
23
+ 'is_configurable' => true,
24
+ 'used_for_promo_rules' => false,
25
+ 'apply_to' => 'simple',
26
+ 'searchable' => true,
27
+ 'filterable' => 1,
28
+ 'comparable' => true,
29
+ 'visible_in_advanced_search' => true,
30
+ 'used_for_price_rules' => false,
31
+ 'filterable_in_search' => true
32
+ ));
33
+
34
+
35
+ $installer->endSetup();
36
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.18-1.0.19.php ADDED
@@ -0,0 +1,388 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->removeAttribute('catalog_product', 'condition');
6
+ $installer->addAttribute('catalog_product', 'condition', array(
7
+ 'group' => 'Borderfree',
8
+ 'sort_order' => 24,
9
+ 'type' => 'int',
10
+ 'backend' => '',
11
+ 'frontend' => '',
12
+ 'label' => 'Condition',
13
+ 'note' => 'e.g., "New", "Refurbished"',
14
+ 'input' => 'select',
15
+ 'class' => '',
16
+ 'source' => 'eav/entity_attribute_source_table',
17
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
18
+ 'visible' => true,
19
+ 'required' => false,
20
+ 'user_defined' => true,
21
+ 'default' => '',
22
+ 'visible_on_front' => false,
23
+ 'unique' => false,
24
+ 'is_configurable' => false,
25
+ 'used_for_promo_rules' => false,
26
+ 'apply_to' => '',
27
+ 'searchable' => true,
28
+ 'filterable' => 1,
29
+ 'comparable' => true,
30
+ 'visible_in_advanced_search' => true,
31
+ 'used_for_price_rules' => false,
32
+ 'filterable_in_search' => true,
33
+ 'option' => array (
34
+ 'value' => array(
35
+ 'New' => array('New'),
36
+ 'Refurbished' => array('Refurbished'),
37
+ )
38
+ )
39
+ ));
40
+
41
+ $installer->removeAttribute('catalog_product', 'fws_source');
42
+ $installer->addAttribute('catalog_product', 'fws_source', array(
43
+ 'group' => 'Borderfree',
44
+ 'sort_order' => 36,
45
+ 'type' => 'int',
46
+ 'backend' => '',
47
+ 'frontend' => '',
48
+ 'label' => 'Fish and Wildlife Source',
49
+ 'note' => '',
50
+ 'input' => 'select',
51
+ 'class' => '',
52
+ 'source' => 'eav/entity_attribute_source_table',
53
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
54
+ 'visible' => true,
55
+ 'required' => false,
56
+ 'user_defined' => true,
57
+ 'default' => '',
58
+ 'visible_on_front' => false,
59
+ 'unique' => false,
60
+ 'is_configurable' => false,
61
+ 'used_for_promo_rules' => false,
62
+ 'apply_to' => '',
63
+ 'searchable' => true,
64
+ 'filterable' => 1,
65
+ 'comparable' => true,
66
+ 'visible_in_advanced_search' => true,
67
+ 'used_for_price_rules' => false,
68
+ 'filterable_in_search' => true,
69
+ 'option' => array (
70
+ 'value' => array(
71
+ 'C' => array('Animals bred in captivity'),
72
+ 'F' => array('Animals born in captivity'),
73
+ 'W' => array('Animals taken from the wild')
74
+ )
75
+ )
76
+ ));
77
+
78
+ $installer->addAttribute('catalog_product', 'collection', array(
79
+ 'group' => 'Borderfree',
80
+ 'sort_order' => 18,
81
+ 'type' => 'int',
82
+ 'backend' => '',
83
+ 'frontend' => '',
84
+ 'label' => 'Collection',
85
+ 'note' => '',
86
+ 'input' => 'select',
87
+ 'class' => '',
88
+ 'source' => 'eav/entity_attribute_source_table',
89
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
90
+ 'visible' => true,
91
+ 'required' => false,
92
+ 'user_defined' => true,
93
+ 'default' => '',
94
+ 'visible_on_front' => true,
95
+ 'unique' => false,
96
+ 'is_configurable' => false,
97
+ 'used_for_promo_rules' => true,
98
+ 'apply_to' => '',
99
+ 'searchable' => true,
100
+ 'filterable' => 1,
101
+ 'comparable' => true,
102
+ 'visible_in_advanced_search' => true,
103
+ 'used_for_price_rules' => true,
104
+ 'filterable_in_search' => true
105
+ ));
106
+
107
+ $installer->removeAttribute("catalog_product", "fws_country_of_origin");
108
+ $installer->addAttribute('catalog_product', 'fws_country_of_origin', array(
109
+ 'group' => 'Borderfree',
110
+ 'sort_order' => 37,
111
+ 'type' => 'int',
112
+ 'backend' => '',
113
+ 'frontend' => '',
114
+ 'label' => 'Fish and Wildlife Country of Origin',
115
+ 'note' => '',
116
+ 'input' => 'select',
117
+ 'class' => '',
118
+ 'source' => 'eav/entity_attribute_source_table',
119
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
120
+ 'visible' => true,
121
+ 'required' => false,
122
+ 'user_defined' => true,
123
+ 'default' => '',
124
+ 'visible_on_front' => false,
125
+ 'unique' => false,
126
+ 'is_configurable' => false,
127
+ 'used_for_promo_rules' => false,
128
+ 'apply_to' => '',
129
+ 'searchable' => false,
130
+ 'filterable' => 0,
131
+ 'comparable' => false,
132
+ 'visible_in_advanced_search' => true,
133
+ 'used_for_price_rules' => false,
134
+ 'filterable_in_search' => false,
135
+ 'option' => array (
136
+ 'value' => array(
137
+ "AF" => array("Afghanistan"),
138
+ "AX" => array("Ã…land Islands"),
139
+ "AL" => array("Albania"),
140
+ "DZ" => array("Algeria"),
141
+ "AS" => array("American Samoa"),
142
+ "AD" => array("Andorra"),
143
+ "AO" => array("Angola"),
144
+ "AI" => array("Anguilla"),
145
+ "AQ" => array("Antarctica"),
146
+ "AG" => array("Antigua and Barbuda"),
147
+ "AR" => array("Argentina"),
148
+ "AM" => array("Armenia"),
149
+ "AW" => array("Aruba"),
150
+ "AU" => array("Australia"),
151
+ "AT" => array("Austria"),
152
+ "AZ" => array("Azerbaijan"),
153
+ "BS" => array("Bahamas"),
154
+ "BH" => array("Bahrain"),
155
+ "BD" => array("Bangladesh"),
156
+ "BB" => array("Barbados"),
157
+ "BY" => array("Belarus"),
158
+ "BE" => array("Belgium"),
159
+ "BZ" => array("Belize"),
160
+ "BJ" => array("Benin"),
161
+ "BM" => array("Bermuda"),
162
+ "BT" => array("Bhutan"),
163
+ "BO" => array("Bolivia"),
164
+ "BA" => array("Bosnia and Herzegovina"),
165
+ "BW" => array("Botswana"),
166
+ "BV" => array("Bouvet Island"),
167
+ "BR" => array("Brazil"),
168
+ "IO" => array("British Indian Ocean Territory"),
169
+ "BN" => array("Brunei Darussalam"),
170
+ "BG" => array("Bulgaria"),
171
+ "BF" => array("Burkina Faso"),
172
+ "BI" => array("Burundi"),
173
+ "KH" => array("Cambodia"),
174
+ "CM" => array("Cameroon"),
175
+ "CA" => array("Canada"),
176
+ "CV" => array("Cape Verde"),
177
+ "KY" => array("Cayman Islands"),
178
+ "CF" => array("Central African Republic"),
179
+ "TD" => array("Chad"),
180
+ "CL" => array("Chile"),
181
+ "CN" => array("China"),
182
+ "CX" => array("Christmas Island"),
183
+ "CC" => array("Cocos (Keeling) Islands"),
184
+ "CO" => array("Colombia"),
185
+ "KM" => array("Comoros"),
186
+ "CG" => array("Congo"),
187
+ "CD" => array("Congo, The Democratic Republic of The"),
188
+ "CK" => array("Cook Islands"),
189
+ "CR" => array("Costa Rica"),
190
+ "CI" => array("Cote D'ivoire"),
191
+ "HR" => array("Croatia"),
192
+ "CU" => array("Cuba"),
193
+ "CY" => array("Cyprus"),
194
+ "CZ" => array("Czech Republic"),
195
+ "DK" => array("Denmark"),
196
+ "DJ" => array("Djibouti"),
197
+ "DM" => array("Dominica"),
198
+ "DO" => array("Dominican Republic"),
199
+ "EC" => array("Ecuador"),
200
+ "EG" => array("Egypt"),
201
+ "SV" => array("El Salvador"),
202
+ "GQ" => array("Equatorial Guinea"),
203
+ "ER" => array("Eritrea"),
204
+ "EE" => array("Estonia"),
205
+ "ET" => array("Ethiopia"),
206
+ "FK" => array("Falkland Islands (Malvinas)"),
207
+ "FO" => array("Faroe Islands"),
208
+ "FJ" => array("Fiji"),
209
+ "FI" => array("Finland"),
210
+ "FR" => array("France"),
211
+ "GF" => array("French Guiana"),
212
+ "PF" => array("French Polynesia"),
213
+ "TF" => array("French Southern Territories"),
214
+ "GA" => array("Gabon"),
215
+ "GM" => array("Gambia"),
216
+ "GE" => array("Georgia"),
217
+ "DE" => array("Germany"),
218
+ "GH" => array("Ghana"),
219
+ "GI" => array("Gibraltar"),
220
+ "GR" => array("Greece"),
221
+ "GL" => array("Greenland"),
222
+ "GD" => array("Grenada"),
223
+ "GP" => array("Guadeloupe"),
224
+ "GU" => array("Guam"),
225
+ "GT" => array("Guatemala"),
226
+ "GG" => array("Guernsey"),
227
+ "GN" => array("Guinea"),
228
+ "GW" => array("Guinea-bissau"),
229
+ "GY" => array("Guyana"),
230
+ "HT" => array("Haiti"),
231
+ "HM" => array("Heard Island and Mcdonald Islands"),
232
+ "VA" => array("Holy See (Vatican City State)"),
233
+ "HN" => array("Honduras"),
234
+ "HK" => array("Hong Kong"),
235
+ "HU" => array("Hungary"),
236
+ "IS" => array("Iceland"),
237
+ "IN" => array("India"),
238
+ "ID" => array("Indonesia"),
239
+ "IR" => array("Iran, Islamic Republic of"),
240
+ "IQ" => array("Iraq"),
241
+ "IE" => array("Ireland"),
242
+ "IM" => array("Isle of Man"),
243
+ "IL" => array("Israel"),
244
+ "IT" => array("Italy"),
245
+ "JM" => array("Jamaica"),
246
+ "JP" => array("Japan"),
247
+ "JE" => array("Jersey"),
248
+ "JO" => array("Jordan"),
249
+ "KZ" => array("Kazakhstan"),
250
+ "KE" => array("Kenya"),
251
+ "KI" => array("Kiribati"),
252
+ "KP" => array("Korea, Democratic People's Republic of"),
253
+ "KR" => array("Korea, Republic of"),
254
+ "KW" => array("Kuwait"),
255
+ "KG" => array("Kyrgyzstan"),
256
+ "LA" => array("Lao People's Democratic Republic"),
257
+ "LV" => array("Latvia"),
258
+ "LB" => array("Lebanon"),
259
+ "LS" => array("Lesotho"),
260
+ "LR" => array("Liberia"),
261
+ "LY" => array("Libyan Arab Jamahiriya"),
262
+ "LI" => array("Liechtenstein"),
263
+ "LT" => array("Lithuania"),
264
+ "LU" => array("Luxembourg"),
265
+ "MO" => array("Macao"),
266
+ "MK" => array("Macedonia, The Former Yugoslav Republic of"),
267
+ "MG" => array("Madagascar"),
268
+ "MW" => array("Malawi"),
269
+ "MY" => array("Malaysia"),
270
+ "MV" => array("Maldives"),
271
+ "ML" => array("Mali"),
272
+ "MT" => array("Malta"),
273
+ "MH" => array("Marshall Islands"),
274
+ "MQ" => array("Martinique"),
275
+ "MR" => array("Mauritania"),
276
+ "MU" => array("Mauritius"),
277
+ "YT" => array("Mayotte"),
278
+ "MX" => array("Mexico"),
279
+ "FM" => array("Micronesia, Federated States of"),
280
+ "MD" => array("Moldova, Republic of"),
281
+ "MC" => array("Monaco"),
282
+ "MN" => array("Mongolia"),
283
+ "ME" => array("Montenegro"),
284
+ "MS" => array("Montserrat"),
285
+ "MA" => array("Morocco"),
286
+ "MZ" => array("Mozambique"),
287
+ "MM" => array("Myanmar"),
288
+ "NA" => array("Namibia"),
289
+ "NR" => array("Nauru"),
290
+ "NP" => array("Nepal"),
291
+ "NL" => array("Netherlands"),
292
+ "AN" => array("Netherlands Antilles"),
293
+ "NC" => array("New Caledonia"),
294
+ "NZ" => array("New Zealand"),
295
+ "NI" => array("Nicaragua"),
296
+ "NE" => array("Niger"),
297
+ "NG" => array("Nigeria"),
298
+ "NU" => array("Niue"),
299
+ "NF" => array("Norfolk Island"),
300
+ "MP" => array("Northern Mariana Islands"),
301
+ "NO" => array("Norway"),
302
+ "OM" => array("Oman"),
303
+ "PK" => array("Pakistan"),
304
+ "PW" => array("Palau"),
305
+ "PS" => array("Palestinian Territory, Occupied"),
306
+ "PA" => array("Panama"),
307
+ "PG" => array("Papua New Guinea"),
308
+ "PY" => array("Paraguay"),
309
+ "PE" => array("Peru"),
310
+ "PH" => array("Philippines"),
311
+ "PN" => array("Pitcairn"),
312
+ "PL" => array("Poland"),
313
+ "PT" => array("Portugal"),
314
+ "PR" => array("Puerto Rico"),
315
+ "QA" => array("Qatar"),
316
+ "RE" => array("Reunion"),
317
+ "RO" => array("Romania"),
318
+ "RU" => array("Russian Federation"),
319
+ "RW" => array("Rwanda"),
320
+ "SH" => array("Saint Helena"),
321
+ "KN" => array("Saint Kitts and Nevis"),
322
+ "LC" => array("Saint Lucia"),
323
+ "PM" => array("Saint Pierre and Miquelon"),
324
+ "VC" => array("Saint Vincent and The Grenadines"),
325
+ "WS" => array("Samoa"),
326
+ "SM" => array("San Marino"),
327
+ "ST" => array("Sao Tome and Principe"),
328
+ "SA" => array("Saudi Arabia"),
329
+ "SN" => array("Senegal"),
330
+ "RS" => array("Serbia"),
331
+ "SC" => array("Seychelles"),
332
+ "SL" => array("Sierra Leone"),
333
+ "SG" => array("Singapore"),
334
+ "SK" => array("Slovakia"),
335
+ "SI" => array("Slovenia"),
336
+ "SB" => array("Solomon Islands"),
337
+ "SO" => array("Somalia"),
338
+ "ZA" => array("South Africa"),
339
+ "GS" => array("South Georgia and The South Sandwich Islands"),
340
+ "ES" => array("Spain"),
341
+ "LK" => array("Sri Lanka"),
342
+ "SD" => array("Sudan"),
343
+ "SR" => array("Suriname"),
344
+ "SJ" => array("Svalbard and Jan Mayen"),
345
+ "SZ" => array("Swaziland"),
346
+ "SE" => array("Sweden"),
347
+ "CH" => array("Switzerland"),
348
+ "SY" => array("Syrian Arab Republic"),
349
+ "TW" => array("Taiwan, Province of China"),
350
+ "TJ" => array("Tajikistan"),
351
+ "TZ" => array("Tanzania, United Republic of"),
352
+ "TH" => array("Thailand"),
353
+ "TL" => array("Timor-leste"),
354
+ "TG" => array("Togo"),
355
+ "TK" => array("Tokelau"),
356
+ "TO" => array("Tonga"),
357
+ "TT" => array("Trinidad and Tobago"),
358
+ "TN" => array("Tunisia"),
359
+ "TR" => array("Turkey"),
360
+ "TM" => array("Turkmenistan"),
361
+ "TC" => array("Turks and Caicos Islands"),
362
+ "TV" => array("Tuvalu"),
363
+ "UG" => array("Uganda"),
364
+ "UA" => array("Ukraine"),
365
+ "AE" => array("United Arab Emirates"),
366
+ "GB" => array("United Kingdom"),
367
+ "US" => array("United States"),
368
+ "UM" => array("United States Minor Outlying Islands"),
369
+ "UY" => array("Uruguay"),
370
+ "UZ" => array("Uzbekistan"),
371
+ "VU" => array("Vanuatu"),
372
+ "VE" => array("Venezuela"),
373
+ "VN" => array("Viet Nam"),
374
+ "VG" => array("Virgin Islands, British"),
375
+ "VI" => array("Virgin Islands, U.S."),
376
+ "WF" => array("Wallis and Futuna"),
377
+ "EH" => array("Western Sahara"),
378
+ "YE" => array("Yemen"),
379
+ "ZM" => array("Zambia"),
380
+ "ZW" => array("Zimbabwe"),
381
+ )
382
+ ),
383
+
384
+ ));
385
+
386
+
387
+ $installer->endSetup();
388
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.19-1.0.20.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("CREATE TABLE borderfree_catalog_export_stores (store_id int(8) NOT NULL, status int(1) NOT NULL, start_time datetime, batch_id char(12) NOT NULL, filenum int(8) NOT NULL, request_id int(8) NOT NULL, type char(15) NOT NULL, PRIMARY KEY (store_id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
5
+ $installer->run("CREATE TABLE borderfree_catalog_export_products (product_id int(8) NOT NULL, status int(1) NOT NULL, PRIMARY KEY (product_id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
6
+ $installer->endSetup();
7
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.2-1.0.3.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
6
+
7
+ $installer->addAttribute('catalog_product', 'size_chart_url', array(
8
+ 'group' => 'Borderfree',
9
+ 'sort_order' => 2,
10
+ 'type' => 'int',
11
+ 'backend' => '',
12
+ 'frontend' => '',
13
+ 'label' => 'Size chart URL',
14
+ 'note' => '',
15
+ 'input' => 'text',
16
+ 'class' => '',
17
+ 'source' => '',
18
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
19
+ 'visible' => true,
20
+ 'required' => false,
21
+ 'user_defined' => true,
22
+ 'default' => '0',
23
+ 'visible_on_front' => false,
24
+ 'unique' => false,
25
+ 'is_configurable' => false,
26
+ 'used_for_promo_rules' => false
27
+ ));
28
+
29
+ $installer->addAttribute('catalog_product', 'is_exclusive', array(
30
+ 'group' => 'Borderfree',
31
+ 'sort_order' => 3,
32
+ 'type' => 'int',
33
+ 'backend' => '',
34
+ 'frontend' => '',
35
+ 'label' => 'Is Exclusive',
36
+ 'note' => 'Indicates whether the Product is exclusive to your catalog.',
37
+ 'input' => 'select',
38
+ 'class' => '',
39
+ 'source' => 'eav/entity_attribute_source_boolean',
40
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
41
+ 'visible' => true,
42
+ 'required' => false,
43
+ 'user_defined' => true,
44
+ 'default' => '0',
45
+ 'visible_on_front' => false,
46
+ 'unique' => false,
47
+ 'is_configurable' => false,
48
+ 'used_for_promo_rules' => false
49
+ ));
50
+
51
+
52
+ $installer->endSetup();
53
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.20-1.0.21.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("TRUNCATE TABLE borderfree_catalog_export_stores;");
5
+ $installer->run("TRUNCATE TABLE borderfree_catalog_export_products;");
6
+ $installer->endSetup();
7
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.21-1.0.22.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("TRUNCATE TABLE borderfree_catalog_export_stores;");
5
+ $installer->run("TRUNCATE TABLE borderfree_catalog_export_products;");
6
+ $installer->endSetup();
7
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.22-1.0.23.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("TRUNCATE TABLE borderfree_catalog_export_stores;");
5
+ $installer->run("TRUNCATE TABLE borderfree_catalog_export_products;");
6
+ $installer->endSetup();
7
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.23-1.0.24.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("TRUNCATE TABLE borderfree_catalog_export_stores;");
5
+ $installer->run("TRUNCATE TABLE borderfree_catalog_export_products;");
6
+ $installer->endSetup();
7
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.24-1.0.25.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("TRUNCATE TABLE borderfree_catalog_export_stores;");
5
+ $installer->run("TRUNCATE TABLE borderfree_catalog_export_products;");
6
+ $installer->endSetup();
7
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.3-1.0.4.php ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
6
+
7
+ $installer->addAttribute('catalog_product', 'manufacturer', array(
8
+ 'group' => 'Borderfree',
9
+ 'sort_order' => 4,
10
+ 'type' => 'varchar',
11
+ 'backend' => '',
12
+ 'frontend' => '',
13
+ 'label' => 'Manufacturer',
14
+ 'note' => '',
15
+ 'input' => 'select',
16
+ 'class' => '',
17
+ 'source' => '',
18
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
19
+ 'visible' => true,
20
+ 'required' => false,
21
+ 'user_defined' => true,
22
+ 'default' => '',
23
+ 'visible_on_front' => true,
24
+ 'unique' => false,
25
+ 'is_configurable' => false,
26
+ 'used_for_promo_rules' => true,
27
+ 'apply_to' => '',
28
+ 'searchable' => true,
29
+ 'filterable' => 1,
30
+ 'comparable' => true,
31
+ 'visible_in_advanced_search' => true,
32
+ 'used_for_price_rules' => true,
33
+ 'filterable_in_search' => true
34
+ ));
35
+
36
+ $installer->addAttribute('catalog_product', 'brand', array(
37
+ 'group' => 'Borderfree',
38
+ 'sort_order' => 5,
39
+ 'type' => 'varchar',
40
+ 'backend' => '',
41
+ 'frontend' => '',
42
+ 'label' => 'Brand',
43
+ 'note' => '',
44
+ 'input' => 'select',
45
+ 'class' => '',
46
+ 'source' => '',
47
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
48
+ 'visible' => true,
49
+ 'required' => false,
50
+ 'user_defined' => true,
51
+ 'default' => '',
52
+ 'visible_on_front' => true,
53
+ 'unique' => false,
54
+ 'is_configurable' => false,
55
+ 'used_for_promo_rules' => true,
56
+ 'apply_to' => '',
57
+ 'searchable' => true,
58
+ 'filterable' => 1,
59
+ 'comparable' => true,
60
+ 'visible_in_advanced_search' => true,
61
+ 'used_for_price_rules' => true,
62
+ 'filterable_in_search' => true
63
+ ));
64
+
65
+ $installer->addAttribute('catalog_product', 'collection', array(
66
+ 'group' => 'Borderfree',
67
+ 'sort_order' => 6,
68
+ 'type' => 'varchar',
69
+ 'backend' => '',
70
+ 'frontend' => '',
71
+ 'label' => 'Collection',
72
+ 'note' => '',
73
+ 'input' => 'select',
74
+ 'class' => '',
75
+ 'source' => '',
76
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
77
+ 'visible' => true,
78
+ 'required' => false,
79
+ 'user_defined' => true,
80
+ 'default' => '',
81
+ 'visible_on_front' => true,
82
+ 'unique' => false,
83
+ 'is_configurable' => false,
84
+ 'used_for_promo_rules' => true,
85
+ 'apply_to' => '',
86
+ 'searchable' => true,
87
+ 'filterable' => 1,
88
+ 'comparable' => true,
89
+ 'visible_in_advanced_search' => true,
90
+ 'used_for_price_rules' => true,
91
+ 'filterable_in_search' => true
92
+ ));
93
+
94
+ $installer->addAttribute('catalog_product', 'gender', array(
95
+ 'group' => 'Borderfree',
96
+ 'sort_order' => 7,
97
+ 'type' => 'varchar',
98
+ 'backend' => '',
99
+ 'frontend' => '',
100
+ 'label' => 'Gender',
101
+ 'note' => '',
102
+ 'input' => 'select',
103
+ 'class' => '',
104
+ 'source' => '',
105
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
106
+ 'visible' => true,
107
+ 'required' => false,
108
+ 'user_defined' => true,
109
+ 'default' => '',
110
+ 'visible_on_front' => true,
111
+ 'unique' => false,
112
+ 'is_configurable' => false,
113
+ 'used_for_promo_rules' => true,
114
+ 'apply_to' => '',
115
+ 'searchable' => true,
116
+ 'filterable' => 1,
117
+ 'comparable' => true,
118
+ 'visible_in_advanced_search' => true,
119
+ 'used_for_price_rules' => true,
120
+ 'option' => array (
121
+ 'value' => array(
122
+ 'MALE' => array('Male'),
123
+ 'FEMALE' => array('Female'),
124
+ 'UNISEX' => array('Unisex'),
125
+ )
126
+ ),
127
+ 'filterable_in_search' => true
128
+ ));
129
+
130
+ $installer->addAttribute('catalog_product', 'age', array(
131
+ 'group' => 'Borderfree',
132
+ 'sort_order' => 8,
133
+ 'type' => 'varchar',
134
+ 'backend' => 'eav/entity_attribute_backend_array',
135
+ 'frontend' => '',
136
+ 'label' => 'Age',
137
+ 'note' => '',
138
+ 'input' => 'multiselect',
139
+ 'class' => '',
140
+ 'source' => '',
141
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
142
+ 'visible' => true,
143
+ 'required' => false,
144
+ 'user_defined' => true,
145
+ 'default' => '',
146
+ 'visible_on_front' => true,
147
+ 'unique' => false,
148
+ 'is_configurable' => false,
149
+ 'used_for_promo_rules' => true,
150
+ 'apply_to' => '',
151
+ 'searchable' => true,
152
+ 'filterable' => 1,
153
+ 'comparable' => true,
154
+ 'visible_in_advanced_search' => true,
155
+ 'used_for_price_rules' => true,
156
+ 'option' => array (
157
+ 'value' => array(
158
+ 'NEWBORN' => array('Newborn'),
159
+ 'INFANT' => array('Infant'),
160
+ 'TODDLER' => array('Toddler'),
161
+ 'CHILD' => array('Child'),
162
+ 'JUNIOR' => array('Junior'),
163
+ 'TEEN' => array('Teen'),
164
+ 'ADULT' => array('Adult'),
165
+ )
166
+ ),
167
+ 'filterable_in_search' => true
168
+ ));
169
+
170
+ $installer->addAttribute('catalog_product', 'season', array(
171
+ 'group' => 'Borderfree',
172
+ 'sort_order' => 9,
173
+ 'type' => 'varchar',
174
+ 'backend' => 'eav/entity_attribute_backend_array',
175
+ 'frontend' => '',
176
+ 'label' => 'Season',
177
+ 'note' => '',
178
+ 'input' => 'multiselect',
179
+ 'class' => '',
180
+ 'source' => '',
181
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
182
+ 'visible' => true,
183
+ 'required' => false,
184
+ 'user_defined' => true,
185
+ 'default' => '',
186
+ 'visible_on_front' => true,
187
+ 'unique' => false,
188
+ 'is_configurable' => false,
189
+ 'used_for_promo_rules' => true,
190
+ 'apply_to' => '',
191
+ 'searchable' => true,
192
+ 'filterable' => 1,
193
+ 'comparable' => true,
194
+ 'visible_in_advanced_search' => true,
195
+ 'used_for_price_rules' => true,
196
+ 'option' => array (
197
+ 'value' => array(
198
+ 'SPRING' => array('Spring'),
199
+ 'SUMMER' => array('Summer'),
200
+ 'FALL' => array('Fall'),
201
+ 'WINTER' => array('Winter'),
202
+ )
203
+ ),
204
+ 'filterable_in_search' => true
205
+ ));
206
+
207
+ $installer->endSetup();
208
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.4-1.0.5.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
6
+
7
+ $installer->addAttribute('catalog_product', 'gtin', array(
8
+ 'group' => 'Borderfree',
9
+ 'sort_order' => 10,
10
+ 'type' => 'varchar',
11
+ 'backend' => '',
12
+ 'frontend' => '',
13
+ 'label' => 'Global Trade Item Number',
14
+ 'note' => '',
15
+ 'input' => 'text',
16
+ 'class' => '',
17
+ 'source' => '',
18
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
19
+ 'visible' => true,
20
+ 'required' => false,
21
+ 'user_defined' => true,
22
+ 'default' => '',
23
+ 'visible_on_front' => false,
24
+ 'unique' => false,
25
+ 'is_configurable' => false,
26
+ 'used_for_promo_rules' => false,
27
+ 'apply_to' => '',
28
+ 'searchable' => true,
29
+ 'filterable' => 1,
30
+ 'comparable' => false,
31
+ 'visible_in_advanced_search' => false,
32
+ 'used_for_price_rules' => false,
33
+ 'filterable_in_search' => false
34
+ ));
35
+
36
+ $installer->addAttribute('catalog_product', 'upc', array(
37
+ 'group' => 'Borderfree',
38
+ 'sort_order' => 11,
39
+ 'type' => 'varchar',
40
+ 'backend' => '',
41
+ 'frontend' => '',
42
+ 'label' => 'Universal Product Code',
43
+ 'note' => '',
44
+ 'input' => 'text',
45
+ 'class' => '',
46
+ 'source' => '',
47
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
48
+ 'visible' => true,
49
+ 'required' => false,
50
+ 'user_defined' => true,
51
+ 'default' => '',
52
+ 'visible_on_front' => false,
53
+ 'unique' => false,
54
+ 'is_configurable' => false,
55
+ 'used_for_promo_rules' => false,
56
+ 'apply_to' => '',
57
+ 'searchable' => true,
58
+ 'filterable' => 1,
59
+ 'comparable' => false,
60
+ 'visible_in_advanced_search' => false,
61
+ 'used_for_price_rules' => false,
62
+ 'filterable_in_search' => false
63
+ ));
64
+
65
+ $installer->addAttribute('catalog_product', 'ean', array(
66
+ 'group' => 'Borderfree',
67
+ 'sort_order' => 12,
68
+ 'type' => 'varchar',
69
+ 'backend' => '',
70
+ 'frontend' => '',
71
+ 'label' => 'European Article Number',
72
+ 'note' => '',
73
+ 'input' => 'text',
74
+ 'class' => '',
75
+ 'source' => '',
76
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
77
+ 'visible' => true,
78
+ 'required' => false,
79
+ 'user_defined' => true,
80
+ 'default' => '',
81
+ 'visible_on_front' => false,
82
+ 'unique' => false,
83
+ 'is_configurable' => false,
84
+ 'used_for_promo_rules' => false,
85
+ 'apply_to' => '',
86
+ 'searchable' => true,
87
+ 'filterable' => 1,
88
+ 'comparable' => false,
89
+ 'visible_in_advanced_search' => false,
90
+ 'used_for_price_rules' => false,
91
+ 'filterable_in_search' => false
92
+ ));
93
+
94
+ $installer->addAttribute('catalog_product', 'apn', array(
95
+ 'group' => 'Borderfree',
96
+ 'sort_order' => 13,
97
+ 'type' => 'varchar',
98
+ 'backend' => '',
99
+ 'frontend' => '',
100
+ 'label' => 'Australian Product Number',
101
+ 'note' => '',
102
+ 'input' => 'text',
103
+ 'class' => '',
104
+ 'source' => '',
105
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
106
+ 'visible' => true,
107
+ 'required' => false,
108
+ 'user_defined' => true,
109
+ 'default' => '',
110
+ 'visible_on_front' => false,
111
+ 'unique' => false,
112
+ 'is_configurable' => false,
113
+ 'used_for_promo_rules' => false,
114
+ 'apply_to' => '',
115
+ 'searchable' => true,
116
+ 'filterable' => 1,
117
+ 'comparable' => false,
118
+ 'visible_in_advanced_search' => false,
119
+ 'used_for_price_rules' => false,
120
+ 'filterable_in_search' => false
121
+ ));
122
+
123
+ $installer->addAttribute('catalog_product', 'jan', array(
124
+ 'group' => 'Borderfree',
125
+ 'sort_order' => 14,
126
+ 'type' => 'varchar',
127
+ 'backend' => '',
128
+ 'frontend' => '',
129
+ 'label' => 'Japanese Article Number',
130
+ 'note' => '',
131
+ 'input' => 'text',
132
+ 'class' => '',
133
+ 'source' => '',
134
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
135
+ 'visible' => true,
136
+ 'required' => false,
137
+ 'user_defined' => true,
138
+ 'default' => '',
139
+ 'visible_on_front' => false,
140
+ 'unique' => false,
141
+ 'is_configurable' => false,
142
+ 'used_for_promo_rules' => false,
143
+ 'apply_to' => '',
144
+ 'searchable' => true,
145
+ 'filterable' => 1,
146
+ 'comparable' => false,
147
+ 'visible_in_advanced_search' => false,
148
+ 'used_for_price_rules' => false,
149
+ 'filterable_in_search' => false
150
+ ));
151
+
152
+ $installer->addAttribute('catalog_product', 'eccn', array(
153
+ 'group' => 'Borderfree',
154
+ 'sort_order' => 15,
155
+ 'type' => 'varchar',
156
+ 'backend' => '',
157
+ 'frontend' => '',
158
+ 'label' => 'Export Control Classification Number',
159
+ 'note' => '',
160
+ 'input' => 'text',
161
+ 'class' => '',
162
+ 'source' => '',
163
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
164
+ 'visible' => true,
165
+ 'required' => false,
166
+ 'user_defined' => true,
167
+ 'default' => '',
168
+ 'visible_on_front' => false,
169
+ 'unique' => false,
170
+ 'is_configurable' => false,
171
+ 'used_for_promo_rules' => false,
172
+ 'apply_to' => '',
173
+ 'searchable' => true,
174
+ 'filterable' => 1,
175
+ 'comparable' => false,
176
+ 'visible_in_advanced_search' => false,
177
+ 'used_for_price_rules' => false,
178
+ 'filterable_in_search' => false
179
+ ));
180
+
181
+ $installer->addAttribute('catalog_product', 'mpn', array(
182
+ 'group' => 'Borderfree',
183
+ 'sort_order' => 16,
184
+ 'type' => 'varchar',
185
+ 'backend' => '',
186
+ 'frontend' => '',
187
+ 'label' => 'Manufacturer Part Number',
188
+ 'note' => '',
189
+ 'input' => 'text',
190
+ 'class' => '',
191
+ 'source' => '',
192
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
193
+ 'visible' => true,
194
+ 'required' => false,
195
+ 'user_defined' => true,
196
+ 'default' => '',
197
+ 'visible_on_front' => false,
198
+ 'unique' => false,
199
+ 'is_configurable' => false,
200
+ 'used_for_promo_rules' => false,
201
+ 'apply_to' => '',
202
+ 'searchable' => true,
203
+ 'filterable' => 1,
204
+ 'comparable' => false,
205
+ 'visible_in_advanced_search' => false,
206
+ 'used_for_price_rules' => false,
207
+ 'filterable_in_search' => false
208
+ ));
209
+
210
+ $installer->endSetup();
211
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.5-1.0.6.php ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
6
+
7
+ $installer->addAttribute('catalog_product', 'care', array(
8
+ 'group' => 'Borderfree',
9
+ 'sort_order' => 17,
10
+ 'type' => 'varchar',
11
+ 'backend' => '',
12
+ 'frontend' => '',
13
+ 'label' => 'Care Instructions',
14
+ 'note' => '',
15
+ 'input' => 'textarea',
16
+ 'class' => '',
17
+ 'source' => '',
18
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
19
+ 'visible' => true,
20
+ 'required' => false,
21
+ 'user_defined' => true,
22
+ 'default' => '',
23
+ 'visible_on_front' => false,
24
+ 'unique' => false,
25
+ 'is_configurable' => false,
26
+ 'used_for_promo_rules' => false,
27
+ 'apply_to' => '',
28
+ 'searchable' => false,
29
+ 'filterable' => 0,
30
+ 'comparable' => false,
31
+ 'visible_in_advanced_search' => false,
32
+ 'used_for_price_rules' => false,
33
+ 'filterable_in_search' => false
34
+ ));
35
+
36
+ $installer->addAttribute('catalog_product', 'contents', array(
37
+ 'group' => 'Borderfree',
38
+ 'sort_order' => 18,
39
+ 'type' => 'varchar',
40
+ 'backend' => '',
41
+ 'frontend' => '',
42
+ 'label' => 'Contents and/or Materials',
43
+ 'note' => '(e.g., 60% cotton, 40% rayon). Use commas to separate values in this field.',
44
+ 'input' => 'textarea',
45
+ 'class' => '',
46
+ 'source' => '',
47
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
48
+ 'visible' => true,
49
+ 'required' => false,
50
+ 'user_defined' => true,
51
+ 'default' => '',
52
+ 'visible_on_front' => false,
53
+ 'unique' => false,
54
+ 'is_configurable' => false,
55
+ 'used_for_promo_rules' => false,
56
+ 'apply_to' => '',
57
+ 'searchable' => false,
58
+ 'filterable' => 0,
59
+ 'comparable' => false,
60
+ 'visible_in_advanced_search' => false,
61
+ 'used_for_price_rules' => false,
62
+ 'filterable_in_search' => false
63
+ ));
64
+
65
+ $installer->addAttribute('catalog_product', 'hs_codes', array(
66
+ 'group' => 'Borderfree',
67
+ 'sort_order' => 19,
68
+ 'type' => 'varchar',
69
+ 'backend' => '',
70
+ 'frontend' => '',
71
+ 'label' => 'Harmonized System (HS) codes',
72
+ 'note' => 'Comma Separated List',
73
+ 'input' => 'text',
74
+ 'class' => '',
75
+ 'source' => '',
76
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
77
+ 'visible' => true,
78
+ 'required' => false,
79
+ 'user_defined' => true,
80
+ 'default' => '',
81
+ 'visible_on_front' => false,
82
+ 'unique' => false,
83
+ 'is_configurable' => false,
84
+ 'used_for_promo_rules' => false,
85
+ 'apply_to' => '',
86
+ 'searchable' => false,
87
+ 'filterable' => 0,
88
+ 'comparable' => false,
89
+ 'visible_in_advanced_search' => false,
90
+ 'used_for_price_rules' => false,
91
+ 'filterable_in_search' => false
92
+ ));
93
+
94
+ $installer->addAttribute('catalog_product', 'is_ormd', array(
95
+ 'group' => 'Borderfree',
96
+ 'sort_order' => 20,
97
+ 'type' => 'int',
98
+ 'backend' => '',
99
+ 'frontend' => '',
100
+ 'label' => 'Is ORM-D',
101
+ 'note' => 'Indicates if the SKU has the "Other Regulated Materials for Domestic transport only"',
102
+ 'input' => 'select',
103
+ 'class' => '',
104
+ 'source' => 'eav/entity_attribute_source_boolean',
105
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
106
+ 'visible' => true,
107
+ 'required' => false,
108
+ 'user_defined' => true,
109
+ 'default' => '0',
110
+ 'visible_on_front' => false,
111
+ 'unique' => false,
112
+ 'is_configurable' => false,
113
+ 'used_for_promo_rules' => false
114
+ ));
115
+
116
+ $installer->addAttribute('catalog_product', 'is_fws_permit_req', array(
117
+ 'group' => 'Borderfree',
118
+ 'sort_order' => 21,
119
+ 'type' => 'int',
120
+ 'backend' => '',
121
+ 'frontend' => '',
122
+ 'label' => 'Fish and Wildlife Services permit required',
123
+ 'note' => '',
124
+ 'input' => 'select',
125
+ 'class' => '',
126
+ 'source' => 'eav/entity_attribute_source_boolean',
127
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
128
+ 'visible' => true,
129
+ 'required' => false,
130
+ 'user_defined' => true,
131
+ 'default' => '0',
132
+ 'visible_on_front' => false,
133
+ 'unique' => false,
134
+ 'is_configurable' => false,
135
+ 'used_for_promo_rules' => false
136
+ ));
137
+
138
+ $installer->addAttribute('catalog_product', 'fws_permit_details', array(
139
+ 'group' => 'Borderfree',
140
+ 'sort_order' => 22,
141
+ 'type' => 'varchar',
142
+ 'backend' => '',
143
+ 'frontend' => '',
144
+ 'label' => "Item's description for the FWS permit",
145
+ 'note' => '',
146
+ 'input' => 'text',
147
+ 'class' => '',
148
+ 'source' => '',
149
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
150
+ 'visible' => true,
151
+ 'required' => false,
152
+ 'user_defined' => true,
153
+ 'default' => '',
154
+ 'visible_on_front' => false,
155
+ 'unique' => false,
156
+ 'is_configurable' => false,
157
+ 'used_for_promo_rules' => false,
158
+ 'apply_to' => '',
159
+ 'searchable' => false,
160
+ 'filterable' => 0,
161
+ 'comparable' => false,
162
+ 'visible_in_advanced_search' => false,
163
+ 'used_for_price_rules' => false,
164
+ 'filterable_in_search' => false
165
+ ));
166
+
167
+ $installer->endSetup();
168
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.6-1.0.7.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
6
+
7
+ $installer->addAttribute('catalog_product', 'box_width', array(
8
+ 'group' => 'Borderfree',
9
+ 'sort_order' => 23,
10
+ 'type' => 'varchar',
11
+ 'backend' => '',
12
+ 'frontend' => '',
13
+ 'label' => 'Box Width',
14
+ 'note' => '',
15
+ 'input' => 'text',
16
+ 'class' => '',
17
+ 'source' => '',
18
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
19
+ 'visible' => true,
20
+ 'required' => false,
21
+ 'user_defined' => true,
22
+ 'default' => '',
23
+ 'visible_on_front' => false,
24
+ 'unique' => false,
25
+ 'is_configurable' => false,
26
+ 'used_for_promo_rules' => false,
27
+ 'apply_to' => '',
28
+ 'searchable' => false,
29
+ 'filterable' => 0,
30
+ 'comparable' => false,
31
+ 'visible_in_advanced_search' => false,
32
+ 'used_for_price_rules' => false,
33
+ 'filterable_in_search' => false
34
+ ));
35
+
36
+ $installer->addAttribute('catalog_product', 'box_length', array(
37
+ 'group' => 'Borderfree',
38
+ 'sort_order' => 24,
39
+ 'type' => 'varchar',
40
+ 'backend' => '',
41
+ 'frontend' => '',
42
+ 'label' => 'Box Length',
43
+ 'note' => '',
44
+ 'input' => 'text',
45
+ 'class' => '',
46
+ 'source' => '',
47
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
48
+ 'visible' => true,
49
+ 'required' => false,
50
+ 'user_defined' => true,
51
+ 'default' => '',
52
+ 'visible_on_front' => false,
53
+ 'unique' => false,
54
+ 'is_configurable' => false,
55
+ 'used_for_promo_rules' => false,
56
+ 'apply_to' => '',
57
+ 'searchable' => false,
58
+ 'filterable' => 0,
59
+ 'comparable' => false,
60
+ 'visible_in_advanced_search' => false,
61
+ 'used_for_price_rules' => false,
62
+ 'filterable_in_search' => false
63
+ ));
64
+
65
+ $installer->addAttribute('catalog_product', 'box_height', array(
66
+ 'group' => 'Borderfree',
67
+ 'sort_order' => 25,
68
+ 'type' => 'varchar',
69
+ 'backend' => '',
70
+ 'frontend' => '',
71
+ 'label' => 'Box Height',
72
+ 'note' => '',
73
+ 'input' => 'text',
74
+ 'class' => '',
75
+ 'source' => '',
76
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
77
+ 'visible' => true,
78
+ 'required' => false,
79
+ 'user_defined' => true,
80
+ 'default' => '',
81
+ 'visible_on_front' => false,
82
+ 'unique' => false,
83
+ 'is_configurable' => false,
84
+ 'used_for_promo_rules' => false,
85
+ 'apply_to' => '',
86
+ 'searchable' => false,
87
+ 'filterable' => 0,
88
+ 'comparable' => false,
89
+ 'visible_in_advanced_search' => false,
90
+ 'used_for_price_rules' => false,
91
+ 'filterable_in_search' => false
92
+ ));
93
+
94
+ $installer->addAttribute('catalog_product', 'product_width', array(
95
+ 'group' => 'Borderfree',
96
+ 'sort_order' => 26,
97
+ 'type' => 'varchar',
98
+ 'backend' => '',
99
+ 'frontend' => '',
100
+ 'label' => 'Product Width',
101
+ 'note' => '',
102
+ 'input' => 'text',
103
+ 'class' => '',
104
+ 'source' => '',
105
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
106
+ 'visible' => true,
107
+ 'required' => false,
108
+ 'user_defined' => true,
109
+ 'default' => '',
110
+ 'visible_on_front' => false,
111
+ 'unique' => false,
112
+ 'is_configurable' => false,
113
+ 'used_for_promo_rules' => false,
114
+ 'apply_to' => '',
115
+ 'searchable' => false,
116
+ 'filterable' => 0,
117
+ 'comparable' => false,
118
+ 'visible_in_advanced_search' => false,
119
+ 'used_for_price_rules' => false,
120
+ 'filterable_in_search' => false
121
+ ));
122
+
123
+ $installer->addAttribute('catalog_product', 'product_length', array(
124
+ 'group' => 'Borderfree',
125
+ 'sort_order' => 27,
126
+ 'type' => 'varchar',
127
+ 'backend' => '',
128
+ 'frontend' => '',
129
+ 'label' => 'Product Length',
130
+ 'note' => '',
131
+ 'input' => 'text',
132
+ 'class' => '',
133
+ 'source' => '',
134
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
135
+ 'visible' => true,
136
+ 'required' => false,
137
+ 'user_defined' => true,
138
+ 'default' => '',
139
+ 'visible_on_front' => false,
140
+ 'unique' => false,
141
+ 'is_configurable' => false,
142
+ 'used_for_promo_rules' => false,
143
+ 'apply_to' => '',
144
+ 'searchable' => false,
145
+ 'filterable' => 0,
146
+ 'comparable' => false,
147
+ 'visible_in_advanced_search' => false,
148
+ 'used_for_price_rules' => false,
149
+ 'filterable_in_search' => false
150
+ ));
151
+
152
+ $installer->addAttribute('catalog_product', 'product_height', array(
153
+ 'group' => 'Borderfree',
154
+ 'sort_order' => 28,
155
+ 'type' => 'varchar',
156
+ 'backend' => '',
157
+ 'frontend' => '',
158
+ 'label' => 'Product Height',
159
+ 'note' => '',
160
+ 'input' => 'text',
161
+ 'class' => '',
162
+ 'source' => '',
163
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
164
+ 'visible' => true,
165
+ 'required' => false,
166
+ 'user_defined' => true,
167
+ 'default' => '',
168
+ 'visible_on_front' => false,
169
+ 'unique' => false,
170
+ 'is_configurable' => false,
171
+ 'used_for_promo_rules' => false,
172
+ 'apply_to' => '',
173
+ 'searchable' => false,
174
+ 'filterable' => 0,
175
+ 'comparable' => false,
176
+ 'visible_in_advanced_search' => false,
177
+ 'used_for_price_rules' => false,
178
+ 'filterable_in_search' => false
179
+ ));
180
+
181
+ $installer->endSetup();
182
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.7-1.0.8.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
6
+
7
+ $installer->addAttribute('catalog_product', 'color', array(
8
+ 'group' => 'Borderfree',
9
+ 'sort_order' => 29,
10
+ 'type' => 'varchar',
11
+ 'backend' => '',
12
+ 'frontend' => '',
13
+ 'label' => 'Color',
14
+ 'note' => '',
15
+ 'input' => 'select',
16
+ 'class' => '',
17
+ 'source' => '',
18
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
19
+ 'visible' => true,
20
+ 'required' => false,
21
+ 'user_defined' => true,
22
+ 'default' => '',
23
+ 'visible_on_front' => false,
24
+ 'unique' => false,
25
+ 'is_configurable' => true,
26
+ 'used_for_promo_rules' => false,
27
+ 'apply_to' => 'simple',
28
+ 'searchable' => true,
29
+ 'filterable' => 1,
30
+ 'comparable' => true,
31
+ 'visible_in_advanced_search' => true,
32
+ 'used_for_price_rules' => false,
33
+ 'filterable_in_search' => true
34
+ ));
35
+
36
+ $installer->addAttribute('catalog_product', 'size', array(
37
+ 'group' => 'Borderfree',
38
+ 'sort_order' => 30,
39
+ 'type' => 'varchar',
40
+ 'backend' => '',
41
+ 'frontend' => '',
42
+ 'label' => 'Size',
43
+ 'note' => '',
44
+ 'input' => 'select',
45
+ 'class' => '',
46
+ 'source' => '',
47
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
48
+ 'visible' => true,
49
+ 'required' => false,
50
+ 'user_defined' => true,
51
+ 'default' => '',
52
+ 'visible_on_front' => false,
53
+ 'unique' => false,
54
+ 'is_configurable' => true,
55
+ 'used_for_promo_rules' => false,
56
+ 'apply_to' => 'simple',
57
+ 'searchable' => true,
58
+ 'filterable' => 1,
59
+ 'comparable' => true,
60
+ 'visible_in_advanced_search' => true,
61
+ 'used_for_price_rules' => false,
62
+ 'filterable_in_search' => true
63
+ ));
64
+
65
+ $installer->endSetup();
66
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.8-1.0.9.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
6
+
7
+ $installer->addAttribute('catalog_product', 'condition', array(
8
+ 'group' => 'Borderfree',
9
+ 'sort_order' => 31,
10
+ 'type' => 'varchar',
11
+ 'backend' => '',
12
+ 'frontend' => '',
13
+ 'label' => 'Condition',
14
+ 'note' => 'e.g., "New", "Refurbished"',
15
+ 'input' => 'select',
16
+ 'class' => '',
17
+ 'source' => '',
18
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
19
+ 'visible' => true,
20
+ 'required' => false,
21
+ 'user_defined' => true,
22
+ 'default' => '',
23
+ 'visible_on_front' => false,
24
+ 'unique' => false,
25
+ 'is_configurable' => true,
26
+ 'used_for_promo_rules' => false,
27
+ 'apply_to' => 'simple',
28
+ 'searchable' => true,
29
+ 'filterable' => 1,
30
+ 'comparable' => true,
31
+ 'visible_in_advanced_search' => true,
32
+ 'used_for_price_rules' => false,
33
+ 'filterable_in_search' => true
34
+ ));
35
+
36
+ $installer->endSetup();
37
+ ?>
app/code/local/Borderfree/Catalog/sql/borderfreecatalog_setup/mysql4-upgrade-1.0.9-1.0.10.php ADDED
@@ -0,0 +1,879 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
6
+
7
+ $installer->addAttribute('catalog_product', 'condition', array(
8
+ 'group' => 'Borderfree',
9
+ 'sort_order' => 31,
10
+ 'type' => 'varchar',
11
+ 'backend' => '',
12
+ 'frontend' => '',
13
+ 'label' => 'Condition',
14
+ 'note' => 'e.g., "New", "Refurbished"',
15
+ 'input' => 'select',
16
+ 'class' => '',
17
+ 'source' => '',
18
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
19
+ 'visible' => true,
20
+ 'required' => false,
21
+ 'user_defined' => true,
22
+ 'default' => '',
23
+ 'visible_on_front' => false,
24
+ 'unique' => false,
25
+ 'is_configurable' => true,
26
+ 'used_for_promo_rules' => false,
27
+ 'apply_to' => '',
28
+ 'searchable' => true,
29
+ 'filterable' => 1,
30
+ 'comparable' => true,
31
+ 'visible_in_advanced_search' => true,
32
+ 'used_for_price_rules' => false,
33
+ 'filterable_in_search' => true,
34
+ 'option' => array (
35
+ 'value' => array(
36
+ 'New' => array('New'),
37
+ 'Refurbished' => array('Refurbished'),
38
+ )
39
+ )
40
+ ));
41
+ /*
42
+ $installer->addAttribute('catalog_product', 'country_of_manufacture', array(
43
+ 'group' => 'Borderfree',
44
+ 'sort_order' => 32,
45
+ 'type' => 'varchar',
46
+ 'backend' => '',
47
+ 'frontend' => '',
48
+ 'label' => 'Country of Origin',
49
+ 'note' => '',
50
+ 'input' => 'select',
51
+ 'class' => '',
52
+ 'source' => '',
53
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
54
+ 'visible' => true,
55
+ 'required' => false,
56
+ 'user_defined' => true,
57
+ 'default' => '',
58
+ 'visible_on_front' => false,
59
+ 'unique' => false,
60
+ 'is_configurable' => false,
61
+ 'used_for_promo_rules' => false,
62
+ 'apply_to' => '',
63
+ 'searchable' => false,
64
+ 'filterable' => 0,
65
+ 'comparable' => false,
66
+ 'visible_in_advanced_search' => true,
67
+ 'used_for_price_rules' => false,
68
+ 'filterable_in_search' => false,
69
+ 'option' => array (
70
+ 'value' => array(
71
+ "AF" => array("Afghanistan"),
72
+ "AX" => array("Ã…land Islands"),
73
+ "AL" => array("Albania"),
74
+ "DZ" => array("Algeria"),
75
+ "AS" => array("American Samoa"),
76
+ "AD" => array("Andorra"),
77
+ "AO" => array("Angola"),
78
+ "AI" => array("Anguilla"),
79
+ "AQ" => array("Antarctica"),
80
+ "AG" => array("Antigua and Barbuda"),
81
+ "AR" => array("Argentina"),
82
+ "AM" => array("Armenia"),
83
+ "AW" => array("Aruba"),
84
+ "AU" => array("Australia"),
85
+ "AT" => array("Austria"),
86
+ "AZ" => array("Azerbaijan"),
87
+ "BS" => array("Bahamas"),
88
+ "BH" => array("Bahrain"),
89
+ "BD" => array("Bangladesh"),
90
+ "BB" => array("Barbados"),
91
+ "BY" => array("Belarus"),
92
+ "BE" => array("Belgium"),
93
+ "BZ" => array("Belize"),
94
+ "BJ" => array("Benin"),
95
+ "BM" => array("Bermuda"),
96
+ "BT" => array("Bhutan"),
97
+ "BO" => array("Bolivia"),
98
+ "BA" => array("Bosnia and Herzegovina"),
99
+ "BW" => array("Botswana"),
100
+ "BV" => array("Bouvet Island"),
101
+ "BR" => array("Brazil"),
102
+ "IO" => array("British Indian Ocean Territory"),
103
+ "BN" => array("Brunei Darussalam"),
104
+ "BG" => array("Bulgaria"),
105
+ "BF" => array("Burkina Faso"),
106
+ "BI" => array("Burundi"),
107
+ "KH" => array("Cambodia"),
108
+ "CM" => array("Cameroon"),
109
+ "CA" => array("Canada"),
110
+ "CV" => array("Cape Verde"),
111
+ "KY" => array("Cayman Islands"),
112
+ "CF" => array("Central African Republic"),
113
+ "TD" => array("Chad"),
114
+ "CL" => array("Chile"),
115
+ "CN" => array("China"),
116
+ "CX" => array("Christmas Island"),
117
+ "CC" => array("Cocos (Keeling) Islands"),
118
+ "CO" => array("Colombia"),
119
+ "KM" => array("Comoros"),
120
+ "CG" => array("Congo"),
121
+ "CD" => array("Congo, The Democratic Republic of The"),
122
+ "CK" => array("Cook Islands"),
123
+ "CR" => array("Costa Rica"),
124
+ "CI" => array("Cote D'ivoire"),
125
+ "HR" => array("Croatia"),
126
+ "CU" => array("Cuba"),
127
+ "CY" => array("Cyprus"),
128
+ "CZ" => array("Czech Republic"),
129
+ "DK" => array("Denmark"),
130
+ "DJ" => array("Djibouti"),
131
+ "DM" => array("Dominica"),
132
+ "DO" => array("Dominican Republic"),
133
+ "EC" => array("Ecuador"),
134
+ "EG" => array("Egypt"),
135
+ "SV" => array("El Salvador"),
136
+ "GQ" => array("Equatorial Guinea"),
137
+ "ER" => array("Eritrea"),
138
+ "EE" => array("Estonia"),
139
+ "ET" => array("Ethiopia"),
140
+ "FK" => array("Falkland Islands (Malvinas)"),
141
+ "FO" => array("Faroe Islands"),
142
+ "FJ" => array("Fiji"),
143
+ "FI" => array("Finland"),
144
+ "FR" => array("France"),
145
+ "GF" => array("French Guiana"),
146
+ "PF" => array("French Polynesia"),
147
+ "TF" => array("French Southern Territories"),
148
+ "GA" => array("Gabon"),
149
+ "GM" => array("Gambia"),
150
+ "GE" => array("Georgia"),
151
+ "DE" => array("Germany"),
152
+ "GH" => array("Ghana"),
153
+ "GI" => array("Gibraltar"),
154
+ "GR" => array("Greece"),
155
+ "GL" => array("Greenland"),
156
+ "GD" => array("Grenada"),
157
+ "GP" => array("Guadeloupe"),
158
+ "GU" => array("Guam"),
159
+ "GT" => array("Guatemala"),
160
+ "GG" => array("Guernsey"),
161
+ "GN" => array("Guinea"),
162
+ "GW" => array("Guinea-bissau"),
163
+ "GY" => array("Guyana"),
164
+ "HT" => array("Haiti"),
165
+ "HM" => array("Heard Island and Mcdonald Islands"),
166
+ "VA" => array("Holy See (Vatican City State)"),
167
+ "HN" => array("Honduras"),
168
+ "HK" => array("Hong Kong"),
169
+ "HU" => array("Hungary"),
170
+ "IS" => array("Iceland"),
171
+ "IN" => array("India"),
172
+ "ID" => array("Indonesia"),
173
+ "IR" => array("Iran, Islamic Republic of"),
174
+ "IQ" => array("Iraq"),
175
+ "IE" => array("Ireland"),
176
+ "IM" => array("Isle of Man"),
177
+ "IL" => array("Israel"),
178
+ "IT" => array("Italy"),
179
+ "JM" => array("Jamaica"),
180
+ "JP" => array("Japan"),
181
+ "JE" => array("Jersey"),
182
+ "JO" => array("Jordan"),
183
+ "KZ" => array("Kazakhstan"),
184
+ "KE" => array("Kenya"),
185
+ "KI" => array("Kiribati"),
186
+ "KP" => array("Korea, Democratic People's Republic of"),
187
+ "KR" => array("Korea, Republic of"),
188
+ "KW" => array("Kuwait"),
189
+ "KG" => array("Kyrgyzstan"),
190
+ "LA" => array("Lao People's Democratic Republic"),
191
+ "LV" => array("Latvia"),
192
+ "LB" => array("Lebanon"),
193
+ "LS" => array("Lesotho"),
194
+ "LR" => array("Liberia"),
195
+ "LY" => array("Libyan Arab Jamahiriya"),
196
+ "LI" => array("Liechtenstein"),
197
+ "LT" => array("Lithuania"),
198
+ "LU" => array("Luxembourg"),
199
+ "MO" => array("Macao"),
200
+ "MK" => array("Macedonia, The Former Yugoslav Republic of"),
201
+ "MG" => array("Madagascar"),
202
+ "MW" => array("Malawi"),
203
+ "MY" => array("Malaysia"),
204
+ "MV" => array("Maldives"),
205
+ "ML" => array("Mali"),
206
+ "MT" => array("Malta"),
207
+ "MH" => array("Marshall Islands"),
208
+ "MQ" => array("Martinique"),
209
+ "MR" => array("Mauritania"),
210
+ "MU" => array("Mauritius"),
211
+ "YT" => array("Mayotte"),
212
+ "MX" => array("Mexico"),
213
+ "FM" => array("Micronesia, Federated States of"),
214
+ "MD" => array("Moldova, Republic of"),
215
+ "MC" => array("Monaco"),
216
+ "MN" => array("Mongolia"),
217
+ "ME" => array("Montenegro"),
218
+ "MS" => array("Montserrat"),
219
+ "MA" => array("Morocco"),
220
+ "MZ" => array("Mozambique"),
221
+ "MM" => array("Myanmar"),
222
+ "NA" => array("Namibia"),
223
+ "NR" => array("Nauru"),
224
+ "NP" => array("Nepal"),
225
+ "NL" => array("Netherlands"),
226
+ "AN" => array("Netherlands Antilles"),
227
+ "NC" => array("New Caledonia"),
228
+ "NZ" => array("New Zealand"),
229
+ "NI" => array("Nicaragua"),
230
+ "NE" => array("Niger"),
231
+ "NG" => array("Nigeria"),
232
+ "NU" => array("Niue"),
233
+ "NF" => array("Norfolk Island"),
234
+ "MP" => array("Northern Mariana Islands"),
235
+ "NO" => array("Norway"),
236
+ "OM" => array("Oman"),
237
+ "PK" => array("Pakistan"),
238
+ "PW" => array("Palau"),
239
+ "PS" => array("Palestinian Territory, Occupied"),
240
+ "PA" => array("Panama"),
241
+ "PG" => array("Papua New Guinea"),
242
+ "PY" => array("Paraguay"),
243
+ "PE" => array("Peru"),
244
+ "PH" => array("Philippines"),
245
+ "PN" => array("Pitcairn"),
246
+ "PL" => array("Poland"),
247
+ "PT" => array("Portugal"),
248
+ "PR" => array("Puerto Rico"),
249
+ "QA" => array("Qatar"),
250
+ "RE" => array("Reunion"),
251
+ "RO" => array("Romania"),
252
+ "RU" => array("Russian Federation"),
253
+ "RW" => array("Rwanda"),
254
+ "SH" => array("Saint Helena"),
255
+ "KN" => array("Saint Kitts and Nevis"),
256
+ "LC" => array("Saint Lucia"),
257
+ "PM" => array("Saint Pierre and Miquelon"),
258
+ "VC" => array("Saint Vincent and The Grenadines"),
259
+ "WS" => array("Samoa"),
260
+ "SM" => array("San Marino"),
261
+ "ST" => array("Sao Tome and Principe"),
262
+ "SA" => array("Saudi Arabia"),
263
+ "SN" => array("Senegal"),
264
+ "RS" => array("Serbia"),
265
+ "SC" => array("Seychelles"),
266
+ "SL" => array("Sierra Leone"),
267
+ "SG" => array("Singapore"),
268
+ "SK" => array("Slovakia"),
269
+ "SI" => array("Slovenia"),
270
+ "SB" => array("Solomon Islands"),
271
+ "SO" => array("Somalia"),
272
+ "ZA" => array("South Africa"),
273
+ "GS" => array("South Georgia and The South Sandwich Islands"),
274
+ "ES" => array("Spain"),
275
+ "LK" => array("Sri Lanka"),
276
+ "SD" => array("Sudan"),
277
+ "SR" => array("Suriname"),
278
+ "SJ" => array("Svalbard and Jan Mayen"),
279
+ "SZ" => array("Swaziland"),
280
+ "SE" => array("Sweden"),
281
+ "CH" => array("Switzerland"),
282
+ "SY" => array("Syrian Arab Republic"),
283
+ "TW" => array("Taiwan, Province of China"),
284
+ "TJ" => array("Tajikistan"),
285
+ "TZ" => array("Tanzania, United Republic of"),
286
+ "TH" => array("Thailand"),
287
+ "TL" => array("Timor-leste"),
288
+ "TG" => array("Togo"),
289
+ "TK" => array("Tokelau"),
290
+ "TO" => array("Tonga"),
291
+ "TT" => array("Trinidad and Tobago"),
292
+ "TN" => array("Tunisia"),
293
+ "TR" => array("Turkey"),
294
+ "TM" => array("Turkmenistan"),
295
+ "TC" => array("Turks and Caicos Islands"),
296
+ "TV" => array("Tuvalu"),
297
+ "UG" => array("Uganda"),
298
+ "UA" => array("Ukraine"),
299
+ "AE" => array("United Arab Emirates"),
300
+ "GB" => array("United Kingdom"),
301
+ "US" => array("United States"),
302
+ "UM" => array("United States Minor Outlying Islands"),
303
+ "UY" => array("Uruguay"),
304
+ "UZ" => array("Uzbekistan"),
305
+ "VU" => array("Vanuatu"),
306
+ "VE" => array("Venezuela"),
307
+ "VN" => array("Viet Nam"),
308
+ "VG" => array("Virgin Islands, British"),
309
+ "VI" => array("Virgin Islands, U.S."),
310
+ "WF" => array("Wallis and Futuna"),
311
+ "EH" => array("Western Sahara"),
312
+ "YE" => array("Yemen"),
313
+ "ZM" => array("Zambia"),
314
+ "ZW" => array("Zimbabwe"),
315
+ "ZZ" => array("Multi-Sourced"),
316
+ )
317
+ ),
318
+
319
+ ));
320
+ */
321
+ $installer->addAttribute('catalog_product', 'country_restrictions', array(
322
+ 'group' => 'Borderfree',
323
+ 'sort_order' => 33,
324
+ 'type' => 'varchar',
325
+ 'backend' => 'eav/entity_attribute_backend_array',
326
+ 'frontend' => '',
327
+ 'label' => 'Country Restrictions',
328
+ 'note' => '',
329
+ 'input' => 'multiselect',
330
+ 'class' => '',
331
+ 'source' => '',
332
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
333
+ 'visible' => true,
334
+ 'required' => false,
335
+ 'user_defined' => true,
336
+ 'default' => '',
337
+ 'visible_on_front' => false,
338
+ 'unique' => false,
339
+ 'is_configurable' => false,
340
+ 'used_for_promo_rules' => false,
341
+ 'apply_to' => '',
342
+ 'searchable' => false,
343
+ 'filterable' => 0,
344
+ 'comparable' => false,
345
+ 'visible_in_advanced_search' => true,
346
+ 'used_for_price_rules' => false,
347
+ 'filterable_in_search' => false,
348
+ 'option' => array (
349
+ 'value' => array(
350
+ "ALL" => array("All"),
351
+ "AF" => array("Afghanistan"),
352
+ "AX" => array("Ã…land Islands"),
353
+ "AL" => array("Albania"),
354
+ "DZ" => array("Algeria"),
355
+ "AS" => array("American Samoa"),
356
+ "AD" => array("Andorra"),
357
+ "AO" => array("Angola"),
358
+ "AI" => array("Anguilla"),
359
+ "AQ" => array("Antarctica"),
360
+ "AG" => array("Antigua and Barbuda"),
361
+ "AR" => array("Argentina"),
362
+ "AM" => array("Armenia"),
363
+ "AW" => array("Aruba"),
364
+ "AU" => array("Australia"),
365
+ "AT" => array("Austria"),
366
+ "AZ" => array("Azerbaijan"),
367
+ "BS" => array("Bahamas"),
368
+ "BH" => array("Bahrain"),
369
+ "BD" => array("Bangladesh"),
370
+ "BB" => array("Barbados"),
371
+ "BY" => array("Belarus"),
372
+ "BE" => array("Belgium"),
373
+ "BZ" => array("Belize"),
374
+ "BJ" => array("Benin"),
375
+ "BM" => array("Bermuda"),
376
+ "BT" => array("Bhutan"),
377
+ "BO" => array("Bolivia"),
378
+ "BA" => array("Bosnia and Herzegovina"),
379
+ "BW" => array("Botswana"),
380
+ "BV" => array("Bouvet Island"),
381
+ "BR" => array("Brazil"),
382
+ "IO" => array("British Indian Ocean Territory"),
383
+ "BN" => array("Brunei Darussalam"),
384
+ "BG" => array("Bulgaria"),
385
+ "BF" => array("Burkina Faso"),
386
+ "BI" => array("Burundi"),
387
+ "KH" => array("Cambodia"),
388
+ "CM" => array("Cameroon"),
389
+ "CA" => array("Canada"),
390
+ "CV" => array("Cape Verde"),
391
+ "KY" => array("Cayman Islands"),
392
+ "CF" => array("Central African Republic"),
393
+ "TD" => array("Chad"),
394
+ "CL" => array("Chile"),
395
+ "CN" => array("China"),
396
+ "CX" => array("Christmas Island"),
397
+ "CC" => array("Cocos (Keeling) Islands"),
398
+ "CO" => array("Colombia"),
399
+ "KM" => array("Comoros"),
400
+ "CG" => array("Congo"),
401
+ "CD" => array("Congo, The Democratic Republic of The"),
402
+ "CK" => array("Cook Islands"),
403
+ "CR" => array("Costa Rica"),
404
+ "CI" => array("Cote D'ivoire"),
405
+ "HR" => array("Croatia"),
406
+ "CU" => array("Cuba"),
407
+ "CY" => array("Cyprus"),
408
+ "CZ" => array("Czech Republic"),
409
+ "DK" => array("Denmark"),
410
+ "DJ" => array("Djibouti"),
411
+ "DM" => array("Dominica"),
412
+ "DO" => array("Dominican Republic"),
413
+ "EC" => array("Ecuador"),
414
+ "EG" => array("Egypt"),
415
+ "SV" => array("El Salvador"),
416
+ "GQ" => array("Equatorial Guinea"),
417
+ "ER" => array("Eritrea"),
418
+ "EE" => array("Estonia"),
419
+ "ET" => array("Ethiopia"),
420
+ "FK" => array("Falkland Islands (Malvinas)"),
421
+ "FO" => array("Faroe Islands"),
422
+ "FJ" => array("Fiji"),
423
+ "FI" => array("Finland"),
424
+ "FR" => array("France"),
425
+ "GF" => array("French Guiana"),
426
+ "PF" => array("French Polynesia"),
427
+ "TF" => array("French Southern Territories"),
428
+ "GA" => array("Gabon"),
429
+ "GM" => array("Gambia"),
430
+ "GE" => array("Georgia"),
431
+ "DE" => array("Germany"),
432
+ "GH" => array("Ghana"),
433
+ "GI" => array("Gibraltar"),
434
+ "GR" => array("Greece"),
435
+ "GL" => array("Greenland"),
436
+ "GD" => array("Grenada"),
437
+ "GP" => array("Guadeloupe"),
438
+ "GU" => array("Guam"),
439
+ "GT" => array("Guatemala"),
440
+ "GG" => array("Guernsey"),
441
+ "GN" => array("Guinea"),
442
+ "GW" => array("Guinea-bissau"),
443
+ "GY" => array("Guyana"),
444
+ "HT" => array("Haiti"),
445
+ "HM" => array("Heard Island and Mcdonald Islands"),
446
+ "VA" => array("Holy See (Vatican City State)"),
447
+ "HN" => array("Honduras"),
448
+ "HK" => array("Hong Kong"),
449
+ "HU" => array("Hungary"),
450
+ "IS" => array("Iceland"),
451
+ "IN" => array("India"),
452
+ "ID" => array("Indonesia"),
453
+ "IR" => array("Iran, Islamic Republic of"),
454
+ "IQ" => array("Iraq"),
455
+ "IE" => array("Ireland"),
456
+ "IM" => array("Isle of Man"),
457
+ "IL" => array("Israel"),
458
+ "IT" => array("Italy"),
459
+ "JM" => array("Jamaica"),
460
+ "JP" => array("Japan"),
461
+ "JE" => array("Jersey"),
462
+ "JO" => array("Jordan"),
463
+ "KZ" => array("Kazakhstan"),
464
+ "KE" => array("Kenya"),
465
+ "KI" => array("Kiribati"),
466
+ "KP" => array("Korea, Democratic People's Republic of"),
467
+ "KR" => array("Korea, Republic of"),
468
+ "KW" => array("Kuwait"),
469
+ "KG" => array("Kyrgyzstan"),
470
+ "LA" => array("Lao People's Democratic Republic"),
471
+ "LV" => array("Latvia"),
472
+ "LB" => array("Lebanon"),
473
+ "LS" => array("Lesotho"),
474
+ "LR" => array("Liberia"),
475
+ "LY" => array("Libyan Arab Jamahiriya"),
476
+ "LI" => array("Liechtenstein"),
477
+ "LT" => array("Lithuania"),
478
+ "LU" => array("Luxembourg"),
479
+ "MO" => array("Macao"),
480
+ "MK" => array("Macedonia, The Former Yugoslav Republic of"),
481
+ "MG" => array("Madagascar"),
482
+ "MW" => array("Malawi"),
483
+ "MY" => array("Malaysia"),
484
+ "MV" => array("Maldives"),
485
+ "ML" => array("Mali"),
486
+ "MT" => array("Malta"),
487
+ "MH" => array("Marshall Islands"),
488
+ "MQ" => array("Martinique"),
489
+ "MR" => array("Mauritania"),
490
+ "MU" => array("Mauritius"),
491
+ "YT" => array("Mayotte"),
492
+ "MX" => array("Mexico"),
493
+ "FM" => array("Micronesia, Federated States of"),
494
+ "MD" => array("Moldova, Republic of"),
495
+ "MC" => array("Monaco"),
496
+ "MN" => array("Mongolia"),
497
+ "ME" => array("Montenegro"),
498
+ "MS" => array("Montserrat"),
499
+ "MA" => array("Morocco"),
500
+ "MZ" => array("Mozambique"),
501
+ "MM" => array("Myanmar"),
502
+ "NA" => array("Namibia"),
503
+ "NR" => array("Nauru"),
504
+ "NP" => array("Nepal"),
505
+ "NL" => array("Netherlands"),
506
+ "AN" => array("Netherlands Antilles"),
507
+ "NC" => array("New Caledonia"),
508
+ "NZ" => array("New Zealand"),
509
+ "NI" => array("Nicaragua"),
510
+ "NE" => array("Niger"),
511
+ "NG" => array("Nigeria"),
512
+ "NU" => array("Niue"),
513
+ "NF" => array("Norfolk Island"),
514
+ "MP" => array("Northern Mariana Islands"),
515
+ "NO" => array("Norway"),
516
+ "OM" => array("Oman"),
517
+ "PK" => array("Pakistan"),
518
+ "PW" => array("Palau"),
519
+ "PS" => array("Palestinian Territory, Occupied"),
520
+ "PA" => array("Panama"),
521
+ "PG" => array("Papua New Guinea"),
522
+ "PY" => array("Paraguay"),
523
+ "PE" => array("Peru"),
524
+ "PH" => array("Philippines"),
525
+ "PN" => array("Pitcairn"),
526
+ "PL" => array("Poland"),
527
+ "PT" => array("Portugal"),
528
+ "PR" => array("Puerto Rico"),
529
+ "QA" => array("Qatar"),
530
+ "RE" => array("Reunion"),
531
+ "RO" => array("Romania"),
532
+ "RU" => array("Russian Federation"),
533
+ "RW" => array("Rwanda"),
534
+ "SH" => array("Saint Helena"),
535
+ "KN" => array("Saint Kitts and Nevis"),
536
+ "LC" => array("Saint Lucia"),
537
+ "PM" => array("Saint Pierre and Miquelon"),
538
+ "VC" => array("Saint Vincent and The Grenadines"),
539
+ "WS" => array("Samoa"),
540
+ "SM" => array("San Marino"),
541
+ "ST" => array("Sao Tome and Principe"),
542
+ "SA" => array("Saudi Arabia"),
543
+ "SN" => array("Senegal"),
544
+ "RS" => array("Serbia"),
545
+ "SC" => array("Seychelles"),
546
+ "SL" => array("Sierra Leone"),
547
+ "SG" => array("Singapore"),
548
+ "SK" => array("Slovakia"),
549
+ "SI" => array("Slovenia"),
550
+ "SB" => array("Solomon Islands"),
551
+ "SO" => array("Somalia"),
552
+ "ZA" => array("South Africa"),
553
+ "GS" => array("South Georgia and The South Sandwich Islands"),
554
+ "ES" => array("Spain"),
555
+ "LK" => array("Sri Lanka"),
556
+ "SD" => array("Sudan"),
557
+ "SR" => array("Suriname"),
558
+ "SJ" => array("Svalbard and Jan Mayen"),
559
+ "SZ" => array("Swaziland"),
560
+ "SE" => array("Sweden"),
561
+ "CH" => array("Switzerland"),
562
+ "SY" => array("Syrian Arab Republic"),
563
+ "TW" => array("Taiwan, Province of China"),
564
+ "TJ" => array("Tajikistan"),
565
+ "TZ" => array("Tanzania, United Republic of"),
566
+ "TH" => array("Thailand"),
567
+ "TL" => array("Timor-leste"),
568
+ "TG" => array("Togo"),
569
+ "TK" => array("Tokelau"),
570
+ "TO" => array("Tonga"),
571
+ "TT" => array("Trinidad and Tobago"),
572
+ "TN" => array("Tunisia"),
573
+ "TR" => array("Turkey"),
574
+ "TM" => array("Turkmenistan"),
575
+ "TC" => array("Turks and Caicos Islands"),
576
+ "TV" => array("Tuvalu"),
577
+ "UG" => array("Uganda"),
578
+ "UA" => array("Ukraine"),
579
+ "AE" => array("United Arab Emirates"),
580
+ "GB" => array("United Kingdom"),
581
+ "US" => array("United States"),
582
+ "UM" => array("United States Minor Outlying Islands"),
583
+ "UY" => array("Uruguay"),
584
+ "UZ" => array("Uzbekistan"),
585
+ "VU" => array("Vanuatu"),
586
+ "VE" => array("Venezuela"),
587
+ "VN" => array("Viet Nam"),
588
+ "VG" => array("Virgin Islands, British"),
589
+ "VI" => array("Virgin Islands, U.S."),
590
+ "WF" => array("Wallis and Futuna"),
591
+ "EH" => array("Western Sahara"),
592
+ "YE" => array("Yemen"),
593
+ "ZM" => array("Zambia"),
594
+ "ZW" => array("Zimbabwe"),
595
+ )
596
+ ),
597
+
598
+ ));
599
+
600
+ $entityTypeId = $installer->getEntityTypeId('catalog_category');
601
+ $installer->addAttributeSet($entityTypeId, "Borderfree", $sortOrder = null);
602
+ $attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
603
+ $installer->addAttributeGroup($entityTypeId, $attributeSetId, "Borderfree", 3);
604
+ $attributeGroupId = $installer->getAttributeGroupId($entityTypeId, $attributeSetId, "Borderfree");
605
+
606
+ $installer->addAttribute('catalog_category', 'category_country_restrictions', array(
607
+ 'type' => 'varchar',
608
+ 'label' => 'Country Restrictions',
609
+ 'input' => 'multiselect',
610
+ 'backend' => 'eav/entity_attribute_backend_array',
611
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
612
+ 'visible' => true,
613
+ 'required' => false,
614
+ 'user_defined' => true,
615
+ 'default' => "",
616
+ 'note' => '',
617
+ 'option' => array (
618
+ 'value' => array(
619
+ "ALL" => array("All"),
620
+ "AF" => array("Afghanistan"),
621
+ "AX" => array("Ã…land Islands"),
622
+ "AL" => array("Albania"),
623
+ "DZ" => array("Algeria"),
624
+ "AS" => array("American Samoa"),
625
+ "AD" => array("Andorra"),
626
+ "AO" => array("Angola"),
627
+ "AI" => array("Anguilla"),
628
+ "AQ" => array("Antarctica"),
629
+ "AG" => array("Antigua and Barbuda"),
630
+ "AR" => array("Argentina"),
631
+ "AM" => array("Armenia"),
632
+ "AW" => array("Aruba"),
633
+ "AU" => array("Australia"),
634
+ "AT" => array("Austria"),
635
+ "AZ" => array("Azerbaijan"),
636
+ "BS" => array("Bahamas"),
637
+ "BH" => array("Bahrain"),
638
+ "BD" => array("Bangladesh"),
639
+ "BB" => array("Barbados"),
640
+ "BY" => array("Belarus"),
641
+ "BE" => array("Belgium"),
642
+ "BZ" => array("Belize"),
643
+ "BJ" => array("Benin"),
644
+ "BM" => array("Bermuda"),
645
+ "BT" => array("Bhutan"),
646
+ "BO" => array("Bolivia"),
647
+ "BA" => array("Bosnia and Herzegovina"),
648
+ "BW" => array("Botswana"),
649
+ "BV" => array("Bouvet Island"),
650
+ "BR" => array("Brazil"),
651
+ "IO" => array("British Indian Ocean Territory"),
652
+ "BN" => array("Brunei Darussalam"),
653
+ "BG" => array("Bulgaria"),
654
+ "BF" => array("Burkina Faso"),
655
+ "BI" => array("Burundi"),
656
+ "KH" => array("Cambodia"),
657
+ "CM" => array("Cameroon"),
658
+ "CA" => array("Canada"),
659
+ "CV" => array("Cape Verde"),
660
+ "KY" => array("Cayman Islands"),
661
+ "CF" => array("Central African Republic"),
662
+ "TD" => array("Chad"),
663
+ "CL" => array("Chile"),
664
+ "CN" => array("China"),
665
+ "CX" => array("Christmas Island"),
666
+ "CC" => array("Cocos (Keeling) Islands"),
667
+ "CO" => array("Colombia"),
668
+ "KM" => array("Comoros"),
669
+ "CG" => array("Congo"),
670
+ "CD" => array("Congo, The Democratic Republic of The"),
671
+ "CK" => array("Cook Islands"),
672
+ "CR" => array("Costa Rica"),
673
+ "CI" => array("Cote D'ivoire"),
674
+ "HR" => array("Croatia"),
675
+ "CU" => array("Cuba"),
676
+ "CY" => array("Cyprus"),
677
+ "CZ" => array("Czech Republic"),
678
+ "DK" => array("Denmark"),
679
+ "DJ" => array("Djibouti"),
680
+ "DM" => array("Dominica"),
681
+ "DO" => array("Dominican Republic"),
682
+ "EC" => array("Ecuador"),
683
+ "EG" => array("Egypt"),
684
+ "SV" => array("El Salvador"),
685
+ "GQ" => array("Equatorial Guinea"),
686
+ "ER" => array("Eritrea"),
687
+ "EE" => array("Estonia"),
688
+ "ET" => array("Ethiopia"),
689
+ "FK" => array("Falkland Islands (Malvinas)"),
690
+ "FO" => array("Faroe Islands"),
691
+ "FJ" => array("Fiji"),
692
+ "FI" => array("Finland"),
693
+ "FR" => array("France"),
694
+ "GF" => array("French Guiana"),
695
+ "PF" => array("French Polynesia"),
696
+ "TF" => array("French Southern Territories"),
697
+ "GA" => array("Gabon"),
698
+ "GM" => array("Gambia"),
699
+ "GE" => array("Georgia"),
700
+ "DE" => array("Germany"),
701
+ "GH" => array("Ghana"),
702
+ "GI" => array("Gibraltar"),
703
+ "GR" => array("Greece"),
704
+ "GL" => array("Greenland"),
705
+ "GD" => array("Grenada"),
706
+ "GP" => array("Guadeloupe"),
707
+ "GU" => array("Guam"),
708
+ "GT" => array("Guatemala"),
709
+ "GG" => array("Guernsey"),
710
+ "GN" => array("Guinea"),
711
+ "GW" => array("Guinea-bissau"),
712
+ "GY" => array("Guyana"),
713
+ "HT" => array("Haiti"),
714
+ "HM" => array("Heard Island and Mcdonald Islands"),
715
+ "VA" => array("Holy See (Vatican City State)"),
716
+ "HN" => array("Honduras"),
717
+ "HK" => array("Hong Kong"),
718
+ "HU" => array("Hungary"),
719
+ "IS" => array("Iceland"),
720
+ "IN" => array("India"),
721
+ "ID" => array("Indonesia"),
722
+ "IR" => array("Iran, Islamic Republic of"),
723
+ "IQ" => array("Iraq"),
724
+ "IE" => array("Ireland"),
725
+ "IM" => array("Isle of Man"),
726
+ "IL" => array("Israel"),
727
+ "IT" => array("Italy"),
728
+ "JM" => array("Jamaica"),
729
+ "JP" => array("Japan"),
730
+ "JE" => array("Jersey"),
731
+ "JO" => array("Jordan"),
732
+ "KZ" => array("Kazakhstan"),
733
+ "KE" => array("Kenya"),
734
+ "KI" => array("Kiribati"),
735
+ "KP" => array("Korea, Democratic People's Republic of"),
736
+ "KR" => array("Korea, Republic of"),
737
+ "KW" => array("Kuwait"),
738
+ "KG" => array("Kyrgyzstan"),
739
+ "LA" => array("Lao People's Democratic Republic"),
740
+ "LV" => array("Latvia"),
741
+ "LB" => array("Lebanon"),
742
+ "LS" => array("Lesotho"),
743
+ "LR" => array("Liberia"),
744
+ "LY" => array("Libyan Arab Jamahiriya"),
745
+ "LI" => array("Liechtenstein"),
746
+ "LT" => array("Lithuania"),
747
+ "LU" => array("Luxembourg"),
748
+ "MO" => array("Macao"),
749
+ "MK" => array("Macedonia, The Former Yugoslav Republic of"),
750
+ "MG" => array("Madagascar"),
751
+ "MW" => array("Malawi"),
752
+ "MY" => array("Malaysia"),
753
+ "MV" => array("Maldives"),
754
+ "ML" => array("Mali"),
755
+ "MT" => array("Malta"),
756
+ "MH" => array("Marshall Islands"),
757
+ "MQ" => array("Martinique"),
758
+ "MR" => array("Mauritania"),
759
+ "MU" => array("Mauritius"),
760
+ "YT" => array("Mayotte"),
761
+ "MX" => array("Mexico"),
762
+ "FM" => array("Micronesia, Federated States of"),
763
+ "MD" => array("Moldova, Republic of"),
764
+ "MC" => array("Monaco"),
765
+ "MN" => array("Mongolia"),
766
+ "ME" => array("Montenegro"),
767
+ "MS" => array("Montserrat"),
768
+ "MA" => array("Morocco"),
769
+ "MZ" => array("Mozambique"),
770
+ "MM" => array("Myanmar"),
771
+ "NA" => array("Namibia"),
772
+ "NR" => array("Nauru"),
773
+ "NP" => array("Nepal"),
774
+ "NL" => array("Netherlands"),
775
+ "AN" => array("Netherlands Antilles"),
776
+ "NC" => array("New Caledonia"),
777
+ "NZ" => array("New Zealand"),
778
+ "NI" => array("Nicaragua"),
779
+ "NE" => array("Niger"),
780
+ "NG" => array("Nigeria"),
781
+ "NU" => array("Niue"),
782
+ "NF" => array("Norfolk Island"),
783
+ "MP" => array("Northern Mariana Islands"),
784
+ "NO" => array("Norway"),
785
+ "OM" => array("Oman"),
786
+ "PK" => array("Pakistan"),
787
+ "PW" => array("Palau"),
788
+ "PS" => array("Palestinian Territory, Occupied"),
789
+ "PA" => array("Panama"),
790
+ "PG" => array("Papua New Guinea"),
791
+ "PY" => array("Paraguay"),
792
+ "PE" => array("Peru"),
793
+ "PH" => array("Philippines"),
794
+ "PN" => array("Pitcairn"),
795
+ "PL" => array("Poland"),
796
+ "PT" => array("Portugal"),
797
+ "PR" => array("Puerto Rico"),
798
+ "QA" => array("Qatar"),
799
+ "RE" => array("Reunion"),
800
+ "RO" => array("Romania"),
801
+ "RU" => array("Russian Federation"),
802
+ "RW" => array("Rwanda"),
803
+ "SH" => array("Saint Helena"),
804
+ "KN" => array("Saint Kitts and Nevis"),
805
+ "LC" => array("Saint Lucia"),
806
+ "PM" => array("Saint Pierre and Miquelon"),
807
+ "VC" => array("Saint Vincent and The Grenadines"),
808
+ "WS" => array("Samoa"),
809
+ "SM" => array("San Marino"),
810
+ "ST" => array("Sao Tome and Principe"),
811
+ "SA" => array("Saudi Arabia"),
812
+ "SN" => array("Senegal"),
813
+ "RS" => array("Serbia"),
814
+ "SC" => array("Seychelles"),
815
+ "SL" => array("Sierra Leone"),
816
+ "SG" => array("Singapore"),
817
+ "SK" => array("Slovakia"),
818
+ "SI" => array("Slovenia"),
819
+ "SB" => array("Solomon Islands"),
820
+ "SO" => array("Somalia"),
821
+ "ZA" => array("South Africa"),
822
+ "GS" => array("South Georgia and The South Sandwich Islands"),
823
+ "ES" => array("Spain"),
824
+ "LK" => array("Sri Lanka"),
825
+ "SD" => array("Sudan"),
826
+ "SR" => array("Suriname"),
827
+ "SJ" => array("Svalbard and Jan Mayen"),
828
+ "SZ" => array("Swaziland"),
829
+ "SE" => array("Sweden"),
830
+ "CH" => array("Switzerland"),
831
+ "SY" => array("Syrian Arab Republic"),
832
+ "TW" => array("Taiwan, Province of China"),
833
+ "TJ" => array("Tajikistan"),
834
+ "TZ" => array("Tanzania, United Republic of"),
835
+ "TH" => array("Thailand"),
836
+ "TL" => array("Timor-leste"),
837
+ "TG" => array("Togo"),
838
+ "TK" => array("Tokelau"),
839
+ "TO" => array("Tonga"),
840
+ "TT" => array("Trinidad and Tobago"),
841
+ "TN" => array("Tunisia"),
842
+ "TR" => array("Turkey"),
843
+ "TM" => array("Turkmenistan"),
844
+ "TC" => array("Turks and Caicos Islands"),
845
+ "TV" => array("Tuvalu"),
846
+ "UG" => array("Uganda"),
847
+ "UA" => array("Ukraine"),
848
+ "AE" => array("United Arab Emirates"),
849
+ "GB" => array("United Kingdom"),
850
+ "US" => array("United States"),
851
+ "UM" => array("United States Minor Outlying Islands"),
852
+ "UY" => array("Uruguay"),
853
+ "UZ" => array("Uzbekistan"),
854
+ "VU" => array("Vanuatu"),
855
+ "VE" => array("Venezuela"),
856
+ "VN" => array("Viet Nam"),
857
+ "VG" => array("Virgin Islands, British"),
858
+ "VI" => array("Virgin Islands, U.S."),
859
+ "WF" => array("Wallis and Futuna"),
860
+ "EH" => array("Western Sahara"),
861
+ "YE" => array("Yemen"),
862
+ "ZM" => array("Zambia"),
863
+ "ZW" => array("Zimbabwe"),
864
+ )
865
+ )
866
+
867
+ ));
868
+
869
+ $installer->addAttributeToGroup(
870
+ $entityTypeId,
871
+ $attributeSetId,
872
+ $attributeGroupId,
873
+ 'category_country_restrictions',
874
+ '1'
875
+ );
876
+
877
+
878
+ $installer->endSetup();
879
+ ?>
app/code/local/Borderfree/Checkout/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Checkout_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
6
+ ?>
app/code/local/Borderfree/Checkout/Model/Shipping.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Checkout
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * Overrides Mage_Sales_Model_Quote_Address_Total_Shipping so shipping is not recalculated after Domestic Leg Shipping is computed
15
+ *
16
+ * @category Borderfree
17
+ * @package Borderfree_Checkout
18
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
19
+ * @see Mage_Sales_Model_Quote_Address_Total_Shipping
20
+ */
21
+ class Borderfree_Checkout_Model_Shipping extends Mage_Sales_Model_Quote_Address_Total_Shipping
22
+ {
23
+ /**
24
+ * Collect totals information about shipping. If shipping internationally do not recalculate shipping charges.
25
+ * Shipping charges are set by Borderfree_Checkout_EnvoyController::checkoutAction
26
+ *
27
+ * @param Mage_Sales_Model_Quote_Address $address
28
+ * @return Mage_Sales_Model_Quote_Address_Total_Shipping
29
+ * @see Mage_Sales_Model_Quote_Address_Total_Shipping::collect
30
+ * @see Borderfree_Checkout_EnvoyController::checkoutAction
31
+ */
32
+ public function collect(Mage_Sales_Model_Quote_Address $address)
33
+ {
34
+ if(!$address->getBorderfree())
35
+ parent::collect($address);
36
+ else
37
+ {
38
+ $this->_setAmount($address->getShippingAmount());
39
+ $this->_setBaseAmount($address->getBaseShippingAmount());
40
+ }
41
+
42
+ return $this;
43
+ }
44
+
45
+ }
app/code/local/Borderfree/Checkout/controllers/EnvoyController.php ADDED
@@ -0,0 +1,463 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Checkout_EnvoyController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $shippingCountry = Mage::getSingleton('customer/session')->getShippingCountry();
7
+ if($shippingCountry == "US")
8
+ {
9
+ $this->_redirect("checkout/onepage/index");
10
+ return;
11
+ }
12
+
13
+ $quote = Mage::getModel('checkout/cart')->getQuote();
14
+
15
+ if (!$quote->hasItems() || $quote->getHasError())
16
+ {
17
+ $this->_redirect('checkout/cart');
18
+ return;
19
+ }
20
+
21
+ if (!$quote->validateMinimumAmount())
22
+ {
23
+ $error = Mage::getStoreConfig('sales/minimum_order/error_message') ?
24
+ Mage::getStoreConfig('sales/minimum_order/error_message') :
25
+ Mage::helper('checkout')->__('Subtotal must exceed minimum order amount');
26
+
27
+ Mage::getSingleton('checkout/session')->addError($error);
28
+ $this->_redirect('checkout/cart');
29
+ return;
30
+ }
31
+
32
+ $this->_redirect("borderfreecheckout/envoy/checkout");
33
+ }
34
+
35
+ public function checkoutAction()
36
+ {
37
+ $cart = Mage::getModel('checkout/cart')->getQuote();
38
+ $totalSalePrice = 0;
39
+ $totalProductExtraShipping = 0;
40
+ $totalProductExtraHandling = 0;
41
+
42
+ $request = Mage::getModel("borderfreeapi/webservice");
43
+ $request->startRequest("setCheckoutSessionRequest");
44
+
45
+ $request->startElement("domesticSession", array("merchantId" => Mage::getStoreConfig('borderfree_options/settings/merchantid')));
46
+ $request->startElement("domesticBasket");
47
+ $request->startElement("basketItems");
48
+ $orderDiscount = 0;
49
+
50
+ $state = Mage::getStoreConfig('borderfree_options/shipping/state');
51
+ $zip = Mage::getStoreConfig('borderfree_options/shipping/zip');
52
+ $method = Mage::getStoreConfig('borderfree_options/shipping/method');
53
+ $shippingAddress = $cart->getShippingAddress();
54
+ $regionModel = Mage::getModel('directory/region')->loadByCode($state, "US");
55
+ $regionId = $regionModel->getId();
56
+ $shippingAddress->setRegionCode($state)->setRegionId($regionId);
57
+ $shippingAddress->setPostcode($zip)->setCountryId("US");
58
+ $shippingAddress->setCollectShippingRates(true);
59
+ $shippingAddress->collectShippingRates();
60
+ $shippingAddress->setShippingMethod($method);
61
+ $shippingAddress->collectTotals();
62
+ $shippingAddress->save();
63
+ $cart->collectTotals();
64
+ $cart->save();
65
+
66
+ $addresses = $cart->getAllShippingAddresses();
67
+ if(isset($addresses[0]))
68
+ $orderDiscount = $addresses[0]->getBaseDiscountAmount() * -1;
69
+ else
70
+ return $this->_redirect("checkout/cart");
71
+
72
+ $loggedIn = Mage::helper('customer')->isLoggedIn();
73
+ if($loggedIn)
74
+ {
75
+ $customer = Mage::getSingleton("customer/session")->getCustomer();
76
+ $cart->setCustomer($customer);
77
+ $cart->save();
78
+ }
79
+
80
+
81
+ foreach ($cart->getAllVisibleItems() as $item)
82
+ {
83
+
84
+ $product = Mage::getModel("catalog/product")->load($item->getProduct()->getId());
85
+ $extraShipping = $product->getExtraShiping();
86
+ if(empty($extraShipping))
87
+ $extraShipping = 0;
88
+
89
+ $basePrice = $item->getBaseCalculationPrice();
90
+ $qty = $item->getQty();
91
+
92
+ $customOptions = "";
93
+ $extraAttributes = "";
94
+ $color = "";
95
+ $color_label = "";
96
+ $size = "";
97
+ $size_label = "";
98
+
99
+ if($item->getProductType() == "configurable" || $item->getProductType() == "simple" || $item->getProductType() == "bundle")
100
+ {
101
+ $productOptions = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());
102
+ if(isset($productOptions["options"]))
103
+ {
104
+ $customOptions = serialize($productOptions["options"]);
105
+ foreach($productOptions["options"] as $option)
106
+ {
107
+ if($extraAttributes != "")
108
+ $extraAttributes .= ", ";
109
+
110
+ $extraAttributes .= $option["label"] . ": " . $option["print_value"];
111
+ }
112
+ }
113
+ }
114
+
115
+ if($item->getProductType() == "configurable")
116
+ {
117
+ $attributes = $item->getProduct()->getTypeInstance(true)
118
+ ->getSelectedAttributesInfo($item->getProduct());
119
+
120
+ $attributesArray = $item->getProduct()->getTypeInstance(true)
121
+ ->getConfigurableAttributesAsArray($item->getProduct());
122
+
123
+ foreach($attributesArray as $attribute)
124
+ {
125
+ if($attribute["attribute_code"] == "color")
126
+ $color_label = $attribute["store_label"];
127
+ elseif($attribute["attribute_code"] == "size")
128
+ $size_label = $attribute["store_label"];
129
+ }
130
+
131
+ foreach($attributes as $attribute)
132
+ {
133
+ if($attribute["label"] == $color_label)
134
+ $color = $attribute["value"];
135
+ elseif($attribute["label"] == $size_label)
136
+ $size = $attribute["value"];
137
+ else
138
+ { if($extraAttributes != "")
139
+ $extraAttributes .= ", ";
140
+
141
+ $extraAttributes .= $attribute["label"] . ": " . $attribute["value"];
142
+ }
143
+ }
144
+
145
+ $item = $item->getOptionByCode('simple_product');
146
+ $product = Mage::getModel("catalog/product")->load($item->getProduct()->getId());
147
+
148
+ $es = $product->getExtraShipping();
149
+ if(!empty($es))
150
+ $extraShipping = $es;
151
+ }
152
+
153
+ $request->startElement("basketItem", array("sku" => $item->getProduct()->getSku()));
154
+ $request->writeElement("quantity", $qty);
155
+ $request->startElement("pricing");
156
+
157
+ $listPrice = $item->getProduct()->getPrice();
158
+ $extraHandling = 0;
159
+ $discount = $item->getProduct()->getPrice() - $basePrice;
160
+ if($discount < 0)
161
+ {
162
+ $extraHandling = $discount * -1;
163
+ $discount = 0;
164
+ }
165
+ $salePrice = $listPrice - $discount;
166
+
167
+ $totalSalePrice += ($salePrice * $qty);
168
+ $totalProductExtraShipping += $extraShipping;
169
+ $totalProductExtraHandling += $extraHandling;
170
+
171
+ $request->writeElement("listPrice", round($listPrice, 2));
172
+ $request->writeElement("itemDiscount", round($discount ,2));
173
+ $request->writeElement("salePrice", round($salePrice, 2));
174
+ $request->writeElement("productExtraShipping", round($extraShipping, 2));
175
+ $request->writeElement("productExtraHandling", round($extraHandling, 2));
176
+ $request->endElement();
177
+ $request->startElement("display");
178
+ $request->writeElement("name", $product->getName(), true);
179
+ $request->writeElement("description", $product->getShortDescription(), true);
180
+ $request->writeElement("productUrl", $product->getProductUrl());
181
+ $request->writeElement("imageUrl", (string)Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(75));
182
+
183
+ if(!empty($color))
184
+ $request->writeElement("color", $color);
185
+ if(!empty($size))
186
+ $request->writeElement("size", $size);
187
+ if(!empty($extraAttributes))
188
+ $request->writeElement("attributes", $extraAttributes);
189
+ $request->writeElement("inventory", $product->isInStock() ? "In Stock" : "Out of Stock");
190
+ $request->endElement(); //display
191
+ $request->writeElement("customData", $customOptions);
192
+ $request->endElement(); //basketItem
193
+ }
194
+ $request->endElement();//basketItems
195
+ $request->startElement("basketTotal");
196
+ $request->writeElement("totalSalePrice" , round($totalSalePrice, 2));
197
+ $request->writeElement("orderDiscount", round($orderDiscount, 2));
198
+ $request->writeElement("totalProductExtraShipping", round($totalProductExtraShipping, 2));
199
+ $request->writeElement("totalProductExtraHandling", round($totalProductExtraHandling, 2));
200
+ $request->writeElement("totalPrice", round($totalSalePrice - $orderDiscount + $totalProductExtraShipping + $totalProductExtraHandling, 2));
201
+ $request->endElement();//basketTotal
202
+ $request->WriteElement("customData");
203
+ $request->endElement();//domesticBasket
204
+ $request->startElement("domesticShippingMethod");
205
+
206
+ $domesticShippingPrice = $cart->getShippingAddress()->getBaseShippingAmount();
207
+ if(empty($domesticShippingPrice))
208
+ $domesticShippingPrice = 0;
209
+
210
+ $domesticHandlingPrice = Mage::getStoreConfig('borderfree_options/shipping/handling');
211
+ if(empty($domesticHandlingPrice))
212
+ $domesticHandlingPrice = 0;
213
+
214
+ $extraInsurancePrice = Mage::getStoreConfig('borderfree_options/shipping/insurance');
215
+ if(empty($extraInsurancePrice))
216
+ $extraInsurancePrice = 0;
217
+
218
+ $deliveryPromiseMinimum = Mage::getStoreConfig('borderfree_options/shipping/min');
219
+ if(empty($deliveryPromiseMinimum))
220
+ $deliveryPromiseMinimum = 0;
221
+
222
+ $deliveryPromiseMaximum = Mage::getStoreConfig('borderfree_options/shipping/max');
223
+ if(empty($deliveryPromiseMaximum))
224
+ $deliveryPromiseMaximum = 0;
225
+
226
+ $request->writeElement("domesticShippingPrice", round($domesticShippingPrice, 2));
227
+ $request->writeElement("domesticHandlingPrice", round($domesticHandlingPrice, 2));
228
+ $request->writeElement("extraInsurancePrice", round($extraInsurancePrice, 2));
229
+ $request->writeElement("deliveryPromiseMinimum", round($deliveryPromiseMinimum, 2));
230
+ $request->writeElement("deliveryPromiseMaximum", round($deliveryPromiseMaximum, 2));
231
+
232
+ $totalShipping = $domesticShippingPrice + $domesticHandlingPrice + $extraInsurancePrice + $totalProductExtraShipping + $totalProductExtraHandling;
233
+ $amountPrice = $cart->getStore()->convertPrice($totalShipping, false);
234
+ $shippingAddress->setShippingAmount($amountPrice);
235
+ $shippingAddress->setBaseShippingAmount($totalShipping);
236
+ $shippingAddress->setBorderfree(true);
237
+ $cart->setTotalsCollectedFlag(false);
238
+ $cart->collectTotals()->save();
239
+ $shippingAddress->save();
240
+
241
+ $request->endElement();//domesticShippingMethod
242
+ $request->startElement("sessionDetails");
243
+ $request->writeElement("buyerSessionId", Mage::getSingleton("core/session")->getEncryptedSessionId());
244
+ $request->writeElement("buyerIpAddress", $_SERVER['REMOTE_ADDR']);
245
+ $request->startElement("checkoutUrls");
246
+ $request->writeElement("successUrl", Mage::getUrl("*/*/success" . "?QID=" . $cart->getId(), array('_secure'=>true)));
247
+ $request->writeElement("pendingUrl", Mage::getUrl("*/*/pending") . "?QID=" . $cart->getId(), array('_secure'=>true));
248
+ $request->writeElement("failureUrl", Mage::getUrl("*/*/failure"), array('_secure'=>true));
249
+ $request->writeElement("callbackUrl", Mage::getUrl("*/*/callback") . "?QID=" . $cart->getId() . "&SID=" . Mage::getSingleton("core/session")->getEncryptedSessionId(), array('_secure'=>true));
250
+ $request->writeElement("basketUrl", Mage::getUrl("checkout/cart"));
251
+ $request->writeElement("contextChooserPageUrl", Mage::getUrl("borderfreelocalization/context"));
252
+ $request->writeElement("usCartStartPageUrl", Mage::getUrl("*/*/uscart"));
253
+ $request->startElement("paymentUrls");
254
+ if(Mage::getStoreConfig('borderfree_options/checkout/paypal'))
255
+ {
256
+ $request->startElement("payPalUrls");
257
+ $request->writeElement("returnUrl", Mage::getUrl("*/*/paypal"));
258
+ $request->writeElement("cancelUrl", Mage::getUrl("checkout/cart"));
259
+ $request->writeElement("headerLogoUrl", Mage::getStoreConfig('borderfree_options/checkout/logo'));
260
+ $request->endElement();
261
+ }
262
+ $request->endElement();//paymentUrls
263
+ $request->endElement();//checkoutUrls
264
+ $request->endElement();//sessionDetails
265
+ $request->startElement("orderProperties");
266
+ $request->writeElement("currencyQuoteId", Mage::getModel("borderfreelocalization/fxrate")->getCollection()->addFieldToFilter("buyer_currency", Mage::app()->getStore()->getCurrentCurrencyCode())->getFirstItem()->getQuoteId());
267
+
268
+ $lcp = Mage::helper("borderfreelocalization")->getLCPRule();
269
+ if($lcp)
270
+ $request->writeElement("lcpRuleId", $lcp);
271
+
272
+ $cart->reserveOrderId();
273
+ //$request->writeElement("merchantOrderId", $cart->getReservedOrderId());
274
+ $request->writeElement("merchantOrderRef", $cart->getId());
275
+ $request->endElement();//orderProperties
276
+ $request->endElement();//domesticSession
277
+ $request->startElement("buyerSession");
278
+ $billingAddress = NULL;
279
+ $shippingAddress = NULL;
280
+
281
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
282
+ $shippingAddressId = $customer->getDefaultShipping();
283
+ if ($shippingAddressId)
284
+ $shippingAddress = Mage::getModel('customer/address')->load($shippingAddressId);
285
+ if($shippingAddressId && $shippingAddress->getCountryId() == Mage::getSingleton('customer/session')->getShippingCountry())
286
+ {
287
+ $street = $shippingAddress->getStreet();
288
+ $countryCode = Mage::getSingleton('customer/session')->getShippingCountry();
289
+
290
+ $request->startElement("shipToAddress");
291
+ $request->writeElement("firstName", $shippingAddress->getFirstname());
292
+ $request->writeElement("lastName", $shippingAddress->getLastname());
293
+ if(isset($street[0]))
294
+ $request->writeElement("addressLine1", $street[0]);
295
+ if(isset($street[1]))
296
+ $request->writeElement("addressLine2", $street[1]);
297
+ if(isset($street[2]))
298
+ $request->writeElement("addressLine3", $street[2]);
299
+ $request->writeElement("city", $shippingAddress->getCity());
300
+ //if($countryCode == "US" || $countryCode == "CA")
301
+ //{
302
+ $request->writeElement("region", $shippingAddress->getRegionCode());
303
+ $request->writeElement("postalCode", $shippingAddress->getPostcode());
304
+ //}
305
+ $request->writeElement("countryCode", $countryCode);
306
+ $request->writeElement("email", $customer->getEmail());
307
+ $request->writeElement("primaryPhone", $shippingAddress->getTelephone());
308
+ $request->endElement();//shipToAddress
309
+ }
310
+ else
311
+ {
312
+ $request->startElement("shipToAddress");
313
+ $request->writeElement("countryCode", Mage::getSingleton('customer/session')->getShippingCountry());
314
+ $request->endElement();//shipToAddress
315
+ }
316
+
317
+ $billingAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling();
318
+ if ($billingAddressId)
319
+ {
320
+ $billingAddress = Mage::getModel('customer/address')->load($billingAddressId);
321
+ $street = $billingAddress->getStreet();
322
+
323
+ $request->startElement("billToAddress");
324
+ $request->writeElement("firstName", $billingAddress->getFirstname());
325
+ $request->writeElement("lastName", $billingAddress->getLastname());
326
+ if(isset($street[0]))
327
+ $request->writeElement("addressLine1", $street[0]);
328
+ if(isset($street[1]))
329
+ $request->writeElement("addressLine2", $street[1]);
330
+ if(isset($street[2]))
331
+ $request->writeElement("addressLine3", $street[2]);
332
+ $request->writeElement("city", $billingAddress->getCity());
333
+ //if($countryCode == "US" || $countryCode == "CA")
334
+ //{
335
+ $request->writeElement("region", $billingAddress->getRegionCode());
336
+ $request->writeElement("postalCode", $billingAddress->getPostcode());
337
+ //}
338
+ $request->writeElement("countryCode", Mage::getSingleton('customer/session')->getIpCountry());
339
+ $request->writeElement("email", $customer->getEmail());
340
+ $request->writeElement("primaryPhone", $billingAddress->getTelephone());
341
+ $request->endElement();//billToAddress
342
+ }
343
+ else
344
+ {
345
+ $request->startElement("billToAddress");
346
+ $request->writeElement("countryCode", Mage::getSingleton('customer/session')->getIpCountry());
347
+ $request->endElement();//billToAddress
348
+ }
349
+
350
+ $request->startElement("buyerPreferences");
351
+ if(strlen(Mage::app()->getStore()->getCode()) == 2)
352
+ $request->writeElement("language", strtoupper(Mage::app()->getStore()->getCode()));
353
+ else
354
+ $request->writeElement("language", "EN");
355
+ $request->writeElement("buyerCurrency", Mage::app()->getStore()->getCurrentCurrencyCode());
356
+ $request->writeElement("couponCode", $cart->getCouponCode());
357
+ $request->endElement();//buyerPreferences
358
+ $request->endElement();//buyerSession
359
+
360
+ $endpoint = Mage::getStoreConfig('borderfree_options/settings/staging') ? Mage::getStoreConfig('borderfree_options/checkout/staging') : Mage::getStoreConfig('borderfree_options/checkout/production');
361
+
362
+ try
363
+ {
364
+ $result = $request->submitRequest($endpoint);
365
+ $xml = new SimpleXMLElement($result);
366
+ }
367
+ catch(Exception $e)
368
+ {
369
+ mail(Mage::getStoreConfig('borderfree_options/settings/erroremail'), "Borderfree Checkout BTP Error", $e->getMessage());
370
+ Mage::getSingleton("checkout/session")->addError(Mage::helper('checkout')->__("An error occured trying to process your order. Please try again later."));
371
+ return $this->_redirect("checkout/cart");
372
+ }
373
+
374
+ $warnings = $xml->payload->warnings;
375
+ $errors = $xml->payload->errorResponse;
376
+
377
+ if($warnings || $errors)
378
+ {
379
+ $message = "";
380
+ $subject = "Borderfree Checkout BTP Warning";
381
+
382
+ if($warnings)
383
+ $message .= $warnings->asXml() . "\n\n";
384
+ if($errors)
385
+ {
386
+ $message .= $errors->asXml() . "\n\n";
387
+ $subject = "Borderfree Checkout BTP Error";
388
+ }
389
+
390
+ mail(Mage::getStoreConfig('borderfree_options/settings/erroremail'), $subject, $message);
391
+ }
392
+
393
+ if($errors)
394
+ {
395
+ Mage::getSingleton("checkout/session")->addError(Mage::helper('checkout')->__("An error occured trying to process your order. Please try again later."));
396
+ return $this->_redirect("checkout/cart");
397
+ }
398
+
399
+ /*$document = $request->outputMemory();
400
+ echo "<pre>";
401
+ echo htmlentities($document);
402
+ echo htmlentities($result);
403
+ echo "</pre>";*/
404
+
405
+ Mage::getSingleton("checkout/session")->setEnvoyUrl((string)$xml->payload->setCheckoutSessionResponse->envoyInitialParams->fullEnvoyUrl);
406
+ $this->loadLayout();
407
+ $this->renderLayout();
408
+ }
409
+
410
+ public function successAction()
411
+ {
412
+ Mage::getSingleton('checkout/session')->clear();
413
+ $quote = Mage::getModel("sales/quote")->load($_GET["QID"]);
414
+ $quote->setIsActive(0)->save();
415
+ }
416
+
417
+ public function pendingAction()
418
+ {
419
+ Mage::getSingleton('checkout/session')->clear();
420
+ $quote = Mage::getModel("sales/quote")->load($_GET["QID"]);
421
+ $quote->setIsActive(0)->save();
422
+ }
423
+
424
+ public function callbackAction()
425
+ {
426
+ Mage::getSingleton("core/session")->setSessionId($_GET["SID"]);
427
+ Mage::getSingleton('checkout/session')->clear();
428
+
429
+ $quote = Mage::getModel("sales/quote")->load($_GET["QID"]);
430
+ $quote->setIsActive(0)->save();
431
+
432
+ $observer = new Varien_Event_Observer();
433
+ $event = new Varien_Event(array('quote'=>$quote));
434
+ $observer->setEvent($event);
435
+ $inv = Mage::getModel("cataloginventory/observer");
436
+ $inv->subtractQuoteInventory($observer);
437
+ $inv->reindexQuoteInventory($observer);
438
+ }
439
+
440
+ public function failureAction()
441
+ {
442
+ }
443
+
444
+ public function uscartAction()
445
+ {
446
+ Mage::app()->getStore()->setCurrentCurrencyCode("USD");
447
+ Mage::getModel("borderfreelocalization/country")->switchCountry("US");
448
+ return $this->_redirect("checkout/cart");
449
+ }
450
+
451
+ public function paypalAction()
452
+ {
453
+ $domain1 = "checkout";
454
+ if(Mage::getStoreConfig('borderfree_options/settings/staging'))
455
+ $domain1 = "stagecheckout";
456
+
457
+ $envoyUrl = "$domain1.borderfree.com/htmlcheckout/views/preloadBack_pp.xhtml";
458
+
459
+ Mage::getSingleton("checkout/session")->setEnvoyUrl($envoyUrl);
460
+ $this->loadLayout();
461
+ $this->renderLayout();
462
+ }
463
+ }
app/code/local/Borderfree/Checkout/etc/config.xml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+
4
+ <modules>
5
+ <Borderfree_Checkout>
6
+ <version>1.0.1</version>
7
+ </Borderfree_Checkout>
8
+ </modules>
9
+
10
+ <global>
11
+ <helpers>
12
+ <borderfreecheckout>
13
+ <class>Borderfree_Checkout_Helper</class>
14
+ </borderfreecheckout>
15
+ </helpers>
16
+ <blocks>
17
+ <borderfreecheckout>
18
+ <class>Borderfree_Checkout_Block</class>
19
+ </borderfreecheckout>
20
+ </blocks>
21
+ <models>
22
+ <borderfreecheckout>
23
+ <class>Borderfree_Checkout_Model</class>
24
+ </borderfreecheckout>
25
+ <sales>
26
+ <rewrite>
27
+ <quote_address_total_shipping>Borderfree_Checkout_Model_Shipping
28
+ </quote_address_total_shipping>
29
+ </rewrite>
30
+ </sales>
31
+ </models>
32
+ <rewrite>
33
+ <borderfreecheckout_onepage>
34
+ <from><![CDATA[#^/checkout/onepage/$#]]></from>
35
+ <to>/borderfreecheckout/envoy/</to>
36
+ </borderfreecheckout_onepage>
37
+ </rewrite>
38
+ </global>
39
+ <frontend>
40
+ <layout>
41
+ <updates>
42
+ <borderfreecheckout>
43
+ <file>borderfreecheckout.xml</file>
44
+ </borderfreecheckout>
45
+ </updates>
46
+ </layout>
47
+ <routers>
48
+ <borderfreecheckout>
49
+ <use>standard</use>
50
+ <args>
51
+ <module>Borderfree_Checkout</module>
52
+ <frontName>borderfreecheckout</frontName>
53
+ </args>
54
+ </borderfreecheckout>
55
+ </routers>
56
+ </frontend>
57
+ </config>
58
+
app/code/local/Borderfree/Crontab/.DS_Store ADDED
Binary file
app/code/local/Borderfree/Crontab/Block/Adminhtml/Cronjobs.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Crontab_Block_Adminhtml_Cronjobs extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ // The blockGroup must match the first half of how we call the block, and controller matches the second half
7
+ // ie. foo_bar/adminhtml_baz
8
+ $this->_blockGroup = 'borderfreecrontab';
9
+ $this->_controller = 'adminhtml_cronjobs';
10
+ $this->_headerText = $this->__('Borderfree Cron Jobs');
11
+
12
+ parent::__construct();
13
+ $this->_removeButton('add');
14
+ }
15
+ }
app/code/local/Borderfree/Crontab/Block/Adminhtml/Cronjobs/Grid.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Crontab_Block_Adminhtml_Cronjobs_Grid extends Mage_Adminhtml_Block_Widget_Grid
3
+ {
4
+ protected $_invalidatedTypes = array();
5
+ /**
6
+ * Class constructor
7
+ */
8
+ public function __construct()
9
+ {
10
+ parent::__construct();
11
+ $this->setId('borderfreecrontab_grid');
12
+ $this->_filterVisibility = false;
13
+ $this->_pagerVisibility = false;
14
+ }
15
+
16
+ /**
17
+ * Prepare grid collection
18
+ */
19
+ protected function _prepareCollection()
20
+ {
21
+ $collection = new Varien_Data_Collection();
22
+
23
+ $job = new Varien_Object();
24
+ $job->setCronjob("Full Catalog Export");
25
+ $model = Mage::getModel('borderfreecrontab/log')->load("Full Catalog Export");
26
+ $job->setLastrun($model->getLastRun());
27
+ $collection->addItem($job);
28
+
29
+ $job = new Varien_Object();
30
+ $job->setCronjob("Incremental Catalog Export");
31
+ $model = Mage::getModel('borderfreecrontab/log')->load("Incremental Catalog Export");
32
+ $job->setLastrun($model->getLastRun());
33
+ $collection->addItem($job);
34
+
35
+ $job = new Varien_Object();
36
+ $job->setCronjob("Get Catalog Error Logs");
37
+ $model = Mage::getModel('borderfreecrontab/log')->load("Get Catalog Error Logs");
38
+ $job->setLastrun($model->getLastRun());
39
+ $collection->addItem($job);
40
+
41
+ $job = new Varien_Object();
42
+ $job->setCronjob("Update Site Cache");
43
+ $model = Mage::getModel('borderfreecrontab/log')->load("Update Site Cache");
44
+ $job->setLastrun($model->getLastRun());
45
+ $collection->addItem($job);
46
+
47
+ $job = new Varien_Object();
48
+ $job->setCronjob("Import Orders");
49
+ $model = Mage::getModel('borderfreecrontab/log')->load("Import Orders");
50
+ $job->setLastrun($model->getLastRun());
51
+ $collection->addItem($job);
52
+
53
+ $this->setCollection($collection);
54
+ return parent::_prepareCollection();
55
+ }
56
+
57
+ /**
58
+ * Prepare grid columns
59
+ */
60
+ protected function _prepareColumns()
61
+ {
62
+ $baseUrl = $this->getUrl();
63
+ $this->addColumn('cronjob', array(
64
+ 'header' => $this->__('Job Name'),
65
+ 'width' => '180',
66
+ 'align' => 'left',
67
+ 'index' => 'cronjob',
68
+ 'sortable' => false,
69
+ ));
70
+
71
+ $this->addColumn('lastrun', array(
72
+ 'header' => $this->__('Last Run'),
73
+ 'width' => '180',
74
+ 'align' => 'left',
75
+ 'index' => 'lastrun',
76
+ 'sortable' => false,
77
+ ));
78
+
79
+ $this->addColumn('action',
80
+ array(
81
+ 'header' => $this->__('Action'),
82
+ 'width' => '100',
83
+ 'type' => 'action',
84
+ 'getter' => 'getCronjob',
85
+ 'actions' => array(
86
+ array(
87
+ 'caption' => $this->__('Run'),
88
+ 'url' => array('base'=> '*/*/run'),
89
+ 'field' => 'cronjob'
90
+ ),
91
+ ),
92
+ 'filter' => false,
93
+ 'sortable' => false,
94
+ 'is_system' => true,
95
+ ));
96
+
97
+ return parent::_prepareColumns();
98
+ }
99
+
100
+
101
+ /**
102
+ * Get row edit url
103
+ *
104
+ * @return string
105
+ */
106
+ public function getRowUrl($row)
107
+ {
108
+ return false;
109
+ }
110
+
111
+ }
app/code/local/Borderfree/Crontab/Helper/Data.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Crontab
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * The Borderfree Crontab helper
15
+ *
16
+ * @category Borderfree
17
+ * @package Borderfree_Crontab
18
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
19
+ */
20
+ class Borderfree_Crontab_Helper_Data extends Mage_Core_Helper_Abstract
21
+ {
22
+
23
+ }
24
+ ?>
app/code/local/Borderfree/Crontab/Model/Log.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Crontab_Model_Log extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreecrontab/log');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Crontab/Model/Mysql4/Log.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Crontab_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreecrontab/log', 'type');
7
+ $this->_isPkAutoIncrement = false;
8
+ }
9
+ }
10
+ ?>
app/code/local/Borderfree/Crontab/Model/Mysql4/Log/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Crontab_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreecrontab/log');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Crontab/controllers/Adminhtml/CronjobsController.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Crontab_Adminhtml_CronjobsController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->_initAction()
7
+ ->renderLayout();
8
+ }
9
+
10
+ protected function _initAction()
11
+ {
12
+ $this->loadLayout()
13
+ // Make the active menu match the menu config nodes (without 'children' inbetween)
14
+ ->_setActiveMenu('system/borderfreecrontab')
15
+ ->_title($this->__('System'))->_title($this->__('Borderfree Cron Jobs'))
16
+ ->_addBreadcrumb($this->__('System'), $this->__('System'))
17
+ ->_addBreadcrumb($this->__('Borderfree Cron Jobs'), $this->__('Borderfree Cron Jobs'));
18
+
19
+ return $this;
20
+ }
21
+
22
+ /**
23
+ * Check currently called action by permissions for current user
24
+ *
25
+ * @return bool
26
+ */
27
+ protected function _isAllowed()
28
+ {
29
+ return Mage::getSingleton('admin/session')->isAllowed('system/borderfreecrontab');
30
+ }
31
+
32
+ public function runAction()
33
+ {
34
+ $job = $this->getRequest()->getParam('cronjob');
35
+ switch($job)
36
+ {
37
+ case "Full Catalog Export":
38
+ Mage::getModel("borderfreecatalog/export")->fullExport();
39
+ break;
40
+
41
+ case "Incremental Catalog Export":
42
+ Mage::getModel("borderfreecatalog/export")->incrementalExport();
43
+ break;
44
+
45
+ case "Get Catalog Error Logs":
46
+ Mage::getModel("borderfreecatalog/export")->getErrorLogs();
47
+ break;
48
+
49
+ case "Update Site Cache":
50
+ Mage::getModel("borderfreelocalization/import")->import();
51
+ break;
52
+
53
+ case "Import Orders":
54
+ Mage::getModel("borderfreeorder/import")->import();
55
+ break;
56
+ }
57
+ $this->_redirect("*/*/index");
58
+ }
59
+ }
app/code/local/Borderfree/Crontab/etc/.DS_Store ADDED
Binary file
app/code/local/Borderfree/Crontab/etc/adminhtml.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <menu>
4
+ <!--
5
+ This item will be created in the Admin menu under Sales
6
+ - If you want another section, reference the appropriate adminhtml.xml file in app/code/core/Mage/Modulename/etc
7
+ - For example, we found out this was 'sales' by referencing the config/menu node of app/code/core/Mage/Sales/etc/adminhtml.xml
8
+ -->
9
+ <system>
10
+ <children>
11
+ <borderfreecrontab translate="title" module="borderfreecrontab">
12
+ <title>Borderfree Cron Jobs</title>
13
+ <action>adminhtml/cronjobs</action>
14
+ <sort_order>999</sort_order>
15
+ </borderfreecrontab>
16
+ </children>
17
+ </system>
18
+ </menu>
19
+
20
+ <acl>
21
+ <resources>
22
+ <admin>
23
+ <children>
24
+ <system>
25
+ <children>
26
+ <borderfreecrontab>
27
+ <title>Borderfree Cron Jobs</title>
28
+ </borderfreecrontab>
29
+ </children>
30
+ </system>
31
+ </children>
32
+ </admin>
33
+ </resources>
34
+ </acl>
35
+ </config>
app/code/local/Borderfree/Crontab/etc/config.xml ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Borderfree_Crontab>
5
+ <version>1.0.1</version>
6
+ </Borderfree_Crontab>
7
+ </modules>
8
+
9
+ <!--
10
+ * * * * * command to be executed
11
+ | | | | |
12
+ | | | | + day of week (0 - 6) (Sunday=0)
13
+ | | | + month (1 - 12)
14
+ | | + day of month (1 - 31)
15
+ | + hour (0 - 23)
16
+ + min (0 - 59)
17
+ The value column can have a * or a list of elements separated by commas (0,10,20,30,40,50)
18
+ Repeat pattern like */2 for every 2 minutes or */10 for every 10 minutes
19
+ The specification of days can be made in two fields: month day and weekday.
20
+ If both are specified in an entry, they are cumulative meaning both of the entries will get executed .
21
+ -->
22
+ <crontab>
23
+ <jobs>
24
+ <borderfree_export_full_catalog>
25
+ <schedule><cron_expr>0 2 * * 0</cron_expr></schedule>
26
+ <run><model>borderfreecatalog/export::fullExport</model></run>
27
+ </borderfree_export_full_catalog>
28
+ <borderfree_export_incremental_catalog>
29
+ <schedule><cron_expr>0 3 * * *</cron_expr></schedule>
30
+ <run><model>borderfreecatalog/export::incrementalExport</model></run>
31
+ </borderfree_export_incremental_catalog>
32
+ <borderfree_export_resume_catalog>
33
+ <schedule><cron_expr>*/5 * * * *</cron_expr></schedule>
34
+ <run><model>borderfreecatalog/export::resumeExport</model></run>
35
+ </borderfree_export_resume_catalog>
36
+ <borderfree_import_error_logs>
37
+ <schedule><cron_expr>*/15 * * * *</cron_expr></schedule>
38
+ <run><model>borderfreecatalog/export::getErrorLogs</model></run>
39
+ </borderfree_import_error_logs>
40
+ <borderfree_localization_cache>
41
+ <schedule><cron_expr>*/15 * * * *</cron_expr></schedule>
42
+ <run><model>borderfreelocalization/import::import</model></run>
43
+ </borderfree_localization_cache>
44
+ <borderfree_order_import>
45
+ <schedule><cron_expr>*/15 * * * *</cron_expr></schedule>
46
+ <run><model>borderfreeorder/import::import</model></run>
47
+ </borderfree_order_import>
48
+ </jobs>
49
+ </crontab>
50
+
51
+ <global>
52
+
53
+ <blocks>
54
+ <borderfreecrontab>
55
+ <class>Borderfree_Crontab_Block</class>
56
+ </borderfreecrontab>
57
+ </blocks>
58
+
59
+ <helpers>
60
+ <borderfreecrontab>
61
+ <class>Borderfree_Crontab_Helper</class>
62
+ </borderfreecrontab>
63
+ </helpers>
64
+
65
+ <models>
66
+ <borderfreecrontab>
67
+ <class>Borderfree_Crontab_Model</class>
68
+ <resourceModel>borderfreecrontab_mysql4</resourceModel>
69
+ </borderfreecrontab>
70
+ <borderfreecrontab_mysql4>
71
+ <class>Borderfree_Crontab_Model_Mysql4</class>
72
+ <entities>
73
+ <log>
74
+ <table>borderfree_cronjob_log</table>
75
+ </log>
76
+ </entities>
77
+ </borderfreecrontab_mysql4>
78
+ </models>
79
+
80
+ <resources>
81
+ <borderfreecrontab_write>
82
+ <connection>
83
+ <use>core_write</use>
84
+ </connection>
85
+ </borderfreecrontab_write>
86
+ <borderfreecrontab_read>
87
+ <connection>
88
+ <use>core_read</use>
89
+ </connection>
90
+ </borderfreecrontab_read>
91
+ <borderfreecrontab_setup>
92
+ <setup>
93
+ <module>Borderfree_Crontab</module>
94
+ <class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
95
+ </setup>
96
+ <connection>
97
+ <use>core_setup</use>
98
+ </connection>
99
+ </borderfreecrontab_setup>
100
+ </resources>
101
+
102
+ </global>
103
+ <admin>
104
+ <routers>
105
+ <adminhtml>
106
+ <args>
107
+ <modules>
108
+ <Borderfree_Crontab before="Mage_Adminhtml">Borderfree_Crontab_Adminhtml</Borderfree_Crontab>
109
+ </modules>
110
+ </args>
111
+ </adminhtml>
112
+ </routers>
113
+ </admin>
114
+ <adminhtml>
115
+ <layout>
116
+ <updates>
117
+ <borderfreecrontab>
118
+ <file>borderfreecrontab.xml</file>
119
+ </borderfreecrontab>
120
+ </updates>
121
+ </layout>
122
+ </adminhtml>
123
+
124
+ </config>
125
+
app/code/local/Borderfree/Crontab/sql/borderfreecrontab_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->run("CREATE TABLE borderfree_cronjob_log (id int(8) NOT NULL AUTO_INCREMENT, type char(30) NOT NULL, merchant_id char(20) NOT NULL, last_run datetime, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
6
+
7
+ $installer->endSetup();
8
+ ?>
app/code/local/Borderfree/Crontab/sql/borderfreecrontab_setup/mysql4-upgrade-1.0.0-1.0.1.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->run("DROP TABLE borderfree_cronjob_log;");
6
+ $installer->run("CREATE TABLE borderfree_cronjob_log (type char(30) NOT NULL, last_run datetime, PRIMARY KEY (type)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
7
+
8
+ $installer->endSetup();
9
+ ?>
app/code/local/Borderfree/Localization/Block/Country.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Localization
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+
14
+ /**
15
+ * FiftyOnne Country List Block
16
+ *
17
+ * @category Borderfree
18
+ * @package Borderfree_Localization
19
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
20
+ *
21
+ */
22
+ class Borderfree_Localization_Block_Country extends Mage_Core_Block_Template
23
+ {
24
+ /**
25
+ * Refrence to the localization helper
26
+ *
27
+ * @var Borderfree_Localization_Helper_Data
28
+ */
29
+ private $localizationHelper = NULL;
30
+
31
+ /**
32
+ * Refrence to the localization helper
33
+ *
34
+ * @var Borderfree_Localization_Helper_Url
35
+ */
36
+ private $localizationUrlHelper = NULL;
37
+
38
+ /**
39
+ * Constroctor - gets the Borderfree Localization & URL Helper
40
+ */
41
+ public function __construct()
42
+ {
43
+ $this->localizationHelper = Mage::helper('borderfreelocalization');
44
+ $this->localizationUrlHelper = Mage::helper('borderfreelocalization/url');
45
+ }
46
+
47
+ /**
48
+ * Get Borderfree ShipTo Countries
49
+ *
50
+ * @return array
51
+ */
52
+ public function getCountries()
53
+ {
54
+ $countries = $this->getData('countries');
55
+ if (is_null($countries))
56
+ {
57
+ $countries = array();
58
+
59
+ //get the Borderfree ship to countries from the Borderfree Site Cache
60
+ $collection = Mage::getModel("borderfreelocalization/country")->getCollection()->addFieldToFilter("ship_to", true)->setOrder("name", "ASC");
61
+
62
+ //create array of Country Code => Country Name
63
+ foreach ($collection as $country)
64
+ {
65
+ $countries[$country->getCountryCode()] = $country->getName();
66
+ }
67
+
68
+ $this->setData('countries', $countries);
69
+ }
70
+ return $countries;
71
+ }
72
+
73
+ /**
74
+ * Get the switch country URL from the give country code
75
+ *
76
+ * @param string $code
77
+ * @return string
78
+ */
79
+ public function getSwitchCountryUrl($code)
80
+ {
81
+ return $this->localizationUrlHelper->getSwitchCountryUrl(array('country' => $code));
82
+ }
83
+
84
+ /**
85
+ * Is Borderfree enabled
86
+ *
87
+ * @return boolean
88
+ */
89
+ public function getBorderfreeEnabled()
90
+ {
91
+ return Mage::helper('borderfreesettings')->isBorderfreeEnabled(false);
92
+ }
93
+
94
+ /**
95
+ * Get the current Shipping Country
96
+ *
97
+ * @return string
98
+ */
99
+ public function getShippingCountry()
100
+ {
101
+ return $this->localizationHelper->getShippingCountry();
102
+ }
103
+ }
app/code/local/Borderfree/Localization/Block/Switch.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Localization
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+
14
+ /**
15
+ * FiftyOnne Language List Block
16
+ *
17
+ * @category Borderfree
18
+ * @package Borderfree_Localization
19
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
20
+ * @see Mage_Page_Block_Switch
21
+ */
22
+ class Borderfree_Localization_Block_Switch extends Mage_Page_Block_Switch
23
+ {
24
+ /**
25
+ * Get the international or domestic store views
26
+ *
27
+ * @return array
28
+ */
29
+ public function getRawStores()
30
+ {
31
+ if (!$this->hasData('raw_stores')) {
32
+ $websiteStores = Mage::app()->getWebsite()->getStores();
33
+ $stores = array();
34
+ foreach ($websiteStores as $store) {
35
+ if(Mage::helper('borderfreesettings')->isBorderfreeEnabled() && $store->getCode() == Mage::app()->getDefaultStoreView()->getCode())
36
+ continue;
37
+ elseif(!Mage::helper('borderfreesettings')->isBorderfreeEnabled() && strlen($store->getCode()) == 2)
38
+ continue;
39
+
40
+ /* @var $store Mage_Core_Model_Store */
41
+ if (!$store->getIsActive()) {
42
+ continue;
43
+ }
44
+ if($store->getCode() == Mage::app()->getDefaultStoreView()->getCode())
45
+ $store->setName("English");
46
+
47
+ $store->setLocaleCode(Mage::getStoreConfig('general/locale/code', $store->getId()));
48
+
49
+ $params = array(
50
+ '_query' => array()
51
+ );
52
+ if (!$this->isStoreInUrl()) {
53
+ $params['_query']['___store'] = $store->getCode();
54
+ }
55
+ $baseUrl = $store->getUrl('', $params);
56
+
57
+ $store->setHomeUrl($baseUrl);
58
+ $stores[$store->getGroupId()][$store->getId()] = $store;
59
+ }
60
+ $this->setData('raw_stores', $stores);
61
+ }
62
+ return $this->getData('raw_stores');
63
+ }
64
+ }
app/code/local/Borderfree/Localization/Block/Welcomemat.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Localization
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * Borderfree Welcome Mat Block
15
+ *
16
+ * @category Borderfree
17
+ * @package Borderfree_Localization
18
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
19
+ *
20
+ */
21
+ class Borderfree_Localization_Block_Welcomemat extends Mage_Core_Block_Template
22
+ {
23
+
24
+ /**
25
+ * Settings Helper
26
+ *
27
+ * @var Borderfree_Settings_Helper_Data
28
+ */
29
+ private $settingsHelper = NULL;
30
+
31
+ /**
32
+ * Localization Helper
33
+ *
34
+ * @var Borderfree_Localization_Helper_Data
35
+ */
36
+ private $localizationHelper = NULL;
37
+
38
+ /**
39
+ * Constructor: Get settings & localization Helpers
40
+ */
41
+ public function __construct()
42
+ {
43
+ $this->settingsHelper = Mage::helper('borderfreesettings');
44
+ $this->localizationHelper = Mage::helper('borderfreelocalization');
45
+ }
46
+
47
+ public function isWelcomeMatEnabled()
48
+ {
49
+ return $this->settingsHelper->isWelcomatEnabled();
50
+ }
51
+
52
+ /**
53
+ * Get the Welcome Mat URL
54
+ *
55
+ * @return string
56
+ */
57
+ public function getWelcomeURL()
58
+ {
59
+ $merchantId = $this->settingsHelper->getMerchantId();
60
+ $countryId = $this->localizationHelper->getShippingCountry();
61
+
62
+ if($this->settingsHelper->isStagingEnabled())
63
+ return trim(Mage::getStoreConfig('borderfree_options/settings/welcomematstageurl')) . "?merchId=$merchantId&countryId=$countryId&setCookie=Y";
64
+ else
65
+ return trim(Mage::getStoreConfig('borderfree_options/settings/welcomematprodurl')) . "?merchId=$merchantId&countryId=$countryId&setCookie=Y";
66
+ }
67
+ }
68
+
app/code/local/Borderfree/Localization/Helper/Data.php ADDED
@@ -0,0 +1,430 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Localization
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * The Borderfree Localization helper class which provides function to assist in site localization.
15
+ *
16
+ * @category Borderfree
17
+ * @package Borderfree_Localization
18
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
19
+ */
20
+ class Borderfree_Localization_Helper_Data extends Mage_Core_Helper_Abstract
21
+ {
22
+ /**
23
+ *
24
+ * @var Borderfree_Settings_Helper_Data
25
+ */
26
+ private $settingsHelper = NULL;
27
+
28
+ /**
29
+ *
30
+ * @var Mage_Customer_Model_Session
31
+ */
32
+ private $customerSession = NULL;
33
+
34
+ public function __construct()
35
+ {
36
+ $this->settingsHelper = Mage::helper('borderfreesettings');
37
+ $this->customerSession = Mage::getSingleton('customer/session');
38
+ }
39
+
40
+ /**
41
+ * Returns true if the product is restricted for the current ship to country
42
+ *
43
+ * @param Mage_Catalog_Model_Product $product
44
+ * @return boolean
45
+ */
46
+ public function isProductRestricted(Mage_Catalog_Model_Product $product)
47
+ {
48
+ if($this->settingsHelper->isBorderfreeEnabled())
49
+ return true;
50
+ else
51
+ return false;
52
+ }
53
+
54
+ /**
55
+ * Get the current ship to country
56
+ *
57
+ * @return string The current ship to country
58
+ */
59
+ public function getShippingCountry()
60
+ {
61
+ return $this->customerSession->getShippingCountry();
62
+ }
63
+
64
+ /**
65
+ * Sets the current shipping country
66
+ *
67
+ * @param string $shippingCountry The new ship to country
68
+ */
69
+ public function setShippingCountry($shippingCountry)
70
+ {
71
+ if(empty($shippingCountry))
72
+ return;
73
+
74
+ $this->customerSession->setShippingCountry($shippingCountry);
75
+ Mage::getModel('core/cookie')->set("shippingCountry", $shippingCountry, 0, "/");
76
+ $this->setLCP();
77
+ }
78
+
79
+ /**
80
+ * Get the current ship to country
81
+ *
82
+ * @return string The current ship to country
83
+ */
84
+ public function getIpCountry()
85
+ {
86
+ return $this->customerSession->getIPCountry();
87
+ }
88
+
89
+ /**
90
+ * Sets the current IP country
91
+ *
92
+ * @param string $ipCountry The new ship to country
93
+ */
94
+ public function setIpCountry($ipCountry)
95
+ {
96
+ if(empty($ipCountry))
97
+ return;
98
+
99
+ $this->customerSession->setIPCountry($ipCountry);
100
+ Mage::getModel('core/cookie')->set("ipCountry", $ipCountry, 0, "/");
101
+ $this->setShippingCountry($ipCountry);
102
+ }
103
+
104
+ public function setLCP()
105
+ {
106
+ if($this->settingsHelper->isBorderfreeEnabled(true))
107
+ {
108
+ $collection = Mage::getModel("borderfreelocalization/lcp")->getCollection()->addFieldToFilter("country_code", $this->getShippingCountry());
109
+ if($collection->count() != 0)
110
+ {
111
+ $lcp = $collection->getFirstItem();
112
+ $this->customerSession->setLCPMultiplier($lcp->getMultiplier());
113
+ $this->customerSession->setLCPRule($lcp->getRuleId());
114
+ return;
115
+ }
116
+ }
117
+
118
+ $this->customerSession->setLCPMultiplier(1);
119
+ $this->customerSession->setLCPRule(0);
120
+ }
121
+
122
+ public function getLCPMultiplier()
123
+ {
124
+ $lcp = $this->customerSession->getLCPMultiplier();
125
+
126
+ if($lcp == NULL)
127
+ $lcp = 1;
128
+
129
+ return $lcp;
130
+ }
131
+
132
+ public function getLCPRule()
133
+ {
134
+ return $this->customerSession->getLCPRule();
135
+ }
136
+
137
+
138
+ /**
139
+ * Gets the attribute option ID for the given attribute value.
140
+ *
141
+ * @param string $attributeType
142
+ * @param string $attributeName
143
+ * @param string $value
144
+ * @return integer
145
+ */
146
+ public function getOptionIdByValue($attributeType, $attributeName, $value)
147
+ {
148
+ $attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode($attributeType, $attributeName);
149
+ $attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);
150
+ return $attribute->getSource()->getOptionId($value);
151
+ }
152
+
153
+ /**
154
+ * Returns the ISO country code for the given country name.
155
+ *
156
+ * @param string $country Country Name
157
+ * @return string Country Code
158
+ */
159
+ public function countryToCode($country)
160
+ {
161
+ return $this->countries[trim($country)];
162
+ }
163
+
164
+ /**
165
+ * Returns the country name for the givin ISO country code.
166
+ *
167
+ * @param string $code
168
+ * @return string
169
+ */
170
+ public function codeToCountry($code)
171
+ {
172
+ $codes = array_flip($this->countries);
173
+ return $codes[$code];
174
+ }
175
+
176
+ /**
177
+ * An array that maps country name => country code.
178
+ *
179
+ * @var array
180
+ */
181
+ private $countries = array(
182
+ "Afghanistan" => "AF",
183
+ "Ã…land Islands" => "AX",
184
+ "Albania" => "AL",
185
+ "Algeria" => "DZ",
186
+ "American Samoa" => "AS",
187
+ "Andorra" => "AD",
188
+ "Angola" => "AO",
189
+ "Anguilla" => "AI",
190
+ "Antarctica" => "AQ",
191
+ "Antigua and Barbuda" => "AG",
192
+ "Argentina" => "AR",
193
+ "Armenia" => "AM",
194
+ "Aruba" => "AW",
195
+ "Australia" => "AU",
196
+ "Austria" => "AT",
197
+ "Azerbaijan" => "AZ",
198
+ "Bahamas" => "BS",
199
+ "Bahrain" => "BH",
200
+ "Bangladesh" => "BD",
201
+ "Barbados" => "BB",
202
+ "Belarus" => "BY",
203
+ "Belgium" => "BE",
204
+ "Belize" => "BZ",
205
+ "Benin" => "BJ",
206
+ "Bermuda" => "BM",
207
+ "Bhutan" => "BT",
208
+ "Bolivia" => "BO",
209
+ "Bosnia and Herzegovina" => "BA",
210
+ "Botswana" => "BW",
211
+ "Bouvet Island" => "BV",
212
+ "Brazil" => "BR",
213
+ "British Indian Ocean Territory" => "IO",
214
+ "Brunei Darussalam" => "BN",
215
+ "Bulgaria" => "BG",
216
+ "Burkina Faso" => "BF",
217
+ "Burundi" => "BI",
218
+ "Cambodia" => "KH",
219
+ "Cameroon" => "CM",
220
+ "Canada" => "CA",
221
+ "Cape Verde" => "CV",
222
+ "Cayman Islands" => "KY",
223
+ "Central African Republic" => "CF",
224
+ "Chad" => "TD",
225
+ "Chile" => "CL",
226
+ "China" => "CN",
227
+ "Christmas Island" => "CX",
228
+ "Cocos (Keeling) Islands" => "CC",
229
+ "Colombia" => "CO",
230
+ "Comoros" => "KM",
231
+ "Congo" => "CG",
232
+ "Congo, The Democratic Republic of The" => "CD",
233
+ "Cook Islands" => "CK",
234
+ "Costa Rica" => "CR",
235
+ "Cote D'ivoire" => "CI",
236
+ "Croatia" => "HR",
237
+ "Cuba" => "CU",
238
+ "Cyprus" => "CY",
239
+ "Czech Republic" => "CZ",
240
+ "Denmark" => "DK",
241
+ "Djibouti" => "DJ",
242
+ "Dominica" => "DM",
243
+ "Dominican Republic" => "DO",
244
+ "Ecuador" => "EC",
245
+ "Egypt" => "EG",
246
+ "El Salvador" => "SV",
247
+ "Equatorial Guinea" => "GQ",
248
+ "Eritrea" => "ER",
249
+ "Estonia" => "EE",
250
+ "Ethiopia" => "ET",
251
+ "Falkland Islands (Malvinas)" => "FK",
252
+ "Faroe Islands" => "FO",
253
+ "Fiji" => "FJ",
254
+ "Finland" => "FI",
255
+ "France" => "FR",
256
+ "French Guiana" => "GF",
257
+ "French Polynesia" => "PF",
258
+ "French Southern Territories" => "TF",
259
+ "Gabon" => "GA",
260
+ "Gambia" => "GM",
261
+ "Georgia" => "GE",
262
+ "Germany" => "DE",
263
+ "Ghana" => "GH",
264
+ "Gibraltar" => "GI",
265
+ "Greece" => "GR",
266
+ "Greenland" => "GL",
267
+ "Grenada" => "GD",
268
+ "Guadeloupe" => "GP",
269
+ "Guam" => "GU",
270
+ "Guatemala" => "GT",
271
+ "Guernsey" => "GG",
272
+ "Guinea" => "GN",
273
+ "Guinea-bissau" => "GW",
274
+ "Guyana" => "GY",
275
+ "Haiti" => "HT",
276
+ "Heard Island and Mcdonald Islands" => "HM",
277
+ "Holy See (Vatican City State)" => "VA",
278
+ "Honduras" => "HN",
279
+ "Hong Kong" => "HK",
280
+ "Hungary" => "HU",
281
+ "Iceland" => "IS",
282
+ "India" => "IN",
283
+ "Indonesia" => "ID",
284
+ "Iran, Islamic Republic of" => "IR",
285
+ "Iraq" => "IQ",
286
+ "Ireland" => "IE",
287
+ "Isle of Man" => "IM",
288
+ "Israel" => "IL",
289
+ "Italy" => "IT",
290
+ "Jamaica" => "JM",
291
+ "Japan" => "JP",
292
+ "Jersey" => "JE",
293
+ "Jordan" => "JO",
294
+ "Kazakhstan" => "KZ",
295
+ "Kenya" => "KE",
296
+ "Kiribati" => "KI",
297
+ "Korea, Democratic People's Republic of" => "KP",
298
+ "Korea, Republic of" => "KR",
299
+ "Kuwait" => "KW",
300
+ "Kyrgyzstan" => "KG",
301
+ "Lao People's Democratic Republic" => "LA",
302
+ "Latvia" => "LV",
303
+ "Lebanon" => "LB",
304
+ "Lesotho" => "LS",
305
+ "Liberia" => "LR",
306
+ "Libyan Arab Jamahiriya" => "LY",
307
+ "Liechtenstein" => "LI",
308
+ "Lithuania" => "LT",
309
+ "Luxembourg" => "LU",
310
+ "Macao" => "MO",
311
+ "Macedonia, The Former Yugoslav Republic of" => "MK",
312
+ "Madagascar" => "MG",
313
+ "Malawi" => "MW",
314
+ "Malaysia" => "MY",
315
+ "Maldives" => "MV",
316
+ "Mali" => "ML",
317
+ "Malta" => "MT",
318
+ "Marshall Islands" => "MH",
319
+ "Martinique" => "MQ",
320
+ "Mauritania" => "MR",
321
+ "Mauritius" => "MU",
322
+ "Mayotte" => "YT",
323
+ "Mexico" => "MX",
324
+ "Micronesia, Federated States of" => "FM",
325
+ "Moldova, Republic of" => "MD",
326
+ "Monaco" => "MC",
327
+ "Mongolia" => "MN",
328
+ "Montenegro" => "ME",
329
+ "Montserrat" => "MS",
330
+ "Morocco" => "MA",
331
+ "Mozambique" => "MZ",
332
+ "Myanmar" => "MM",
333
+ "Namibia" => "NA",
334
+ "Nauru" => "NR",
335
+ "Nepal" => "NP",
336
+ "Netherlands" => "NL",
337
+ "Netherlands Antilles" => "AN",
338
+ "New Caledonia" => "NC",
339
+ "New Zealand" => "NZ",
340
+ "Nicaragua" => "NI",
341
+ "Niger" => "NE",
342
+ "Nigeria" => "NG",
343
+ "Niue" => "NU",
344
+ "Norfolk Island" => "NF",
345
+ "Northern Mariana Islands" => "MP",
346
+ "Norway" => "NO",
347
+ "Oman" => "OM",
348
+ "Pakistan" => "PK",
349
+ "Palau" => "PW",
350
+ "Palestinian Territory, Occupied" => "PS",
351
+ "Panama" => "PA",
352
+ "Papua New Guinea" => "PG",
353
+ "Paraguay" => "PY",
354
+ "Peru" => "PE",
355
+ "Philippines" => "PH",
356
+ "Pitcairn" => "PN",
357
+ "Poland" => "PL",
358
+ "Portugal" => "PT",
359
+ "Puerto Rico" => "PR",
360
+ "Qatar" => "QA",
361
+ "Reunion" => "RE",
362
+ "Romania" => "RO",
363
+ "Russian Federation" => "RU",
364
+ "Rwanda" => "RW",
365
+ "Saint Helena" => "SH",
366
+ "Saint Kitts and Nevis" => "KN",
367
+ "Saint Lucia" => "LC",
368
+ "Saint Pierre and Miquelon" => "PM",
369
+ "Saint Vincent and The Grenadines" => "VC",
370
+ "Samoa" => "WS",
371
+ "San Marino" => "SM",
372
+ "Sao Tome and Principe" => "ST",
373
+ "Saudi Arabia" => "SA",
374
+ "Senegal" => "SN",
375
+ "Serbia" => "RS",
376
+ "Seychelles" => "SC",
377
+ "Sierra Leone" => "SL",
378
+ "Singapore" => "SG",
379
+ "Slovakia" => "SK",
380
+ "Slovenia" => "SI",
381
+ "Solomon Islands" => "SB",
382
+ "Somalia" => "SO",
383
+ "South Africa" => "ZA",
384
+ "South Georgia and The South Sandwich Islands" => "GS",
385
+ "Spain" => "ES",
386
+ "Sri Lanka" => "LK",
387
+ "Sudan" => "SD",
388
+ "Suriname" => "SR",
389
+ "Svalbard and Jan Mayen" => "SJ",
390
+ "Swaziland" => "SZ",
391
+ "Sweden" => "SE",
392
+ "Switzerland" => "CH",
393
+ "Syrian Arab Republic" => "SY",
394
+ "Taiwan, Province of China" => "TW",
395
+ "Tajikistan" => "TJ",
396
+ "Tanzania, United Republic of" => "TZ",
397
+ "Thailand" => "TH",
398
+ "Timor-leste" => "TL",
399
+ "Togo" => "TG",
400
+ "Tokelau" => "TK",
401
+ "Tonga" => "TO",
402
+ "Trinidad and Tobago" => "TT",
403
+ "Tunisia" => "TN",
404
+ "Turkey" => "TR",
405
+ "Turkmenistan" => "TM",
406
+ "Turks and Caicos Islands" => "TC",
407
+ "Tuvalu" => "TV",
408
+ "Uganda" => "UG",
409
+ "Ukraine" => "UA",
410
+ "United Arab Emirates" => "AE",
411
+ "United Kingdom" => "GB",
412
+ "United States" => "US",
413
+ "United States Minor Outlying Islands" => "UM",
414
+ "Uruguay" => "UY",
415
+ "Uzbekistan" => "UZ",
416
+ "Vanuatu" => "VU",
417
+ "Venezuela" => "VE",
418
+ "Viet Nam" => "VN",
419
+ "Virgin Islands, British" => "VG",
420
+ "Virgin Islands, U.S." => "VI",
421
+ "Wallis and Futuna" => "WF",
422
+ "Western Sahara" => "EH",
423
+ "Yemen" => "YE",
424
+ "Zambia" => "ZM",
425
+ "Zimbabwe" => "ZW",
426
+ "Multi-Sourced" => "ZZ",
427
+ "All" => "All"
428
+ );
429
+ }
430
+ ?>
app/code/local/Borderfree/Localization/Helper/Url.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Localization
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * Creates the URLs for the cournry selector
15
+ *
16
+ * @see Borderfree_Localization_Block_Country::getCountryUrl()
17
+ * @category Borderfree
18
+ * @package Borderfree_Localization
19
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
20
+ *
21
+ */
22
+ class Borderfree_Localization_Helper_Url extends Mage_Core_Helper_Url
23
+ {
24
+
25
+ /**
26
+ * Creates a switch country based on the key pair $params["country"} => Country Code
27
+ *
28
+ * @see Borderfree_Localization_Block_Country::getCountryUrl()
29
+ * @param $params parameters to be passes in in the construced URL
30
+ */
31
+ public function getSwitchCountryUrl($params = array())
32
+ {
33
+ $params = is_array($params) ? $params : array();
34
+
35
+ //Set redirect URL for after the switchCountryAction is dispatched
36
+ if ($this->_getRequest()->getAlias('rewrite_request_path'))
37
+ $url = Mage::app()->getStore()->getBaseUrl() . $this->_getRequest()->getAlias('rewrite_request_path');
38
+ else
39
+ $url = $this->getCurrentUrl();
40
+
41
+ //clean up the URL to prevent loops
42
+ $url = preg_replace("/.___store=.*&___from_store=.*/", "", $url);
43
+ $url = preg_replace("/checkout.onepage.index/", "checkout/cart", $url);
44
+ $url = preg_replace("/borderfreecheckout.envoy.checkout/", "checkout/cart", $url);
45
+
46
+ //encode the URL as a parameter
47
+ $params[Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED] = Mage::helper('core')->urlEncode($url);
48
+
49
+ return $this->_getUrl('borderfreelocalization/country/switch', $params);
50
+ }
51
+
52
+ }
app/code/local/Borderfree/Localization/Helper/Wishlist.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Localization
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * Overrides Magento Wishlist Helper for localization.
15
+ *
16
+ * Overrides isAllow()
17
+ *
18
+ * @category Borderfree
19
+ * @package Borderfree_Localization
20
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
21
+ * @see Mage_Wishlist_Helper_Data::isAllow()
22
+ */
23
+ class Borderfree_Localization_Helper_Wishlist extends Mage_Wishlist_Helper_Data
24
+ {
25
+ /**
26
+ * Check is allow wishlist module
27
+ *
28
+ * @return bool
29
+ */
30
+ public function isAllow()
31
+ {
32
+ if(Mage::helper('borderfreesettings')->isBorderfreeEnabled())
33
+ return false;
34
+
35
+ return parent::isAllow();
36
+ }
37
+ }
app/code/local/Borderfree/Localization/Model/Cache.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Cache extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/cache');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Convert.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Convert extends Mage_Directory_Model_Currency
3
+ {
4
+ public function convert($price, $toCurrency=null)
5
+ {
6
+ if(!Mage::helper("borderfreesettings")->isBorderfreeEnabled())
7
+ return parent::convert($price, $toCurrency);
8
+
9
+ if (is_null($toCurrency))
10
+ return $price;
11
+
12
+ if ($rate = $this->getRate($toCurrency))
13
+ {
14
+ $merchantId = Mage::getStoreConfig('borderfree_options/settings/merchantid');
15
+ $collection = Mage::getModel("borderfreelocalization/currency")->getCollection()
16
+ ->addFieldToFilter("currency_code", $toCurrency->getCurrencyCode())->addFieldToFilter("merchant_id", $merchantId);
17
+ $currency = $collection->getFirstItem();
18
+ $roundMethod = $currency->getRoundMethod();
19
+ $lcp = Mage::helper("borderfreelocalization")->getLCPMultiplier();
20
+
21
+ return round($price*$rate*$lcp, $roundMethod);
22
+ }
23
+
24
+ throw new Exception(Mage::helper('directory')->__('Undefined rate from "%s-%s".', $this->getCode(), $toCurrency->getCode()));
25
+ }
26
+
27
+ }
app/code/local/Borderfree/Localization/Model/Country.php ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Localization
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * Country data model
15
+ *
16
+ * @category Borderfree
17
+ * @package Borderfree_Localization
18
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
19
+ */
20
+ class Borderfree_Localization_Model_Country extends Mage_Core_Model_Abstract
21
+ {
22
+ /**
23
+ * Refrence to the settings helper
24
+ *
25
+ * @var Borderfree_Settings_Helper_Data
26
+ */
27
+ private $settingsHelper = NULL;
28
+
29
+ /**
30
+ * Refrence to the localization helper
31
+ *
32
+ * @var Borderfree_Localization_Helper_Data
33
+ */
34
+ private $localizationHelper = NULL;
35
+
36
+ protected function _construct()
37
+ {
38
+ $this->_init('borderfreelocalization/country');
39
+ $this->settingsHelper = Mage::helper("borderfreesettings");
40
+ $this->localizationHelper = Mage::helper("borderfreelocalization");
41
+ }
42
+
43
+ /**
44
+ * Set the store currency/language based on the IP country.
45
+ *
46
+ * @param string $countryCode The country code used to lookup the currency/language
47
+ * @param boolean $setIpCountry Switch IP Country true/false
48
+ */
49
+ public function _setLocale($countryCode, $setIpCountry = true)
50
+ {
51
+ if($setIpCountry)
52
+ $this->localizationHelper->setIpCountry($countryCode);
53
+
54
+ //lookup country data in the Borderfree site cache
55
+ $collection = $this->getCollection()
56
+ ->addFieldToFilter("country_code", $countryCode)->addFieldToFilter("merchant_id", $this->settingsHelper->getMerchantId());
57
+
58
+ $country = $collection->getFirstItem();
59
+ $currencyCode = $country->getCurrencyCode();
60
+ $languageCode = $country->getLanguageCode();
61
+
62
+ //make sure currency is enabled otherwise default to USD
63
+ if(Mage::getModel("borderfreelocalization/currency")->getCollection()->addFieldToFilter("currency_code", $currencyCode)->count() == 0)
64
+ $currencyCode = "USD";
65
+
66
+ if($countryCode == "US")
67
+ {
68
+ $currencyCode = "USD";
69
+ $languageCode = Mage::app()->getDefaultStoreView()->getCode();
70
+ }
71
+
72
+ //set the store language based on the current country
73
+ if($setIpCountry)
74
+ $this->switchStore($languageCode);
75
+ else
76
+ $this->switchCountry($countryCode);
77
+
78
+ //set store currency to the active country
79
+ Mage::app()->getStore()->setCurrentCurrencyCode($currencyCode);
80
+ }
81
+
82
+ /**
83
+ * Switches the current shipping country and sets the appropiate store view.
84
+ *
85
+ * @param string $countryCode The new Country Code
86
+ */
87
+ public function switchCountry($countryCode)
88
+ {
89
+ if(empty($countryCode))
90
+ return;
91
+
92
+ $this->localizationHelper->setShippingCountry($countryCode);
93
+
94
+ if($countryCode != "US")
95
+ {
96
+ $merchantId = $this->settingsHelper->getMerchantId();
97
+
98
+ $collection = Mage::getModel("borderfreelocalization/country")->getCollection()
99
+ ->addFieldToFilter("country_code", $countryCode)->addFieldToFilter("merchant_id", $merchantId);
100
+
101
+ $country = $collection->getFirstItem();
102
+
103
+ $store = Mage::app()->getSafeStore(strtolower($countryCode));
104
+
105
+ if(Mage::app()->getStore()->getCode() == Mage::app()->getDefaultStoreView()->getCode())
106
+ Mage::getModel('core/cookie')->set("switchStore", "en", 0, "/");
107
+ else if($store->getCode() != null)
108
+ Mage::getModel('core/cookie')->set("switchStore", strtolower($countryCode), 0, "/");
109
+ }
110
+ else
111
+ {
112
+ if(Mage::app()->getStore()->getCode() == "en")
113
+ $storeCode = Mage::app()->getDefaultStoreView()->getCode();
114
+ else
115
+ $storeCode = Mage::app()->getStore()->getCode() . "_us";
116
+
117
+ $store = Mage::app()->getSafeStore(strtolower($storeCode));
118
+
119
+ if($store->getCode() != null)
120
+ Mage::getModel('core/cookie')->set("switchStore", $storeCode, 0, "/");
121
+ }
122
+ }
123
+
124
+ /**
125
+ * Try to switch to store view for the given language code
126
+ *
127
+ * @param string $languageCode The language code used to locate the proper store view
128
+ */
129
+ public function switchStore($languageCode)
130
+ {
131
+ if(empty($languageCode))
132
+ return;
133
+
134
+ //try to find the store view than matchs the given language code
135
+ $store = Mage::app()->getSafeStore(strtolower($languageCode));
136
+
137
+ //default to the international English store view if shipping outside the US
138
+ if($store->getCode() == NULL && $this->settingsHelper->isBorderfreeEnabled())
139
+ $store = Mage::app()->getSafeStore("en");
140
+
141
+ //fall back to default store view
142
+ if($store->getCode() == NULL)
143
+ $store = Mage::app()->getDefaultStoreView();
144
+
145
+ //redirect to the new store view
146
+ if($store->getCode() != Mage::app()->getStore()->getCode())
147
+ {
148
+ $storeUrl = $store->getCurrentUrl(Mage::app()->getStore()->getCode());
149
+ Mage::app()->getResponse()->setRedirect(str_replace("&amp;", "&", $storeUrl));
150
+ //Mage::app()->getRequest()->setDispatched();
151
+ }
152
+
153
+ //Delete the switchStore cookie
154
+ Mage::getModel('core/cookie')->delete("switchStore");
155
+ }
156
+
157
+ }
158
+ ?>
app/code/local/Borderfree/Localization/Model/Currency.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Currency extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/currency');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Discount.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Borderfree_Localization_Model_Discount extends Mage_SalesRule_Model_Quote_Discount
4
+ {
5
+
6
+
7
+ /**
8
+ * Aggregate item discount information to address data and related properties
9
+ *
10
+ * @param Mage_Sales_Model_Quote_Item_Abstract $item
11
+ * @return Mage_SalesRule_Model_Quote_Discount
12
+ */
13
+ protected function _aggregateItemDiscount($item)
14
+ {
15
+ if(!Mage::helper("borderfreesettings")->isBorderfreeEnabled())
16
+ return parent::_aggregateItemDiscount($item);
17
+
18
+ $merchantId = Mage::getStoreConfig('borderfree_options/settings/merchantid');
19
+ $collection = Mage::getModel("borderfreelocalization/currency")->getCollection()
20
+ ->addFieldToFilter("currency_code", Mage::app()->getStore()->getCurrentCurrencyCode())->addFieldToFilter("merchant_id", $merchantId);
21
+ $currency = $collection->getFirstItem();
22
+ $roundMethod = $currency->getRoundMethod();
23
+ $lcp = Mage::helper("borderfreelocalization")->getLCPMultiplier();
24
+
25
+ $discount = $item->getDiscountAmount();
26
+ $discount = $discount / $lcp;
27
+ $discount = round($discount, $roundMethod);
28
+
29
+ $this->_addAmount(-$discount);
30
+ $this->_addBaseAmount(-$item->getBaseDiscountAmount());
31
+ return $this;
32
+ }
33
+ }
app/code/local/Borderfree/Localization/Model/Fxrate.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Fxrate extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/fxrate');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Import.php ADDED
@@ -0,0 +1,360 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Import extends Mage_Core_Model_Abstract
3
+ {
4
+ private $merchantIds = array();
5
+
6
+ public function import()
7
+ {
8
+ $model = Mage::getModel('borderfreecrontab/log');
9
+ $model->setType("Update Site Cache");
10
+ $model->setLastRun(time());
11
+ $model->save();
12
+
13
+ $this->getIPGeo();
14
+ $this->getFxRates();
15
+
16
+ $allStores = Mage::app()->getStores();
17
+ foreach ($allStores as $_eachStoreId => $val)
18
+ {
19
+ $store = Mage::app()->getStore($_eachStoreId)->getId();
20
+ Mage::app()->setCurrentStore($store);
21
+ if(Mage::getStoreConfig('borderfree_options/settings/enabled'))
22
+ {
23
+ $merchantId = Mage::getStoreConfig('borderfree_options/settings/merchantid');
24
+ if(!in_array($merchantId, $this->merchantIds))
25
+ {
26
+ $this->merchantIds[] = Mage::getStoreConfig('borderfree_options/settings/merchantid');
27
+ $this->getCountries($merchantId);
28
+ $this->getCurrencies($merchantId);
29
+ $this->getPricingCustomizations($merchantId);
30
+ }
31
+ }
32
+ }
33
+ }
34
+
35
+ /**
36
+ * Cache pricing customizations
37
+ *
38
+ * @param string $merchantId
39
+ */
40
+ public function getPricingCustomizations($merchantId)
41
+ {
42
+ list($xml, $version, $newVersion) = $this->callApi("PRICING_CUSTOMIZATIONS", $merchantId, true);
43
+ if(!$newVersion)
44
+ return;
45
+
46
+ $pricingCustomizations = $xml->xpath("//pricingCustomization");
47
+
48
+ $this->resetTable("borderfree_lcp_rules", $merchantId);
49
+ $this->resetTable("borderfree_rounding_rules", $merchantId);
50
+
51
+ foreach($pricingCustomizations as $customization)
52
+ {
53
+ $countries = $customization->xpath("./conditions/condition/shipToCountry/country");
54
+
55
+ $attributes = $customization->attributes();
56
+ $customizationId = $attributes["id"];
57
+
58
+ $component = $customization->component;
59
+ $attributes = $component->attributes();
60
+ $type = $attributes["type"];
61
+
62
+ if($type != "PRODUCT_PRICES")
63
+ continue;
64
+
65
+ $override = $component->override;
66
+ $attributes = $override->attributes();
67
+ $type = $attributes["type"];
68
+
69
+ if($type == "FRONT_LOAD_PERCENT")
70
+ {
71
+ foreach($countries as $country)
72
+ {
73
+ $attributes = $country->attributes();
74
+ $countryCode = $attributes["code"];
75
+
76
+ $model = Mage::getModel("borderfreelocalization/lcp");
77
+ $model->setRuleId($customizationId);
78
+ $model->setCountryCode($countryCode);
79
+ $model->setMerchantId($merchantId);
80
+ $model->setName($customization->name);
81
+ $model->setDescription($customization->description);
82
+ $model->setMultiplier($override->lcp->multiplier);
83
+ $model->save();
84
+ }
85
+ }
86
+ else if($type == "ROUND_UP")
87
+ {
88
+ foreach($countries as $country)
89
+ {
90
+ $attributes = $country->attributes();
91
+ $countryCode = $attributes["code"];
92
+
93
+ $model = Mage::getModel("borderfreelocalization/rounding");
94
+ $model->setRuleId($customizationId);
95
+ $model->setCountryCode($countryCode);
96
+ $model->setMerchantId($merchantId);
97
+ $model->setName($customization->name);
98
+ $model->setDescription($customization->description);
99
+ $model->setAmount($override->amount);
100
+ $model->save();
101
+ }
102
+ }
103
+ }
104
+
105
+ $version->save();
106
+
107
+ }
108
+
109
+ public function getCurrencies($merchantId)
110
+ {
111
+ list($xml, $version, $newVersion) = $this->callApi("CURRENCIES", $merchantId, true);
112
+ if(!$newVersion)
113
+ return;
114
+
115
+ $currencies = $xml->xpath("//currency");
116
+ $allowedCurrencies = array();
117
+ $data = array();
118
+
119
+ if(count($currencies) != 0)
120
+ $this->resetTable("borderfree_currency", $merchantId);
121
+
122
+ foreach($currencies as $currency)
123
+ {
124
+ $attributes = $currency->attributes();
125
+ $currencyCode = $attributes["code"];
126
+
127
+ if($currency->isCurrencyEnabled)
128
+ $allowedCurrencies[] = $currencyCode;
129
+
130
+ $model = Mage::getModel("borderfreelocalization/currency");
131
+ $model->setCurrencyCode($currencyCode);
132
+ $model->setMerchantId($merchantId);
133
+ $model->setName($currency->name);
134
+ $model->setRoundMethod($currency->roundMethod);
135
+ $model->setSymbol($currency->symbol);
136
+ $model->setEnabled($currency->isCurrencyEnabled == "true" ? true : false);
137
+ $model->save();
138
+
139
+ $methods = $currency->xpath("./paymentMethodSupport/paymentMethod");
140
+
141
+ if(count($methods) != 0)
142
+ {
143
+ $sql = "DELETE FROM borderfree_payment WHERE merchant_id = '$merchantId' AND currency_code = '$currencyCode'";
144
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
145
+ $connection->query($sql);
146
+ }
147
+
148
+ foreach($methods as $method)
149
+ {
150
+ $model = Mage::getModel("borderfreelocalization/payment");
151
+ $model->setCurrencyCode($currencyCode);
152
+ $model->setMerchantId($merchantId);
153
+ $model->setMethod($method);
154
+ $model->save();
155
+ }
156
+ }
157
+
158
+ if(count($allowedCurrencies))
159
+ {
160
+ $currencyList = implode(",", $allowedCurrencies);
161
+ $config = new Mage_Core_Model_Config();
162
+ $config->saveConfig("currency/options/allow", $currencyList, 'websites', Mage::app()->getStore()->getWebsiteId());
163
+ }
164
+
165
+ $version->save();
166
+ }
167
+
168
+ public function getCountries($merchantId)
169
+ {
170
+ list($xml, $version, $newVersion) = $this->callApi("COUNTRIES", $merchantId, true);
171
+ if(!$newVersion)
172
+ return;
173
+
174
+ $countries = $xml->xpath("//country");
175
+
176
+ if(count($countries) != 0)
177
+ $this->resetTable("borderfree_countries", $merchantId);
178
+
179
+ foreach($countries as $country)
180
+ {
181
+ $attributes = $country->attributes();
182
+ $countryCode = $attributes["code"];
183
+
184
+ $model = Mage::getModel("borderfreelocalization/country");
185
+ $model->setCountryCode($countryCode);
186
+ $model->setMerchantId($merchantId);
187
+ $model->setName($country->name);
188
+ $model->setShipTo($country->isShipToEnabled == "true" ? true : false);
189
+ $model->setBillTo($country->isBillToEnabled == "true" ? true : false);
190
+ $model->setPostalCode($country->isPostalCodeRequired == "true" ? true : false);
191
+ $model->setCurrencyCode($country->currencyCode);
192
+ $model->setLanguageCode($country->languageCode);
193
+ $model->setLocale($country->locale);
194
+ $model->setTranslationAvailable($country->isTranslationAvailable == "true" ? true : false);
195
+ $model->setPricingModel($country->pricingModel);
196
+ $model->save();
197
+
198
+ if($country->pricingModel == "REGIONAL")
199
+ {
200
+ $regions = $country->xpath("./regions/region");
201
+
202
+ if(count($regions) != 0)
203
+ {
204
+ $sql = "DELETE FROM borderfree_regions WHERE merchant_id = '$merchantId' AND country_code = '$countryCode'";
205
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
206
+ $connection->query($sql);
207
+ }
208
+
209
+ foreach($regions as $region)
210
+ {
211
+ $attributes = $region->attributes();
212
+ $regionCode = $attributes["code"];
213
+
214
+ $model = Mage::getModel("borderfreelocalization/region");
215
+ $model->setCountryCode($countryCode);
216
+ $model->setMerchantId($merchantId);
217
+ $model->setName($region);
218
+ $model->setRegionCode($regionCode);
219
+ $model->save();
220
+ }
221
+ }
222
+ }
223
+
224
+ $version->save();
225
+ }
226
+
227
+ private function resetTable($name, $merchantId = NULL)
228
+ {
229
+ $sql = "DELETE FROM $name";
230
+
231
+ if($merchantId != NULL)
232
+ $sql .= " WHERE merchant_id = '$merchantId'";
233
+
234
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
235
+ $connection->query($sql);
236
+ }
237
+
238
+ public function getFxRates()
239
+ {
240
+ $data = array("USD" => array());
241
+
242
+ list($xml, $version, $newVersion) = $this->callApi("FX_RATES", 0, true);
243
+ if(!$newVersion)
244
+ return;
245
+
246
+ $quotes = $xml->xpath("//quote");
247
+ foreach($quotes as $quote)
248
+ {
249
+ $quoteId = 0;
250
+ foreach($quote->attributes() as $name => $value)
251
+ {
252
+ if($name == "id")
253
+ $quoteId = $value;
254
+ }
255
+ $model = Mage::getModel("borderfreelocalization/fxrate");
256
+ $model->setBuyerCurrency($quote->buyerCurrency);
257
+ $model->setMerchantCurrency($quote->merchantCurrency);
258
+ $model->setFxRate($quote->fxRate);
259
+ $model->setQuoteId($quoteId);
260
+ $model->save();
261
+
262
+ $value = abs(Mage::getSingleton('core/locale')->getNumber($quote->fxRate));
263
+ $data[(string)$quote->merchantCurrency][(string)$quote->buyerCurrency] = $value;
264
+ }
265
+
266
+ Mage::getModel('directory/currency')->saveRates($data);
267
+
268
+ $version->save();
269
+ }
270
+
271
+ public function getIPGeo()
272
+ {
273
+ list($xml, $version, $newVersion) = $this->callApi("IP_GEO", 0, true);
274
+ if(!$newVersion)
275
+ return;
276
+
277
+ $countries = $xml->xpath("//country");
278
+
279
+ if(count($countries) != 0)
280
+ $this->resetTable("borderfree_localization_ip");
281
+
282
+ foreach($countries as $country)
283
+ {
284
+ $attributes = $country->attributes();
285
+ $countryCode = $attributes["code"];
286
+
287
+ $ranges = explode(",", $country);
288
+ foreach($ranges as $range)
289
+ {
290
+ $range = explode(":", $range);
291
+ $model = Mage::getModel("borderfreelocalization/ip");
292
+ $model->setCountryCode($countryCode);
293
+ $model->setLow($range[0]);
294
+ $model->setHigh($range[1]);
295
+ $model->save();
296
+ }
297
+ }
298
+
299
+ $version->save();
300
+ }
301
+
302
+ private function callApi($data_type, $merchantId, $quiet = false)
303
+ {
304
+ $collection = Mage::getModel("borderfreelocalization/cache")->getCollection()->addFieldToFilter("data_type", $data_type)->addFieldToFilter("merchant_id", $merchantId);
305
+ if(count($collection) == 0)
306
+ {
307
+ $model = Mage::getModel("borderfreelocalization/cache");
308
+ $model->setDataType($data_type);
309
+ $model->setMerchantId($merchantId);
310
+ $model->setVersion(0);
311
+ $model->save();
312
+ }
313
+ else
314
+ $model = $collection->getFirstItem();
315
+
316
+ $version = $model->getVersion();
317
+ $uuid = uniqid('', true);
318
+ $quiet = $quiet ? " quiet=\"true\"" : "";
319
+ $merchantId = $merchantId != 0 ? " merchantId=\"$merchantId\"" : "";
320
+ $credentials = Mage::getStoreConfig('borderfree_options/settings/apiuser') . ":" . Mage::helper('core')->decrypt(Mage::getStoreConfig('borderfree_options/settings/apipassword'));
321
+ $endpoint = Mage::getStoreConfig('borderfree_options/settings/staging') ? Mage::getStoreConfig('borderfree_options/localization/staging') : Mage::getStoreConfig('borderfree_options/localization/production');
322
+
323
+ $request = "<message>\n";
324
+ $request .= " <payload>\n";
325
+ $request .= " <getLocalizationDataRequest id=\"$uuid\">\n";
326
+ $request .= " <dataTypes>\n";
327
+ $request .= " <dataType localVersion=\"$version\"$merchantId$quiet>$data_type</dataType>\n";
328
+ $request .= " </dataTypes>\n";
329
+ $request .= " </getLocalizationDataRequest>\n";
330
+ $request .= " </payload>\n";
331
+ $request .= "</message>\n";
332
+
333
+ $ch = curl_init();
334
+ curl_setopt($ch, CURLOPT_URL, $endpoint);
335
+ curl_setopt($ch, CURLOPT_HEADER, false);
336
+ curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/xml; charset=utf-8"));
337
+ curl_setopt($ch, CURLOPT_USERPWD, $credentials);
338
+ curl_setopt($ch, CURLOPT_POST, 1);
339
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
340
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
341
+
342
+ $result = curl_exec($ch);
343
+ $info = curl_getinfo($ch);
344
+ curl_close($ch);
345
+
346
+ $xml = new SimpleXMLElement($result);
347
+
348
+ $errors = $xml->xpath("//errors");
349
+ if(count($errors))
350
+ throw new Exception($errors[0]->asXML());
351
+
352
+ $dataVersion = $xml->xpath("//dataVersion");
353
+ $attributes = $dataVersion[0]->attributes();
354
+ $model->setVersion((string)$attributes["version"]);
355
+
356
+ $newVersion = $version != $model->getVersion();
357
+ return array($xml, $model, $newVersion);
358
+ }
359
+
360
+ }
app/code/local/Borderfree/Localization/Model/Ip.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Localization
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * IP Geolocation data model
15
+ *
16
+ * @category Borderfree
17
+ * @package Borderfree_Localization
18
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
19
+ */
20
+ class Borderfree_Localization_Model_Ip extends Mage_Core_Model_Abstract
21
+ {
22
+ /**
23
+ * Refrence to the localization helper
24
+ *
25
+ * @var Borderfree_Localization_Helper_Data
26
+ */
27
+ private $localizationHelper = NULL;
28
+
29
+ /**
30
+ * Refrence to the settings helper
31
+ *
32
+ * @var Borderfree_Settings_Helper_Data
33
+ */
34
+ private $settingsHelper = NULL;
35
+
36
+ protected function _construct()
37
+ {
38
+ $this->_init('borderfreelocalization/ip');
39
+ $this->localizationHelper = Mage::helper("borderfreelocalization");
40
+ $this->settingsHelper = Mage::helper('borderfreesettings');
41
+ }
42
+
43
+ /**
44
+ * Get the current IP country using Geo Location data and set the currency/language
45
+ *
46
+ */
47
+ public function getIpCountry()
48
+ {
49
+ //get IP contry form session if it exists
50
+ $ipCountry = $this->localizationHelper->getIpCountry();
51
+
52
+ //Determine IP country based on Geo Location data
53
+ if(empty($ipCountry))
54
+ {
55
+ //Set IP country to US by default
56
+ $ipCountry = "US";
57
+
58
+ //convert IP dotted quad IP address into decimal notation
59
+ $ipNumbers = explode(".", $_SERVER['REMOTE_ADDR']);
60
+ $ip = $ipNumbers[0] * (16777216) + $ipNumbers[1] * (65536) + $ipNumbers[2] * (256) + $ipNumbers[3] * (1);
61
+
62
+ //search for IP address in Geo Location database
63
+ $collection = $this->getCollection()
64
+ ->addFieldToFilter("high", array('gteq' => $ip))
65
+ ->addFieldToFilter("low", array('lteq' => $ip));
66
+
67
+ //If an entry in the Geo Location database is found, set the IP country
68
+ if($collection->count() > 0)
69
+ $ipCountry = $collection->getFirstItem()->getCountryCode();
70
+
71
+ //If request is coming from the test IP address, set the IP country to the Mock country.
72
+ if($this->settingsHelper->isTestIp())
73
+ $ipCountry = $this->settingsHelper->getTestCountry();
74
+
75
+ //set IP/shipping country, currency & language
76
+ Mage::getModel("borderfreelocalization/country")->_setLocale($ipCountry);
77
+ }
78
+ }
79
+
80
+ }
81
+ ?>
app/code/local/Borderfree/Localization/Model/Lcp.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Lcp extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/lcp');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Cache.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Cache extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/cache', 'id');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Cache/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Cache_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/cache');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Country.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Country extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/country', 'id');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Country/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Country_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/country');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Currency.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Currency extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/currency', 'id');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Currency/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Currency_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/currency');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Fxrate.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Fxrate extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/fxrate', 'buyer_currency');
7
+ $this->_isPkAutoIncrement = false;
8
+ }
9
+ }
10
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Fxrate/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Fxrate_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/fxrate');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Ip.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Ip extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/ip', 'id');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Ip/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Ip_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/ip');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Lcp.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Lcp extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/lcp', 'id');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Lcp/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Lcp_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/lcp');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Payment.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Payment extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/payment', 'id');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Payment/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Payment_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/payment');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Region.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Region extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/region', 'id');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Region/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Region_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/region');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Rounding.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Rounding extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/rounding', 'id');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Mysql4/Rounding/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Mysql4_Rounding_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/rounding');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Observer.php ADDED
@@ -0,0 +1,368 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Localization
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * TheBorderfree Localization Observer
15
+ *
16
+ * Observes the following events:
17
+ *
18
+ * fiftonelocalization_predispatch_observer
19
+ * controller_action_layout_load_before
20
+ *
21
+ * @category Borderfree
22
+ * @package Borderfree_Localization
23
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
24
+ *
25
+ */
26
+ class Borderfree_Localization_Model_Observer
27
+ {
28
+
29
+ /**
30
+ *
31
+ * @var Mage_Core_Controller_Request_Http
32
+ */
33
+ private $request = NULL;
34
+ /**
35
+ *
36
+ * @var Mage_Core_Controller_Response_Http
37
+ */
38
+ private $response = NULL;
39
+
40
+ /**
41
+ * Refrence to the localization helper
42
+ *
43
+ * @var Borderfree_Localization_Helper_Data
44
+ */
45
+ private $localizationHelper = NULL;
46
+
47
+ /**
48
+ * Refrence to the settings helper
49
+ *
50
+ * @var Borderfree_Settings_Helper_Data
51
+ */
52
+ private $settingsHelper = NULL;
53
+
54
+ /**
55
+ * The attribute option ID for "All" from catalog_country_restrictions
56
+ *
57
+ * @var integer
58
+ */
59
+ private $allCountries = NULL;
60
+
61
+ /**
62
+ * Borderfree restricted categories
63
+ *
64
+ * @var array
65
+ */
66
+ private $restrictedCategories = array();
67
+
68
+ /**
69
+ *
70
+ * @var Mage_Core_Model_Cookie;
71
+ */
72
+ private $cookies = NULL;
73
+
74
+
75
+ /**
76
+ * Constroctor - gets the Borderfree Localization Helper
77
+ */
78
+ public function __construct()
79
+ {
80
+ $this->localizationHelper = Mage::helper('borderfreelocalization');
81
+ $this->settingsHelper = Mage::helper('borderfreesettings');
82
+ $this->cookies = Mage::getModel("core/cookie");
83
+ $this->allCountries = $this->localizationHelper->getOptionIdByValue("catalog_category", "category_country_restrictions", "All");
84
+ }
85
+
86
+ /**
87
+ * Observer which detetcs foregin site visits and requests for Language changes
88
+ *
89
+ * Observes: controller_action_predispatch
90
+ *
91
+ * If Borderfree is enbled and this is the first request, set IP Country, Shipping Country and Language.
92
+ * Check For "switchStore" cookie and swithch to the requested store view
93
+ *
94
+ * @param Varien_Event_Observer $observer
95
+ * @return Borderfree_Localization_Model_Observer
96
+ */
97
+ public function preDispatch(Varien_Event_Observer $observer)
98
+ {
99
+ if($this->settingsHelper->isBorderfreeEnabled(false))
100
+ {
101
+ //make sure this is a storefront request
102
+ if(!$this->settingsHelper->isStoreFrontRequest())
103
+ return $this;
104
+
105
+ //Save the request and response data from the observer data
106
+ $this->response = $observer->getControllerAction()->getResponse();
107
+ $this->request = $observer->getControllerAction()->getRequest();
108
+
109
+
110
+ //logout customer if shipping internationally
111
+ if(Mage::helper('customer')->isLoggedIn() && $this->settingsHelper->isBorderfreeEnabled())
112
+ {
113
+ //logout customer
114
+ Mage::getSingleton('customer/session')->logout();
115
+ }
116
+
117
+ //set IP & shipping countries from cookies
118
+ $this->localizationHelper->setIpCountry($this->cookies->get("ipCountry"));
119
+ $this->localizationHelper->setShippingCountry($this->cookies->get("shippingCountry"));
120
+
121
+
122
+ //redirect customer account URls to home page if shipping internationally
123
+ if($this->settingsHelper->isBorderfreeEnabled() && $this->request->getRouteName() == "customer")
124
+ {
125
+ $this->response->setRedirect(Mage::getBaseUrl());
126
+ //$this->request->setDispatched();
127
+ return;
128
+ }
129
+
130
+ //lookup the IP Country using geolocation data
131
+ Mage::getModel("borderfreelocalization/ip")->getIpCountry();
132
+
133
+ Mage::getModel("borderfreelocalization/country")->switchStore($this->cookies->get("switchStore"));
134
+ }
135
+ else //default shipping & IP country to US
136
+ $this->localizationHelper->setIpCountry("US");
137
+
138
+ $currencyCoookie = $this->cookies->get("currency");
139
+ if(!empty($currencyCoookie))
140
+ {
141
+ $currency = explode("|", $currencyCoookie);
142
+ Mage::app()->getStore()->setCurrentCurrencyCode($currency[1]);
143
+ }
144
+
145
+
146
+ return $this;
147
+ }
148
+
149
+ /**
150
+ * Observer which adds layout handle Borderfree when shippingCountry != US
151
+ *
152
+ * Observes: controller_action_layout_load_before
153
+ *
154
+ * @param $observer Varien_Event_Observer
155
+ * @return Borderfree_Localization_Model_Observer
156
+ */
157
+ public function updateLayout(Varien_Event_Observer $observer)
158
+ {
159
+ if($this->settingsHelper->isBorderfreeEnabled())
160
+ {
161
+ $update = $observer->getEvent()->getLayout()->getUpdate();
162
+ $update->addHandle('borderfree');
163
+ }
164
+
165
+ return $this;
166
+ }
167
+
168
+ /**
169
+ * Apply category view for tree based on Borderfree restrictions
170
+ *
171
+ * @param Varien_Event_Observer $observer
172
+ * @return Enterprise_CatalogPermissions_Model_Observer
173
+ */
174
+ public function applyCategoryInactiveIds(Varien_Event_Observer $observer)
175
+ {
176
+ if (!$this->settingsHelper->isBorderfreeEnabled()) {
177
+ return $this;
178
+ }
179
+
180
+ $this->restrictedCategories = array();
181
+ $currentCountryCode = $this->localizationHelper->getShippingCountry();
182
+ $currentCountryName = $this->localizationHelper->codeToCountry($currentCountryCode);
183
+ $currentCountryId = $this->localizationHelper->getOptionIdByValue("catalog_category", "category_country_restrictions", $currentCountryName);
184
+
185
+ $categories = Mage::getModel("catalog/category")->getCollection()->addFieldToFilter('borderfree_restricted', 1);
186
+ foreach($categories as $category)
187
+ $this->addRestrictedCategory($category);
188
+
189
+ $categories = Mage::getModel("catalog/category")->getCollection()->addFieldToFilter('category_country_restrictions', array('finset' => $this->allCountries));
190
+ foreach($categories as $category)
191
+ $this->addRestrictedCategory($category);
192
+
193
+ $categories = Mage::getModel("catalog/category")->getCollection()->addFieldToFilter('category_country_restrictions', array('finset' => $currentCountryId));
194
+ foreach($categories as $category)
195
+ $this->addRestrictedCategory($category);
196
+
197
+ $observer->getEvent()->getTree()->addInactiveCategoryIds($this->restrictedCategories);
198
+
199
+ return $this;
200
+ }
201
+
202
+ public function applyProductPermissionOnCollection(Varien_Event_Observer $observer)
203
+ {
204
+ if (!$this->settingsHelper->isBorderfreeEnabled())
205
+ return $this;
206
+
207
+
208
+ $currentCountryCode = $this->localizationHelper->getShippingCountry();
209
+ $currentCountryName = $this->localizationHelper->codeToCountry($currentCountryCode);
210
+ $currentCountryId = $this->localizationHelper->getOptionIdByValue("catalog_product", "country_restrictions", $currentCountryName);
211
+
212
+ $allCountries = "(#? IS NOT NULL AND FIND_IN_SET('" . $this->localizationHelper->getOptionIdByValue("catalog_product", "country_restrictions", "All") . "', #?))";
213
+ $currentCountry = "(#? IS NOT NULL AND FIND_IN_SET('" . $currentCountryId . "', #?))";
214
+
215
+ $collection = $observer->getEvent()->getCollection();
216
+ $collection = $collection->addAttributeToFilter('borderfree_restricted', array("neq" => 1));
217
+ $collection = $collection->addAttributeToFilter('country_restrictions', array('eq' => 0, 'field_expr' => $allCountries), "left");
218
+ $collection = $collection->addAttributeToFilter('country_restrictions', array('eq' => 0, 'field_expr' => $currentCountry), "left");
219
+
220
+ return $this;
221
+ }
222
+
223
+
224
+ /**
225
+ *
226
+ *
227
+ * @param Mage_Catalog_Model_Category $category
228
+ */
229
+ private function addRestrictedCategory(Mage_Catalog_Model_Category $category)
230
+ {
231
+ $this->restrictedCategories[] = $category->getId();
232
+ array_merge($this->restrictedCategories, $this->getChildCategoyIds($category));
233
+ }
234
+
235
+
236
+ /**
237
+ * Returns an arry of child category IDs
238
+ *
239
+ * @param Mage_Catalog_Model_Category $category
240
+ * @return array
241
+ */
242
+ private function getChildCategoyIds(Mage_Catalog_Model_Category $category)
243
+ {
244
+ $childCategoryIds = array();
245
+
246
+ foreach($category->getChildrenCategories() as $category)
247
+ {
248
+ $childCategoryIds[] = $category->getId();
249
+ array_merge($childCategoryIds, $this->getChildCategoyIds($category));
250
+ }
251
+
252
+ return $childCategoryIds;
253
+ }
254
+
255
+ /**
256
+ * Checks if given category is restricted for shipping to current country
257
+ *
258
+ * @param Mage_Catalog_Model_Category $category
259
+ * @return boolean
260
+ */
261
+ private function isCategoryRestricted(Mage_Catalog_Model_Category $category)
262
+ {
263
+ if($this->settingsHelper->isBorderfreeEnabled())
264
+ {
265
+ if($this->checkCategoryRestrictions($category))
266
+ return true;
267
+
268
+ $categories = $category->getParentCategories();
269
+
270
+ foreach($categories as $category)
271
+ {
272
+ $this->checkCategoryRestrictions($category);
273
+ }
274
+ }
275
+
276
+ return false;
277
+ }
278
+
279
+ /**
280
+ * Check for Borderfree category restrictions.
281
+ *
282
+ * @param Mage_Catalog_Model_Category $category
283
+ * @return boolean
284
+ */
285
+ private function checkCategoryRestrictions(Mage_Catalog_Model_Category $category)
286
+ {
287
+ $category = Mage::getModel('catalog/category')->load($category->getId());
288
+
289
+ $currentCountryCode = $this->localizationHelper->getShippingCountry();
290
+ $currentCountryName = $this->localizationHelper->codeToCountry($currentCountryCode);
291
+ $currentCountryId = $this->localizationHelper->getOptionIdByValue("catalog_category", "category_country_restrictions", $currentCountryName);
292
+
293
+ if($category->getFiftyoneRestricted())
294
+ return true;
295
+
296
+ $countryRestrictions = explode(",", $category->getCategoryCountryRestrictions());
297
+
298
+ if($countryRestrictions != NULL && in_array($this->allCountries, $countryRestrictions))
299
+ return true;
300
+
301
+ if($countryRestrictions != NULL && in_array($currentCountryId, $countryRestrictions))
302
+ return true;
303
+
304
+ return false;
305
+ }
306
+
307
+
308
+ /**
309
+ * Returns user to the home page is current category is restricted for current country.
310
+ *
311
+ * @param Varien_Event_Observer $observer
312
+ * @return @return FiFtyOne_Localization_Model_Observer
313
+ */
314
+ public function applyCategoryPermission(Varien_Event_Observer $observer)
315
+ {
316
+ if($this->settingsHelper->isBorderfreeEnabled())
317
+ {
318
+ $category = $observer->getEvent()->getCategory();
319
+ if($this->isCategoryRestricted($category))
320
+ {
321
+ $this->response = $observer->getEvent()->getControllerAction()->getResponse();
322
+ $this->response->setRedirect(Mage::getBaseUrl());
323
+ Mage::throwException($this->localizationHelper->__('Products in this category to not ship to your selected shipping country'));
324
+ }
325
+ }
326
+
327
+ return $this;
328
+ }
329
+
330
+ public function applyCategoryPermissionOnIsActiveFilterToCollection(Varien_Event_Observer $observer)
331
+ {
332
+ if (!$this->settingsHelper->isBorderfreeEnabled()) {
333
+ return $this;
334
+ }
335
+
336
+ $this->restrictedCategories = array();
337
+ $currentCountryCode = $this->localizationHelper->getShippingCountry();
338
+ $currentCountryName = $this->localizationHelper->codeToCountry($currentCountryCode);
339
+ $currentCountryId = $this->localizationHelper->getOptionIdByValue("catalog_category", "category_country_restrictions", $currentCountryName);
340
+
341
+ $categories = Mage::getModel("catalog/category")->getCollection()->addFieldToFilter('category_country_restrictions', array('finset' => $this->allCountries));
342
+ foreach($categories as $category)
343
+ $this->addRestrictedCategory($category);
344
+
345
+ $categories = Mage::getModel("catalog/category")->getCollection()->addFieldToFilter('category_country_restrictions', array('finset' => $currentCountryId));
346
+ foreach($categories as $category)
347
+ $this->addRestrictedCategory($category);
348
+
349
+ $categoryCollection = $observer->getEvent()->getCategoryCollection()->addFieldToFilter('borderfree_restricted', array("neq" => 1));
350
+
351
+ $categoryCollection->addFieldToFilter("entity_id", array("nin" => $this->restrictedCategories));
352
+
353
+ return $this;
354
+ }
355
+
356
+ public function removeShippingMethod(Varien_Event_Observer $observer)
357
+ {
358
+ if($this->settingsHelper->isBorderfreeEnabled())
359
+ {
360
+ $quote = Mage::getModel('checkout/cart')->getQuote();
361
+ $quote->getShippingAddress()->setShippingMethod("");
362
+ }
363
+
364
+ return $this;
365
+ }
366
+
367
+ }
368
+ ?>
app/code/local/Borderfree/Localization/Model/Payment.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Payment extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/payment');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Region.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Region extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/region');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Rounding.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Localization_Model_Rounding extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreelocalization/rounding');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Localization/Model/Store.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Localization
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * Overides Mage_Core_Model_Store to set Akamai cookie when currency is changed
15
+ *
16
+ * @category Borderfree
17
+ * @package Borderfree_Localization
18
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
19
+ * @see Mage_Core_Model_Store
20
+ *
21
+ */
22
+ class Borderfree_Localization_Model_Store extends Mage_Core_Model_Store
23
+ {
24
+ /**
25
+ * Set the Borderfree Akamai Cookie when store currency is changed.
26
+ *
27
+ * @param $code Currency Code
28
+ * @return Borderfree_Localization_Model_Store
29
+ * @see Mage_Core_Model_Store::setCurrentCurrencyCode()
30
+ */
31
+ public function setCurrentCurrencyCode($code)
32
+ {
33
+ $countryCode = Mage::getSingleton('customer/session')->getShippingCountry();
34
+ $rate = Mage::getModel("directory/currency")->setCurrencyCode("USD")->getRate($code);
35
+ $lcp = Mage::helper("borderfreelocalization")->getLCPMultiplier();
36
+ $rate = $rate * $lcp;
37
+
38
+ $code = strtoupper($code);
39
+ if (in_array($code, $this->getAvailableCurrencyCodes()))
40
+ {
41
+ $this->_getSession()->setCurrencyCode($code);
42
+ Mage::app()->getCookie()->set(self::COOKIE_CURRENCY, "$countryCode|$code|$rate", 0);
43
+ }
44
+
45
+ if(Mage::getStoreConfig('borderfree_options/settings/akamai'))
46
+ setcookie("Borderfree_Akamai", "$countryCode|$code|$rate", 0, "/");
47
+
48
+ return $this;
49
+ }
50
+ }
app/code/local/Borderfree/Localization/Model/Tax.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Localization
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * Overides Mage_Tax_Model_Calculation to ensure international customers are not charged sales tax
15
+ *
16
+ * @category Borderfree
17
+ * @package Borderfree_Localization
18
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
19
+ * @see Mage_Tax_Model_Calculation
20
+ *
21
+ */
22
+ class Borderfree_Localization_Model_Tax extends Mage_Tax_Model_Calculation
23
+ {
24
+ /**
25
+ * Forces sales tax for international orders to zero
26
+ *
27
+ * @param $request
28
+ * @return float
29
+ * @see Mage_Tax_Model_Calculation::getRate()
30
+ */
31
+ public function getRate($request)
32
+ {
33
+ if(Mage::getSingleton('customer/session')->getShippingCountry() != "US")
34
+ return 0;
35
+
36
+ return parent::getRate($request);
37
+ }
38
+ }
app/code/local/Borderfree/Localization/controllers/CountryController.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Localization
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * This controler handles requests to switch shipping countries.
15
+ *
16
+ * @category Borderfree
17
+ * @package Borderfree_Localization
18
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
19
+ *
20
+ */
21
+ class Borderfree_Localization_CountryController extends Mage_Core_Controller_Front_Action
22
+ {
23
+ /**
24
+ * Switches current shipping country based on "country" paramater.
25
+ */
26
+ public function switchAction()
27
+ {
28
+ if ($country = (string) $this->getRequest()->getParam('country'))
29
+ Mage::getModel("borderfreelocalization/country")->_setLocale($country, false);
30
+
31
+ $this->_redirectReferer(Mage::getBaseUrl());
32
+ }
33
+ }
app/code/local/Borderfree/Localization/etc/config.xml ADDED
@@ -0,0 +1,275 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Borderfree_Localization>
5
+ <version>1.0.9</version>
6
+ </Borderfree_Localization>
7
+ </modules>
8
+
9
+ <global>
10
+
11
+ <helpers>
12
+ <borderfreelocalization>
13
+ <class>Borderfree_Localization_Helper</class>
14
+ </borderfreelocalization>
15
+ <wishlist>
16
+ <rewrite>
17
+ <data>Borderfree_Localization_Helper_Wishlist</data>
18
+ </rewrite>
19
+ </wishlist>
20
+ </helpers>
21
+
22
+ <blocks>
23
+ <borderfreelocalization>
24
+ <class>Borderfree_Localization_Block</class>
25
+ </borderfreelocalization>
26
+ </blocks>
27
+
28
+ <models>
29
+ <borderfreelocalization>
30
+ <class>Borderfree_Localization_Model</class>
31
+ <resourceModel>borderfreelocalization_mysql4</resourceModel>
32
+ </borderfreelocalization>
33
+ <borderfreelocalization_mysql4>
34
+ <class>Borderfree_Localization_Model_Mysql4</class>
35
+ <entities>
36
+ <cache>
37
+ <table>borderfree_localization_cache</table>
38
+ </cache>
39
+ <ip>
40
+ <table>borderfree_localization_ip</table>
41
+ </ip>
42
+ <fxrate>
43
+ <table>borderfree_fx_rates</table>
44
+ </fxrate>
45
+ <country>
46
+ <table>borderfree_countries</table>
47
+ </country>
48
+ <region>
49
+ <table>borderfree_regions</table>
50
+ </region>
51
+ <currency>
52
+ <table>borderfree_currency</table>
53
+ </currency>
54
+ <payment>
55
+ <table>borderfree_payment</table>
56
+ </payment>
57
+ <lcp>
58
+ <table>borderfree_lcp_rules</table>
59
+ </lcp>
60
+ <rounding>
61
+ <table>borderfree_rounding_rules</table>
62
+ </rounding>
63
+ </entities>
64
+ </borderfreelocalization_mysql4>
65
+ <directory>
66
+ <rewrite>
67
+ <currency>Borderfree_Localization_Model_Convert</currency>
68
+ </rewrite>
69
+ </directory>
70
+ <tax>
71
+ <rewrite>
72
+ <calculation>Borderfree_Localization_Model_Tax</calculation>
73
+ </rewrite>
74
+ </tax>
75
+ <salesrule>
76
+ <rewrite>
77
+ <quote_discount>Borderfree_Localization_Model_Discount</quote_discount>
78
+ </rewrite>
79
+ </salesrule>
80
+ <core>
81
+ <rewrite>
82
+ <store>Borderfree_Localization_Model_Store</store>
83
+ </rewrite>
84
+ </core>
85
+ </models>
86
+
87
+ <resources>
88
+ <borderfreelocalization_write>
89
+ <connection>
90
+ <use>core_write</use>
91
+ </connection>
92
+ </borderfreelocalization_write>
93
+ <borderfreelocalization_read>
94
+ <connection>
95
+ <use>core_read</use>
96
+ </connection>
97
+ </borderfreelocalization_read>
98
+ <borderfreelocalization_setup>
99
+ <setup>
100
+ <module>Borderfree_Localization</module>
101
+ <class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
102
+ </setup>
103
+ <connection>
104
+ <use>core_setup</use>
105
+ </connection>
106
+ </borderfreelocalization_setup>
107
+ </resources>
108
+ </global>
109
+
110
+ <frontend>
111
+
112
+ <layout>
113
+ <updates>
114
+ <borderfreelocalization>
115
+ <file>borderfreelocalization.xml</file>
116
+ </borderfreelocalization>
117
+ </updates>
118
+ </layout>
119
+
120
+ <events>
121
+ <controller_action_predispatch>
122
+ <observers>
123
+ <fiftonelocalization>
124
+ <class>borderfreelocalization/observer</class>
125
+ <method>preDispatch</method>
126
+ </fiftonelocalization>
127
+ </observers>
128
+ </controller_action_predispatch>
129
+ <controller_action_layout_load_before>
130
+ <observers>
131
+ <fiftonelocalization>
132
+ <class>borderfreelocalization/observer</class>
133
+ <method>updateLayout</method>
134
+ </fiftonelocalization>
135
+ </observers>
136
+ </controller_action_layout_load_before>
137
+ <catalog_category_tree_init_inactive_category_ids>
138
+ <observers>
139
+ <borderfreelocalization>
140
+ <class>borderfreelocalization/observer</class>
141
+ <method>applyCategoryInactiveIds</method>
142
+ </borderfreelocalization>
143
+ </observers>
144
+ </catalog_category_tree_init_inactive_category_ids>
145
+ <catalog_controller_category_init_after>
146
+ <observers>
147
+ <borderfreelocalization>
148
+ <class>borderfreelocalization/observer</class>
149
+ <method>applyCategoryPermission</method>
150
+ </borderfreelocalization>
151
+ </observers>
152
+ </catalog_controller_category_init_after>
153
+ <catalog_category_collection_add_is_active_filter>
154
+ <observers>
155
+ <borderfreelocalization>
156
+ <class>borderfreelocalization/observer</class>
157
+ <method>applyCategoryPermissionOnIsActiveFilterToCollection</method>
158
+ </borderfreelocalization>
159
+ </observers>
160
+ </catalog_category_collection_add_is_active_filter>
161
+ <controller_action_predispatch_checkout_cart_index>
162
+ <observers>
163
+ <borderfreelocalization>
164
+ <class>borderfreelocalization/observer</class>
165
+ <method>removeShippingMethod</method>
166
+ </borderfreelocalization>
167
+ </observers>
168
+ </controller_action_predispatch_checkout_cart_index>
169
+ <catalog_product_collection_apply_limitations_after>
170
+ <observers>
171
+ <borderfreelocalization>
172
+ <class>borderfreelocalization/observer</class>
173
+ <method>applyProductPermissionOnCollection</method>
174
+ </borderfreelocalization>
175
+ </observers>
176
+ </catalog_product_collection_apply_limitations_after>
177
+
178
+
179
+ <!--
180
+ <catalog_product_collection_before_add_count_to_categories>
181
+ <observers>
182
+ <enterprise_catalogpermissions>
183
+ <class>enterprise_catalogpermissions/observer</class>
184
+ <method>applyCategoryPermissionOnProductCount</method>
185
+ </enterprise_catalogpermissions>
186
+ </observers>
187
+ </catalog_product_collection_before_add_count_to_categories>
188
+ <catalog_product_is_salable_after>
189
+ <observers>
190
+ <enterprise_catalogpermissions>
191
+ <class>enterprise_catalogpermissions/observer</class>
192
+ <method>applyIsSalableToProduct</method>
193
+ </enterprise_catalogpermissions>
194
+ </observers>
195
+ </catalog_product_is_salable_after>
196
+ <catalog_product_collection_load_after>
197
+ <observers>
198
+ <enterprise_catalogpermissions>
199
+ <class>enterprise_catalogpermissions/observer</class>
200
+ <method>applyProductPermissionOnCollectionAfterLoad</method>
201
+ </enterprise_catalogpermissions>
202
+ </observers>
203
+ </catalog_product_collection_load_after>
204
+ <catalog_controller_product_init_after>
205
+ <observers>
206
+ <enterprise_catalogpermissions>
207
+ <class>enterprise_catalogpermissions/observer</class>
208
+ <method>applyProductPermission</method>
209
+ </enterprise_catalogpermissions>
210
+ </observers>
211
+ </catalog_controller_product_init_after>
212
+ <review_controller_product_init_after>
213
+ <observers>
214
+ <enterprise_catalogpermissions>
215
+ <class>enterprise_catalogpermissions/observer</class>
216
+ <method>applyProductPermission</method>
217
+ </enterprise_catalogpermissions>
218
+ </observers>
219
+ </review_controller_product_init_after>
220
+ <checkout_cart_product_add_after>
221
+ <observers>
222
+ <enterprise_catalogpermissions>
223
+ <class>enterprise_catalogpermissions/observer</class>
224
+ <method>checkQuoteItemSetProduct</method>
225
+ </enterprise_catalogpermissions>
226
+ </observers>
227
+ </checkout_cart_product_add_after>
228
+ <checkout_cart_save_before>
229
+ <observers>
230
+ <enterprise_catalogpermissions>
231
+ <class>enterprise_catalogpermissions/observer</class>
232
+ <method>checkQuotePermissions</method>
233
+ </enterprise_catalogpermissions>
234
+ </observers>
235
+ </checkout_cart_save_before>
236
+ <controller_action_predispatch_catalogsearch>
237
+ <observers>
238
+ <enterprise_catalogpermissions>
239
+ <class>enterprise_catalogpermissions/observer</class>
240
+ <method>checkCatalogSearchPreDispatch</method>
241
+ </enterprise_catalogpermissions>
242
+ </observers>
243
+ </controller_action_predispatch_catalogsearch>
244
+ <controller_action_layout_load_before>
245
+ <observers>
246
+ <enterprise_catalogpermissions>
247
+ <class>enterprise_catalogpermissions/observer</class>
248
+ <method>checkCatalogSearchLayout</method>
249
+ </enterprise_catalogpermissions>
250
+ </observers>
251
+ </controller_action_layout_load_before>
252
+ -->
253
+
254
+ </events>
255
+
256
+ <routers>
257
+ <borderfreelocalization>
258
+ <use>standard</use>
259
+ <args>
260
+ <module>Borderfree_Localization</module>
261
+ <frontName>borderfreelocalization</frontName>
262
+ </args>
263
+ </borderfreelocalization>
264
+ </routers>
265
+ <category>
266
+ <collection>
267
+ <attributes>
268
+ <borderfree_restricted />
269
+ <category_country_restrictions />
270
+ </attributes>
271
+ </collection>
272
+ </category>
273
+ </frontend>
274
+ </config>
275
+
app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("CREATE TABLE borderfree_localization_cache (id int(8) NOT NULL AUTO_INCREMENT, data_type char(30) NOT NULL, merchant_id char(10) NOT NULL, version int(8) NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
5
+ $installer->endSetup();
6
+ ?>
app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.0-1.0.1.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("CREATE TABLE borderfree_localization_ip (id int(8) NOT NULL AUTO_INCREMENT, country_code char(2) NOT NULL, low INT UNSIGNED NOT NULL, high INT UNSIGNED NOT NULL, PRIMARY KEY (id), INDEX(high), INDEX(low)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
5
+ $installer->endSetup();
6
+ ?>
app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.1-1.0.2.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("CREATE TABLE borderfree_fx_rates (buyer_currency char(3) NOT NULL, merchant_currency char(3) NOT NULL, fx_rate DOUBLE NOT NULL, PRIMARY KEY (buyer_currency)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
5
+ $installer->endSetup();
6
+ ?>
app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.2-1.0.3.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("CREATE TABLE borderfree_countries (id INT(8) NOT NULL AUTO_INCREMENT, country_code char(2) NOT NULL, merchant_id char(20), name char(75) NOT NULL, bill_to BOOLEAN NOT NULL, ship_to BOOLEAN NOT NULL, postal_code BOOLEAN NOT NULL, currency_code char(3) NOT NULL, language_code char(2) NOT NULL, locale char(10) NOT NULL, translation_available BOOLEAN NOT NULL, pricing_model char(10) NOT NULL, PRIMARY KEY (id), INDEX(country_code, merchant_id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
5
+ $installer->endSetup();
6
+ ?>
app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.3-1.0.4.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("CREATE TABLE borderfree_regions (id int(8) NOT NULL AUTO_INCREMENT, region_code char(2), country_code char(2) NOT NULL, merchant_id char(20), name char(75) NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
5
+ $installer->endSetup();
6
+ ?>
app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.4-1.0.5.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("CREATE TABLE borderfree_currency (id int(8) NOT NULL AUTO_INCREMENT, currency_code char(3), merchant_id char(20), name char(50), round_method tinyint(1), symbol char(10) NOT NULL, enabled BOOLEAN NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
5
+ $installer->run("CREATE TABLE borderfree_payment (id int(8) NOT NULL AUTO_INCREMENT, currency_code char(3), merchant_id char(20), method char(20) NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
6
+ $installer->endSetup();
7
+ ?>
app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.5-1.0.6.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ //$installer->run("CREATE TABLE borderfree_currency (id int(8) NOT NULL AUTO_INCREMENT, currency_code char(3), merchant_id char(20), name char(50), round_method tinyint(1), symbol char(10) NOT NULL, enabled BOOLEAN NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
5
+ $installer->endSetup();
6
+ ?>
app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.6-1.0.7.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("ALTER TABLE borderfree_fx_rates ADD quote_id int UNSIGNED");
5
+ $installer->endSetup();
6
+ ?>
app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.7-1.0.8.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("CREATE TABLE borderfree_lcp_rules (id int(8) NOT NULL, country_code char(2) NOT NULL, merchant_id char(20) NOT NULL, name char(50), description text(1024), multiplier DECIMAL(3,2) NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
5
+ $installer->run("CREATE TABLE borderfree_rounding_rules (id int(8) NOT NULL, country_code char(2) NOT NULL, merchant_id char(20) NOT NULL, name char(50), description text(1024), amount DECIMAL(3,2) NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
6
+ $installer->endSetup();
7
+ ?>
app/code/local/Borderfree/Localization/sql/borderfreelocalization_setup/mysql4-upgrade-1.0.8-1.0.9.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("DROP TABLE borderfree_lcp_rules;");
5
+ $installer->run("DROP TABLE borderfree_rounding_rules;");
6
+ $installer->run("CREATE TABLE borderfree_lcp_rules (id int(8) NOT NULL AUTO_INCREMENT, rule_id int(8) NOT NULL, country_code char(2) NOT NULL, merchant_id char(20) NOT NULL, name char(50), description text(1024), multiplier DECIMAL(3,2) NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
7
+ $installer->run("CREATE TABLE borderfree_rounding_rules (id int(8) NOT NULL AUTO_INCREMENT, rule_id int(8) NOT NULL, country_code char(2) NOT NULL, merchant_id char(20) NOT NULL, name char(50), description text(1024), amount DECIMAL(3,2) NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
8
+ $installer->endSetup();
9
+ ?>
app/code/local/Borderfree/Marketing/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Marketing_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
6
+ ?>
app/code/local/Borderfree/Marketing/Model/Mysql4/Marketing/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Marketing_Model_Mysql4_Record_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreemarketing/record');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Marketing/Model/Mysql4/Record.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Marketing_Model_Mysql4_Record extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreemarketing/record', 'email');
7
+ $this->_isPkAutoIncrement = false;
8
+ }
9
+ }
10
+ ?>
app/code/local/Borderfree/Marketing/Model/Record.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Marketing_Model_Record extends Mage_Core_Model_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('borderfreemarketing/record');
7
+ }
8
+ }
9
+ ?>
app/code/local/Borderfree/Marketing/etc/config.xml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Borderfree_Marketing>
5
+ <version>1.0.0</version>
6
+ </Borderfree_Marketing>
7
+ </modules>
8
+
9
+ <global>
10
+
11
+ <helpers>
12
+ <borderfreemarketing>
13
+ <class>Borderfree_Marketing_Helper</class>
14
+ </borderfreemarketing>
15
+ </helpers>
16
+
17
+ <models>
18
+ <borderfreemarketing>
19
+ <class>Borderfree_Marketing_Model</class>
20
+ <resourceModel>borderfreemarketing_mysql4</resourceModel>
21
+ </borderfreemarketing>
22
+ <borderfreemarketing_mysql4>
23
+ <class>Borderfree_Marketing_Model_Mysql4</class>
24
+ <entities>
25
+ <record>
26
+ <table>borderfree_marketing</table>
27
+ </record>
28
+ </entities>
29
+ </borderfreemarketing_mysql4>
30
+ </models>
31
+
32
+ <resources>
33
+ <borderfreemarketing_write>
34
+ <connection>
35
+ <use>core_write</use>
36
+ </connection>
37
+ </borderfreemarketing_write>
38
+ <borderfreemarketing_read>
39
+ <connection>
40
+ <use>core_read</use>
41
+ </connection>
42
+ </borderfreemarketing_read>
43
+ <borderfreemarketing_setup>
44
+ <setup>
45
+ <module>Borderfree_Marketing</module>
46
+ <class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
47
+ </setup>
48
+ <connection>
49
+ <use>core_setup</use>
50
+ </connection>
51
+ </borderfreemarketing_setup>
52
+ </resources>
53
+ </global>
54
+
55
+ </config>
56
+
app/code/local/Borderfree/Marketing/sql/borderfreemarketing_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("CREATE TABLE borderfree_marketing (email char(254) NOT NULL,
5
+ first_name char(100),
6
+ middle_initials char(1),
7
+ last_name char(100),
8
+ address1 char(35),
9
+ address2 char(35),
10
+ address3 char(35),
11
+ city char(70),
12
+ region char(20),
13
+ postal_code char(12),
14
+ country char(2),
15
+ primary_phone char(20),
16
+ scondary_phone char(20),
17
+ PRIMARY KEY (email)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
18
+ $installer->endSetup();
19
+ ?>
app/code/local/Borderfree/Order/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Order_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
6
+ ?>
app/code/local/Borderfree/Order/Model/Import.php ADDED
@@ -0,0 +1,422 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Order_Model_Import extends Mage_Core_Model_Abstract
3
+ {
4
+ private $dir = "";
5
+ private $errors = "";
6
+ private $merchantIds = array();
7
+ private $subject = "Borderfree Order Import Error";
8
+ private $batchId;
9
+
10
+ function __construct()
11
+ {
12
+ parent::__construct();
13
+
14
+ $dir = Mage::getBaseDir('app') . DS . "etc" . DS . ".gnupg";
15
+ putenv('GNUPGHOME=' . $dir);
16
+
17
+ $this->dir = Mage::getBaseDir('var') . DS . "Borderfree" . DS . "orders" . DS;
18
+ umask(0);
19
+ $this->batchId = date("mdyHis");
20
+
21
+ if(!is_dir(Mage::getBaseDir('var') .DS . "Borderfree"))
22
+ mkdir(Mage::getBaseDir('var') .DS . "Borderfree");
23
+
24
+ if(!is_dir($this->dir))
25
+ mkdir($this->dir);
26
+
27
+ if(!is_dir($this->dir . "errors"))
28
+ mkdir($this->dir . "errors");
29
+ }
30
+
31
+ public function getPoFiles()
32
+ {
33
+ try
34
+ {
35
+ $server = Mage::getStoreConfig('borderfree_options/settings/staging') ? Mage::getStoreConfig('borderfree_options/catalog/ftpstage') : Mage::getStoreConfig('borderfree_options/catalog/ftpprod');
36
+ $username = Mage::getStoreConfig('borderfree_options/catalog/ftpuser');
37
+ $password = Mage::helper('core')->decrypt(Mage::getStoreConfig('borderfree_options/catalog/ftppassword'));
38
+
39
+ $conn_id = ftp_ssl_connect($server);
40
+ if(!$conn_id)
41
+ throw new Exception("Unable to connect to FTP server: $server");
42
+
43
+ $login_result = ftp_login($conn_id, $username, $password);
44
+ if(!$login_result)
45
+ throw new Exception("Login to FTP server $server failed for user $username");
46
+
47
+ ftp_pasv($conn_id, true);
48
+
49
+ $chdir = ftp_chdir($conn_id, "/Outbox/Orders");
50
+ if(!$chdir)
51
+ throw new Exception("Unable to change directory to /Outbox/Orders on server $server");
52
+
53
+ $files = ftp_nlist($conn_id, ".");
54
+ foreach($files as $file)
55
+ {
56
+ if(strpos($file, "asc") > 0)
57
+ {
58
+ $get = ftp_get($conn_id, $this->dir . $file, $file, FTP_BINARY);
59
+ ftp_delete($conn_id, $file);
60
+ }
61
+ }
62
+ }
63
+ catch(Exception $e)
64
+ {
65
+ $this->logError("Get PO files: " . $e->getMessage());
66
+ }
67
+ if($conn_id) {
68
+ ftp_close($conn_id);
69
+ }
70
+ }
71
+
72
+
73
+ public function import()
74
+ {
75
+ $model = Mage::getModel('borderfreecrontab/log');
76
+ $model->setType("Import Orders");
77
+ $model->setLastRun(time());
78
+ $model->save();
79
+
80
+ $allStores = Mage::app()->getStores();
81
+ foreach ($allStores as $_eachStoreId => $val)
82
+ {
83
+ $store = Mage::app()->getStore($_eachStoreId)->getId();
84
+ Mage::app()->setCurrentStore($store);
85
+ if(Mage::getStoreConfig('borderfree_options/settings/enabled'))
86
+ {
87
+ if(!in_array(Mage::getStoreConfig('borderfree_options/settings/merchantid'), $this->merchantIds))
88
+ {
89
+ try
90
+ {
91
+ $this->merchantIds[] = Mage::getStoreConfig('borderfree_options/settings/merchantid');
92
+ $this->getPoFiles();
93
+ $this->importPoFiles();
94
+ }
95
+ catch(Exception $e)
96
+ {
97
+ $this->logError($e->getMessage());
98
+ }
99
+
100
+ }
101
+ }
102
+ }
103
+
104
+ $this->sendErrorLog();
105
+ }
106
+
107
+ private function importPoFiles()
108
+ {
109
+ $gpg = new gnupg();
110
+ $result = $gpg->import(Mage::getStoreConfig('borderfree_options/order/pgp'));
111
+ $gpg->adddecryptkey($result["fingerprint"], "");
112
+ $dir = dir($this->dir);
113
+ while ((false !== ($file = $dir->read())))
114
+ {
115
+ try
116
+ {
117
+ if(strpos($file, "asc") > 0)
118
+ {
119
+ $enc = file_get_contents($this->dir . $file);
120
+ $orderXml = $gpg->decrypt($enc);
121
+ $this->importPoFile($orderXml, $file);
122
+ }
123
+ }
124
+ catch(Exception $e)
125
+ {
126
+ $this->logError("Error decrypting PO file $file: " . $e->getMessage());
127
+ rename($this->dir . $file, $this->dir . "errors" . DS. $file);
128
+ }
129
+ }
130
+ $dir->close();
131
+ }
132
+
133
+ private function setQuoteAddress($quoteAdderss, $address)
134
+ {
135
+ $quoteAdderss->setFirstname((string)$address->FirstName);
136
+ $quoteAdderss->setMiddlename((string)$address->MiddleInitials);
137
+ $quoteAdderss->setLastname((string)$address->LastName);
138
+ $quoteAdderss->setCity((string)$address->City);
139
+ $quoteAdderss->setCountryId("US");
140
+ $quoteAdderss->setPostcode((string)$address->PostalCode);
141
+ $quoteAdderss->setTelephone((string)$address->PrimaryPhone);
142
+ $quoteAdderss->setSameAsBilling(0);
143
+
144
+ $state = $address->Region;
145
+ $regionModel = Mage::getModel('directory/region')->loadByCode($state, "US");
146
+ $quoteAdderss->setRegionId($regionModel->getId());
147
+
148
+
149
+ $street = array();
150
+ $street[] = (string)$address->AddressLine1;
151
+ $street[] = (string)$address->AddressLine2;
152
+ $street[] = (string)$address->AddressLine3;
153
+ $quoteAdderss->setStreet($street);
154
+
155
+ $quoteAdderss->save();
156
+ }
157
+
158
+ /**
159
+ * Import a purchase order
160
+ *
161
+ * @todo quote not found
162
+ * @todo quote active
163
+ * @todo totals do not match
164
+ * @todo already has increment ID
165
+ *
166
+ * @param string $xml PO XML
167
+ * @param string $file PO filename
168
+ */
169
+ private function importPoFile($xml, $file)
170
+ {
171
+ $hasError = false;
172
+ $orders = new SimpleXMLElement($xml);
173
+ foreach($orders->Order as $order)
174
+ {
175
+ try
176
+ {
177
+ $quoteId = (string)$order->OrderId->MerchantOrderRef;
178
+ $fraudState = (string)$order->FraudState;
179
+ $quote = Mage::getModel("sales/quote")->load($quoteId);
180
+ $blind = ($quote->getId() == NULL);
181
+
182
+ if($blind)
183
+ $quote->save();
184
+
185
+ if($fraudState == "GREEN")
186
+ {
187
+ $quote->setBorderfreeOrderId((string)$order->OrderId->E4XOrderId);
188
+ $domesticProfile = $order->DomesticProfile;
189
+ $billingAddress = $domesticProfile->Address[0];
190
+ $quote->setCustomerEmail((string)$billingAddress->Email);
191
+ $this->setQuoteAddress($quote->getBillingAddress(), $billingAddress);
192
+ $shippingAddress = $domesticProfile->Address[1];
193
+ $this->setQuoteAddress($quote->getShippingAddress(), $shippingAddress);
194
+
195
+ $quote->setStore(Mage::app()->getStore());
196
+ $quote->setBaseCurrencyCode("USD");
197
+ $quote->setCurrencyCode("USD");
198
+
199
+ $items = $order->DomesticBasket->BasketDetails->BasketItem;
200
+ $totalProductExtraShipping = floatval(0);
201
+ $totalProductExtraHandling = floatval(0);
202
+ if($blind)
203
+ {
204
+
205
+ foreach($items as $item)
206
+ {
207
+ $sku = (string)$item->MerchantSKU;
208
+ $qty = new Varien_Object(array('qty' => (string)$item->ProductQuantity));
209
+ $price = (string)$item->ProductSalePrice;
210
+ $product = Mage::helper('catalog/product')->getProduct($sku, Mage::app()->getStore()->getId(), 'sku');
211
+ $quoteItem = $quote->addProduct($product, $qty);
212
+ $quoteItem->setCustomPrice($price);
213
+ $quoteItem->setOriginalCustomPrice($price);
214
+ $totalProductExtraShipping += $item->ProductExtraShipping;
215
+ $totalProductExtraHandling += $item->ProductExtraHandling;
216
+ //$quoteItem->getProduct()->setIsSuperMode(true);
217
+ }
218
+
219
+ }
220
+ else
221
+ {
222
+ foreach($quote->getAllItems() as $qItem)
223
+ {
224
+ foreach($items as $item)
225
+ {
226
+ if($qItem->getSku() == (string)$item->MerchantSKU)
227
+ {
228
+ $price = (string)$item->ProductSalePrice;
229
+ $qItem->setCustomPrice($price);
230
+ $qItem->setOriginalCustomPrice($price);
231
+ $totalProductExtraShipping += $item->ProductExtraShipping;
232
+ $totalProductExtraHandling += $item->ProductExtraHandling;
233
+ $qItem->getProduct()->setIsSuperMode(true);
234
+ }
235
+ }
236
+ }
237
+ }
238
+
239
+
240
+
241
+
242
+ $domesticShippingPrice = floatval($order->COPShippingMethod->DeliveryServiceType->ShippingPrice);
243
+ $domesticHandlingPrice = floatval($order->COPShippingMethod->DeliveryServiceType->HandlingPrice);
244
+ $extraInsurancePrice = floatval($order->COPShippingMethod->DeliveryServiceType->ExtraInsurancePrice);
245
+ $totalShipping = $domesticShippingPrice + $domesticHandlingPrice + $extraInsurancePrice + $totalProductExtraShipping + $totalProductExtraHandling;
246
+
247
+ $method = Mage::getStoreConfig('borderfree_options/shipping/method');
248
+ $shippingAddress = $quote->getShippingAddress();
249
+ $shippingAddress->setCollectShippingRates(true);
250
+ $shippingAddress->collectShippingRates();
251
+ $shippingAddress->setShippingMethod($method);
252
+ $shippingAddress->collectTotals();
253
+ $shippingAddress->save();
254
+ $quote->collectTotals();
255
+ $quote->save();
256
+
257
+
258
+ $shippingAddress->setShippingAmount($totalShipping);
259
+ $shippingAddress->setBaseShippingAmount($totalShipping);
260
+ $shippingAddress->setBorderfree(true);
261
+ $quote->setTotalsCollectedFlag(false);
262
+ $quote->collectTotals()->save();
263
+
264
+ $customerId = $quote->getCustomerId();
265
+ if($customerId == NULL)
266
+ {
267
+ $quote->setCustomerIsGuest(1);
268
+ $address = $order->Marketing->Address[1];
269
+ $quote->setCustomerFirstname((string)$address->FirstName);
270
+ $quote->setCustomerMiddlename((string)$address->MiddleInitials);
271
+ $quote->setCustomerLastname((string)$address->LastName);
272
+ $quote->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID);
273
+ }
274
+
275
+ $payment = array();
276
+ $payment["method"] = (string)Mage::getStoreConfig('borderfree_options/order/method');
277
+
278
+ if($payment["method"] != "checkmo")
279
+ {
280
+ $payment["cc_owner"] = (string)$order->CreditCard->NameOnCard;
281
+ if(strpos((string)$order->CreditCard->Type, "A") === 0)
282
+ $payment["cc_type"] = "AE";
283
+ else if(strpos((string)$order->CreditCard->Type, "V") === 0)
284
+ $payment["cc_type"] = "VI";
285
+ else if(strpos((string)$order->CreditCard->Type, "M") === 0)
286
+ $payment["cc_type"] = "MC";
287
+ else if(strpos((string)$order->CreditCard->Type, "D") === 0)
288
+ $payment["cc_type"] = "DI";
289
+ $payment["cc_number"] = (string)$order->CreditCard->Number;
290
+ $payment["cc_exp_month"] = intval((string)$order->CreditCard->Expiry->Month);
291
+ $payment["cc_exp_year"] = intval((string)$order->CreditCard->Expiry->Year);
292
+ $payment["cc_cid"] = (string)$order->CreditCard->CVN;
293
+ }
294
+
295
+ $quote->setTotalsCollectedFlag(true);
296
+ $quote->getBillingAddress()->setPaymentMethod($payment['method']);
297
+ $quote->getPayment()->importData($payment);
298
+
299
+ $service = Mage::getModel('sales/service_quote', $quote);
300
+ $service->submitAll();
301
+
302
+ $morder = $service->getOrder();
303
+ /*if ($morder && $morder->getCanSendNewEmailFlag())
304
+ $morder->sendNewOrderEmail();*/
305
+
306
+ $profiles = $service->getRecurringPaymentProfiles();
307
+ Mage::dispatchEvent(
308
+ 'checkout_submit_all_after',
309
+ array('order' => $morder, 'quote' => $quote, 'recurring_profiles' => $profiles)
310
+ );
311
+
312
+ $quote->save();
313
+ if($blind)
314
+ {
315
+ $observer = new Varien_Event_Observer();
316
+ $event = new Varien_Event(array('quote'=>$quote));
317
+ $observer->setEvent($event);
318
+ $inv = Mage::getModel("cataloginventory/observer");
319
+ $inv->subtractQuoteInventory($observer,true);
320
+ $inv->reindexQuoteInventory($observer);
321
+ }
322
+
323
+ $confirmed = $this->confirmOrder($morder->getIncrementId(), (string)$order->OrderId->E4XOrderId);
324
+ if(!$confirmed)
325
+ $hasError = true;
326
+
327
+ }
328
+ elseif(!$blind)
329
+ {
330
+ $observer = new Varien_Event_Observer();
331
+ $event = new Varien_Event(array('quote'=>$quote));
332
+ $observer->setEvent($event);
333
+ $inv = Mage::getModel("cataloginventory/observer");
334
+ $inv->revertQuoteInventory($observer);
335
+ $inv->reindexQuoteInventory($observer);
336
+ }
337
+
338
+ $email = (string)$order->Marketing->Address[1]->Email;
339
+ if(!empty($email))
340
+ {
341
+ $data = $order->Marketing->Address[1];
342
+ $record = Mage::getModel("borderfreemarketing/record")->load($email);
343
+ $record->setEmail($email);
344
+ $record->setFirstName($data->FirstName);
345
+ $record->setMiddleInitials($data->MiddleInitials);
346
+ $record->setLastName($data->LastName);
347
+ $record->setAddress1($data->AddressLine1);
348
+ $record->setAddress2($data->AddressLine2);
349
+ $record->setAddress3($data->AddressLine3);
350
+ $record->setCity($data->City);
351
+ $record->setRegion($data->Region);
352
+ $record->setCountry($data->setCountry);
353
+ $record->setPostalCode($data->PostalCode);
354
+ $record->setPrimaryPhone($data->PrimaryPhone);
355
+ $record->setSecondaryPhone($data->SecondaryPhone);
356
+ $record->save();
357
+ }
358
+
359
+ }
360
+ catch(Exception $e)
361
+ {
362
+ $this->logError("Error Importing order - PO file $file: " . $e->getMessage());
363
+ $hasError = true;
364
+ }
365
+ }
366
+
367
+ if($hasError)
368
+ rename($this->dir . $file, $this->dir . "errors" . DS. $file);
369
+ else
370
+ unlink($this->dir . $file);
371
+ }
372
+
373
+ private function confirmOrder($merchantOrderId, $orderId)
374
+ {
375
+ $ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
376
+
377
+ $token = new stdClass;
378
+ $token->Username = new SOAPVar(Mage::getStoreConfig('borderfree_options/settings/apiuser'), XSD_STRING, null, null, null, $ns);
379
+ $token->Password = new SOAPVar(Mage::helper('core')->decrypt(Mage::getStoreConfig('borderfree_options/settings/apipassword')), XSD_STRING, null, null, null, $ns);
380
+
381
+ $wsec = new stdClass;
382
+ $wsec->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $ns);
383
+
384
+ $header = new SOAPHeader($ns, 'Security', $wsec, true);
385
+
386
+ $orderConfirmation = new stdClass();
387
+ $orderConfirmation->order = new stdClass();
388
+ $orderConfirmation->order->merchantOrderId = $merchantOrderId;
389
+ $orderConfirmation->order->orderId = $orderId;
390
+
391
+ $wsdl = Mage::getStoreConfig('borderfree_options/settings/staging') ? Mage::getStoreConfig('borderfree_options/order/staging') : Mage::getStoreConfig('borderfree_options/order/production');
392
+ $client = new SoapClient($wsdl);
393
+ $client->__setSoapHeaders($header);
394
+ try
395
+ {
396
+ $response = $client->orderConfirmation($orderConfirmation);
397
+ }
398
+ catch(Exception $e)
399
+ {
400
+ $this->logError("Order Confirmation API Error - Order: $merchantOrderId - " . $e->getMessage());
401
+ return false;
402
+ }
403
+
404
+ return true;
405
+ }
406
+
407
+ private function sendErrorLog()
408
+ {
409
+ if(empty($this->errors))
410
+ return;
411
+
412
+ mail(Mage::getStoreConfig('borderfree_options/settings/erroremail'), $this->subject, $this->errors);
413
+ $this->errors = "";
414
+
415
+ }
416
+
417
+ private function logError($message)
418
+ {
419
+ $this->errors .= $message . "\n";
420
+ Mage::log($message, Zend_Log::ERR, "borderfree_order_import.log");
421
+ }
422
+ }
app/code/local/Borderfree/Order/Model/Observer.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ //check if Magento EE 1.13 and above
4
+ if(class_exists('Enterprise_CatalogInventory_Model_Index_Observer')){
5
+
6
+ class Borderfree_Order_Model_Observer extends Enterprise_CatalogInventory_Model_Index_Observer
7
+ {
8
+
9
+ public function subtractQuoteInventory(Varien_Event_Observer $observer, $blind = false)
10
+ {
11
+ $quote = $observer->getEvent()->getQuote();
12
+ $borderfreeOrderId = $quote->getBorderfreeOrderId();
13
+ if(!is_null($borderfreeOrderId) && $borderfreeOrderId != '' && !$blind) {
14
+ return;
15
+ } else {
16
+ // Maybe we've already processed this quote in some event during order placement
17
+ // e.g. call in event 'sales_model_service_quote_submit_before' and later in 'checkout_submit_all_after'
18
+ if ($quote->getInventoryProcessed()) {
19
+ return;
20
+ }
21
+ $items = $this->_getProductsQty($quote->getAllItems());
22
+
23
+ /**
24
+ * Remember items
25
+ */
26
+ $this->_itemsForReindex = Mage::getSingleton('cataloginventory/stock')->registerProductsSale($items);
27
+
28
+ $quote->setInventoryProcessed(true);
29
+ return $this;
30
+ }
31
+ }
32
+ }
33
+
34
+
35
+ }else{
36
+
37
+
38
+ class Borderfree_Order_Model_Observer extends Mage_CatalogInventory_Model_Observer
39
+ {
40
+
41
+ public function subtractQuoteInventory(Varien_Event_Observer $observer, $blind = false)
42
+ {
43
+ $quote = $observer->getEvent()->getQuote();
44
+ $borderfreeOrderId = $quote->getBorderfreeOrderId();
45
+ if(!is_null($borderfreeOrderId) && $borderfreeOrderId != '' && !$blind) {
46
+ return;
47
+ } else {
48
+ // Maybe we've already processed this quote in some event during order placement
49
+ // e.g. call in event 'sales_model_service_quote_submit_before' and later in 'checkout_submit_all_after'
50
+ if ($quote->getInventoryProcessed()) {
51
+ return;
52
+ }
53
+ $items = $this->_getProductsQty($quote->getAllItems());
54
+
55
+ /**
56
+ * Remember items
57
+ */
58
+ $this->_itemsForReindex = Mage::getSingleton('cataloginventory/stock')->registerProductsSale($items);
59
+
60
+ $quote->setInventoryProcessed(true);
61
+ return $this;
62
+ }
63
+ }
64
+ }
65
+ }
app/code/local/Borderfree/Order/Model/Track.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Order
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * Overrides Mage_Sales_Model_Order_Shipment_Track to send tracking numbers to Borderfree.
15
+ *
16
+ * @category Borderfree
17
+ * @package Borderfree_Order
18
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
19
+ * @see Mage_Sales_Model_Order_Shipment_Track
20
+ */
21
+ class Borderfree_Order_Model_Track extends Mage_Sales_Model_Order_Shipment_Track
22
+ {
23
+ /**
24
+ * Sends tracking number and shipment contents to Fifty_One
25
+ *
26
+ * @todo Use error handling model
27
+ *
28
+ * @see Mage_Sales_Model_Order_Shipment_Track::_beforeSave()
29
+ */
30
+ protected function _beforeSave()
31
+ {
32
+ parent::_beforeSave();
33
+
34
+ $track = $this;
35
+
36
+ $shipment = $track->getShipment();
37
+ $order = $shipment->getOrder();
38
+ $borderfreeOrderId = $order->getBorderfreeOrderId();
39
+ if(!is_null($borderfreeOrderId) && $borderfreeOrderId != '')
40
+ {
41
+
42
+ $ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
43
+
44
+ $token = new stdClass;
45
+ $token->Username = new SOAPVar(Mage::getStoreConfig('borderfree_options/settings/apiuser'), XSD_STRING, null, null, null, $ns);
46
+ $token->Password = new SOAPVar(Mage::helper('core')->decrypt(Mage::getStoreConfig('borderfree_options/settings/apipassword')), XSD_STRING, null, null, null, $ns);
47
+
48
+ $wsec = new stdClass;
49
+ $wsec->UsernameToken = new SoapVar($token, SOAP_ENC_OBJECT, null, null, null, $ns);
50
+
51
+ $header = new SOAPHeader($ns, 'Security', $wsec, true);
52
+
53
+ $date = new DateTime();
54
+ $shippingDate = $date->format("Ymd");
55
+
56
+ $items = array();
57
+ $orderItems = array();
58
+
59
+ foreach ($shipment->getAllItems() as $item)
60
+ {
61
+ if ($item->getQty()>0)
62
+ {
63
+ if (!$item->getOrderItem()->isDummy(true))
64
+ {
65
+ $sku = $item->getSku();
66
+
67
+ $orderItem = $item->getOrderItem();
68
+ if($orderItem->getProductType() == "configurable")
69
+ {
70
+ $options = $orderItem->getProductOptions();
71
+ $sku = $options['simple_sku'];
72
+ }
73
+
74
+ $i = new stdClass();
75
+ $i->quantity = $item->getQty();
76
+ $i->sku = $sku;
77
+ $items[] = $i;
78
+ if($orderItem->canInvoice()) {
79
+ $orderItems[$orderItem->getItemId()] = $item->getQty();
80
+ }
81
+ }
82
+ }
83
+ }
84
+
85
+
86
+ $parcelShipmentNotification = new stdClass();
87
+ $parcelShipmentNotification->parcel = new stdClass();
88
+ $parcelShipmentNotification->parcel->carrierName = Mage::getStoreConfig('borderfree_options/shipping/carrier');
89
+ $parcelShipmentNotification->parcel->carrierService = Mage::getStoreConfig('borderfree_options/shipping/service');
90
+ $parcelShipmentNotification->parcel->items = $items;
91
+ $parcelShipmentNotification->parcel->orderId = $order->getBorderfreeOrderId();
92
+ $parcelShipmentNotification->parcel->parcelId = $track->getTrackNumber();
93
+ $parcelShipmentNotification->parcel->shippingDate = $shippingDate;
94
+
95
+ $trackingURL = Mage::getStoreConfig('borderfree_options/shipping/url');
96
+ if(!empty($trackingURL))
97
+ {
98
+ $trackingURL = str_replace("##", $track->getTrackNumber(), $trackingURL);
99
+ $parcelShipmentNotification->parcel->trackingURL = $trackingURL;
100
+ }
101
+
102
+ $parcelShipmentNotification->requestPackingSlip = false;
103
+
104
+ $wsdl = Mage::getStoreConfig('borderfree_options/settings/staging') ? Mage::getStoreConfig('borderfree_options/order/staging') : Mage::getStoreConfig('borderfree_options/order/production');
105
+ $client = new SoapClient($wsdl);
106
+ $client->__setSoapHeaders($header);
107
+ try
108
+ {
109
+ $response = $client->parcelShipmentNotification($parcelShipmentNotification);
110
+
111
+ }
112
+ catch(Exception $e)
113
+ {
114
+ $message = "Shipment Tracking API Error - Order: " . $order->getIncrementId() . " - " . $e->getMessage();
115
+ mail(Mage::getStoreConfig('borderfree_options/settings/erroremail'), "Borderfree Order Tracking API Error", $message);
116
+ }
117
+
118
+ if ($order->canInvoice())
119
+ {
120
+ try
121
+ {
122
+ foreach ($order->getAllItems() as $item)
123
+ {
124
+ if(!isset($orderItems[$item->getItemId()])) {
125
+ $orderItems[$item->getItemId()] = 0;
126
+ }
127
+ }
128
+ if($order->getPayment()->canCapturePartial())
129
+ {
130
+ $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice($orderItems);
131
+ }
132
+ else
133
+ {
134
+ $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
135
+ }
136
+ $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
137
+ $invoice->register();
138
+ $transactionSave = Mage::getModel('core/resource_transaction')->addObject($invoice)->addObject($invoice->getOrder());
139
+ $transactionSave->save();
140
+ }
141
+ catch (Exception $e)
142
+ {
143
+ $order->addStatusHistoryComment($e->getMessage());
144
+ $order->save();
145
+ $orderNumber = $order->getIncrementId();
146
+ Mage::log("Error Invoicing Order #" . $orderNumber . ": " . $e->getMessage(), null, "borderfree_order_invoice.log");
147
+ $order->setState(Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, true)->save();
148
+ }
149
+ }
150
+ }
151
+
152
+ return $this;
153
+ }
154
+ }
155
+
app/code/local/Borderfree/Order/etc/config.xml ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+
4
+ <modules>
5
+ <Borderfree_Order>
6
+ <version>1.0.0</version>
7
+ </Borderfree_Order>
8
+ </modules>
9
+
10
+ <global>
11
+ <helpers>
12
+ <borderfreeorder>
13
+ <class>Borderfree_Order_Helper</class>
14
+ </borderfreeorder>
15
+ </helpers>
16
+
17
+ <models>
18
+ <borderfreeorder>
19
+ <class>Borderfree_Order_Model</class>
20
+ <resourceModel>borderfreeorder_mysql4</resourceModel>
21
+ </borderfreeorder>
22
+ <borderfreeorder_mysql4>
23
+ <class>Borderfree_Order_Model_Mysql4</class>
24
+ </borderfreeorder_mysql4>
25
+
26
+ <sales>
27
+ <rewrite>
28
+ <order_shipment_track>Borderfree_Order_Model_Track</order_shipment_track>
29
+ </rewrite>
30
+ </sales>
31
+
32
+ <enterprise_cataloginventory>
33
+ <rewrite>
34
+ <index_observer>Borderfree_Order_Model_Observer</index_observer>
35
+ </rewrite>
36
+ </enterprise_cataloginventory>
37
+
38
+ <cataloginventory>
39
+ <rewrite>
40
+ <observer>Borderfree_Order_Model_Observer</observer>
41
+ </rewrite>
42
+ </cataloginventory>
43
+
44
+ </models>
45
+
46
+ <resources>
47
+ <borderfreeorder_write>
48
+ <connection>
49
+ <use>core_write</use>
50
+ </connection>
51
+ </borderfreeorder_write>
52
+ <borderfreeorder_read>
53
+ <connection>
54
+ <use>core_read</use>
55
+ </connection>
56
+ </borderfreeorder_read>
57
+ <borderfreeorder_setup>
58
+ <setup>
59
+ <module>Borderfree_Order</module>
60
+ <class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
61
+ </setup>
62
+ <connection>
63
+ <use>core_setup</use>
64
+ </connection>
65
+ </borderfreeorder_setup>
66
+ </resources>
67
+
68
+ <fieldsets>
69
+ <sales_convert_quote>
70
+ <borderfree_order_id>
71
+ <to_order>*</to_order>
72
+ </borderfree_order_id>
73
+ </sales_convert_quote>
74
+ </fieldsets>
75
+
76
+ </global>
77
+
78
+ </config>
79
+
app/code/local/Borderfree/Order/sql/borderfreeorder_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+ $installer->startSetup();
5
+
6
+
7
+ $installer->getConnection()
8
+ ->addColumn($installer->getTable('sales/order'), 'borderfree_order_id', array(
9
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
10
+ 'comment' => 'Borderfree Order ID',
11
+ 'length' => '100'
12
+ ));
13
+ $installer->getConnection()
14
+ ->addColumn($installer->getTable('sales/quote'), 'borderfree_order_id', array(
15
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
16
+ 'comment' => 'Borderfree Order ID',
17
+ 'length' => '100'
18
+ ));
19
+
20
+ $installer->endSetup();
app/code/local/Borderfree/Settings/Block/Adminhtml/Payment.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Settings_Block_Adminhtml_Payment
3
+ extends Mage_Adminhtml_Block_System_Config_Form_Field
4
+ {
5
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
6
+ {
7
+ $this->setElement($element);
8
+
9
+ $html = '<div id="merchant_allowed_methods_template">';
10
+ $html .= $this->_getRowTemplateHtml($this->_getValue('method'));
11
+ $html .= '</div>';
12
+
13
+ return $html;
14
+ }
15
+
16
+ /**
17
+ * Retrieve html template for shipping method row
18
+ *
19
+ * @param int $rowIndex
20
+ * @return string
21
+ */
22
+ protected function _getRowTemplateHtml($rowIndex = 0)
23
+ {
24
+ $html = '<select name="' . $this->getElement()->getName() . '" ' . $this->_getDisabled() . '>';
25
+ $html .= '<option value="" style="background:white;">' . $this->__('* Select payment method') . '</option>';
26
+ $html .= '<option value="checkmo" ' . $this->_getSelected('method/' . $rowIndex, "checkmo") . ' style="background:white;">' . $this->__('Borderfree ACH') . '</option>';
27
+
28
+ foreach(Mage::helper('payment')->getPaymentMethods($this->getRequest()->getParam('store')) as $code => $method)
29
+ {
30
+ if(isset($method['active']) && $method['active'] == 1 && isset($method['cctypes']))
31
+ {
32
+ $html .= '<option value="' . $this->escapeHtml($code) . '" '
33
+ . $this->_getSelected('method/' . $rowIndex, $code)
34
+ . ' style="background:white;">' . $this->escapeHtml($method['title']);
35
+ if(Mage::getModel($method['model'])->canCapturePartial())
36
+ {
37
+ $html .= ' - ' . Mage::helper('borderfreesettings')->__('(supports partial invoicing )');
38
+ }
39
+ else
40
+ {
41
+ $html .= ' - ' . Mage::helper('borderfreesettings')->__('(does not support partial invoicing)');
42
+ }
43
+ $html .= '</option>';
44
+ }
45
+ }
46
+
47
+ $html .= '</select>';
48
+
49
+ return $html;
50
+ }
51
+
52
+ protected function _getDisabled()
53
+ {
54
+ return $this->getElement()->getDisabled() ? ' disabled' : '';
55
+ }
56
+
57
+ protected function _getValue($key)
58
+ {
59
+ return $this->getElement()->getData('value');
60
+ }
61
+
62
+ protected function _getSelected($key, $value)
63
+ {
64
+ return $this->getElement()->getData('value') == $value ? 'selected="selected"' : '';
65
+ }
66
+
67
+ }
app/code/local/Borderfree/Settings/Block/Adminhtml/Shipping/Merchant.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Settings_Block_Adminhtml_Shipping_Merchant extends Mage_Adminhtml_Block_System_Config_Form_Field
3
+ {
4
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
5
+ {
6
+ $this->setElement($element);
7
+
8
+ $html = '<div id="merchant_allowed_methods_template">';
9
+ $html .= $this->_getRowTemplateHtml($this->_getValue('method'));
10
+ $html .= '</div>';
11
+
12
+ return $html;
13
+ }
14
+
15
+ /**
16
+ * Retrieve html template for shipping method row
17
+ *
18
+ * @param int $rowIndex
19
+ * @return string
20
+ */
21
+ protected function _getRowTemplateHtml($rowIndex = 0)
22
+ {
23
+ $html = '<select name="' . $this->getElement()->getName() . '" ' . $this->_getDisabled() . '>';
24
+ $html .= '<option value="">' . $this->__('* Select shipping method') . '</option>';
25
+
26
+ foreach ($this->getShippingMethods() as $carrierCode => $carrier) {
27
+ $html .= '<optgroup label="' . $this->escapeHtml($carrier['title'])
28
+ . '" style="border-top:solid 1px black; margin-top:3px;">';
29
+
30
+ foreach ($carrier['methods'] as $methodCode => $method) {
31
+ $code = $carrierCode . '_' . $methodCode;
32
+ $html .= '<option value="' . $this->escapeHtml($code) . '" '
33
+ . $this->_getSelected('method/' . $rowIndex, $code)
34
+ . ' style="background:white;">' . $this->escapeHtml($method['title']) . '</option>';
35
+ }
36
+ $html .= '</optgroup>';
37
+ }
38
+ $html .= '</select>';
39
+
40
+ return $html;
41
+ }
42
+
43
+ protected function getShippingMethods()
44
+ {
45
+ if (!$this->hasData('shipping_methods')) {
46
+ $website = $this->getRequest()->getParam('website');
47
+ $store = $this->getRequest()->getParam('store');
48
+
49
+ $storeId = null;
50
+ if (!is_null($website)) {
51
+ $storeId = Mage::getModel('core/website')
52
+ ->load($website, 'code')
53
+ ->getDefaultGroup()
54
+ ->getDefaultStoreId();
55
+ } elseif (!is_null($store)) {
56
+ $storeId = Mage::getModel('core/store')
57
+ ->load($store, 'code')
58
+ ->getId();
59
+ }
60
+
61
+ $methods = array();
62
+ $carriers = Mage::getSingleton('shipping/config')->getActiveCarriers($storeId);
63
+ foreach ($carriers as $carrierCode=>$carrierModel) {
64
+ if (!$carrierModel->isActive()) {
65
+ continue;
66
+ }
67
+ $carrierMethods = $carrierModel->getAllowedMethods();
68
+ if (!$carrierMethods) {
69
+ continue;
70
+ }
71
+ $carrierTitle = Mage::getStoreConfig('carriers/' . $carrierCode . '/title', $storeId);
72
+ $methods[$carrierCode] = array(
73
+ 'title' => $carrierTitle,
74
+ 'methods' => array(),
75
+ );
76
+ foreach ($carrierMethods as $methodCode=>$methodTitle) {
77
+ $methods[$carrierCode]['methods'][$methodTitle] = array(
78
+ 'title' => '[' . $carrierCode . '] ' . $methodTitle,
79
+ );
80
+ }
81
+ }
82
+ $this->setData('shipping_methods', $methods);
83
+ }
84
+ return $this->getData('shipping_methods');
85
+ }
86
+
87
+ protected function _getDisabled()
88
+ {
89
+ return $this->getElement()->getDisabled() ? ' disabled' : '';
90
+ }
91
+
92
+ protected function _getValue($key)
93
+ {
94
+ return $this->getElement()->getData('value');
95
+ }
96
+
97
+ protected function _getSelected($key, $value)
98
+ {
99
+ return $this->getElement()->getData('value') == $value ? 'selected="selected"' : '';
100
+ }
101
+
102
+ }
app/code/local/Borderfree/Settings/Block/Adminhtml/Shipping/State.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Settings_Block_Adminhtml_Shipping_State
3
+ extends Mage_Adminhtml_Block_System_Config_Form_Field
4
+ {
5
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
6
+ {
7
+ $this->setElement($element);
8
+
9
+ $html = '<div id="merchant_allowed_methods_template">';
10
+ $html .= $this->_getRowTemplateHtml($this->_getValue('method'));
11
+ $html .= '</div>';
12
+
13
+ return $html;
14
+ }
15
+
16
+ /**
17
+ * Retrieve html template for shipping method row
18
+ *
19
+ * @param int $rowIndex
20
+ * @return string
21
+ */
22
+ protected function _getRowTemplateHtml($rowIndex = 0)
23
+ {
24
+ $html = '<select name="' . $this->getElement()->getName() . '" ' . $this->_getDisabled() . '>';
25
+ $html .= '<option value="">' . $this->__('Select Ship-To State') . '</option>';
26
+
27
+ foreach ($this->state_list as $stateCode => $state)
28
+ {
29
+ $html .= '<option value="' . $stateCode . '" '
30
+ . $this->_getSelected($stateCode)
31
+ . ' style="background:white;">' . $state . '</option>';
32
+ }
33
+ $html .= '</select>';
34
+
35
+ return $html;
36
+ }
37
+
38
+
39
+ protected function _getDisabled()
40
+ {
41
+ return $this->getElement()->getDisabled() ? ' disabled' : '';
42
+ }
43
+
44
+ protected function _getValue($key)
45
+ {
46
+ return $this->getElement()->getData('value');
47
+ }
48
+
49
+ protected function _getSelected($value)
50
+ {
51
+ return $this->getElement()->getData('value') == $value ? 'selected="selected"' : '';
52
+ }
53
+
54
+ private $state_list = array('AL'=>"Alabama",
55
+ 'AK'=>"Alaska",
56
+ 'AZ'=>"Arizona",
57
+ 'AR'=>"Arkansas",
58
+ 'CA'=>"California",
59
+ 'CO'=>"Colorado",
60
+ 'CT'=>"Connecticut",
61
+ 'DE'=>"Delaware",
62
+ 'DC'=>"District of Coloumbia",
63
+ 'FL'=>"Flordia",
64
+ 'GA'=>"Georgia",
65
+ 'HI'=>"Hawaii",
66
+ 'ID'=>"Idaho",
67
+ 'IL'=>"Illinois",
68
+ 'IN'=>"Indiana",
69
+ 'IA'=>"Iowa",
70
+ 'KS'=>"Kansas",
71
+ 'KY'=>"Kentucky",
72
+ 'LA'=>"Louisiana",
73
+ 'ME'=>"Maine",
74
+ 'MD'=>"Maryland",
75
+ 'MA'=>"Massachusetts",
76
+ 'MI'=>"Michigan",
77
+ 'MN'=>"Minnesota",
78
+ 'MS'=>"Mississippi",
79
+ 'MO'=>"Missouri",
80
+ 'MT'=>"Montana",
81
+ 'NE'=>"Nebraska",
82
+ 'NV'=>"Nevada",
83
+ 'NH'=>"New Hampshire",
84
+ 'NJ'=>"New Jersey",
85
+ 'NM'=>"New Mexico",
86
+ 'NY'=>"New York",
87
+ 'NC'=>"North Carolina",
88
+ 'ND'=>"North Dakota",
89
+ 'OH'=>"Ohio",
90
+ 'OK'=>"Oklahoma",
91
+ 'OR'=>"Oregon",
92
+ 'PA'=>"Pennsylvania",
93
+ 'RI'=>"Rhode Island",
94
+ 'SC'=>"South Carolina",
95
+ 'SD'=>"South Dakota",
96
+ 'TN'=>"Tennessee",
97
+ 'TX'=>"Texas",
98
+ 'UT'=>"Utah",
99
+ 'VT'=>"Vermont",
100
+ 'VA'=>"Virginia",
101
+ 'WA'=>"Washington",
102
+ 'WV'=>"West Virginia",
103
+ 'WI'=>"Wisconson",
104
+ 'WY'=>"Wyoming");
105
+
106
+ }
app/code/local/Borderfree/Settings/Helper/Data.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Settings
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * The Borderfree Settings helper class which provides access to the Borderfree Site Settings.
15
+ *
16
+ * @category Borderfree
17
+ * @package Borderfree_Settings
18
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
19
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
20
+ */
21
+ class Borderfree_Settings_Helper_Data extends Mage_Core_Helper_Abstract
22
+ {
23
+
24
+ /**
25
+ * Get the Merchant ID for the current store
26
+ *
27
+ * @return string
28
+ */
29
+ public function getMerchantId()
30
+ {
31
+ return Mage::getStoreConfig('borderfree_options/settings/merchantid');
32
+ }
33
+
34
+ /**
35
+ * Is Borderfree Enabled
36
+ *
37
+ * @param $internationalOnly Return true only if shipping country != US
38
+ * @return boolean
39
+ */
40
+ public function isBorderfreeEnabled($internationalOnly = true)
41
+ {
42
+ $international = true;
43
+ if($internationalOnly)
44
+ $international = Mage::helper('borderfreelocalization')->getShippingCountry() != "US";
45
+
46
+ return Mage::getStoreConfig('borderfree_options/settings/enabled') && $international;
47
+ }
48
+
49
+ /**
50
+ * Is the Borderfree Welcome Mat Enabled
51
+ *
52
+ * @return boolean
53
+ */
54
+ public function isWelcomatEnabled()
55
+ {
56
+ return $this->isBorderfreeEnabled() && Mage::getStoreConfig('borderfree_options/settings/welcomemat');
57
+ }
58
+
59
+ /**
60
+ * Is staging mode enabled
61
+ *
62
+ * @return boolean
63
+ */
64
+ public function isStagingEnabled()
65
+ {
66
+ return Mage::getStoreConfig('borderfree_options/settings/staging');
67
+ }
68
+
69
+ /**
70
+ * Gets the international parcel tracking URL prefix.
71
+ *
72
+ * @return string
73
+ */
74
+ public function getEnvironment()
75
+ {
76
+ if($this->isStagingEnabled())
77
+ return "sandbox";
78
+ return "embassy";
79
+ }
80
+
81
+ /**
82
+ * Get the height of the international parcel tracking page
83
+ *
84
+ * @return integer
85
+ */
86
+ public function getTrackHeight()
87
+ {
88
+ return Mage::getStoreConfig('borderfree_options/shipping/height');
89
+ }
90
+
91
+ /**
92
+ * Is this request from the test IP
93
+ *
94
+ * @return bool
95
+ */
96
+ public function isTestIp()
97
+ {
98
+ return Mage::getStoreConfig('borderfree_options/settings/testip') == $_SERVER['REMOTE_ADDR'];
99
+ }
100
+
101
+ /**
102
+ * Get the test country code
103
+ *
104
+ * @return string
105
+ */
106
+ public function getTestCountry()
107
+ {
108
+ return Mage::getStoreConfig('borderfree_options/settings/testcountry');
109
+ }
110
+
111
+ /**
112
+ * Get the credentials for the Borderfree API
113
+ *
114
+ * @return string
115
+ */
116
+ public function getApiCredentials()
117
+ {
118
+ return Mage::getStoreConfig('borderfree_options/settings/apiuser') . ":" . Mage::helper('core')->decrypt(Mage::getStoreConfig('borderfree_options/settings/apipassword'));
119
+ }
120
+
121
+ /**
122
+ * Detect if this request is a StoreFront Request
123
+ */
124
+ public function isStoreFrontRequest()
125
+ {
126
+ $uri = Mage::app()->getRequest()->getRequestUri();
127
+ if(strpos($uri, 'api') || Mage::app()->getStore()->isAdmin() || Mage::getDesign()->getArea() == 'adminhtml' || strpos($uri, 'downloader') || strpos($uri, 'fileuploader'))
128
+ return false;
129
+ else
130
+ return true;
131
+ }
132
+
133
+ }
134
+ ?>
app/code/local/Borderfree/Settings/Model/Days.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Settings_Model_Days extends Mage_Core_Model_Config_Data
3
+ {
4
+ public function save()
5
+ {
6
+ $number = $this->getValue();
7
+ if(!is_numeric($number) || $number < 0 || $number > 12)
8
+ {
9
+ Mage::throwException("Domestic Leg Delivery Days must be a number between 0 & 12");
10
+ }
11
+ return parent::save();
12
+ }
13
+ }
app/code/local/Borderfree/Settings/Model/Handling.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Settings_Model_Handling extends Mage_Core_Model_Config_Data
3
+ {
4
+ public function save()
5
+ {
6
+ $number = $this->getValue();
7
+
8
+ if(!is_numeric($number))
9
+ {
10
+ Mage::throwException("Domestic Leg Extra Handling must be a number");
11
+ }
12
+ return parent::save();
13
+ }
14
+ }
app/code/local/Borderfree/Settings/Model/Insurance.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Settings_Model_Insurance extends Mage_Core_Model_Config_Data
3
+ {
4
+ public function save()
5
+ {
6
+ $number = $this->getValue();
7
+
8
+ if(!is_numeric($number))
9
+ {
10
+ Mage::throwException("Domestic Leg Extra Insurance Price must be a number");
11
+ }
12
+ return parent::save();
13
+ }
14
+ }
app/code/local/Borderfree/Settings/Model/Lengthunit.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Settings_Model_Lengthunit
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value' => 'IN', 'label' => Mage::helper('borderfreecatalog')->__('IN')),
8
+ array('value' => 'CM', 'label' => Mage::helper('borderfreecatalog')->__('CM'))
9
+ );
10
+ }
11
+
12
+ }
app/code/local/Borderfree/Settings/Model/Rate.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Settings_Model_Rate extends Mage_Core_Model_Config_Data
3
+ {
4
+ public function save()
5
+ {
6
+ $number = $this->getValue();
7
+
8
+ if(empty($number))
9
+ return parent::save();
10
+
11
+ if(!is_numeric($number))
12
+ {
13
+ Mage::throwException("Domestic Leg Flat Shipping Rate must be a number");
14
+ }
15
+ return parent::save();
16
+ }
17
+ }
app/code/local/Borderfree/Settings/Model/Weightunit.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Settings_Model_Weightunit
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value' => 'LB', 'label' => Mage::helper('borderfreecatalog')->__('LB')),
8
+ array('value' => 'KG', 'label' => Mage::helper('borderfreecatalog')->__('KG'))
9
+ );
10
+ }
11
+
12
+ }
app/code/local/Borderfree/Settings/Model/Zip.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Borderfree_Settings_Model_Zip extends Mage_Core_Model_Config_Data
3
+ {
4
+ public function save()
5
+ {
6
+ $number = $this->getValue();
7
+ $number = preg_replace('#[^0-9]#','',$number);
8
+
9
+ if(Mage::getStoreConfig('borderfree_options/shipping/flatrate'))
10
+ return parent::save();
11
+
12
+ if(strlen($number) == 5)
13
+ return parent::save();
14
+ if(strlen($number) == 9)
15
+ return parent::save();
16
+
17
+ Mage::throwException("Invlaid Domestic Leg Ship-to Zipcode");
18
+ }
19
+ }
app/code/local/Borderfree/Settings/etc/config.xml ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+
4
+ <modules>
5
+ <Borderfree_Settings>
6
+ <version>1.0.0</version>
7
+ </Borderfree_Settings>
8
+ </modules>
9
+
10
+ <global>
11
+ <helpers>
12
+ <borderfreesettings>
13
+ <class>Borderfree_Settings_Helper</class>
14
+ </borderfreesettings>
15
+ </helpers>
16
+ <blocks>
17
+ <borderfreesettings>
18
+ <class>Borderfree_Settings_Block</class>
19
+ </borderfreesettings>
20
+ </blocks>
21
+ <models>
22
+ <borderfreesettings>
23
+ <class>Borderfree_Settings_Model</class>
24
+ </borderfreesettings>
25
+ </models>
26
+ </global>
27
+
28
+ <adminhtml>
29
+ <acl>
30
+ <resources>
31
+ <admin>
32
+ <children>
33
+ <system>
34
+ <children>
35
+ <config>
36
+ <children>
37
+ <borderfree_options>
38
+ <title>Borderfree Settings</title>
39
+ </borderfree_options>
40
+ </children>
41
+ </config>
42
+ </children>
43
+ </system>
44
+ </children>
45
+ </admin>
46
+ </resources>
47
+ </acl>
48
+ </adminhtml>
49
+
50
+ <default>
51
+ <borderfree_options>
52
+ <settings>
53
+ <enabled>0</enabled>
54
+ <staging>0</staging>
55
+ <welcommat>1</welcommat>
56
+ <welcomematprodurl>https://embassy.fiftyone.com/welcome/welcome.srv</welcomematprodurl>
57
+ <welcomematstageurl>https://sandbox.fiftyone.com/welcome/welcome.srv</welcomematstageurl>
58
+ </settings>
59
+ <catalog>
60
+ <ftpprod>ftp.fiftyone.com</ftpprod>
61
+ <ftpstage>stageftp.fiftyone.com</ftpstage>
62
+ <filerecords>1500</filerecords>
63
+ <weightunit>LB</weightunit>
64
+ <lengthunit>IN</lengthunit>
65
+ </catalog>
66
+ <localization>
67
+ <staging>https://sandbox.fiftyone.com/embassy/localizationAPI.srv</staging>
68
+ <production>https://embassy.fiftyone.com/embassy/localizationAPI.srv</production>
69
+ </localization>
70
+ <shipping>
71
+ <state>OH</state>
72
+ <zip>43137</zip>
73
+ <min>1</min>
74
+ <max>12</max>
75
+ <method>borderfreeshipping_Borderfree</method>
76
+ <height>700</height>
77
+ <width>898</width>
78
+ </shipping>
79
+ <checkout>
80
+ <staging>https://sandbox.fiftyone.com/checkout/checkoutAPI-v2.srv</staging>
81
+ <production>https://services.fiftyone.com/checkout/checkoutAPI-v2.srv</production>
82
+ </checkout>
83
+ <order>
84
+ <staging>https://sandbox.fiftyone.com/ws/PartnerAPI-SOAP1.1?wsdl</staging>
85
+ <production>https://services.fiftyone.com/ws/PartnerAPI-SOAP1.1?wsdl</production>
86
+ </order>
87
+ </borderfree_options>
88
+ </default>
89
+ </config>
90
+
app/code/local/Borderfree/Settings/etc/system.xml ADDED
@@ -0,0 +1,450 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <tabs>
3
+ <borderfree translate="label" module="borderfreesettings">
4
+ <label>Borderfree</label>
5
+ <sort_order>99999</sort_order>
6
+ </borderfree>
7
+ </tabs>
8
+ <sections>
9
+ <borderfree_options translate="label" module="borderfreesettings">
10
+ <label>Settings</label>
11
+ <tab>borderfree</tab>
12
+ <frontend_type>text</frontend_type>
13
+ <sort_order>1000</sort_order>
14
+ <show_in_default>1</show_in_default>
15
+ <show_in_website>1</show_in_website>
16
+ <show_in_store>1</show_in_store>
17
+ <groups>
18
+ <settings translate="label">
19
+ <label>General Settings</label>
20
+ <frontend_type>text</frontend_type>
21
+ <sort_order>1</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>0</show_in_store>
25
+ <fields>
26
+ <enabled>
27
+ <label>Borderfree Enabled</label>
28
+ <frontend_type>select</frontend_type>
29
+ <source_model>adminhtml/system_config_source_yesno</source_model>
30
+ <sort_order>1</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>0</show_in_store>
34
+ </enabled>
35
+ <staging>
36
+ <label>Staging Mode Enabled</label>
37
+ <frontend_type>select</frontend_type>
38
+ <source_model>adminhtml/system_config_source_yesno</source_model>
39
+ <sort_order>2</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>0</show_in_store>
43
+ </staging>
44
+ <merchantid>
45
+ <label>Borderfree Merchant ID</label>
46
+ <frontend_type>text</frontend_type>
47
+ <sort_order>3</sort_order>
48
+ <show_in_default>1</show_in_default>
49
+ <show_in_website>1</show_in_website>
50
+ <show_in_store>0</show_in_store>
51
+ </merchantid>
52
+ <apiuser>
53
+ <label>Borderfree API User ID</label>
54
+ <frontend_type>text</frontend_type>
55
+ <sort_order>4</sort_order>
56
+ <show_in_default>1</show_in_default>
57
+ <show_in_website>1</show_in_website>
58
+ <show_in_store>0</show_in_store>
59
+ </apiuser>
60
+ <apipassword>
61
+ <label>Borderfree API Password</label>
62
+ <frontend_type>password</frontend_type>
63
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
64
+ <sort_order>5</sort_order>
65
+ <show_in_default>1</show_in_default>
66
+ <show_in_website>1</show_in_website>
67
+ <show_in_store>0</show_in_store>
68
+ </apipassword>
69
+ <erroremail>
70
+ <label>Error Email Address</label>
71
+ <frontend_type>text</frontend_type>
72
+ <sort_order>6</sort_order>
73
+ <show_in_default>1</show_in_default>
74
+ <show_in_website>1</show_in_website>
75
+ <show_in_store>0</show_in_store>
76
+ </erroremail>
77
+ <welcomemat>
78
+ <label>Display Welcome Mat</label>
79
+ <frontend_type>select</frontend_type>
80
+ <source_model>adminhtml/system_config_source_yesno</source_model>
81
+ <sort_order>7</sort_order>
82
+ <show_in_default>1</show_in_default>
83
+ <show_in_website>1</show_in_website>
84
+ <show_in_store>0</show_in_store>
85
+ </welcomemat>
86
+ <welcomematprodurl>
87
+ <label>Welcome Mat Production URL</label>
88
+ <frontend_type>text</frontend_type>
89
+ <comment>Default URL: https://embassy.fiftyone.com/welcome/welcome.srv</comment>
90
+ <sort_order>7</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>1</show_in_website>
93
+ <show_in_store>0</show_in_store>
94
+ </welcomematprodurl>
95
+ <welcomematstageurl>
96
+ <label>Welcome Mat Staging URL</label>
97
+ <frontend_type>text</frontend_type>
98
+ <comment>Default URL: https://sandbox.fiftyone.com/welcome/welcome.srv</comment>
99
+ <sort_order>7</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>1</show_in_website>
102
+ <show_in_store>0</show_in_store>
103
+ </welcomematstageurl>
104
+ <akamai>
105
+ <label>Enable Akamai Cache Key Cookie</label>
106
+ <frontend_type>select</frontend_type>
107
+ <source_model>adminhtml/system_config_source_yesno</source_model>
108
+ <sort_order>8</sort_order>
109
+ <show_in_default>1</show_in_default>
110
+ <show_in_website>1</show_in_website>
111
+ <show_in_store>0</show_in_store>
112
+ </akamai>
113
+ <testip>
114
+ <label>Test IP Address</label>
115
+ <frontend_type>text</frontend_type>
116
+ <comment>IP Address for testing site internationalzation</comment>
117
+ <sort_order>9</sort_order>
118
+ <show_in_default>1</show_in_default>
119
+ <show_in_website>1</show_in_website>
120
+ <show_in_store>0</show_in_store>
121
+ </testip>
122
+ <testcountry>
123
+ <label>IP Country</label>
124
+ <frontend_type>text</frontend_type>
125
+ <comment>Mock country for test IP Address</comment>
126
+ <sort_order>10</sort_order>
127
+ <show_in_default>1</show_in_default>
128
+ <show_in_website>1</show_in_website>
129
+ <show_in_store>0</show_in_store>
130
+ </testcountry>
131
+ </fields>
132
+ </settings>
133
+ <catalog translate="label">
134
+ <label>Catalog Export Settings</label>
135
+ <frontend_type>text</frontend_type>
136
+ <sort_order>2</sort_order>
137
+ <show_in_default>1</show_in_default>
138
+ <show_in_website>0</show_in_website>
139
+ <show_in_store>0</show_in_store>
140
+ <fields>
141
+ <ftpprod>
142
+ <label>Production FTP Host Name</label>
143
+ <frontend_type>text</frontend_type>
144
+ <sort_order>1</sort_order>
145
+ <show_in_default>1</show_in_default>
146
+ <show_in_website>0</show_in_website>
147
+ <show_in_store>0</show_in_store>
148
+ </ftpprod>
149
+ <ftpstage>
150
+ <label>Staging FTP Host Name</label>
151
+ <frontend_type>text</frontend_type>
152
+ <sort_order>1</sort_order>
153
+ <show_in_default>1</show_in_default>
154
+ <show_in_website>0</show_in_website>
155
+ <show_in_store>0</show_in_store>
156
+ </ftpstage>
157
+ <ftpuser>
158
+ <label>FTP User Name</label>
159
+ <frontend_type>text</frontend_type>
160
+ <sort_order>2</sort_order>
161
+ <show_in_default>1</show_in_default>
162
+ <show_in_website>0</show_in_website>
163
+ <show_in_store>0</show_in_store>
164
+ </ftpuser>
165
+ <ftppassword>
166
+ <label>FTP Password</label>
167
+ <frontend_type>password</frontend_type>
168
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
169
+ <sort_order>3</sort_order>
170
+ <show_in_default>1</show_in_default>
171
+ <show_in_website>0</show_in_website>
172
+ <show_in_store>0</show_in_store>
173
+ </ftppassword>
174
+ <filerecords>
175
+ <label>Records per file</label>
176
+ <frontend_type>text</frontend_type>
177
+ <sort_order>4</sort_order>
178
+ <show_in_default>1</show_in_default>
179
+ <show_in_website>0</show_in_website>
180
+ <show_in_store>0</show_in_store>
181
+ </filerecords>
182
+ <weightunit>
183
+ <label>Weight Unit of Measure</label>
184
+ <frontend_type>select</frontend_type>
185
+ <source_model>borderfreesettings/weightunit</source_model>
186
+ <sort_order>5</sort_order>
187
+ <show_in_default>1</show_in_default>
188
+ <show_in_website>0</show_in_website>
189
+ <show_in_store>0</show_in_store>
190
+ </weightunit>
191
+ <lengthunit>
192
+ <label>Length Unit of Measure</label>
193
+ <frontend_type>select</frontend_type>
194
+ <source_model>borderfreesettings/lengthunit</source_model>
195
+ <sort_order>6</sort_order>
196
+ <show_in_default>1</show_in_default>
197
+ <show_in_website>0</show_in_website>
198
+ <show_in_store>0</show_in_store>
199
+ </lengthunit>
200
+ <truncate>
201
+ <label>Truncate data</label>
202
+ <frontend_type>select</frontend_type>
203
+ <source_model>adminhtml/system_config_source_yesno</source_model>
204
+ <sort_order>7</sort_order>
205
+ <show_in_default>1</show_in_default>
206
+ <show_in_website>1</show_in_website>
207
+ <show_in_store>0</show_in_store>
208
+ </truncate>
209
+ </fields>
210
+ </catalog>
211
+ <localization translate="label">
212
+ <label>Localization Settings</label>
213
+ <frontend_type>text</frontend_type>
214
+ <sort_order>3</sort_order>
215
+ <show_in_default>1</show_in_default>
216
+ <show_in_website>0</show_in_website>
217
+ <show_in_store>0</show_in_store>
218
+ <fields>
219
+ <production>
220
+ <label>Production Endpoint</label>
221
+ <frontend_type>text</frontend_type>
222
+ <sort_order>1</sort_order>
223
+ <show_in_default>1</show_in_default>
224
+ <show_in_website>0</show_in_website>
225
+ <show_in_store>0</show_in_store>
226
+ </production>
227
+ <staging>
228
+ <label>Staging Endpoint</label>
229
+ <frontend_type>text</frontend_type>
230
+ <sort_order>2</sort_order>
231
+ <show_in_default>1</show_in_default>
232
+ <show_in_website>0</show_in_website>
233
+ <show_in_store>0</show_in_store>
234
+ </staging>
235
+ </fields>
236
+ </localization>
237
+ <shipping translate="label">
238
+ <label>Shipping Settings</label>
239
+ <frontend_type>text</frontend_type>
240
+ <sort_order>4</sort_order>
241
+ <show_in_default>1</show_in_default>
242
+ <show_in_website>1</show_in_website>
243
+ <show_in_store>0</show_in_store>
244
+ <fields>
245
+ <min>
246
+ <label>Domestic Leg Minimum Delivery Days</label>
247
+ <frontend_type>text</frontend_type>
248
+ <comment>Minimum number of days to deliver shipment to the Borderfree Domestic Hub (0-12)</comment>
249
+ <sort_order>1</sort_order>
250
+ <show_in_default>1</show_in_default>
251
+ <show_in_website>1</show_in_website>
252
+ <show_in_store>0</show_in_store>
253
+ <backend_model>borderfreesettings/days</backend_model>
254
+ </min>
255
+ <max>
256
+ <label>Domestic Leg Maximum Delivery Days</label>
257
+ <frontend_type>text</frontend_type>
258
+ <comment>Maximum number of days to deliver shipment to the Borderfree Domestic Hub (0-12)</comment>
259
+ <sort_order>2</sort_order>
260
+ <show_in_default>1</show_in_default>
261
+ <show_in_website>1</show_in_website>
262
+ <show_in_store>0</show_in_store>
263
+ <backend_model>borderfreesettings/days</backend_model>
264
+ </max>
265
+ <method translate="label">
266
+ <label>Domestic Leg Shipping Method</label>
267
+ <frontend_type>select</frontend_type>
268
+ <frontend_model>borderfreesettings/adminhtml_shipping_merchant</frontend_model>
269
+ <sort_order>3</sort_order>
270
+ <show_in_default>1</show_in_default>
271
+ <show_in_website>1</show_in_website>
272
+ <show_in_store>0</show_in_store>
273
+ </method>
274
+ <carrier>
275
+ <label>Domestic Leg Shipping Carrier Name</label>
276
+ <frontend_type>text</frontend_type>
277
+ <sort_order>4</sort_order>
278
+ <show_in_default>1</show_in_default>
279
+ <show_in_website>1</show_in_website>
280
+ <show_in_store>1</show_in_store>
281
+ </carrier>
282
+ <service>
283
+ <label>Domestic Leg Shipping Carrier Service</label>
284
+ <frontend_type>text</frontend_type>
285
+ <sort_order>5</sort_order>
286
+ <show_in_default>1</show_in_default>
287
+ <show_in_website>1</show_in_website>
288
+ <show_in_store>1</show_in_store>
289
+ </service>
290
+ <url>
291
+ <label>Domestic Leg Shipping Tracking URL</label>
292
+ <frontend_type>text</frontend_type>
293
+ <comment>Enter the tracking URL. Put "##" where the tracking number shoud go. Example: http://wwwapps.ups.com/WebTracking/track?track=yes&amp;trackNums=##</comment>
294
+ <sort_order>6</sort_order>
295
+ <show_in_default>1</show_in_default>
296
+ <show_in_website>1</show_in_website>
297
+ <show_in_store>0</show_in_store>
298
+ </url>
299
+ <height>
300
+ <label>International Parcel Tracking Page height</label>
301
+ <frontend_type>text</frontend_type>
302
+ <comment>The height of the International Parcel Tracking Page</comment>
303
+ <sort_order>7</sort_order>
304
+ <show_in_default>1</show_in_default>
305
+ <show_in_website>1</show_in_website>
306
+ <show_in_store>0</show_in_store>
307
+ </height>
308
+ <width>
309
+ <label>International Parcel Tracking Page width</label>
310
+ <frontend_type>text</frontend_type>
311
+ <comment>The width of the International Parcel Tracking Page</comment>
312
+ <sort_order>8</sort_order>
313
+ <show_in_default>1</show_in_default>
314
+ <show_in_website>1</show_in_website>
315
+ <show_in_store>0</show_in_store>
316
+ </width>
317
+ <handling>
318
+ <label>Domestic Leg Extra Handling</label>
319
+ <frontend_type>text</frontend_type>
320
+ <sort_order>9</sort_order>
321
+ <show_in_default>1</show_in_default>
322
+ <show_in_website>1</show_in_website>
323
+ <show_in_store>0</show_in_store>
324
+ <backend_model>borderfreesettings/handling</backend_model>
325
+ </handling>
326
+ <insurance>
327
+ <label>Domestic Leg Insurance Price</label>
328
+ <frontend_type>text</frontend_type>
329
+ <sort_order>10</sort_order>
330
+ <show_in_default>1</show_in_default>
331
+ <show_in_website>1</show_in_website>
332
+ <show_in_store>0</show_in_store>
333
+ <backend_model>borderfreesettings/insurance</backend_model>
334
+ </insurance>
335
+ <state>
336
+ <label>Domestic Leg Ship-to State</label>
337
+ <frontend_type>text</frontend_type>
338
+ <frontend_model>borderfreesettings/adminhtml_shipping_state</frontend_model>
339
+ <comment>If you are not using flat rate shipping enter the state of the Borderfree Shipping hub.</comment>
340
+ <sort_order>11</sort_order>
341
+ <show_in_default>1</show_in_default>
342
+ <show_in_website>1</show_in_website>
343
+ <show_in_store>0</show_in_store>
344
+ </state>
345
+ <zip>
346
+ <label>Domestic Leg Ship-to Zipcode</label>
347
+ <frontend_type>text</frontend_type>
348
+ <comment>If you are not using flat rate shipping enter the zipcode of the Borderfree Shipping hub.</comment>
349
+ <sort_order>12</sort_order>
350
+ <show_in_default>1</show_in_default>
351
+ <show_in_website>1</show_in_website>
352
+ <show_in_store>0</show_in_store>
353
+ <backend_model>borderfreesettings/zip</backend_model>
354
+ </zip>
355
+ </fields>
356
+ </shipping>
357
+ <checkout translate="label">
358
+ <label>Checkout Settings</label>
359
+ <frontend_type>text</frontend_type>
360
+ <sort_order>5</sort_order>
361
+ <show_in_default>1</show_in_default>
362
+ <show_in_website>0</show_in_website>
363
+ <show_in_store>0</show_in_store>
364
+ <fields>
365
+ <production>
366
+ <label>Production Endpoint</label>
367
+ <frontend_type>text</frontend_type>
368
+ <sort_order>1</sort_order>
369
+ <show_in_default>1</show_in_default>
370
+ <show_in_website>0</show_in_website>
371
+ <show_in_store>0</show_in_store>
372
+ </production>
373
+ <staging>
374
+ <label>Staging Endpoint</label>
375
+ <frontend_type>text</frontend_type>
376
+ <sort_order>2</sort_order>
377
+ <show_in_default>1</show_in_default>
378
+ <show_in_website>0</show_in_website>
379
+ <show_in_store>0</show_in_store>
380
+ </staging>
381
+ <paypal>
382
+ <label>PayPal Enabled</label>
383
+ <frontend_type>select</frontend_type>
384
+ <source_model>adminhtml/system_config_source_yesno</source_model>
385
+ <sort_order>3</sort_order>
386
+ <show_in_default>1</show_in_default>
387
+ <show_in_website>1</show_in_website>
388
+ <show_in_store>0</show_in_store>
389
+ </paypal>
390
+ <logo>
391
+ <label>Paypal Header Logo URL</label>
392
+ <frontend_type>text</frontend_type>
393
+ <sort_order>4</sort_order>
394
+ <show_in_default>1</show_in_default>
395
+ <show_in_website>1</show_in_website>
396
+ <show_in_store>1</show_in_store>
397
+ </logo>
398
+ </fields>
399
+ </checkout>
400
+ <order translate="label">
401
+ <label>Order Import Settings</label>
402
+ <frontend_type>text</frontend_type>
403
+ <sort_order>6</sort_order>
404
+ <show_in_default>1</show_in_default>
405
+ <show_in_website>0</show_in_website>
406
+ <show_in_store>0</show_in_store>
407
+ <fields>
408
+ <method translate="label">
409
+ <label>Borderfree Payment Method</label>
410
+ <comment>
411
+ Select the payment method used to process Borderfree purchase orders.
412
+ If the selected payment method does not support partial invoicing, the entire order amount will be captured as soon as first item is shipped.
413
+ </comment>
414
+ <frontend_type>select</frontend_type>
415
+ <frontend_model>borderfreesettings/adminhtml_payment</frontend_model>
416
+ <sort_order>1</sort_order>
417
+ <show_in_default>1</show_in_default>
418
+ <show_in_website>1</show_in_website>
419
+ <show_in_store>0</show_in_store>
420
+ </method>
421
+ <production>
422
+ <label>Production Endpoint</label>
423
+ <frontend_type>text</frontend_type>
424
+ <sort_order>2</sort_order>
425
+ <show_in_default>1</show_in_default>
426
+ <show_in_website>0</show_in_website>
427
+ <show_in_store>0</show_in_store>
428
+ </production>
429
+ <staging>
430
+ <label>Staging Endpoint</label>
431
+ <frontend_type>text</frontend_type>
432
+ <sort_order>3</sort_order>
433
+ <show_in_default>1</show_in_default>
434
+ <show_in_website>0</show_in_website>
435
+ <show_in_store>0</show_in_store>
436
+ </staging>
437
+ <pgp>
438
+ <label>PGP Key</label>
439
+ <frontend_type>textarea</frontend_type>
440
+ <sort_order>4</sort_order>
441
+ <show_in_default>1</show_in_default>
442
+ <show_in_website>1</show_in_website>
443
+ <show_in_store>0</show_in_store>
444
+ </pgp>
445
+ </fields>
446
+ </order>
447
+ </groups>
448
+ </borderfree_options>
449
+ </sections>
450
+ </config>
app/code/local/Borderfree/Shipping/Helper/Data.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Shipping
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * Borderfree Shipping Helper
15
+ *
16
+ * @category Borderfree
17
+ * @package Borderfree_Shipping
18
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
19
+ *
20
+ */
21
+ class Borderfree_Shipping_Helper_Data extends Mage_Core_Helper_Abstract
22
+ {
23
+ /**
24
+ * Get link to Borderfree International Parcel Tracking page
25
+ *
26
+ * @return string
27
+ */
28
+ public function getTrackUrl()
29
+ {
30
+ return $this->_getUrl("borderfreeshipping/track/shipment");
31
+ }
32
+ }
33
+ ?>
app/code/local/Borderfree/Shipping/Model/Shipping.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Borderfree_Shipping_Model_Shipping extends Mage_Shipping_Model_Carrier_Abstract
5
+ {
6
+
7
+ /**
8
+ * unique identifier for our shipping module
9
+ * @var string $_code
10
+ */
11
+ protected $_code = 'borderfreeshipping';
12
+
13
+ /**
14
+ * Collect rates for this shipping method based on information in $request
15
+ *
16
+ * @param Mage_Shipping_Model_Rate_Request $data
17
+ * @return Mage_Shipping_Model_Rate_Result
18
+ */
19
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
20
+ {
21
+ if (!$this->getConfigData('active'))
22
+ return false;
23
+
24
+ $shippingCountry = Mage::getSingleton('customer/session')->getShippingCountry();
25
+ if($shippingCountry == "US")
26
+ return;
27
+
28
+ $result = Mage::getModel('shipping/rate_result');
29
+ $method = Mage::getModel('shipping/rate_result_method');
30
+ $method->setCarrier($this->_code);
31
+ $method->setCarrierTitle("Borderfree");
32
+ $method->setMethod("Borderfree");
33
+ $method->setMethodTitle("International Shipping");
34
+ $method->setCost(10);
35
+ $method->setPrice(Mage::getStoreConfig('carriers/borderfreeshipping/rate'));
36
+ $result->append($method);
37
+
38
+ return $result;
39
+ }
40
+
41
+ public function getAllowedMethods()
42
+ {
43
+ return array("Borderfree");
44
+ }
45
+
46
+ }
app/code/local/Borderfree/Shipping/controllers/TrackController.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Borderfree_Shipping
7
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
8
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
9
+ *
10
+ */
11
+ ?>
12
+ <?php
13
+ /**
14
+ * This controler handles requests to switch shipping countries.
15
+ *
16
+ * @category Borderfree
17
+ * @package Borderfree_Shipping
18
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
19
+ *
20
+ */
21
+ class Borderfree_Shipping_TrackController extends Mage_Core_Controller_Front_Action
22
+ {
23
+ /**
24
+ * Render Borderfree International Parcel Tracking URL
25
+ */
26
+ public function shipmentAction()
27
+ {
28
+ $this->loadLayout();
29
+ $this->renderLayout();
30
+ }
31
+ }
app/code/local/Borderfree/Shipping/etc/config.xml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Borderfree_Shipping>
5
+ <version>1.0.0</version>
6
+ <depends>
7
+ <Mage_Shipping />
8
+ </depends>
9
+ </Borderfree_Shipping>
10
+ </modules>
11
+
12
+ <global>
13
+ <models>
14
+ <borderfreeshipping>
15
+ <class>Borderfree_Shipping_Model</class>
16
+ </borderfreeshipping>
17
+ </models>
18
+ <helpers>
19
+ <borderfreeshipping>
20
+ <class>Borderfree_Shipping_Helper</class>
21
+ </borderfreeshipping>
22
+ </helpers>
23
+ </global>
24
+
25
+ <frontend>
26
+
27
+ <layout>
28
+ <updates>
29
+ <borderfreeshipping>
30
+ <file>borderfreeshipping.xml</file>
31
+ </borderfreeshipping>
32
+ </updates>
33
+ </layout>
34
+
35
+ <routers>
36
+ <borderfreeshipping>
37
+ <use>standard</use>
38
+ <args>
39
+ <module>Borderfree_Shipping</module>
40
+ <frontName>borderfreeshipping</frontName>
41
+ </args>
42
+ </borderfreeshipping>
43
+ </routers>
44
+
45
+ </frontend>
46
+
47
+ <default>
48
+ <carriers>
49
+ <borderfreeshipping>
50
+ <model>borderfreeshipping/shipping</model>
51
+ <title>Borderfree Shipping</title>
52
+ <active>1</active>
53
+ <sort_order>1</sort_order>
54
+ </borderfreeshipping>
55
+ </carriers>
56
+ </default>
57
+ </config>
58
+
app/code/local/Borderfree/Shipping/etc/system.xml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <carriers>
5
+ <groups>
6
+ <borderfreeshipping translate="label" module="shipping">
7
+
8
+ <label>Borderfree Shipping</label>
9
+ <frontend_type>text</frontend_type>
10
+ <sort_order>13</sort_order>
11
+ <show_in_default>1</show_in_default>
12
+ <show_in_website>1</show_in_website>
13
+ <show_in_store>1</show_in_store>
14
+
15
+ <fields>
16
+ <active translate="label">
17
+ <label>Enabled</label>
18
+ <frontend_type>select</frontend_type>
19
+ <source_model>adminhtml/system_config_source_yesno</source_model>
20
+ <sort_order>1</sort_order>
21
+ <show_in_default>1</show_in_default>
22
+ <show_in_website>1</show_in_website>
23
+ <show_in_store>1</show_in_store>
24
+ </active>
25
+
26
+ <sort_order translate="label">
27
+ <label>Sort order</label>
28
+ <frontend_type>text</frontend_type>
29
+ <sort_order>100</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ </sort_order>
34
+
35
+ <title translate="label">
36
+ <label>Title</label>
37
+ <frontend_type>text</frontend_type>
38
+ <sort_order>2</sort_order>
39
+ <show_in_default>1</show_in_default>
40
+ <show_in_website>1</show_in_website>
41
+ <show_in_store>1</show_in_store>
42
+ </title>
43
+
44
+ <rate>
45
+ <label>Domestic Leg Flat Shipping Rate</label>
46
+ <frontend_type>text</frontend_type>
47
+ <sort_order>5</sort_order>
48
+ <show_in_default>1</show_in_default>
49
+ <show_in_website>1</show_in_website>
50
+ <show_in_store>0</show_in_store>
51
+ <backend_model>borderfreesettings/rate</backend_model>
52
+ </rate>
53
+
54
+ <showmethod translate="label">
55
+ <label>Show method if not applicable</label>
56
+ <frontend_type>select</frontend_type>
57
+ <sort_order>92</sort_order>
58
+ <source_model>adminhtml/system_config_source_yesno</source_model>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>1</show_in_website>
61
+ <show_in_store>1</show_in_store>
62
+ </showmethod>
63
+
64
+ </fields>
65
+ </borderfreeshipping>
66
+ </groups>
67
+ </carriers>
68
+ </sections>
69
+ </config>
app/design/adminhtml/default/default/layout/borderfreecrontab.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <!-- Here, we reference the XML node path of our route -->
4
+ <adminhtml_cronjobs_index>
5
+ <reference name="content">
6
+ <!-- We also reference our block by namespacename_modulename/adminhtml_controllername, and name it uniquely -->
7
+ <block type="borderfreecrontab/adminhtml_cronjobs" name="borderfreecrontab_cronjobs" />
8
+ </reference>
9
+ </adminhtml_cronjobs_index>
10
+ </layout>
app/design/frontend/base/default/layout/borderfreecheckout.xml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="0.1.0">
3
+ <borderfreecheckout_envoy_checkout translate="label">
4
+ <reference name="head">
5
+ <action method="setTitle" translate="title" module="borderfreecheckout"><title>Checkout</title></action>
6
+ <block type="core/template" name="borderfreeenvoyhead" template="borderfree/envoyhead.phtml"/>
7
+ </reference>
8
+ <reference name="root">
9
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
10
+ <action method="setHeaderTitle" translate="title" module="borderfreecheckout"><title>Checkout</title></action>
11
+ </reference>
12
+ <reference name="content">
13
+ <block type="core/template" name="borderfreeenvoy" template="borderfree/envoy.phtml"/>
14
+ </reference>
15
+ </borderfreecheckout_envoy_checkout>
16
+
17
+ <borderfreecheckout_envoy_paypal translate="label">
18
+ <reference name="head">
19
+ <action method="setTitle" translate="title" module="borderfreecheckout"><title>Checkout</title></action>
20
+ <block type="core/template" name="borderfreeenvoyhead" template="borderfree/envoyhead.phtml"/>
21
+ </reference>
22
+ <reference name="root">
23
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
24
+ <action method="setHeaderTitle" translate="title" module="borderfreecheckout"><title>Checkout</title></action>
25
+ </reference>
26
+ <reference name="content">
27
+ <block type="core/template" name="borderfreeenvoy" template="borderfree/envoy.phtml"/>
28
+ </reference>
29
+ </borderfreecheckout_envoy_paypal>
30
+ </layout>
app/design/frontend/base/default/layout/borderfreelocalization.xml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="top.switches">
5
+ <remove name="currency"/>
6
+ <remove name="store_language"/>
7
+ <block type="borderfreelocalization/switch" name="borderfreelanguage" as="borderfreelanguage" template="borderfree/language.phtml"/>
8
+ <block type="directory/currency" name="borderfreecurrency" before="borderfreelanguage" template="borderfree/currency.phtml"/>
9
+ <block type="borderfreelocalization/country" name="borderfree" before="currency" template="borderfree/country.phtml"/>
10
+ </reference>
11
+
12
+ <reference name="before_body_end">
13
+ <block type="borderfreelocalization/welcomemat" name="borderfree_welcomemat" template="borderfree/welcomemat.phtml"></block>
14
+ </reference>
15
+ <reference name="head">
16
+ <action method="addCss"><stylesheet>css/borderfree.css</stylesheet></action>
17
+ </reference>
18
+ </default>
19
+
20
+ <borderfree>
21
+ <reference name="header">
22
+ <remove name="account.links" />
23
+ </reference>
24
+ <reference name="top.links">
25
+ <action method="removeLinkByUrl"><url helper="customer/getAccountUrl" /></action>
26
+ </reference>
27
+ <reference name="content">
28
+ <remove name="checkout.cart.shipping" />
29
+ <remove name="checkout.cart.giftcardaccount" />
30
+ <reference name="checkout.cart.methods">
31
+ <remove name="checkout.cart.methods.multishipping" />
32
+ </reference>
33
+ <!--
34
+ <reference name="product.info">
35
+ <remove name="product.info.addtocart" />
36
+ <block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>
37
+ </reference>
38
+ -->
39
+ </reference>
40
+ </borderfree>
41
+ </layout>
app/design/frontend/base/default/layout/borderfreeshipping.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="0.1.0">
3
+ <borderfreeshipping_track_shipment translate="label">
4
+ <reference name="head">
5
+ <action method="setTitle" translate="title" module="borderfreeshipping"><title>International Parcel Tracking</title></action>
6
+ </reference>
7
+ <reference name="root">
8
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
9
+ <action method="setHeaderTitle" translate="title" module="borderfreeshipping"><title>International Parcel Tracking</title></action>
10
+ </reference>
11
+ <reference name="content">
12
+ <block type="core/template" name="borderfreetrack" template="borderfree/track.phtml"/>
13
+ </reference>
14
+ </borderfreeshipping_track_shipment>
15
+
16
+ <borderfree>
17
+ <reference name="top.links">
18
+ <action method="addLink" translate="label title" module="borderfreeshipping"><label>Track Shipments</label><url helper="borderfreeshipping/getTrackUrl"/><title>Track Shipments</title><prepare/><urlParams/><position>100</position></action>
19
+ </reference>
20
+ </borderfree>
21
+ </layout>
app/design/frontend/base/default/template/borderfree/.DS_Store ADDED
Binary file
app/design/frontend/base/default/template/borderfree/country.phtml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Design_Base_Frontend
7
+ * @subpackage Localization_Country
8
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
9
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
10
+ *
11
+ */
12
+ ?>
13
+ <?php if($this->getBorderfreeEnabled()): ?>
14
+ <?php $countries = $this->getCountries(); ?>
15
+ <?php $currentCountryCode = $this->getShippingCountry(); ?>
16
+ <div class="switch switcher-country">
17
+ <label><?php echo $this->__('Shipping To') ?>:</label>
18
+ <div class="switch-wrapper" id="countrySelect">
19
+ <span class="switcher-holder">
20
+ <span onclick="popUpMenu(this);" class="switcher">
21
+ <?php if($currentCountryCode != "US"):?>
22
+ <img src="<?php echo $this->getSkinUrl('images/borderfree/' . $currentCountryCode . '.gif'); ?>" alt="<?php echo $this->htmlEscape($currentCountryCode)?>" />
23
+ <?php echo $this->htmlEscape($countries[$currentCountryCode]) ?>
24
+ <?php else: ?>
25
+ <img src="<?php echo $this->getSkinUrl('images/borderfree/US.gif'); ?>" alt="<?php echo "US"?>" />
26
+ USA
27
+ <?php endif;?>
28
+ </span>
29
+ </span>
30
+ <ul style="display:none" id="popId-countrySelect">
31
+ <li class="current country-<?php echo $this->htmlEscape(Mage::app()->getStore()->getCode()) ?>">
32
+ <span>
33
+ <?php if($currentCountryCode != "US"):?>
34
+ <img src="<?php echo $this->getSkinUrl('images/borderfree/' . $currentCountryCode . '.gif'); ?>" alt="<?php echo $this->htmlEscape($currentCountryCode)?>" />
35
+ <?php echo $this->htmlEscape($countries[$currentCountryCode]) ?>
36
+ <?php else: ?>
37
+ <img src="<?php echo $this->getSkinUrl('images/borderfree/US.gif'); ?>" alt="<?php echo "US"?>" />
38
+ USA
39
+ <?php endif;?>
40
+ </span>
41
+ </li>
42
+ <?php if($currentCountryCode != "US"):?>
43
+ <li class="country-us">
44
+ <a href="<?php echo $this->getSwitchCountryUrl("US") ?>">
45
+ <img src="<?php echo $this->getSkinUrl('images/borderfree/US.gif'); ?>" alt="<?php echo "US"?>" />
46
+ USA
47
+ </a>
48
+ </li>
49
+ <?php endif;?>
50
+ <?php foreach ($countries as $_code => $_name): ?>
51
+ <?php if($_code != $currentCountryCode): ?>
52
+ <li class="country-<?php echo $_code ?>">
53
+ <a href="<?php echo $this->getSwitchCountryUrl($_code) ?>">
54
+ <img src="<?php echo $this->getSkinUrl('images/borderfree/' . $_code . '.gif'); ?>" alt="<?php echo $this->htmlEscape($currentCountryCode)?>" />
55
+ <?php echo $_name ?>
56
+ </a>
57
+ </li>
58
+ <?php endif; ?>
59
+ <?php endforeach; ?>
60
+ </ul>
61
+ </div>
62
+ </div>
63
+ <?php endif; ?>
app/design/frontend/base/default/template/borderfree/currency.phtml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ($this->getCurrencyCount() > 1): ?>
2
+ <?php $currencies = $this->getCurrencies(); ?>
3
+ <?php $currentCurrencyCode = $this->getCurrentCurrencyCode(); ?>
4
+ <div class="switch switcher-currency">
5
+ <label><?php echo $this->__('Currency') ?>:</label>
6
+ <div class="switch-wrapper" id="currencySelect">
7
+ <span class="switcher-holder">
8
+ <span onclick="popUpMenu(this);" class="switcher">
9
+ <?php echo @$this->htmlEscape($currencies[$currentCurrencyCode]) ?>
10
+ </span>
11
+ </span>
12
+ <ul style="display:none" id="popId-currencySelect">
13
+ <li class="current currency-<?php echo $this->htmlEscape(Mage::app()->getStore()->getCode()) ?>">
14
+ <span><?php echo $this->htmlEscape($currentCurrencyCode) ?>
15
+ <?php if (isset($currencies[$currentCurrencyCode])): ?>
16
+ - <?php echo $this->htmlEscape($currencies[$currentCurrencyCode]) ?></span>
17
+ <?php endif;?>
18
+ </li>
19
+ <?php foreach ($currencies as $_code => $_name): ?>
20
+ <?php if($_code != $currentCurrencyCode): ?>
21
+ <li class="currency-<?php echo $_code ?>">
22
+ <a href="<?php echo $this->getSwitchCurrencyUrl($_code) ?>"><?php echo $_code ?> - <?php echo $_name ?></a>
23
+ </li>
24
+ <?php endif; ?>
25
+ <?php endforeach; ?>
26
+ </ul>
27
+ </div>
28
+ </div>
29
+ <?php endif; ?>
app/design/frontend/base/default/template/borderfree/envoy.phtml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $envoyUrl = Mage::getSingleton("checkout/session")->getEnvoyUrl();
3
+ $domain1 = "checkout";
4
+ $domain2 = "embassy";
5
+ if(Mage::getStoreConfig('borderfree_options/settings/staging'))
6
+ {
7
+ $domain1 = "stagecheckout";
8
+ $domain2 = "sandbox";
9
+ }
10
+
11
+ if(isset($_GET["ppStatus"]))
12
+ $envoyUrl = "https://" . $domain1 . ".fiftyone.com/htmlcheckout/views/preloadBack_pp.xhtml?ppStatus=" . $_GET["ppStatus"] . "&token=" . $_GET["token"];
13
+ ?>
14
+
15
+ <!-- Your custom header here -->
16
+ <!-- Envoy 3 Checkout URL in iFrame tag -->
17
+ <iframe name="envoy" id="envoyId" src="<?php echo $envoyUrl ?>" frameBorder="0" scrolling="no" style="width: 100%;"></iframe>
18
+ <!--Used to call Success, Failure or Pending URL -->
19
+ <iframe id="__frame" width="0" height="0" frameborder="0" src="https://<?php echo $domain2 ?>.fiftyone.com/utils/empty.jsp"></iframe>
20
+ <!-- Your custom footer here -->
app/design/frontend/base/default/template/borderfree/envoyhead.phtml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ $envoyUrl = Mage::getSingleton("checkout/session")->getEnvouUrl();
3
+ $domain1 = "checkout";
4
+ if(Mage::getStoreConfig('borderfree_options/settings/staging'))
5
+ $domain1 = "stagecheckout";
6
+ ?>
7
+ <script type="text/javascript" src="https://<?php echo $domain1 ?>.fiftyone.com/htmlcheckout/resources/js/merchant.js"></script>
app/design/frontend/base/default/template/borderfree/language.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if(count($this->getStores())>1): ?>
2
+ <?php $shippingCountry = Mage::getSingleton('customer/session')->getShippingCountry()?>
3
+ <div class="switch switcher-language">
4
+ <label><?php echo $this->__('Language') ?>:</label>
5
+ <div class="switch-wrapper" id="languageSelect">
6
+ <span class="switcher-holder">
7
+ <span onclick="popUpMenu(this);" class="switcher">
8
+ <?php echo $this->htmlEscape(Mage::app()->getStore()->getName()) ?>
9
+ </span>
10
+ </span>
11
+ <ul style="display:none" id="popId-languageSelect">
12
+ <li class="current language-<?php echo $this->htmlEscape(Mage::app()->getStore()->getCode()) ?>">
13
+ <span><?php echo $this->htmlEscape(Mage::app()->getStore()->getName()) ?></span>
14
+ </li>
15
+ <?php foreach ($this->getStores() as $_lang): ?>
16
+ <?php if($_lang->getId()!=$this->getCurrentStoreId()): ?>
17
+ <li class="language-<?php echo $this->htmlEscape($_lang->getCode()); ?>">
18
+ <a href="<?php echo $_lang->getCurrentUrl() ?>"><?php echo $this->htmlEscape($_lang->getName())?></a>
19
+ </li>
20
+ <?php endif; ?>
21
+ <?php endforeach; ?>
22
+ </ul>
23
+ </div>
24
+ </div>
25
+ <?php endif; ?>
26
+
app/design/frontend/base/default/template/borderfree/track.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $environment = Mage::helper('borderfreesettings')->getEnvironment()?>
2
+ <div id="trackingContainer">
3
+ <h3><strong>You need to upgrade your Adobe Flash Player</strong></h3>
4
+
5
+ <a href="https://www.adobe.com/go/getflashplayer" target="getflashplayer">
6
+ <img src=https://www.adobe.com/images/shared/download_buttons/get_flash_player.gif
7
+ alt="Get Adobe Flash Player" width="88" height="31" border="0" />
8
+
9
+ Download the free Adobe Flash Player now! </a>
10
+ <p> If you have already installed the latest version of Adobe Flash Player and you
11
+ still see this message then refer to your browser's documentation to learn how to enable JavaScript.</p>
12
+ </div>
13
+
14
+ <script type="text/JavaScript" src="https://<?php echo $environment?>.borderfree.com/tracking/swfobject.js"></script>
15
+ <script type="text/javascript">
16
+
17
+ var ePath = "https://<?php echo $environment?>.borderfree.com/flex/tracking/tracking.swf";
18
+ var eID = "flashOrderGeneralId";
19
+ var eWidth = <?php echo Mage::helper('borderfreesettings')->getTrackHeight()?>;
20
+ var eHeight = <?php echo Mage::helper('borderfreesettings')->getTrackHeight()?>;
21
+ var fpMinVer = "9";
22
+ var eBackground = "#FFFFFF";
23
+ var so = new SWFObject(ePath, eID, eWidth, eHeight, fpMinVer, eBackground);
24
+ so.setAttribute("AllowScriptAccess","always");
25
+ so.useExpressInstall("https://$environment.borderfree.com/utils/expressinstall.swf");
26
+ so.setAttribute("xiRedirectUrl",window.location);
27
+ so.write("trackingContainer");
28
+ </script>
app/design/frontend/base/default/template/borderfree/welcomemat.phtml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This code is part of the Borderfree Magento Extension.
4
+ *
5
+ * @category Borderfree
6
+ * @package Design_Base_Frontend
7
+ * @subpackage Localization_Welcomemat
8
+ * @author Jamie Kail <jamie.kail@livearealabs.com>
9
+ * @copyright Copyright (c) 2013 Borderfree (http://www.borderfree.com)
10
+ *
11
+ */
12
+ ?>
13
+ <?php if($this->isWelcomeMatEnabled()):?>
14
+ <script type="text/javascript">
15
+ //---------------------------------------------------------//
16
+ // Borderfree International Visitor Welcome Mat | Nov. 2010
17
+ //---------------------------------------------------------//
18
+
19
+ // Write Dynamic JavaScript
20
+
21
+ function wlcme51func(url) {
22
+ var wlcme51 = document.createElement("script");
23
+ wlcme51.src = url;
24
+ wlcme51.type = "text/javascript";
25
+ document.getElementsByTagName("head")[0].appendChild(wlcme51);
26
+ }
27
+
28
+ // Drop / Check for cookie to ensure visitor only sees Welcome Mat once per session
29
+ function isWelcome() {
30
+ var c_name = 'wlcme';
31
+ if (document.cookie.length > 0) {
32
+ c_start = document.cookie.indexOf(c_name + "=");
33
+ if (c_start != -1) {
34
+ c_start = c_start + c_name.length + 1;
35
+ c_end = document.cookie.indexOf(";", c_start);
36
+ if (c_end == -1) c_end = document.cookie.length;
37
+ return unescape(document.cookie.substring(c_start, c_end));
38
+ }
39
+ }
40
+ return "";
41
+ }
42
+
43
+ // If first page view per session, launch the Welcome Mat
44
+ if (!isWelcome()) {
45
+ wlcme51func("<?php echo $this->getWelcomeUrl() ?>");
46
+ }
47
+ </script>
48
+ <?php endif;?>
app/etc/modules/Borderfree_Api.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Borderfree_Api>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Borderfree_Api>
8
+ </modules>
9
+ </config>
10
+
app/etc/modules/Borderfree_Catalog.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Borderfree_Catalog>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Borderfree_Catalog>
8
+ </modules>
9
+ </config>
10
+
app/etc/modules/Borderfree_Chcekout.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Borderfree_Checkout>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Borderfree_Checkout>
8
+ </modules>
9
+ </config>
10
+
app/etc/modules/Borderfree_Crontab.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Borderfree_Crontab>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Borderfree_Crontab>
8
+ </modules>
9
+ </config>
10
+
app/etc/modules/Borderfree_Localization.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Borderfree_Localization>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Borderfree_Localization>
8
+ </modules>
9
+ </config>
10
+
app/etc/modules/Borderfree_Marketing.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Borderfree_Marketing>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Borderfree_Marketing>
8
+ </modules>
9
+ </config>
10
+
app/etc/modules/Borderfree_Order.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Borderfree_Order>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Borderfree_Order>
8
+ </modules>
9
+ </config>
10
+
app/etc/modules/Borderfree_Settings.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Borderfree_Settings>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Borderfree_Settings>
8
+ </modules>
9
+ </config>
10
+
app/etc/modules/Borderfree_Shipping.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Borderfree_Shipping>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Borderfree_Shipping>
8
+ </modules>
9
+ </config>
10
+
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Borderfree</name>
4
+ <version>1.1.1</version>
5
+ <stability>stable</stability>
6
+ <license>SaaS</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Magento to Borderfree Integration</summary>
10
+ <description>Borderfree enables U.S. retailers to transact with customers in more than 100 countries and in more than 60 currencies worldwide. From marketing and localization to customs and fraud, Borderfree gets your products into the hands of your global fans.</description>
11
+ <notes>Borderfree enables U.S. retailers to transact with customers in more than 100 countries and in more than 60 currencies worldwide. From marketing and localization to customs and fraud, Borderfree gets your products into the hands of your global fans.</notes>
12
+ <authors><author><name>Borderfree</name><user>Borderfree</user><email>sales@borderfree.com</email></author></authors>
13
+ <date>2014-08-12</date>
14
+ <time>20:15:33</time>
15
+ <contents><target name="magelocal"><dir name="Borderfree"><dir name="Api"><dir name="Helper"><file name="Data.php" hash="46c19a8f8df607491c6ac644d1ef9a49"/></dir><dir name="Model"><file name="Webservice.php" hash="86d43cb9b84b52d1ac7b16c355512936"/></dir><dir name="etc"><file name="config.xml" hash="cbcdb6765ba085b1ceca32b53abc4aa4"/></dir></dir><dir name="Catalog"><dir name="Helper"><file name="Data.php" hash="796fe8faff20dddcf42c4bcdebd22ed1"/></dir><dir name="Model"><file name="Export.php" hash="9ade44c647d35075b436ee15ff82e5fc"/><file name="Log.php" hash="583eee7512d141d8b87682681e918e5d"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="038517b832fd0cc54300c7ed6f0a0827"/></dir><file name="Log.php" hash="71b038370e16bc29d0bc1ac702e8103f"/><dir name="Products"><file name="Collection.php" hash="0df3b5dc49bbdcecf0f0a18f858c32b6"/></dir><file name="Products.php" hash="3af55934acde7b6a7f0a2fe58155bd99"/><dir name="Stores"><file name="Collection.php" hash="31e9ff899f276be33e76e0ab3df907b0"/></dir><file name="Stores.php" hash="84850c7c07758af52605f1d757aeb16e"/></dir><file name="Products.php" hash="55043930d378baa78dc2b0e852461e3d"/><file name="Stores.php" hash="7d6f80b5fdb1aaa40fabd0da55ccbeb9"/></dir><dir name="etc"><file name="config.xml" hash="09540918b0e10930c39d83acee698dfb"/></dir><dir name="sql"><dir name="borderfreecatalog_setup"><file name="mysql4-install-1.0.0.php" hash="d805f2eca14c034c74933b6158181560"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="799562744a78479af6db2c4cb4cfe0b8"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="39e985436df70b62a5c3a71b96ff4401"/><file name="mysql4-upgrade-1.0.10-1.0.11.php" hash="7cac56b924d5bdc6b1c66b6e6fbc54e9"/><file name="mysql4-upgrade-1.0.11-1.0.12.php" hash="c4ebbd1129457e2fde3562d5bf1d5b02"/><file name="mysql4-upgrade-1.0.12-1.0.13.php" hash="88d06b1b349452eba126d9a5d8e5ab6d"/><file name="mysql4-upgrade-1.0.13-1.0.14.php" hash="bd7e81984acc286c69d077d896b16103"/><file name="mysql4-upgrade-1.0.14-1.0.15.php" hash="6d876e35ed30551c7ec17fd1c9b22c23"/><file name="mysql4-upgrade-1.0.15-1.0.16.php" hash="e72cb14f17acb17986d41d26179b505d"/><file name="mysql4-upgrade-1.0.16-1.0.17.php" hash="de464474be8b946df06c3c3c62a86e29"/><file name="mysql4-upgrade-1.0.17-1.0.18.php" hash="27a889e88448bc776ac3745ab12e5535"/><file name="mysql4-upgrade-1.0.18-1.0.19.php" hash="1003d0cba014cfccd4e4b5637a399c0e"/><file name="mysql4-upgrade-1.0.19-1.0.20.php" hash="470e6d75418b07a2fd4fd8a8976a16dc"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="5bdbe2dd2349e7e26d4630fd89fa7bf5"/><file name="mysql4-upgrade-1.0.20-1.0.21.php" hash="8615d2ff3361b74db8259617611d1c05"/><file name="mysql4-upgrade-1.0.21-1.0.22.php" hash="8615d2ff3361b74db8259617611d1c05"/><file name="mysql4-upgrade-1.0.22-1.0.23.php" hash="8615d2ff3361b74db8259617611d1c05"/><file name="mysql4-upgrade-1.0.23-1.0.24.php" hash="8615d2ff3361b74db8259617611d1c05"/><file name="mysql4-upgrade-1.0.24-1.0.25.php" hash="8615d2ff3361b74db8259617611d1c05"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="ff54a300318913a62b54143a0ebb6bf5"/><file name="mysql4-upgrade-1.0.4-1.0.5.php" hash="3dc620215fdbf79429fc2051d4060d2b"/><file name="mysql4-upgrade-1.0.5-1.0.6.php" hash="0341863881faa1c333edbfeee4bf0def"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="0d25f6880c7549f66fe564a477efd572"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="5aec1af371f97e0398ad764f5f940216"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="72a3efbd9aed503cafb6ee0b49094989"/><file name="mysql4-upgrade-1.0.9-1.0.10.php" hash="23404bfbfe951322b2d980dd3b075f37"/></dir></dir></dir><dir name="Checkout"><dir name="Helper"><file name="Data.php" hash="7bb72a4e93f346e39dd28b457c092287"/></dir><dir name="Model"><file name="Shipping.php" hash="ce240cca6e3cabbff2316aabd9a85e60"/></dir><dir name="controllers"><file name="EnvoyController.php" hash="764a6b5d9b48cad1be1fafcd962605e0"/></dir><dir name="etc"><file name="config.xml" hash="89a725bf76d97f740d0720e22b518ad4"/></dir></dir><dir name="Crontab"><dir name="Block"><dir name="Adminhtml"><dir name="Cronjobs"><file name="Grid.php" hash="5d45b418800e04ca5091f8c1f46fe8bf"/></dir><file name="Cronjobs.php" hash="6129c47c666218d13a239b88184addea"/></dir></dir><dir name="Helper"><file name="Data.php" hash="850c7d5212935b9cd4e1de9ec177fe69"/></dir><dir name="Model"><file name="Log.php" hash="11e2ed45bc3c190adcf8f71a5a4e2a04"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="51579fb0b71e304861c198e6e437a99c"/></dir><file name="Log.php" hash="5cb0e9e39a4185552d0548515bb8269a"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CronjobsController.php" hash="83920b8da41bbfd33fb75de8649b3c8b"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="199a8650aa75a55fdfd27d6da2417b3a"/><file name="config.xml" hash="ee271a803cf3dffb705347e6312c962d"/><file name=".DS_Store" hash="fc9082b6938870ffcaadac2a409c989c"/></dir><dir name="sql"><dir name="borderfreecrontab_setup"><file name="mysql4-install-1.0.0.php" hash="906898dcc5fadfa1d0b2a7ed3f5ea975"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="3584e7f22d727b98736fd8ca18463fe3"/></dir></dir><file name=".DS_Store" hash="a06b656ad6eaedbe578aac179d395d0f"/></dir><dir name="Localization"><dir name="Block"><file name="Country.php" hash="fa5d11d0ecf24993e9089ae87cf4fc34"/><file name="Switch.php" hash="94088c517a57e31edc5df1189772fd78"/><file name="Welcomemat.php" hash="18c494d44794aa2791e339e5e52a829c"/></dir><dir name="Helper"><file name="Data.php" hash="690bc29353081cd6d007fa1f48b3698a"/><file name="Url.php" hash="b5090e39ce02ddcb66a80c1dbf989f57"/><file name="Wishlist.php" hash="e8c08bdbacd708eec35198e010855ede"/></dir><dir name="Model"><file name="Cache.php" hash="53f2862d5a98c51823cc81ce7dacf2e7"/><file name="Convert.php" hash="ba0d1fe148f93732bb9bb90240929e9a"/><file name="Country.php" hash="4904281c96aece1d8bd716827a1b82a8"/><file name="Currency.php" hash="63a3264a2d9af09d72c523af99072d7d"/><file name="Discount.php" hash="ee43e52f595b6ac5a68b7cd46dc2bbdc"/><file name="Fxrate.php" hash="af6cc21af79587ca3c8419f191480633"/><file name="Import.php" hash="847b56256f4d1a9ca0027a7a6bf2182b"/><file name="Ip.php" hash="298b47a1e8d24c972ab5f9980fc2ee52"/><file name="Lcp.php" hash="94bf4529232cf0217022cbdae34a1079"/><dir name="Mysql4"><dir name="Cache"><file name="Collection.php" hash="15b60b9b3a302f650801457891c8ff04"/></dir><file name="Cache.php" hash="ec69e6f8de8e2aa09791d4e6b8b941c6"/><dir name="Country"><file name="Collection.php" hash="e42718cbbf70c9b0adc8412e474567a0"/></dir><file name="Country.php" hash="12936d04243daf126267c6183515b012"/><dir name="Currency"><file name="Collection.php" hash="b856c902e21fa1de2f290250831a1e2f"/></dir><file name="Currency.php" hash="c323e115ea260148ef263fff208c5da2"/><dir name="Fxrate"><file name="Collection.php" hash="d0b0ea8388cfbb17ae12266677987809"/></dir><file name="Fxrate.php" hash="78335a77b526bc25aec3418fe8adf817"/><dir name="Ip"><file name="Collection.php" hash="abf81d900dc3bfa41c0775740cf714b1"/></dir><file name="Ip.php" hash="46fedf0217b9a973403e73c2d8241be1"/><dir name="Lcp"><file name="Collection.php" hash="aeceba4918d4c94e42355c527f78a15e"/></dir><file name="Lcp.php" hash="6181b15c5e6fec13ede289909d5434bf"/><dir name="Payment"><file name="Collection.php" hash="ea58ca0f74c80b58a92da470343605c4"/></dir><file name="Payment.php" hash="17bf6bb2a1a9f1fa7a3372f769a3b935"/><dir name="Region"><file name="Collection.php" hash="b88c717de98ee7185b8c7c8475e6513c"/></dir><file name="Region.php" hash="a4c2c63f05d7a0e50c1764ef57cfb344"/><dir name="Rounding"><file name="Collection.php" hash="80d7e626712c5e7b46e3a883dc2e5927"/></dir><file name="Rounding.php" hash="e8c28413fc49c9f3ee5cda241727893c"/></dir><file name="Observer.php" hash="fccf15b12159643c832a5f1dd6a9a4f8"/><file name="Payment.php" hash="47e67ec87891e76ae7918163d45331c9"/><file name="Region.php" hash="cc97bf7eeb3f356240f79228e6f16688"/><file name="Rounding.php" hash="c153be4fd5cb91783a4937f8b023337c"/><file name="Store.php" hash="57d017739e6b0b0182526cf18123bc7c"/><file name="Tax.php" hash="eb5e76b15ee174381fd00472a8eedbcb"/></dir><dir name="controllers"><file name="CountryController.php" hash="2d195a12a2d41c2c7ec15e14b0ac46dd"/></dir><dir name="etc"><file name="config.xml" hash="8d414b5e6c97144ded73a450d36c5751"/></dir><dir name="sql"><dir name="borderfreelocalization_setup"><file name="mysql4-install-1.0.0.php" hash="ebfc6cfb344c6718e56249e8afcd5670"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="c9a658e0ae7b2c733d7d94932adb8e08"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="40cb84d9f7a6fde54a5dc79976eeca30"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="68915000d70bdfd69b75dbff2f0166a8"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="c9ac6f38b0109068e823c0f4e010d63e"/><file name="mysql4-upgrade-1.0.4-1.0.5.php" hash="7a47cf242e09597091098314c788d195"/><file name="mysql4-upgrade-1.0.5-1.0.6.php" hash="c2a5aceceeb124e85ecb2c453e80e949"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="db2af2ba9a989076db031909f0a9538f"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="8003a14b90d005e908839ff872fcbb91"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="33d21e1dca82facd172f0fbc76a7ff32"/></dir></dir></dir><dir name="Marketing"><dir name="Helper"><file name="Data.php" hash="2369a6ca4cc6f4712a0fdeb7a6a55309"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Marketing"><file name="Collection.php" hash="e6841eb10e4551a7c5c4e02ffeb253ed"/></dir><file name="Record.php" hash="915844a51f59b95a7562f23e32e6ca37"/></dir><file name="Record.php" hash="ed2a4ca26d7b45cede9da4497dda24ba"/></dir><dir name="etc"><file name="config.xml" hash="15c52419a0264bef5e61a9f4059c2df9"/></dir><dir name="sql"><dir name="borderfreemarketing_setup"><file name="mysql4-install-1.0.0.php" hash="a484a673f061663b81c8489aad210499"/></dir></dir></dir><dir name="Order"><dir name="Helper"><file name="Data.php" hash="5f20b81ca06d7489f01e65ba5829b19f"/></dir><dir name="Model"><file name="Import.php" hash="a9bb5f1cfe85825b8e61b168499d4ad4"/><file name="Observer.php" hash="6c9868b9aab6dc25146806f8d4045efe"/><file name="Track.php" hash="23e7bffc3ea8cbcf827d937b92903ac9"/></dir><dir name="etc"><file name="config.xml" hash="d27ecb6629d90917a655259a8a3e8061"/></dir><dir name="sql"><dir name="borderfreeorder_setup"><file name="mysql4-install-1.0.0.php" hash="e94a1c6c98be242a1ce214fd11bb17bd"/></dir></dir></dir><dir name="Settings"><dir name="Block"><dir name="Adminhtml"><file name="Payment.php" hash="b2c7d95e33794db32f1afb7f4fff00df"/><dir name="Shipping"><file name="Merchant.php" hash="b3081fc6d80003969ffecfa93757c5c3"/><file name="State.php" hash="bc7208d52986346b4daccc01e7452494"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="30b3b9d8e9c8e472155134e8a632670b"/></dir><dir name="Model"><file name="Days.php" hash="f37a1559eff3ec1beb8a9c5eec70c6cd"/><file name="Handling.php" hash="60f29e42f38d8ed04a1c4113ac7f0cf3"/><file name="Insurance.php" hash="5542d56fc3f0324d485b43912f2ed7c8"/><file name="Lengthunit.php" hash="67b5f431c6d74d6dc10bcef8a152f1aa"/><file name="Rate.php" hash="eb1db6ff1ca4363f92e71a140806dbcd"/><file name="Weightunit.php" hash="5bb4b1fd52e7a3c3596be0483c9c9be5"/><file name="Zip.php" hash="fd313938de2217b84aab1f21546aa5bc"/></dir><dir name="etc"><file name="config.xml" hash="acbb7db382595011c6805dbfbd8283ef"/><file name="system.xml" hash="ab4c2ad6423f909c1cf0cc52d2da6eec"/></dir></dir><dir name="Shipping"><dir name="Helper"><file name="Data.php" hash="a0ec77610f2b35eb5344115e5183c7b0"/></dir><dir name="Model"><file name="Shipping.php" hash="079d462a199fb3c957bc95e2ceb988a7"/></dir><dir name="controllers"><file name="TrackController.php" hash="8fce04f456b41cb6baf38a640a707000"/></dir><dir name="etc"><file name="config.xml" hash="0197045c60d81760907a4a175766dcda"/><file name="system.xml" hash="b0ed8db7ba83901d7b07eaafe3a75f36"/></dir></dir><file name=".DS_Store" hash="7b66ed0b47539c3c0b1f155248013834"/></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Borderfree_Api.xml" hash="d1fe3c536554699d9e71b03f2cbb6ed5"/><file name="Borderfree_Catalog.xml" hash="ed72369b068741d1fe5e0cb78f81104c"/><file name="Borderfree_Chcekout.xml" hash="87609a20000f8eb4e09e7d0a2c38d8ca"/><file name="Borderfree_Crontab.xml" hash="b959528901d7f88f1d51770fd799552e"/><file name="Borderfree_Localization.xml" hash="0aa4b02986785c688ba4b620e5da7f0d"/><file name="Borderfree_Marketing.xml" hash="4c53baf0a0477eab43b83343d7ae7225"/><file name="Borderfree_Order.xml" hash="cc310f9053452850eed902ad568b698d"/><file name="Borderfree_Settings.xml" hash="621f66d1ecf6607488115aecc78dabaf"/><file name="Borderfree_Shipping.xml" hash="a5dbaa7b758647c9a9373718513ed945"/></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="borderfreecrontab.xml" hash="629af4c09089849d27b187c2f5f9a283"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="borderfreecheckout.xml" hash="302e7c4e9d984b0c00b72e2993a4d9b1"/><file name="borderfreelocalization.xml" hash="c76695fcf12daafe56a8ba724c53ce44"/><file name="borderfreeshipping.xml" hash="7b6ecc8b2b4995560bdfd988221fc126"/></dir><dir name="template"><dir name="borderfree"><file name="country.phtml" hash="5919796cecd0aeceef019f8760e62de5"/><file name="currency.phtml" hash="23974ea9d42c9077f518630cae32176a"/><file name="envoy.phtml" hash="a776a2051cfa67bdd036a31aa991cedb"/><file name="envoyhead.phtml" hash="0c085931fcad19e7b63a20fef71275c3"/><file name="language.phtml" hash="a49d0b4b4af2ebeec35a61473bcf1500"/><file name="track.phtml" hash="a4d17b8d580cccac80823d321ea0a7b6"/><file name="welcomemat.phtml" hash="9bc91370215ce29a704d2e339914fd39"/><file name=".DS_Store" hash="073d3e6a04b9e48929d123f062b9dc69"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="borderfree.css" hash="5bd0cee5eb1212040e73ef750e1d8781"/></dir><dir name="images"><dir name="borderfree"><file name="AD.gif" hash="e8a56bb5320e546f86df1b5cac2bc283"/><file name="AE.gif" hash="1b65692471a85d0eeb1729c746dd84f9"/><file name="AF.gif" hash="314600b394b9c5f3f1f2495dbc4f398c"/><file name="AG.gif" hash="1e7551468a645a0d4cc130174c4bf36c"/><file name="AI.gif" hash="c264ba72e6a105aa6991df0bd68b9923"/><file name="AL.gif" hash="9fdfaa3bb2ca142cf6c253aec29db796"/><file name="AM.gif" hash="f691ca8c7328ae5138713892e4935428"/><file name="AN.gif" hash="02c74f84c3f8b682e0d9eb20beaecbb7"/><file name="AO.gif" hash="a3521e04599715041bbc5e3942d37ca4"/><file name="AQ.gif" hash="c22e48671fda02cbe4c143f1c9310378"/><file name="AR.gif" hash="493874e530ed3add9fdc6dd6f08e35b6"/><file name="AS.gif" hash="4ded04cfa64a3cf8fea72c7946ee3807"/><file name="AT.gif" hash="6b7a30dfda9f8c69c1c0fce623aa9c18"/><file name="AU.gif" hash="7a22f2752c8178366a7101efd8f0da68"/><file name="AW.gif" hash="7efaf7c947669122c18627ce8f7fee72"/><file name="AX.gif" hash="ac026cadb5bcc39eb52d6072e7f35255"/><file name="AZ.gif" hash="3df6d089c5c68e79feeff260a0fe9681"/><file name="BA.gif" hash="03c36f53e25886e1c92eb46c19017c8d"/><file name="BB.gif" hash="c473997d1dc14d2ec6ba712de816c45f"/><file name="BD.gif" hash="a20d92fe7b704d40f106796c8a12ed0b"/><file name="BE.gif" hash="08a1c906bef2642cb79e93f8ffd9cf3e"/><file name="BF.gif" hash="956a80a1b68ea65b7f3c47928e484da2"/><file name="BG.gif" hash="369d044891df723a53784b5f95864507"/><file name="BH.gif" hash="db6859e3ed668f1b1b5bd8fad10cf3c5"/><file name="BI.gif" hash="10e32f60a52368a221c24e9e321bc59f"/><file name="BJ.gif" hash="ab30586f7ffdfc84490d7137024bafff"/><file name="BL.gif" hash="0b66499a3b7c50bf46fee16cdf002d19"/><file name="BM.gif" hash="d7ef33ac7eb0aa180d2bcdd222e1fa2f"/><file name="BN.gif" hash="f6eb1a6fc8c180e0ba96a60b61cfc5ca"/><file name="BO.gif" hash="41fb5db437b3648d191b0f2ed6f89ede"/><file name="BQ.gif" hash="a5d1f47bad05cc44c1b7b0353145297c"/><file name="BR.gif" hash="a67282256570a3b5fa49cc30922b2eae"/><file name="BS.gif" hash="25270624a3cf66b17c1b1902d2826def"/><file name="BT.gif" hash="31dd050ea9b28e51eb6d7a1527e1fdfe"/><file name="BV.gif" hash="397af455556c1cca350936d0a9c0b043"/><file name="BW.gif" hash="a3d3148864c3ef8d47b722bda3f8ad8b"/><file name="BY.gif" hash="1292a2749a5d256659492efecb61b7db"/><file name="BZ.gif" hash="db68de5a85241c05c47852a4b14e4c44"/><file name="CA.gif" hash="7bc41449c33ed010bd2f0d3fa1a288ae"/><file name="CC.gif" hash="72c5abdc47d4f70f46e670998e4b39be"/><file name="CD.gif" hash="059887cc84ef47b8b506a18b736de759"/><file name="CF.gif" hash="e7cb7bbd481813ac7f2562590982832f"/><file name="CG.gif" hash="79b5b814ff34c4514e633e2ff97c6eaf"/><file name="CH.gif" hash="e63bd8221596e90c8f13ad228e2d0fc2"/><file name="CI.gif" hash="0185842aa17ab0dd7790215275e2840c"/><file name="CK.gif" hash="76425eba75da9ef102e3005c8224c855"/><file name="CL.gif" hash="1ca6b48c14c319134d385e9d8c0c2880"/><file name="CM.gif" hash="693990b735794b170bfa8564a4f466cb"/><file name="CN.gif" hash="b98fb0fbc65241cf4c9ce26a43dc0642"/><file name="CO.gif" hash="71a591b161ecd4fc04d7725c6614a4a5"/><file name="CR.gif" hash="7eb4c59f13c2e3a28c3abd6121ef2d18"/><file name="CS.gif" hash="5e2afae62f17d648196e528b42a9db0e"/><file name="CU.gif" hash="991e3cdabe0ec5ce78d982fd255c3636"/><file name="CV.gif" hash="44fb7c1ff45c8111cf7ffdd83421519c"/><file name="CW.gif" hash="cc1a226c75f520cef9101552a6eb6649"/><file name="CX.gif" hash="6fc67c8308caea8ebb006a91763fe55e"/><file name="CY.gif" hash="bd9e01a862f765c6de363b97a2657754"/><file name="CZ.gif" hash="5e2afae62f17d648196e528b42a9db0e"/><file name="DE.gif" hash="22957403e915293800553bd5348bf23d"/><file name="DJ.gif" hash="1b88748978f8ddc7c537dc739509699a"/><file name="DK.gif" hash="ad3335e5cfc0e4d4f1a45b0998420fee"/><file name="DM.gif" hash="b53f54e479e6fa21f5ccaf29fc17baea"/><file name="DO.gif" hash="41a7cf83f95743df728881d3964b6926"/><file name="DZ.gif" hash="c396356fff5210fea111e41e016b924c"/><file name="EC.gif" hash="48b688bf2b2e4dd4c5a8f9af8dbc3d98"/><file name="EE.gif" hash="fff1bf81f711a6c1fa8c475c363473b6"/><file name="EG.gif" hash="297f3718c2ba77ec2177b38461d78e91"/><file name="EH.gif" hash="61beb4b4d15aa8452f02afcd8911007a"/><file name="ER.gif" hash="632b4e2e72c93d15918805b215cbf158"/><file name="ES.gif" hash="306367e52b7180910211067f7c7531df"/><file name="ET.gif" hash="0de41f1d757e51df4e7b95b0f0bfe69f"/><file name="EU.gif" hash="9b71ad7ba350973a787a3838733cbc2c"/><file name="FI.gif" hash="37ab815546ff244ea8858642f9ca870f"/><file name="FJ.gif" hash="2d2b38fdc365b5352eaa2ae89895bffa"/><file name="FK.gif" hash="05343793b1adeafdf6d04634563b4a9c"/><file name="FM.gif" hash="67d470611192ec39024843a9e22849da"/><file name="FO.gif" hash="2512edfc4dc5c1dfcfb51bcf7e9512e7"/><file name="FR.gif" hash="1b2d4896c6fdcd3bf97545e1914c1588"/><file name="GA.gif" hash="3397508dcec74e152ad61b5657b45c5d"/><file name="GB.gif" hash="4526151110a10b8cfcb6996fe63b4548"/><file name="GD.gif" hash="214f016271bf0c66d4c1fe905cbed7b8"/><file name="GE.gif" hash="3ff17495cda7f2e987f0fa7be0e76191"/><file name="GF.gif" hash="a3ff68c3391e7f4a149241375c835f94"/><file name="GG.gif" hash="bd0ea96ab8ef1016727cad692fc46dcb"/><file name="GH.gif" hash="bd8dabcc368620cda6302b10181db33e"/><file name="GI.gif" hash="d68f6139ec0047da331d2cff0df7726f"/><file name="GL.gif" hash="1f1ce5e9fc2476710efe2e9dfef217e6"/><file name="GM.gif" hash="5fa9303d8260d49095562d6f6fa95c4f"/><file name="GN.gif" hash="7122b6218aa43d113cbc58903fc895ad"/><file name="GP.gif" hash="448f93cbced3168513a511b66ba9b007"/><file name="GQ.gif" hash="3e7ac731bf7439192f5ee132d2011e5c"/><file name="GR.gif" hash="67e0b5af6e9e1aa13cacc8e5e3bd818e"/><file name="GS.gif" hash="7441afcfdb87d3ae29b51cbc40c08445"/><file name="GT.gif" hash="d47480024a5d40e84170affd2fa364ad"/><file name="GU.gif" hash="d7fbeb4461d3ddd503cea4e61215bf67"/><file name="GW.gif" hash="15ab69559233377065fadb093f9dfb33"/><file name="GY.gif" hash="b753eb123ef37a56c1c4dde65ad8d06b"/><file name="HK.gif" hash="5286568ed4c82471cce1e965dc8df75e"/><file name="HM.gif" hash="7a22f2752c8178366a7101efd8f0da68"/><file name="HN.gif" hash="3bd3906bca28e3493254db3844b6dbbf"/><file name="HR.gif" hash="b118a37649a9b4df47b8493e547c45ee"/><file name="HT.gif" hash="144dc1f6f626c5e04352f18c2239587c"/><file name="HU.gif" hash="91144dff3de1fa36141092b10dee3f4d"/><file name="IC.gif" hash="ffbf7173ba6064091024f67cdcb33164"/><file name="ID.gif" hash="f85b1dcb5d31f72410ad1d919e2385a4"/><file name="IE.gif" hash="432cd30c1d824d0b93671854479e9fad"/><file name="IL.gif" hash="02f1fd1e35ebd5048c7618a155513f7b"/><file name="IM.gif" hash="a9a45af27d1a840c0079890e6d51f58b"/><file name="IN.gif" hash="589d9ee92e7358776bb0e9c005c9f747"/><file name="IO.gif" hash="4b970879268d68de20caa7bc45cd9cce"/><file name="IQ.gif" hash="b70a4e8fba571f0b3ffe97f9fda86a8f"/><file name="IR.gif" hash="2214229f61269bd6178137fc27fddf96"/><file name="IS.gif" hash="5926bbe5298c847850a0cb8c85f58a87"/><file name="IT.gif" hash="face673e8f01d382b4b23815d97398b1"/><file name="JE.gif" hash="9bf6dc98f1ecec9e1e997ce4e6ed7585"/><file name="JM.gif" hash="4b9ab3a4f33f7971816569c222a8e5fc"/><file name="JO.gif" hash="0016fbceae2bb23c09050e1b6e1b2cb7"/><file name="JP.gif" hash="1e06c9605cf689f56c53b9be6cc24711"/><file name="KE.gif" hash="fb34cc2da17362f17f0eb91b901490d8"/><file name="KG.gif" hash="87bcdac965f6cf514b10522004f977cd"/><file name="KH.gif" hash="9fd28912a4bafda14247d40484f9dcf1"/><file name="KI.gif" hash="59064f74f7f86ed8125ce757301eee51"/><file name="KM.gif" hash="93349606d178be5d97b3fd76650ec220"/><file name="KN.gif" hash="34fa93b8c287e96dddd5305886db84cc"/><file name="KP.gif" hash="068dafe015584c9e8c5fe5435272eb0e"/><file name="KR.gif" hash="a50e3e7a2f9777d9ff95384735e4deb5"/><file name="KW.gif" hash="f0ee5362fea6634e86be75251cc7bb4a"/><file name="KY.gif" hash="49bae51c4ed44379d0b4a84aaf030563"/><file name="KZ.gif" hash="6fb23d2f00c292ca2ff16727e3012f9f"/><file name="LA.gif" hash="589855150372720b80cc50cda5d53f73"/><file name="LB.gif" hash="145d83036f5030ec7ef6c413dd583862"/><file name="LC.gif" hash="7e3b8dd17b2772e4eb02fe4a97d20aeb"/><file name="LI.gif" hash="b7931a1c2fe7d48bdac9bc81ab65bb73"/><file name="LK.gif" hash="fa8c4e9c848ff8af8008c1eda4d34f2e"/><file name="LR.gif" hash="d27a063f5a6b61bf50d7bcee9b6a90c6"/><file name="LS.gif" hash="2dd226bee8bd7a9546742d56f21c2dd7"/><file name="LT.gif" hash="599c8b877df67e9b3a1acb4dd12ada3e"/><file name="LU.gif" hash="15ad2efff73399f39687ce00aa92f6bf"/><file name="LV.gif" hash="036ba95a1c28f2a39223f8ca194df34f"/><file name="LY.gif" hash="c2cc482136f0f12f409372aedbdea961"/><file name="MA.gif" hash="e2fd71e74a88325fb29387a09f0af912"/><file name="MC.gif" hash="85bc4ebfbaa9a4b66ced61bffb7f7e83"/><file name="MD.gif" hash="18149114e0973e7f362dc33df49f5306"/><file name="ME.gif" hash="a52e425eece2cd987727960daeb02245"/><file name="MF.gif" hash="b1990d43eb5d181ea7b35472f2fd5289"/><file name="MG.gif" hash="5c9ac227a1982f549560a36c1cd3989f"/><file name="MH.gif" hash="fac53ed4e53fcc67d1d8e7273897cb7e"/><file name="MK.gif" hash="58b7c500c26b2f03353de3dd5f406793"/><file name="ML.gif" hash="53fbd65aecd01e360f62fecb47dd245a"/><file name="MM.gif" hash="360b981beb729717a06aa92fc04110a9"/><file name="MN.gif" hash="6e0f8343d7b28a08b28c05e60495788a"/><file name="MO.gif" hash="9e42921e506a851555e89aad27b6ca4f"/><file name="MP.gif" hash="cc2a848707f36e3f5033676f17400744"/><file name="MQ.gif" hash="5e14382e6a0f4d1bf5093d75abaf83a3"/><file name="MR.gif" hash="83c6cff000819d77bcc0d67e3e6fdae4"/><file name="MS.gif" hash="2dcae2a71738cb0002fee007065be965"/><file name="MT.gif" hash="d0f4112107347443804e423c311dffa2"/><file name="MU.gif" hash="1478652a15df8bf89e7b618813d25781"/><file name="MV.gif" hash="af0b9304c61ea5e87f6ccc26a7bff336"/><file name="MW.gif" hash="e4ffabb1b771245e2d439937beec2d25"/><file name="MX.gif" hash="f8655ede4e8de63960f394b9348c6a61"/><file name="MY.gif" hash="8dd40a168a05d6acfa8639a2e0f4997e"/><file name="MZ.gif" hash="f6736d88cdb0fb811a603fc46836851e"/><file name="NA.gif" hash="5e350043d4548189f4a2b090976e16c5"/><file name="NC.gif" hash="39e928a55de3db3eca5b51cee806d27b"/><file name="NE.gif" hash="1088b7749027b5c6dc4d3e5b4eb0ec76"/><file name="NF.gif" hash="486ed5413bceddca2904764a79c2a9d3"/><file name="NG.gif" hash="ba17b6d8725224f5bd0f97692578e925"/><file name="NI.gif" hash="562925f67f907608173f5f39f9408562"/><file name="NL.gif" hash="06e789595b0f689964321d4ef0450909"/><file name="NO.gif" hash="397af455556c1cca350936d0a9c0b043"/><file name="NP.gif" hash="b09d9283f6f06a360d6be14abcc3275a"/><file name="NR.gif" hash="85bf2ccfb7ee21f2058be3c4d1cca458"/><file name="NU.gif" hash="16cc7de1dbd792135d53471a01c3d0ec"/><file name="NZ.gif" hash="a36e93ddd7d78b00cf41b2f5e1b1e97b"/><file name="OM.gif" hash="209712201bffa5b5e0d0b5d085fb1e25"/><file name="PA.gif" hash="fb4fd258799a0d40c3592a768143cd92"/><file name="PE.gif" hash="84300e0ec672c0c52cc2f1d7ea912dbb"/><file name="PF.gif" hash="ad1f903433f6951393ec0b4b59c8a675"/><file name="PG.gif" hash="a8a6de5949a733e6f3cc438ea0d86b65"/><file name="PH.gif" hash="e603e0e8d72e85d2ad9dfa72bd8f6adb"/><file name="PK.gif" hash="34eabec088e18a6aa36f62124a0f6df6"/><file name="PL.gif" hash="8a2d63dbc0e2eaf8f6b89ba93a61f624"/><file name="PM.gif" hash="83a200b3e946cd9a69b97319c08120f2"/><file name="PN.gif" hash="ae8f16ed4368acd5487540664c00d5d0"/><file name="PR.gif" hash="c158741b5adea750699d1ac7b06ada2d"/><file name="PS.gif" hash="93fbeefb038ce8b6d3c99e0c22811a3b"/><file name="PT.gif" hash="71d629618e36c1891b96aca341336f75"/><file name="PW.gif" hash="95625d277a5d44143f2b3657f1ab80e1"/><file name="PY.gif" hash="140f90824989aeb0081c5d5192ee0d89"/><file name="QA.gif" hash="85ec86a3d4905bd3cac5e41c13c454d9"/><file name="RE.gif" hash="1b2d4896c6fdcd3bf97545e1914c1588"/><file name="RO.gif" hash="e19183a81d1c798e6a9dd97d051cd708"/><file name="RS.gif" hash="11fcf534e7192f7768430271ee2ad88c"/><file name="RU.gif" hash="7fa4c38bad4d7c34101db673e171a44b"/><file name="RW.gif" hash="c448b7f6b530c9a76683c984dc43605f"/><file name="SA.gif" hash="d347045f73b32b7106a71d3395c57c28"/><file name="SB.gif" hash="c8c0ad13b680c62eb979ac845a9c4760"/><file name="SC.gif" hash="bfbf95d8eef821680e44e73c8d59afec"/><file name="SD.gif" hash="b868716809267e3d2056ed7964ce858d"/><file name="SE.gif" hash="74bb5ddc99e6f900a04b3c4bb9b95ca4"/><file name="SG.gif" hash="27796cfd7533a70f992e0f6701205b98"/><file name="SH.gif" hash="09ca0de3bfb265893a8318ed5617ec1e"/><file name="SI.gif" hash="39a2fe053c57e2961632419cadf3b545"/><file name="SJ.gif" hash="397af455556c1cca350936d0a9c0b043"/><file name="SK.gif" hash="9a43a09d98b071d6824dfc3bc15b6703"/><file name="SL.gif" hash="cdb4550ad3c359418708f9ae64659913"/><file name="SM.gif" hash="c8980d1baa51690c619f77dd54dd452e"/><file name="SN.gif" hash="db1b325658f52914a2fb8b1dfae9447d"/><file name="SO.gif" hash="e95558e1464c21e1db4b2701888d838d"/><file name="SR.gif" hash="4adf85780a90c390a29999b007feb83c"/><file name="ST.gif" hash="9c46a39ddeca49cbad8d9e424937f14b"/><file name="SV.gif" hash="2e55868e33bebb406626361ecdd4ec79"/><file name="SX.gif" hash="30e1bb01fbee254a21083b92c9036a42"/><file name="SY.gif" hash="622b98992374d47db951a5b129fb9f21"/><file name="SZ.gif" hash="4ba0515b68b88a13306da412aa389343"/><file name="TC.gif" hash="1ffc70883b65dc3c3723cc7d8b8bb326"/><file name="TD.gif" hash="152cc75134e33bddc9a56fa312a3be92"/><file name="TF.gif" hash="2548c9ab271406c3f0e8ce4ffab71d93"/><file name="TG.gif" hash="a4521a7a3784020ff6bfcfeda8fe122d"/><file name="TH.gif" hash="a0264d1157a3ea99bce1d245c7623577"/><file name="TJ.gif" hash="34138339bda9b79a9930dc26f0e74ffe"/><file name="TK.gif" hash="939faa02cba41d18fbbeeeb2ee9694bb"/><file name="TL.gif" hash="782cc9b8529bb03dc1eeebf1058b87c8"/><file name="TM.gif" hash="b30bff894bcbe1c558bb61c6065a97e2"/><file name="TN.gif" hash="9cc7946754499ae38fe24e61271424df"/><file name="TO.gif" hash="118e8fa53685c000db5249d8cf6e54f2"/><file name="TP.gif" hash="782cc9b8529bb03dc1eeebf1058b87c8"/><file name="TR.gif" hash="095d4eab1ef0f373618b6d573d2f767f"/><file name="TT.gif" hash="68628c32dcfda4d8d571ba98de3496fd"/><file name="TV.gif" hash="b8f8caf87babf588366dd052c3ab9e9a"/><file name="TW.gif" hash="ebd65b11d797742315c79dba9736c570"/><file name="TZ.gif" hash="60c26a8428ba8f96e1c47d03d871a05b"/><file name="UA.gif" hash="d0e289b2fad4af34102af9a39cb9ae15"/><file name="UG.gif" hash="e98bc391b61eee6104667b354ed71cd6"/><file name="UM.gif" hash="0abea8f4a3b7a614b96c8cc97d8479fd"/><file name="US.gif" hash="0abea8f4a3b7a614b96c8cc97d8479fd"/><file name="UY.gif" hash="412140c4ac36571da95b1e1f98e30e18"/><file name="UZ.gif" hash="4a6eb46383d812f55c983cef88ab0f91"/><file name="VA.gif" hash="ef1530fcba22651dab29c090a667acde"/><file name="VC.gif" hash="351ba3e7255ac67e71a0b830253177c1"/><file name="VE.gif" hash="1e260c41c5bcbe77a702f517c1aae882"/><file name="VG.gif" hash="fd5b975be8b2fa25f04c6f22c2b37c25"/><file name="VI.gif" hash="d6e842fb52452c5549dee204bb6da3cb"/><file name="VN.gif" hash="9ef0f0992b330c49d6867aece655e1ed"/><file name="VU.gif" hash="46a03c675e542d953a401ab6cc93c35f"/><file name="WF.gif" hash="b96a1a5e9a33548f798f0a30dde441a6"/><file name="WS.gif" hash="00f03fcf83448946e023f96bc48eaf93"/><file name="YE.gif" hash="90466eb36ed03b574db3d96c03bb056e"/><file name="YT.gif" hash="8b7259fb33dbc2467b61cad358903ec2"/><file name="YU.gif" hash="11fcf534e7192f7768430271ee2ad88c"/><file name="ZA.gif" hash="e4a95d44b6d420d9437f8c3507379bc3"/><file name="ZM.gif" hash="af99f4f88c1e9baf2b1654418d1174ce"/><file name="ZW.gif" hash="55ae1b4c99e25fbae95f78c1996e2bea"/><file name="ZZ.gif" hash="d7e23b0b56978104514bc7af9d77a33f"/></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>
skin/frontend/base/default/css/borderfree.css ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ .switcher-holder img {vertical-align: middle;}
2
+ .page { position: relative }
3
+ #countrySelect, #currencySelect { position : static; }
4
+ #countrySelect ul, #currencySelect ul { min-width: 0; width: 940px; left: 0px; z-index: 100;}
5
+ #countrySelect li, #currencySelect li { float : left; width: 186px; }
6
+ #countrySelect li.current, #currencySelect li.current { float: none; clear: both; }
skin/frontend/base/default/images/borderfree/AD.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AE.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AF.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AG.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AI.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AL.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AN.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AO.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AQ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AR.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AS.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AT.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AU.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AW.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AX.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/AZ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BA.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BB.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BD.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BE.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BF.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BG.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BH.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BI.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BJ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BL.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BN.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BO.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BQ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BR.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BS.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BT.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BV.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BW.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BY.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/BZ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CA.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CC.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CD.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CF.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CG.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CH.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CI.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CK.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CL.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CN.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CO.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CR.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CS.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CU.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CV.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CW.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CX.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CY.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/CZ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/DE.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/DJ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/DK.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/DM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/DO.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/DZ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/EC.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/EE.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/EG.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/EH.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/ER.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/ES.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/ET.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/EU.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/FI.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/FJ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/FK.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/FM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/FO.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/FR.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GA.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GB.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GD.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GE.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GF.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GG.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GH.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GI.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GL.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GN.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GP.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GQ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GR.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GS.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GT.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GU.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GW.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/GY.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/HK.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/HM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/HN.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/HR.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/HT.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/HU.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/IC.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/ID.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/IE.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/IL.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/IM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/IN.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/IO.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/IQ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/IR.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/IS.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/IT.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/JE.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/JM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/JO.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/JP.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/KE.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/KG.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/KH.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/KI.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/KM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/KN.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/KP.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/KR.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/KW.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/KY.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/KZ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/LA.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/LB.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/LC.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/LI.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/LK.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/LR.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/LS.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/LT.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/LU.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/LV.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/LY.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MA.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MC.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MD.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/ME.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MF.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MG.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MH.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MK.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/ML.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MN.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MO.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MP.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MQ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MR.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MS.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MT.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MU.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MV.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MW.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MX.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MY.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/MZ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/NA.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/NC.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/NE.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/NF.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/NG.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/NI.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/NL.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/NO.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/NP.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/NR.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/NU.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/NZ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/OM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/PA.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/PE.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/PF.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/PG.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/PH.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/PK.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/PL.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/PM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/PN.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/PR.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/PS.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/PT.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/PW.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/PY.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/QA.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/RE.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/RO.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/RS.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/RU.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/RW.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SA.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SB.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SC.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SD.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SE.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SG.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SH.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SI.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SJ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SK.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SL.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SN.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SO.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SR.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/ST.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SV.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SX.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SY.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/SZ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TC.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TD.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TF.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TG.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TH.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TJ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TK.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TL.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TN.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TO.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TP.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TR.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TT.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TV.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TW.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/TZ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/UA.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/UG.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/UM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/US.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/UY.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/UZ.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/VA.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/VC.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/VE.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/VG.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/VI.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/VN.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/VU.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/WF.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/WS.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/YE.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/YT.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/YU.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/ZA.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/ZM.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/ZW.gif ADDED
Binary file
skin/frontend/base/default/images/borderfree/ZZ.gif ADDED
Binary file