Holbi_Qixol - Version 0.1.0

Version Notes

The first stable version

Download this release

Release Info

Developer Sergey
Extension Holbi_Qixol
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

Files changed (196) hide show
  1. app/code/community/Holbi/Qixol/Block/Adminhtml/Banner.php +11 -0
  2. app/code/community/Holbi/Qixol/Block/Adminhtml/Banner/Edit.php +69 -0
  3. app/code/community/Holbi/Qixol/Block/Adminhtml/Banner/Edit/Form.php +19 -0
  4. app/code/community/Holbi/Qixol/Block/Adminhtml/Banner/Edit/Tab/Form.php +177 -0
  5. app/code/community/Holbi/Qixol/Block/Adminhtml/Banner/Edit/Tabs.php +20 -0
  6. app/code/community/Holbi/Qixol/Block/Adminhtml/Banner/Grid.php +168 -0
  7. app/code/community/Holbi/Qixol/Block/Adminhtml/Bannerboxes.php +11 -0
  8. app/code/community/Holbi/Qixol/Block/Adminhtml/Bannerboxes/Edit.php +37 -0
  9. app/code/community/Holbi/Qixol/Block/Adminhtml/Bannerboxes/Edit/Form.php +19 -0
  10. app/code/community/Holbi/Qixol/Block/Adminhtml/Bannerboxes/Edit/Tab/Form.php +88 -0
  11. app/code/community/Holbi/Qixol/Block/Adminhtml/Bannerboxes/Edit/Tabs.php +20 -0
  12. app/code/community/Holbi/Qixol/Block/Adminhtml/Bannerboxes/Grid.php +85 -0
  13. app/code/community/Holbi/Qixol/Block/Adminhtml/Customergrouspmap.php +11 -0
  14. app/code/community/Holbi/Qixol/Block/Adminhtml/Customergrouspmap/Edit.php +37 -0
  15. app/code/community/Holbi/Qixol/Block/Adminhtml/Customergrouspmap/Edit/Form.php +17 -0
  16. app/code/community/Holbi/Qixol/Block/Adminhtml/Customergrouspmap/Edit/Tab/Form.php +66 -0
  17. app/code/community/Holbi/Qixol/Block/Adminhtml/Customergrouspmap/Edit/Tabs.php +20 -0
  18. app/code/community/Holbi/Qixol/Block/Adminhtml/Customergrouspmap/Grid.php +97 -0
  19. app/code/community/Holbi/Qixol/Block/Adminhtml/Qixolbackend.php +5 -0
  20. app/code/community/Holbi/Qixol/Block/Adminhtml/Sales/Order/Total.php +64 -0
  21. app/code/community/Holbi/Qixol/Block/Adminhtml/Shippingmap.php +11 -0
  22. app/code/community/Holbi/Qixol/Block/Adminhtml/Shippingmap/Edit.php +37 -0
  23. app/code/community/Holbi/Qixol/Block/Adminhtml/Shippingmap/Edit/Form.php +17 -0
  24. app/code/community/Holbi/Qixol/Block/Adminhtml/Shippingmap/Edit/Tab/Form.php +89 -0
  25. app/code/community/Holbi/Qixol/Block/Adminhtml/Shippingmap/Edit/Tabs.php +20 -0
  26. app/code/community/Holbi/Qixol/Block/Adminhtml/Shippingmap/Grid.php +119 -0
  27. app/code/community/Holbi/Qixol/Block/Adminhtml/Sticker.php +11 -0
  28. app/code/community/Holbi/Qixol/Block/Adminhtml/Sticker/Edit.php +69 -0
  29. app/code/community/Holbi/Qixol/Block/Adminhtml/Sticker/Edit/Form.php +19 -0
  30. app/code/community/Holbi/Qixol/Block/Adminhtml/Sticker/Edit/Tab/Form.php +247 -0
  31. app/code/community/Holbi/Qixol/Block/Adminhtml/Sticker/Edit/Tabs.php +20 -0
  32. app/code/community/Holbi/Qixol/Block/Adminhtml/Sticker/Grid.php +160 -0
  33. app/code/community/Holbi/Qixol/Block/Adminhtml/Storesmap.php +11 -0
  34. app/code/community/Holbi/Qixol/Block/Adminhtml/Storesmap/Edit.php +37 -0
  35. app/code/community/Holbi/Qixol/Block/Adminhtml/Storesmap/Edit/Form.php +17 -0
  36. app/code/community/Holbi/Qixol/Block/Adminhtml/Storesmap/Edit/Tab/Form.php +66 -0
  37. app/code/community/Holbi/Qixol/Block/Adminhtml/Storesmap/Edit/Tabs.php +20 -0
  38. app/code/community/Holbi/Qixol/Block/Adminhtml/Storesmap/Grid.php +97 -0
  39. app/code/community/Holbi/Qixol/Block/Adminhtml/System/Config/Attributes.php +40 -0
  40. app/code/community/Holbi/Qixol/Block/Adminhtml/Widget/Grid.php +22 -0
  41. app/code/community/Holbi/Qixol/Block/Adminhtml/Widget/Grid/Column.php +36 -0
  42. app/code/community/Holbi/Qixol/Block/Adminhtml/Widget/Grid/Column/Filter/Banner.php +7 -0
  43. app/code/community/Holbi/Qixol/Block/Adminhtml/Widget/Grid/Column/Renderer/Banner.php +31 -0
  44. app/code/community/Holbi/Qixol/Block/Adminhtml/Widget/Grid/Column/Renderer/Sticker.php +39 -0
  45. app/code/community/Holbi/Qixol/Block/Banner.php +54 -0
  46. app/code/community/Holbi/Qixol/Block/Bannerboxes.php +17 -0
  47. app/code/community/Holbi/Qixol/Block/Customergrouspmap.php +17 -0
  48. app/code/community/Holbi/Qixol/Block/Issuedcoupon.php +10 -0
  49. app/code/community/Holbi/Qixol/Block/Sales/Creditmemo.php +21 -0
  50. app/code/community/Holbi/Qixol/Block/Sales/Invoice.php +20 -0
  51. app/code/community/Holbi/Qixol/Block/Sales/Order.php +20 -0
  52. app/code/community/Holbi/Qixol/Block/Sales/Order/Total.php +64 -0
  53. app/code/community/Holbi/Qixol/Block/Shippingmap.php +17 -0
  54. app/code/community/Holbi/Qixol/Block/Startexportbutton.php +219 -0
  55. app/code/community/Holbi/Qixol/Block/Startimportbutton.php +219 -0
  56. app/code/community/Holbi/Qixol/Block/Sticker.php +54 -0
  57. app/code/community/Holbi/Qixol/Block/Storesmap.php +17 -0
  58. app/code/community/Holbi/Qixol/Helper/Data.php +63 -0
  59. app/code/community/Holbi/Qixol/Model/Advert.php +130 -0
  60. app/code/community/Holbi/Qixol/Model/Banner.php +71 -0
  61. app/code/community/Holbi/Qixol/Model/Bannerboxes.php +36 -0
  62. app/code/community/Holbi/Qixol/Model/Bannerimages.php +25 -0
  63. app/code/community/Holbi/Qixol/Model/Bannerresize.php +232 -0
  64. app/code/community/Holbi/Qixol/Model/Bonuspoints.php +117 -0
  65. app/code/community/Holbi/Qixol/Model/Creditmemopoints.php +18 -0
  66. app/code/community/Holbi/Qixol/Model/Cron.php +16 -0
  67. app/code/community/Holbi/Qixol/Model/Customergrouspmap.php +21 -0
  68. app/code/community/Holbi/Qixol/Model/Deletedproduct.php +12 -0
  69. app/code/community/Holbi/Qixol/Model/Exportstat.php +12 -0
  70. app/code/community/Holbi/Qixol/Model/Exprpocessstat.php +12 -0
  71. app/code/community/Holbi/Qixol/Model/Invoicepoints.php +20 -0
  72. app/code/community/Holbi/Qixol/Model/Issuedcoupon.php +16 -0
  73. app/code/community/Holbi/Qixol/Model/Mysql4/Banner.php +239 -0
  74. app/code/community/Holbi/Qixol/Model/Mysql4/Banner/Collection.php +9 -0
  75. app/code/community/Holbi/Qixol/Model/Mysql4/Bannerboxes.php +9 -0
  76. app/code/community/Holbi/Qixol/Model/Mysql4/Bannerboxes/Collection.php +9 -0
  77. app/code/community/Holbi/Qixol/Model/Mysql4/Bannerimages.php +8 -0
  78. app/code/community/Holbi/Qixol/Model/Mysql4/Bannerimages/Collection.php +9 -0
  79. app/code/community/Holbi/Qixol/Model/Mysql4/Bonuspoints.php +8 -0
  80. app/code/community/Holbi/Qixol/Model/Mysql4/Bonuspoints/Collection.php +9 -0
  81. app/code/community/Holbi/Qixol/Model/Mysql4/Customergrouspmap.php +9 -0
  82. app/code/community/Holbi/Qixol/Model/Mysql4/Customergrouspmap/Collection.php +9 -0
  83. app/code/community/Holbi/Qixol/Model/Mysql4/Deletedproduct.php +8 -0
  84. app/code/community/Holbi/Qixol/Model/Mysql4/Deletedproduct/Collection.php +12 -0
  85. app/code/community/Holbi/Qixol/Model/Mysql4/Exportstat.php +8 -0
  86. app/code/community/Holbi/Qixol/Model/Mysql4/Exportstat/Collection.php +12 -0
  87. app/code/community/Holbi/Qixol/Model/Mysql4/Exprpocessstat.php +8 -0
  88. app/code/community/Holbi/Qixol/Model/Mysql4/Exprpocessstat/Collection.php +12 -0
  89. app/code/community/Holbi/Qixol/Model/Mysql4/Issuedcoupon.php +10 -0
  90. app/code/community/Holbi/Qixol/Model/Mysql4/Issuedcoupon/Collection.php +12 -0
  91. app/code/community/Holbi/Qixol/Model/Mysql4/Promotions.php +46 -0
  92. app/code/community/Holbi/Qixol/Model/Mysql4/Promotions/Collection.php +12 -0
  93. app/code/community/Holbi/Qixol/Model/Mysql4/Shippingmap.php +9 -0
  94. app/code/community/Holbi/Qixol/Model/Mysql4/Shippingmap/Collection.php +9 -0
  95. app/code/community/Holbi/Qixol/Model/Mysql4/Sticker.php +50 -0
  96. app/code/community/Holbi/Qixol/Model/Mysql4/Sticker/Collection.php +9 -0
  97. app/code/community/Holbi/Qixol/Model/Mysql4/Storesmap.php +9 -0
  98. app/code/community/Holbi/Qixol/Model/Mysql4/Storesmap/Collection.php +9 -0
  99. app/code/community/Holbi/Qixol/Model/Observer.php +819 -0
  100. app/code/community/Holbi/Qixol/Model/Ordertotalpoints.php +56 -0
  101. app/code/community/Holbi/Qixol/Model/Promotions.php +12 -0
  102. app/code/community/Holbi/Qixol/Model/Shippingmap.php +21 -0
  103. app/code/community/Holbi/Qixol/Model/Sinch.php +1303 -0
  104. app/code/community/Holbi/Qixol/Model/Status.php +13 -0
  105. app/code/community/Holbi/Qixol/Model/Sticker.php +67 -0
  106. app/code/community/Holbi/Qixol/Model/Storesmap.php +21 -0
  107. app/code/community/Holbi/Qixol/Model/System/Config/Source/Attributes.php +21 -0
  108. app/code/community/Holbi/Qixol/Model/System/Config/Source/Cart/Settings.php +38 -0
  109. app/code/community/Holbi/Qixol/Model/System/Config/Source/Customers/List.php +19 -0
  110. app/code/community/Holbi/Qixol/Model/System/Config/Source/Iservices/Values.php +29 -0
  111. app/code/community/Holbi/Qixol/Model/System/Config/Source/Shippings/List.php +42 -0
  112. app/code/community/Holbi/Qixol/Model/System/Config/Source/Stores.php +23 -0
  113. app/code/community/Holbi/Qixol/Model/Wysiwyg/Config.php +38 -0
  114. app/code/community/Holbi/Qixol/Model/config.php +9 -0
  115. app/code/community/Holbi/Qixol/controllers/Adminhtml/BannerController.php +248 -0
  116. app/code/community/Holbi/Qixol/controllers/Adminhtml/BannerboxesController.php +105 -0
  117. app/code/community/Holbi/Qixol/controllers/Adminhtml/CustomergrouspmapController.php +105 -0
  118. app/code/community/Holbi/Qixol/controllers/Adminhtml/QixolbackendController.php +11 -0
  119. app/code/community/Holbi/Qixol/controllers/Adminhtml/ShippingmapController.php +105 -0
  120. app/code/community/Holbi/Qixol/controllers/Adminhtml/StickerController.php +224 -0
  121. app/code/community/Holbi/Qixol/controllers/Adminhtml/StoresmapController.php +105 -0
  122. app/code/community/Holbi/Qixol/controllers/AjaxController.php +103 -0
  123. app/code/community/Holbi/Qixol/controllers/CartController.php +57 -0
  124. app/code/community/Holbi/Qixol/controllers/IndexController.php +22 -0
  125. app/code/community/Holbi/Qixol/controllers/IssuedcouponController.php +17 -0
  126. app/code/community/Holbi/Qixol/etc/adminhtml.xml +22 -0
  127. app/code/community/Holbi/Qixol/etc/config.xml +396 -0
  128. app/code/community/Holbi/Qixol/etc/system.xml +407 -0
  129. app/code/community/Holbi/Qixol/sql/qixol_setup/mysql4-install-0.1.0.php +278 -0
  130. app/design/adminhtml/default/default/layout/qixol.xml +102 -0
  131. app/design/adminhtml/default/default/template/qixol/bannerboxes.phtml +1 -0
  132. app/design/adminhtml/default/default/template/qixol/banners.phtml +50 -0
  133. app/design/adminhtml/default/default/template/qixol/customergrouspmap.phtml +1 -0
  134. app/design/adminhtml/default/default/template/qixol/order/advert.phtml +38 -0
  135. app/design/adminhtml/default/default/template/qixol/qixolbackend.phtml +196 -0
  136. app/design/adminhtml/default/default/template/qixol/shippingmap.phtml +1 -0
  137. app/design/adminhtml/default/default/template/qixol/stickers.phtml +50 -0
  138. app/design/adminhtml/default/default/template/qixol/storesmap.phtml +1 -0
  139. app/design/adminhtml/default/default/template/qixol/system/config/attributes.phtml +10 -0
  140. app/design/frontend/base/default/layout/qixol.xml +154 -0
  141. app/design/frontend/base/default/template/qixol/cart/advert.phtml +91 -0
  142. app/design/frontend/base/default/template/qixol/cart/bonuspointbox.phtml +75 -0
  143. app/design/frontend/base/default/template/qixol/cart/cart.phtml +246 -0
  144. app/design/frontend/base/default/template/qixol/cart/item/default.phtml +386 -0
  145. app/design/frontend/base/default/template/qixol/cart/totals.phtml +1 -0
  146. app/design/frontend/base/default/template/qixol/issuedcoupon/list.phtml +95 -0
  147. app/design/frontend/base/default/template/qixol/issuedpoints/box.phtml +6 -0
  148. app/design/frontend/base/default/template/qixol/issuedpoints/dashboard_points.phtml +10 -0
  149. app/design/frontend/base/default/template/qixol/minicart/advert.phtml +64 -0
  150. app/design/frontend/base/default/template/qixol/minicart/default.phtml +238 -0
  151. app/design/frontend/base/default/template/qixol/minicart/mincart.phtml +250 -0
  152. app/design/frontend/base/default/template/qixol/myaccount/order/email/default.phtml +163 -0
  153. app/design/frontend/base/default/template/qixol/myaccount/order/email/items.phtml +138 -0
  154. app/design/frontend/base/default/template/qixol/myaccount/order/invoice/default.phtml +328 -0
  155. app/design/frontend/base/default/template/qixol/myaccount/order/invoice/invoice.phtml +128 -0
  156. app/design/frontend/base/default/template/qixol/myaccount/order/items/default.phtml +347 -0
  157. app/design/frontend/base/default/template/qixol/myaccount/order/items/items.phtml +109 -0
  158. app/design/frontend/base/default/template/qixol/myaccount/order/print/default.phtml +347 -0
  159. app/design/frontend/base/default/template/qixol/myaccount/order/print/messages.phtml +1 -0
  160. app/design/frontend/base/default/template/qixol/myaccount/order/print/print.phtml +132 -0
  161. app/design/frontend/base/default/template/qixol/onepage/advert.phtml +88 -0
  162. app/design/frontend/base/default/template/qixol/onepage/item.phtml +288 -0
  163. app/design/frontend/base/default/template/qixol/onepage/review.phtml +148 -0
  164. app/design/frontend/base/default/template/qixol/product/qixol_adv.phtml +44 -0
  165. app/design/frontend/base/default/template/qixol/product/qixol_info_details.phtml +23 -0
  166. app/design/frontend/base/default/template/qixol/product/qixol_product_info.phtml +63 -0
  167. app/design/frontend/base/default/template/qixol/sidebar/advert.phtml +62 -0
  168. app/design/frontend/base/default/template/qixol/sidebar/default.phtml +145 -0
  169. app/design/frontend/base/default/template/qixol/sidebar/sidebar.phtml +80 -0
  170. app/design/frontend/rwd/default/template/qixol/minicart/advert.phtml +64 -0
  171. app/design/frontend/rwd/default/template/qixol/minicart/default.phtml +258 -0
  172. app/design/frontend/rwd/default/template/qixol/minicart/mincart.phtml +250 -0
  173. app/etc/modules/Holbi_Qixol.xml +10 -0
  174. app/locale/en_US/Holbi_Qixol.csv +132 -0
  175. media/custom/banners/File-1459507414.jpg +0 -0
  176. media/custom/banners/resize/File-1459507414.jpg +0 -0
  177. media/custom/stickers/File-1460972848.png +0 -0
  178. media/custom/stickers/resize/File-1460972848.png +0 -0
  179. package.xml +18 -0
  180. skin/adminhtml/default/default/images/_run.gif +0 -0
  181. skin/adminhtml/default/default/images/_yes.gif +0 -0
  182. skin/frontend/base/default/css/qixol.css +110 -0
  183. skin/frontend/base/default/images/qixol/BASKETREDUCTION.png +0 -0
  184. skin/frontend/base/default/images/qixol/BOGOF.png +0 -0
  185. skin/frontend/base/default/images/qixol/BOGOR.png +0 -0
  186. skin/frontend/base/default/images/qixol/BUNDLE.png +0 -0
  187. skin/frontend/base/default/images/qixol/DEAL.png +0 -0
  188. skin/frontend/base/default/images/qixol/DELIVERYREDUCTION.png +0 -0
  189. skin/frontend/base/default/images/qixol/FREEPRODUCT.png +0 -0
  190. skin/frontend/base/default/images/qixol/ISSUECOUPON.png +0 -0
  191. skin/frontend/base/default/images/qixol/ISSUEPOINTS.png +0 -0
  192. skin/frontend/base/default/images/qixol/PRODUCTSREDUCTION.png +0 -0
  193. skin/frontend/base/default/images/qixol/red_sales_sticker_pv.png +0 -0
  194. skin/frontend/base/default/js/lib/jquery.cycle2.min.js +16 -0
  195. skin/frontend/base/default/js/lib/jquery.cycle2.swipe.min.js +2 -0
  196. var/logs_qixol/logs_here.txt +1 -0
app/code/community/Holbi/Qixol/Block/Adminhtml/Banner.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Banner extends Mage_Adminhtml_Block_Widget_Grid_Container {
3
+
4
+ public function __construct() {
5
+ $this->_controller = 'adminhtml_banner';
6
+ $this->_blockGroup = 'qixol';
7
+ $this->_headerText = Mage::helper('qixol')->__('Banner Manager');
8
+ $this->_addButtonLabel = Mage::helper('qixol')->__('Add Banner Item');
9
+ parent::__construct();
10
+ }
11
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Banner/Edit.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Banner_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+
7
+ $this->_objectId = 'id';
8
+ $this->_blockGroup = 'qixol';
9
+ $this->_controller = 'adminhtml_banner';
10
+
11
+ $this->_updateButton('save', 'label', Mage::helper('qixol')->__('Save Item'));
12
+ $this->_updateButton('delete', 'label', Mage::helper('qixol')->__('Delete Item'));
13
+
14
+ $this->_addButton('saveandcontinue', array(
15
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
16
+ 'onclick' => 'saveAndContinueEdit()',
17
+ 'class' => 'save',
18
+ ), -100);
19
+
20
+ $this->_formScripts[] = "
21
+ /*function toggleEditor() {
22
+ if (tinyMCE.getInstanceById('banner_content') == null) {
23
+ tinyMCE.execCommand('mceAddControl', false, 'banner_content');
24
+ } else {
25
+ tinyMCE.execCommand('mceRemoveControl', false, 'banner_content');
26
+ }
27
+ }*/
28
+
29
+ function saveAndContinueEdit(){
30
+ editForm.submit($('edit_form').action+'back/edit/');
31
+ }
32
+
33
+ function showTypeContents(){
34
+ var typeId=$('banner_type').value;
35
+ var show = ((typeId==0)?'block':'none');
36
+ var hide = ((typeId==0)?'none':'block');
37
+ $('filename').setStyle({display:show});
38
+ $('filename_delete').setStyle({display:show});
39
+ //$('banner_content').setStyle({display:hide});
40
+ setTimeout('bannerContentType()',1000);
41
+ alert($('filename').getStyle('display'))
42
+ }
43
+
44
+ function bannerContentType(){
45
+ var typeId=$('banner_type').value;
46
+ var hide = ((typeId==0)?'none':'block');
47
+ $('buttonsbanner_content').setStyle({display:hide});
48
+ $('banner_content_parent').setStyle({display:hide});
49
+ }
50
+
51
+
52
+ /* Event.observe('banner_type', 'change', function(){
53
+ showTypeContents();
54
+ });
55
+ Event.observe(window, 'load', function(){
56
+ showTypeContents();
57
+ }); */
58
+ ";
59
+ }
60
+
61
+ public function getHeaderText() {
62
+ if (Mage::registry('banner_data') && Mage::registry('banner_data')->getId()) {
63
+ return Mage::helper('qixol')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('banner_data')->getTitle()));
64
+ } else {
65
+ return Mage::helper('qixol')->__('Add Item');
66
+ }
67
+ }
68
+
69
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Banner/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Banner_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form(array(
7
+ 'id' => 'edit_form',
8
+
9
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
+ 'method' => 'post',
11
+ 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Banner/Edit/Tab/Form.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Banner_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
3
+
4
+ protected function _prepareForm() {
5
+ $form = new Varien_Data_Form();
6
+ $this->setForm($form);
7
+ $fieldset = $form->addFieldset('banner_form', array('legend' => Mage::helper('qixol')->__('Item information')));
8
+ $version = substr(Mage::getVersion(), 0, 3);
9
+ //$config = (($version == '1.4' || $version == '1.5') ? "'config' => Mage::getSingleton('banner/wysiwyg_config')->getConfig()" : "'class'=>''");
10
+
11
+ $fieldset->addField('title', 'text', array(
12
+ 'label' => Mage::helper('qixol')->__('Title'),
13
+ 'class' => 'required-entry',
14
+ 'required' => true,
15
+ 'name' => 'title',
16
+ ));
17
+
18
+ $fieldset->addField('banner_link_name', 'multiselect', array(
19
+ 'label' => Mage::helper('qixol')->__('Display Zone'),
20
+ 'class' => 'required-entry',
21
+ 'required' => true,
22
+ 'name' => 'banner_link_name',
23
+ 'values' => Mage::getModel('qixol/bannerboxes')->getOptionArray(),
24
+ 'after_element_html' => Mage::helper('qixol')->__('use: <br>CATEGORY_TOP for showing on category list<br>PRODUCT_BOTTOM on bottom product page<br>PRODUCT_TOP on top on product page<br>PRODUCT_INLINE on top on product page<br>BACKET_INLINE on shopping cart<br>separate by ; '),
25
+ ));
26
+
27
+ $fieldset->addField('banner_images', 'multiselect', array(
28
+ 'label' => Mage::helper('qixol')->__('Images'),
29
+ 'required' => false,
30
+ 'name' => 'banner_images',
31
+ 'values' => Mage::getModel('qixol/bannerimages')->getOptionArray()
32
+ ));
33
+
34
+
35
+ $fieldset->addField('filename', 'image', array(
36
+ 'label' => Mage::helper('qixol')->__('Image'),
37
+ 'required' => false,
38
+ 'name' => 'filename',
39
+ ));
40
+
41
+ $fieldset->addField('banner_group', 'text', array(
42
+ 'label' => Mage::helper('qixol')->__('Promotion Ref'),
43
+ 'required' => false,
44
+ 'name' => 'banner_group',
45
+ ));
46
+
47
+ /*$fieldset->addField('banner_group', 'select', array(
48
+ 'label' => Mage::helper('qixol')->__('Banner Group'),
49
+ 'class' => 'required-entry',
50
+ 'required' => true,
51
+ 'name' => 'banner_group',
52
+ 'values' => array(
53
+ array(
54
+ 'value' => '',
55
+ 'label' => Mage::helper('qixol')->__('Not defined'),
56
+ ),
57
+ array(
58
+ 'value' => 'BOGOF',
59
+ 'label' => Mage::helper('qixol')->__('Buy one get one free'),
60
+ ),
61
+ array(
62
+ 'value' => 'BOGOR',
63
+ 'label' => Mage::helper('qixol')->__('Buy one get one reduced'),
64
+ ),
65
+ array(
66
+ 'value' => 'BUNDLE',
67
+ 'label' => Mage::helper('qixol')->__('Bundle'),
68
+ ),
69
+ array(
70
+ 'value' => 'DEAL',
71
+ 'label' => Mage::helper('qixol')->__('Deal'),
72
+ ),
73
+ array(
74
+ 'value' => 'FREEPRODUCT',
75
+ 'label' => Mage::helper('qixol')->__('Free product'),
76
+ ),
77
+ array(
78
+ 'value' => 'ISSUECOUPON',
79
+ 'label' => Mage::helper('qixol')->__('Issue coupon'),
80
+ ),
81
+ array(
82
+ 'value' => 'ISSUEPOINTS',
83
+ 'label' => Mage::helper('qixol')->__('Issue points'),
84
+ ),
85
+ array(
86
+ 'value' => 'BASKETREDUCTION',
87
+ 'label' => Mage::helper('qixol')->__('Backet reduction'),
88
+ ),
89
+ array(
90
+ 'value' => 'DELIVERYREDUCTION',
91
+ 'label' => Mage::helper('qixol')->__('Delivery reduction'),
92
+ ),
93
+ /*array(
94
+ 'value' => 8,
95
+ 'label' => Mage::helper('qixol')->__('Multiple promos'),
96
+ ),*//*
97
+ array(
98
+ 'value' => 'PRODUCTSREDUCTION',
99
+ 'label' => Mage::helper('qixol')->__('Product reduction'),
100
+ ),
101
+ ),
102
+ ));*/
103
+
104
+ /*if ($version == '1.4' || $version == '1.5') {
105
+ $fieldset->addField('banner_content', 'editor', array(
106
+ 'name' => 'banner_content',
107
+ 'label' => Mage::helper('qixol')->__('Content'),
108
+ 'title' => Mage::helper('qixol')->__('Content'),
109
+ 'style' => 'width:600px; height:250px;',
110
+ 'config' => Mage::getSingleton('banner/wysiwyg_config')->getConfig(),
111
+ 'wysiwyg' => true,
112
+ 'required' => false,
113
+ ));
114
+ } else {
115
+ $fieldset->addField('banner_content', 'editor', array(
116
+ 'name' => 'banner_content',
117
+ 'label' => Mage::helper('cms')->__('Content'),
118
+ 'title' => Mage::helper('cms')->__('Content'),
119
+ 'style' => 'width:600px; height:250px;',
120
+ 'wysiwyg' => false,
121
+ 'required' => false,
122
+ ));
123
+ }*/
124
+
125
+ $fieldset->addField('sort_order', 'text', array(
126
+ 'label' => Mage::helper('qixol')->__('Sort Order'),
127
+ 'name' => 'sort_order',
128
+ ));
129
+
130
+ /*$fieldset->addField('is_default', 'select', array(
131
+ 'label' => Mage::helper('qixol')->__('Default?'),
132
+ 'class' => 'required-entry',
133
+ 'name' => 'is_default',
134
+ 'values' => array(
135
+ array(
136
+ 'value' => 1,
137
+ 'label' => Mage::helper('qixol')->__('Yes'),
138
+ ),
139
+ array(
140
+ 'value' => 0,
141
+ 'label' => Mage::helper('qixol')->__('No'),
142
+ ),
143
+ ),
144
+ ));*/
145
+
146
+ $fieldset->addField('url', 'text', array(
147
+ 'label' => Mage::helper('qixol')->__('Url'),
148
+ 'required' => false,
149
+ 'name' => 'url',
150
+ ));
151
+
152
+ $fieldset->addField('status', 'select', array(
153
+ 'label' => Mage::helper('qixol')->__('Status'),
154
+ 'class' => 'required-entry',
155
+ 'name' => 'status',
156
+ 'values' => array(
157
+ array(
158
+ 'value' => 1,
159
+ 'label' => Mage::helper('qixol')->__('Enabled'),
160
+ ),
161
+ array(
162
+ 'value' => 2,
163
+ 'label' => Mage::helper('qixol')->__('Disabled'),
164
+ ),
165
+ ),
166
+ ));
167
+
168
+ if (Mage::getSingleton('adminhtml/session')->getBannerData()) {
169
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getBannerData());
170
+ Mage::getSingleton('adminhtml/session')->setBannerData(null);
171
+ } elseif (Mage::registry('banner_data')) {
172
+ $form->setValues(Mage::registry('banner_data')->getData());
173
+ }
174
+ return parent::_prepareForm();
175
+ }
176
+
177
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Banner/Edit/Tabs.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Banner_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+ $this->setId('qixol_tabs');
7
+ $this->setDestElementId('edit_form');
8
+ $this->setTitle(Mage::helper('qixol')->__('Item Information'));
9
+ }
10
+
11
+ protected function _beforeToHtml() {
12
+ $this->addTab('form_section', array(
13
+ 'label' => Mage::helper('qixol')->__('Banner Information'),
14
+ 'alt' => Mage::helper('qixol')->__('Banner information'),
15
+ 'content' => $this->getLayout()->createBlock('qixol/adminhtml_banner_edit_tab_form')->toHtml(),
16
+ ));
17
+ return parent::_beforeToHtml();
18
+ }
19
+
20
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Banner/Grid.php ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Banner_Grid extends Holbi_Qixol_Block_Adminhtml_Widget_Grid {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+ $this->setId('bannerGrid');
7
+ $this->setDefaultSort('banner_id');
8
+ $this->setDefaultDir('ASC');
9
+ $this->setSaveParametersInSession(true);
10
+ }
11
+
12
+ protected function _prepareCollection() {
13
+ $collection = Mage::getModel('qixol/banner')->getCollection();
14
+ $this->setCollection($collection);
15
+ return parent::_prepareCollection();
16
+ }
17
+
18
+ protected function _prepareColumns() {
19
+ $this->addColumn('banner_id', array(
20
+ 'header' => Mage::helper('qixol')->__('ID'),
21
+ 'align' => 'center',
22
+ 'width' => '30px',
23
+ 'index' => 'banner_id',
24
+ ));
25
+
26
+ /*$this->addColumn('filename', array(
27
+ 'header' => Mage::helper('qixol')->__('Image'),
28
+ 'align' => 'center',
29
+ 'index' => 'filename',
30
+ 'type' => 'banner',
31
+ 'escape' => true,
32
+ 'sortable' => false,
33
+ 'width' => '150px',
34
+ ));*/
35
+
36
+ $this->addColumn('title', array(
37
+ 'header' => Mage::helper('qixol')->__('Title'),
38
+ 'width' => '150px',
39
+ 'index' => 'title',
40
+ ));
41
+
42
+ $this->addColumn('banner_link_name', array(
43
+ 'header' => Mage::helper('qixol')->__('Display Zone'),
44
+ 'width' => '250px',
45
+ 'index' => 'banner_link_name',
46
+ ));
47
+
48
+
49
+ $this->addColumn('banner_group', array(
50
+ 'header' => Mage::helper('qixol')->__('Promotion Ref'),
51
+ 'width' => '250px',
52
+ 'index' => 'banner_group',
53
+ ));
54
+
55
+ /*$this->addColumn('banner_group', array(
56
+ 'header' => Mage::helper('qixol')->__('Promotion Ref'),
57
+ 'width' => '100px',
58
+ 'index' => 'banner_group',
59
+ 'type' => 'options',
60
+ 'options' => array(
61
+ '' => Mage::helper('qixol')->__('Not defined'),
62
+ 'BOGOF' => Mage::helper('qixol')->__('Buy one get one free'),
63
+ 'BOGOR' => Mage::helper('qixol')->__('Buy one get one reduced'),
64
+ 'BUNDLE' => Mage::helper('qixol')->__('Bundle'),
65
+ 'DEAL' => Mage::helper('qixol')->__('Deal'),
66
+ 'FREEPRODUCT' => Mage::helper('qixol')->__('Free product'),
67
+ 'ISSUECOUPON' => Mage::helper('qixol')->__('Issue coupon'),
68
+
69
+ 'ISSUEPOINTS' => Mage::helper('qixol')->__('Issue points'),
70
+ 'BASKETREDUCTION' => Mage::helper('qixol')->__('Basket reduction'),
71
+ 'DELIVERYREDUCTION' => Mage::helper('qixol')->__('Delivery coupon'),
72
+
73
+ /*7 => 'Issue points',
74
+ 8 => 'Multiple promos',*/
75
+ /*'PRODUCTSREDUCTION' => Mage::helper('qixol')->__('Product reduction'),
76
+ ),
77
+ ));*/
78
+
79
+ $this->addColumn('status', array(
80
+ 'header' => Mage::helper('qixol')->__('Status'),
81
+ 'align' => 'left',
82
+ 'width' => '80px',
83
+ 'index' => 'status',
84
+ 'type' => 'options',
85
+ 'options' => array(
86
+ 1 => 'Enabled',
87
+ 0 => 'Disabled',
88
+ ),
89
+ ));
90
+
91
+ $this->addColumn('sort_order', array(
92
+ 'header' => Mage::helper('qixol')->__('Sort Order'),
93
+ 'width' => '80px',
94
+ 'index' => 'sort_order',
95
+ 'align' => 'center',
96
+ ));
97
+
98
+ /*$this->addColumn('is_default', array(
99
+ 'header' => Mage::helper('qixol')->__('Default?'),
100
+ 'align' => 'left',
101
+ 'width' => '80px',
102
+ 'index' => 'is_default',
103
+ 'type' => 'options',
104
+ 'options' => array(
105
+ 1 => 'Yes',
106
+ 0 => 'No',
107
+ ),
108
+ ));*/
109
+
110
+ $this->addColumn('action',
111
+ array(
112
+ 'header' => Mage::helper('qixol')->__('Action'),
113
+ 'width' => '80',
114
+ 'type' => 'action',
115
+ 'getter' => 'getId',
116
+ 'actions' => array(
117
+ array(
118
+ 'caption' => Mage::helper('qixol')->__('Edit'),
119
+ 'url' => array('base' => '*/*/edit'),
120
+ 'field' => 'id'
121
+ )
122
+ ),
123
+ 'filter' => false,
124
+ 'sortable' => false,
125
+ 'index' => 'stores',
126
+ 'is_system' => true,
127
+ ));
128
+
129
+ //$this->addExportType('*/*/exportCsv', Mage::helper('qixol')->__('CSV'));
130
+ //$this->addExportType('*/*/exportXml', Mage::helper('qixol')->__('XML'));
131
+
132
+ return parent::_prepareColumns();
133
+ }
134
+
135
+ protected function _prepareMassaction() {
136
+ $this->setMassactionIdField('banner_id');
137
+ $this->getMassactionBlock()->setFormFieldName('banner');
138
+
139
+ $this->getMassactionBlock()->addItem('delete', array(
140
+ 'label' => Mage::helper('qixol')->__('Delete'),
141
+ 'url' => $this->getUrl('*/*/massDelete'),
142
+ 'confirm' => Mage::helper('qixol')->__('Are you sure?')
143
+ ));
144
+
145
+ $statuses = Mage::getSingleton('qixol/status')->getOptionArray();
146
+
147
+ array_unshift($statuses, array('label' => '', 'value' => ''));
148
+ $this->getMassactionBlock()->addItem('status', array(
149
+ 'label' => Mage::helper('qixol')->__('Change status'),
150
+ 'url' => $this->getUrl('*/*/massStatus', array('_current' => true)),
151
+ 'additional' => array(
152
+ 'visibility' => array(
153
+ 'name' => 'status',
154
+ 'type' => 'select',
155
+ 'class' => 'required-entry',
156
+ 'label' => Mage::helper('qixol')->__('Status'),
157
+ 'values' => $statuses
158
+ )
159
+ )
160
+ ));
161
+ return $this;
162
+ }
163
+
164
+ public function getRowUrl($row) {
165
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
166
+ }
167
+
168
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Bannerboxes.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Bannerboxes extends Mage_Adminhtml_Block_Widget_Grid_Container {
3
+
4
+ public function __construct() {
5
+ $this->_controller = 'adminhtml_bannerboxes';
6
+ $this->_blockGroup = 'qixol';
7
+ $this->_headerText = Mage::helper('qixol')->__('Banner Box Manager');
8
+ $this->_addButtonLabel = Mage::helper('qixol')->__('Add Banner box');
9
+ parent::__construct();
10
+ }
11
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Bannerboxes/Edit.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Bannerboxes_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+
7
+ $this->_objectId = 'id';
8
+ $this->_blockGroup = 'qixol';
9
+ $this->_controller = 'adminhtml_bannerboxes';
10
+
11
+ $this->_updateButton('save', 'label', Mage::helper('qixol')->__('Save Item'));
12
+ $this->_updateButton('delete', 'label', Mage::helper('qixol')->__('Delete Item'));
13
+
14
+ $this->_addButton('saveandcontinue', array(
15
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
16
+ 'onclick' => 'saveAndContinueEdit()',
17
+ 'class' => 'save',
18
+ ), -100);
19
+
20
+ $this->_formScripts[] = "
21
+
22
+ function saveAndContinueEdit(){
23
+ editForm.submit($('edit_form').action+'back/edit/');
24
+ }
25
+
26
+ ";
27
+ }
28
+
29
+ public function getHeaderText() {
30
+ if (Mage::registry('bannerbox_data') && Mage::registry('bannerbox_data')->getId()) {
31
+ return Mage::helper('qixol')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('bannerbox_data')->getTitle()));
32
+ } else {
33
+ return Mage::helper('qixol')->__('Add Item');
34
+ }
35
+ }
36
+
37
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Bannerboxes/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Bannerboxes_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form(array(
7
+ 'id' => 'edit_form',
8
+
9
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
+ 'method' => 'post',
11
+ // 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Bannerboxes/Edit/Tab/Form.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Bannerboxes_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
3
+
4
+ protected function _prepareForm() {
5
+ $form = new Varien_Data_Form();
6
+ $this->setForm($form);
7
+ $fieldset = $form->addFieldset('bannerbox_form', array('legend' => Mage::helper('qixol')->__('Item information')));
8
+ $version = substr(Mage::getVersion(), 0, 3);
9
+ //$config = (($version == '1.4' || $version == '1.5') ? "'config' => Mage::getSingleton('banner/wysiwyg_config')->getConfig()" : "'class'=>''");
10
+
11
+
12
+
13
+
14
+
15
+
16
+ $fieldset->addField('banner_box_type', 'select', array(
17
+ 'label' => Mage::helper('qixol')->__('Box Position'),
18
+ 'class' => 'required-entry',
19
+ 'required' => true,
20
+ 'name' => 'banner_box_type',
21
+ 'values' => array(
22
+ array(
23
+ 'value' => 'CATEGORY_TOP',
24
+ 'label' => Mage::helper('qixol')->__('CATEGORY_TOP - the top box of category listsing'),
25
+ ),
26
+ array(
27
+ 'value' => 'PRODUCT_BOTTOM',
28
+ 'label' => Mage::helper('qixol')->__('bottom of the product view page'),
29
+ ),
30
+ array(
31
+ 'value' => 'PRODUCT_TOP',
32
+ 'label' => Mage::helper('qixol')->__('PRODUCT_TOP - top of product view page'),
33
+ ),
34
+ array(
35
+ 'value' => 'PRODUCT_INLINE',
36
+ 'label' => Mage::helper('qixol')->__('PRODUCT_INLINE - inline in add to catrt box on product page'),
37
+ ),
38
+ array(
39
+ 'value' => 'BASKET_INLINE',
40
+ 'label' => Mage::helper('qixol')->__('BASKET_INLINE - box on basket'),
41
+ ),
42
+ array(
43
+ 'value' => 'CATEGORY_STICKERS',
44
+ 'label' => Mage::helper('qixol')->__('CATEGORY_STICKERS - stickers on category listing'),
45
+ ),
46
+ array(
47
+ 'value' => 'PRODUCT_INFO_STICKERS',
48
+ 'label' => Mage::helper('qixol')->__('PRODUCT_INFO_STICKERS - stickers on product info'),
49
+ ),
50
+
51
+ ),
52
+ ));
53
+
54
+ $fieldset->addField('banner_box_translation_type', 'text', array(
55
+ 'label' => Mage::helper('qixol')->__('Translation Type'),
56
+ 'class' => 'required-entry',
57
+ 'required' => true,
58
+ 'name' => 'banner_box_translation_type',
59
+ 'after_element_html' => Mage::helper('qixol')->__('fadeout, scrollHorz , tileSlide or others from Cycle2 for myltyple data'),
60
+ ));
61
+
62
+
63
+ $fieldset->addField('banner_box_is_active', 'select', array(
64
+ 'label' => Mage::helper('qixol')->__('Status'),
65
+ 'class' => 'required-entry',
66
+ 'name' => 'banner_box_is_active',
67
+ 'values' => array(
68
+ array(
69
+ 'value' => 1,
70
+ 'label' => Mage::helper('qixol')->__('Enabled'),
71
+ ),
72
+ array(
73
+ 'value' => 2,
74
+ 'label' => Mage::helper('qixol')->__('Disabled'),
75
+ ),
76
+ ),
77
+ ));
78
+
79
+ if (Mage::getSingleton('adminhtml/session')->getBannerboxData()) {
80
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getBannerboxData());
81
+ Mage::getSingleton('adminhtml/session')->setBannerboxData(null);
82
+ } elseif (Mage::registry('bannerbox_data')) {
83
+ $form->setValues(Mage::registry('bannerbox_data')->getData());
84
+ }
85
+ return parent::_prepareForm();
86
+ }
87
+
88
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Bannerboxes/Edit/Tabs.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Bannerboxes_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+ $this->setId('qixol_tabs');
7
+ $this->setDestElementId('edit_form');
8
+ $this->setTitle(Mage::helper('qixol')->__('Banner box Information'));
9
+ }
10
+
11
+ protected function _beforeToHtml() {
12
+ $this->addTab('form_section', array(
13
+ 'label' => Mage::helper('qixol')->__('Banner box Information'),
14
+ 'alt' => Mage::helper('qixol')->__('Banner box Information'),
15
+ 'content' => $this->getLayout()->createBlock('qixol/adminhtml_bannerboxes_edit_tab_form')->toHtml(),
16
+ ));
17
+ return parent::_beforeToHtml();
18
+ }
19
+
20
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Bannerboxes/Grid.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Bannerboxes_Grid extends Mage_Adminhtml_Block_Widget_Grid {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+ $this->setId('bannerGrid');
7
+ $this->setDefaultSort('banner_box_type');
8
+ $this->setDefaultDir('ASC');
9
+ $this->setSaveParametersInSession(true);
10
+ }
11
+
12
+ protected function _prepareCollection() {
13
+ $collection = Mage::getModel('qixol/bannerboxes')->getCollection();
14
+ $this->setCollection($collection);
15
+ return parent::_prepareCollection();
16
+ }
17
+
18
+ protected function _prepareColumns() {
19
+
20
+ $this->addColumn('banner_box_type', array(
21
+ 'header' => Mage::helper('qixol')->__('Banner Box Type'),
22
+ 'width' => '100px',
23
+ 'index' => 'banner_box_type',
24
+ 'type' => 'options',
25
+ 'options' => array(
26
+ 'CATEGORY_TOP' => 'CATEGORY_TOP',
27
+ 'PRODUCT_BOTTOM' => 'PRODUCT_BOTTOM',
28
+ 'PRODUCT_TOP' => 'PRODUCT_TOP',
29
+ 'PRODUCT_INLINE' => 'PRODUCT_INLINE',
30
+ 'BASKET_INLINE' => 'BASKET_INLINE',
31
+ 'CATEGORY_STICKERS' => 'CATEGORY_STICKERS',
32
+ 'PRODUCT_INFO_STICKERS' => 'PRODUCT_INFO_STICKERS',
33
+ ),
34
+ ));
35
+
36
+ $this->addColumn('banner_box_is_active', array(
37
+ 'header' => Mage::helper('qixol')->__('Enabled?'),
38
+ 'align' => 'left',
39
+ 'width' => '80px',
40
+ 'index' => 'banner_box_is_active',
41
+ 'type' => 'options',
42
+ 'options' => array(
43
+ 1 => 'Enabled',
44
+ 2 => 'Disabled',
45
+ ),
46
+ ));
47
+
48
+ $this->addColumn('banner_box_translation_type', array(
49
+ 'header' => Mage::helper('qixol')->__('Translate Type'),
50
+ 'width' => '80px',
51
+ 'index' => 'banner_box_translation_type',
52
+ 'align' => 'center',
53
+ ));
54
+
55
+
56
+
57
+ $this->addColumn('action',
58
+ array(
59
+ 'header' => Mage::helper('qixol')->__('Action'),
60
+ 'width' => '80',
61
+ 'type' => 'action',
62
+ 'getter' => 'getId',
63
+ 'actions' => array(
64
+ array(
65
+ 'caption' => Mage::helper('qixol')->__('Edit'),
66
+ 'url' => array('base' => '*/*/edit'),
67
+ 'field' => 'id'
68
+ )
69
+ ),
70
+ 'filter' => false,
71
+ 'sortable' => false,
72
+ 'index' => 'stores',
73
+ 'is_system' => true,
74
+ ));
75
+
76
+ //$this->addExportType('*/*/exportCsv', Mage::helper('qixol')->__('CSV'));
77
+ //$this->addExportType('*/*/exportXml', Mage::helper('qixol')->__('XML'));
78
+ return parent::_prepareColumns();
79
+ }
80
+
81
+ public function getRowUrl($row) {
82
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
83
+ }
84
+
85
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Customergrouspmap.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Customergrouspmap extends Mage_Adminhtml_Block_Widget_Grid_Container {
3
+
4
+ public function __construct() {
5
+ $this->_controller = 'adminhtml_customergrouspmap';
6
+ $this->_blockGroup = 'qixol';
7
+ $this->_headerText = Mage::helper('qixol')->__('Customer Group Map');
8
+ $this->_addButtonLabel = Mage::helper('qixol')->__('Add Customer Group Map');
9
+ parent::__construct();
10
+ }
11
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Customergrouspmap/Edit.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Customergrouspmap_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+
7
+ $this->_objectId = 'id';
8
+ $this->_blockGroup = 'qixol';
9
+ $this->_controller = 'adminhtml_customergrouspmap';
10
+
11
+ $this->_updateButton('save', 'label', Mage::helper('qixol')->__('Save Item'));
12
+ $this->_updateButton('delete', 'label', Mage::helper('qixol')->__('Delete Item'));
13
+
14
+ $this->_addButton('saveandcontinue', array(
15
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
16
+ 'onclick' => 'saveAndContinueEdit()',
17
+ 'class' => 'save',
18
+ ), -100);
19
+
20
+ $this->_formScripts[] = "
21
+
22
+ function saveAndContinueEdit(){
23
+ editForm.submit($('edit_form').action+'back/edit/');
24
+ }
25
+
26
+ ";
27
+ }
28
+
29
+ public function getHeaderText() {
30
+ if (Mage::registry('customergrouspmap_data') && Mage::registry('customergrouspmap_data')->getId()) {
31
+ return Mage::helper('qixol')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('customergrouspmap_data')->getTitle()));
32
+ } else {
33
+ return Mage::helper('qixol')->__('Add Item');
34
+ }
35
+ }
36
+
37
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Customergrouspmap/Edit/Form.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Customergrouspmap_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form(array(
7
+ 'id' => 'edit_form',
8
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
9
+ 'method' => 'post',
10
+ )
11
+ );
12
+
13
+ $form->setUseContainer(true);
14
+ $this->setForm($form);
15
+ return parent::_prepareForm();
16
+ }
17
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Customergrouspmap/Edit/Tab/Form.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Customergrouspmap_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
3
+
4
+ protected function _prepareForm() {
5
+ $hlp=Mage::helper('qixol');
6
+ $form = new Varien_Data_Form();
7
+ $this->setForm($form);
8
+ $fieldset = $form->addFieldset('customergrouspmap_form', array('legend' => $hlp->__('Item information')));
9
+ //$version = substr(Mage::getVersion(), 0, 3);
10
+ //$config = (($version == '1.4' || $version == '1.5') ? "'config' => Mage::getSingleton('quxol/wysiwyg_config')->getConfig()" : "'class'=>''");
11
+
12
+ $list_map_names=Mage::getModel('qixol/customergrouspmap')->getCollection();
13
+
14
+ $customer_group_name_array_list=Array();
15
+ $list_map_names_exists=array();
16
+
17
+ foreach ($list_map_names as $list_map){
18
+ $list_map_names_exists[$list_map->getCustomerGroupName()]=$list_map->getCustomerGroupName();
19
+ }
20
+
21
+
22
+ $customerGroupModel = new Mage_Customer_Model_Group();
23
+ $allCustomerGroups = $customerGroupModel->getCollection()->toOptionHash();
24
+ foreach($allCustomerGroups as $key => $group){
25
+ $customer_group_name_array_list[$group] = $hlp->__($group);
26
+ if (isset($list_map_names_exists[$group])) unset($list_map_names_exists[$group]);
27
+
28
+ }
29
+
30
+
31
+
32
+ if (count($list_map_names_exists)){
33
+ foreach ($list_map_names_exists as $exists_old_code)
34
+ $customer_group_name_array_list[$exists_old_code] = $hlp->__($exists_old_code);
35
+
36
+ }
37
+
38
+
39
+
40
+ $fieldset->addField('customer_group_name', 'select', array(
41
+ 'label' => Mage::helper('qixol')->__('Customer Group Magento:'),
42
+ 'class' => 'required-entry',
43
+ 'required' => true,
44
+ 'name' => 'customer_group_name',
45
+ 'values' => $customer_group_name_array_list
46
+ ));
47
+
48
+ $fieldset->addField('customer_group_name_map', 'text', array(
49
+ 'label' => Mage::helper('qixol')->__('Customer Group Name'),
50
+ 'class' => 'required-entry',
51
+ 'required' => true,
52
+ 'name' => 'customer_group_name_map',
53
+ 'after_element_html' => Mage::helper('qixol')->__('Name to be send to qixol.'),
54
+ ));
55
+
56
+
57
+ if (Mage::getSingleton('adminhtml/session')->getCustomergrouspmapData()) {
58
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getCustomergrouspmapData());
59
+ Mage::getSingleton('adminhtml/session')->getCustomergrouspmapData(null);
60
+ } elseif (Mage::registry('customergrouspmap_data')) {
61
+ $form->setValues(Mage::registry('customergrouspmap_data')->getData());
62
+ }
63
+ return parent::_prepareForm();
64
+ }
65
+
66
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Customergrouspmap/Edit/Tabs.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Customergrouspmap_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+ $this->setId('qixol_tabs');
7
+ $this->setDestElementId('edit_form');
8
+ $this->setTitle(Mage::helper('qixol')->__('Customer Group Map Information'));
9
+ }
10
+
11
+ protected function _beforeToHtml() {
12
+ $this->addTab('form_section', array(
13
+ 'label' => Mage::helper('qixol')->__('Customer Group Map Information'),
14
+ 'alt' => Mage::helper('qixol')->__('Customer Group Map Information'),
15
+ 'content' => $this->getLayout()->createBlock('qixol/adminhtml_customergrouspmap_edit_tab_form')->toHtml(),
16
+ ));
17
+ return parent::_beforeToHtml();
18
+ }
19
+
20
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Customergrouspmap/Grid.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Customergrouspmap_Grid extends Mage_Adminhtml_Block_Widget_Grid {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+ $this->setId('customergrouspmapGrid');
7
+ $this->setDefaultSort('customer_group_name_map');
8
+ $this->setDefaultDir('ASC');
9
+ $this->setSaveParametersInSession(true);
10
+ }
11
+
12
+ protected function _prepareCollection() {
13
+ $collection = Mage::getModel('qixol/customergrouspmap')->getCollection();
14
+ $this->setCollection($collection);
15
+ return parent::_prepareCollection();
16
+ }
17
+
18
+ protected function _prepareColumns() {
19
+ $hlp = Mage::helper('qixol');
20
+ $list_map_names=Mage::getModel('qixol/customergrouspmap')->getCollection();
21
+
22
+ $customer_group_name_array_list=Array();
23
+ $list_map_names_exists=array();
24
+
25
+ foreach ($list_map_names as $list_map){
26
+ $list_map_names_exists[$list_map->getCustomerGroupName()]=$list_map->getCustomerGroupName();
27
+ }
28
+
29
+
30
+ $customerGroupModel = new Mage_Customer_Model_Group();
31
+ $allCustomerGroups = $customerGroupModel->getCollection()->toOptionHash();
32
+ foreach($allCustomerGroups as $key => $group){
33
+ $customer_group_name_array_list[$group] = $hlp->__($group);
34
+ if (isset($list_map_names_exists[$group])) unset($list_map_names_exists[$group]);
35
+
36
+ }
37
+
38
+
39
+
40
+ if (count($list_map_names_exists)){
41
+ foreach ($list_map_names_exists as $exists_old_code)
42
+ $customer_group_name_array_list[$exists_old_code] = $hlp->__($exists_old_code);
43
+
44
+ }
45
+
46
+
47
+
48
+ $this->addColumn('customer_group_name', array(
49
+ 'header' => $hlp->__('Customer Group Name Magento:'),
50
+ 'type' => 'customer',
51
+ 'align' => 'left',
52
+ 'width' => '250px',
53
+ 'index' => 'customer_group_name',
54
+ 'type' => 'options',
55
+ 'options' => $customer_group_name_array_list
56
+ ));
57
+
58
+
59
+
60
+ $this->addColumn('customer_group_name_map', array(
61
+ 'header' => $hlp->__('Customer Group Name To'),
62
+ 'width' => '350px',
63
+ 'index' => 'customer_group_name_map'
64
+ ));
65
+
66
+ $this->addColumn('action',
67
+ array(
68
+ 'header' => $hlp->__('Action'),
69
+ 'width' => '80',
70
+ 'type' => 'action',
71
+ 'getter' => 'getId',
72
+ 'actions' => array(
73
+ array(
74
+ 'caption' => $hlp->__('Edit'),
75
+ 'url' => array('base' => '*/*/edit'),
76
+ 'field' => 'id'
77
+ ),
78
+ array(
79
+ 'caption' => $hlp->__('Delete'),
80
+ 'url' => array('base' => '*/*/delete'),
81
+ 'field' => 'id'
82
+ )
83
+ ),
84
+ 'filter' => false,
85
+ 'sortable' => false,
86
+ 'index' => 'stores',
87
+ 'is_system' => true,
88
+ ));
89
+
90
+ return parent::_prepareColumns();
91
+ }
92
+
93
+ public function getRowUrl($row) {
94
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
95
+ }
96
+
97
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Qixolbackend.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ class Holbi_Qixol_Block_Adminhtml_Qixolbackend extends Mage_Adminhtml_Block_Template {
4
+
5
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Sales/Order/Total.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Sales_Order_Total extends Mage_Core_Block_Template
3
+ {
4
+ /**
5
+ * Get label cell tag properties
6
+ *
7
+ * @return string
8
+ */
9
+ public function getLabelProperties()
10
+ {
11
+ return $this->getParentBlock()->getLabelProperties();
12
+ }
13
+
14
+ /**
15
+ * Get order store object
16
+ *
17
+ * @return Mage_Sales_Model_Order
18
+ */
19
+ public function getOrder()
20
+ {
21
+ return $this->getParentBlock()->getOrder();
22
+ }
23
+
24
+ /**
25
+ * Get totals source object
26
+ *
27
+ * @return Mage_Sales_Model_Order
28
+ */
29
+ public function getSource()
30
+ {
31
+ return $this->getParentBlock()->getSource();
32
+ }
33
+
34
+ /**
35
+ * Get value cell tag properties
36
+ *
37
+ * @return string
38
+ */
39
+ public function getValueProperties()
40
+ {
41
+ return $this->getParentBlock()->getValueProperties();
42
+ }
43
+
44
+ /**
45
+ * Initialize reward points totals
46
+ *
47
+ */
48
+ public function initTotals()
49
+ {
50
+ if ((float) $this->getOrder()->getBasePointsAmount()) {
51
+ $source = $this->getSource();
52
+ $value = $source->getPointsAmount();
53
+
54
+ $this->getParentBlock()->addTotal(new Varien_Object(array(
55
+ 'code' => 'points',
56
+ 'strong' => false,
57
+ 'label' => 'Reward points discount',
58
+ 'value' => $source instanceof Mage_Sales_Model_Order_Creditmemo ? - $value : -$value
59
+ )));
60
+ }
61
+
62
+ return $this;
63
+ }
64
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Shippingmap.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Shippingmap extends Mage_Adminhtml_Block_Widget_Grid_Container {
3
+
4
+ public function __construct() {
5
+ $this->_controller = 'adminhtml_shippingmap';
6
+ $this->_blockGroup = 'qixol';
7
+ $this->_headerText = Mage::helper('qixol')->__('Manage Shippings Map');
8
+ $this->_addButtonLabel = Mage::helper('qixol')->__('Add Shipping Map');
9
+ parent::__construct();
10
+ }
11
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Shippingmap/Edit.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Shippingmap_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+
7
+ $this->_objectId = 'id';
8
+ $this->_blockGroup = 'qixol';
9
+ $this->_controller = 'adminhtml_shippingmap';
10
+
11
+ $this->_updateButton('save', 'label', Mage::helper('qixol')->__('Save Item'));
12
+ $this->_updateButton('delete', 'label', Mage::helper('qixol')->__('Delete Item'));
13
+
14
+ $this->_addButton('saveandcontinue', array(
15
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
16
+ 'onclick' => 'saveAndContinueEdit()',
17
+ 'class' => 'save',
18
+ ), -100);
19
+
20
+ $this->_formScripts[] = "
21
+
22
+ function saveAndContinueEdit(){
23
+ editForm.submit($('edit_form').action+'back/edit/');
24
+ }
25
+
26
+ ";
27
+ }
28
+
29
+ public function getHeaderText() {
30
+ if (Mage::registry('shippingmap_data') && Mage::registry('shippingmap_data')->getId()) {
31
+ return Mage::helper('qixol')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('shippingmap_data')->getTitle()));
32
+ } else {
33
+ return Mage::helper('qixol')->__('Add Item');
34
+ }
35
+ }
36
+
37
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Shippingmap/Edit/Form.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Shippingmap_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form(array(
7
+ 'id' => 'edit_form',
8
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
9
+ 'method' => 'post',
10
+ )
11
+ );
12
+
13
+ $form->setUseContainer(true);
14
+ $this->setForm($form);
15
+ return parent::_prepareForm();
16
+ }
17
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Shippingmap/Edit/Tab/Form.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Shippingmap_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
3
+
4
+ protected function _prepareForm() {
5
+ $hlp=Mage::helper('qixol');
6
+ $form = new Varien_Data_Form();
7
+ $this->setForm($form);
8
+ $fieldset = $form->addFieldset('shippingmap_form', array('legend' => $hlp->__('Item information')));
9
+ //$version = substr(Mage::getVersion(), 0, 3);
10
+ //$config = (($version == '1.4' || $version == '1.5') ? "'config' => Mage::getSingleton('quxol/wysiwyg_config')->getConfig()" : "'class'=>''");
11
+
12
+
13
+
14
+ $shipping_name_array_list=Array();
15
+
16
+
17
+ $list_map_names=Mage::getModel('qixol/shippingmap')->getCollection();
18
+ $list_map_names_exists=array();
19
+
20
+ foreach ($list_map_names as $list_map){
21
+ $list_map_names_exists[$list_map->getShippingName()]=$list_map->getShippingName();
22
+ }
23
+ //returns only active list
24
+ $only_active=Mage::getStoreConfig('qixol/shippings/onlyactive');
25
+ /*if ($only_active>0)
26
+ $methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
27
+ else */
28
+ $methods = Mage::getSingleton('shipping/config')->getAllCarriers();
29
+
30
+ //$options = array();
31
+
32
+ foreach($methods as $_ccode => $_carrier)
33
+ {
34
+ $_methodOptions = array();
35
+ try{ //some methods not allowed getAllowedMethods
36
+ if($_methods = $_carrier->getAllowedMethods())
37
+ {
38
+ foreach($_methods as $_mcode => $_method)
39
+ {
40
+ $_code = $_ccode . '_' . $_mcode;
41
+ $shipping_name_array_list[] = array('value'=>$_code ,'label'=>$hlp->__(trim($_method)==''?$_code:$_method));
42
+ if (isset($list_map_names_exists[$_code])) unset($_code);
43
+ }
44
+
45
+ /* if(!$_title = Mage::getStoreConfig("carriers/$_ccode/title"))
46
+ $_title = $_ccode;
47
+
48
+ $options[] = array('value' => $_methodOptions, 'label' => $hlp->__($_title));*/
49
+ }
50
+ }
51
+ catch(Exception $e) {
52
+ continue;
53
+ }
54
+ }
55
+ if (count($list_map_names_exists)){
56
+ foreach ($list_map_names_exists as $exists_old_code)
57
+ $shipping_name_array_list[] = array('value'=>$exists_old_code,'label'=>$hlp->__($exists_old_code));
58
+
59
+ }
60
+
61
+
62
+
63
+ $fieldset->addField('shipping_name', 'select', array(
64
+ 'label' => Mage::helper('qixol')->__('Shipping Name Magento:'),
65
+ 'class' => 'required-entry',
66
+ 'required' => true,
67
+ 'name' => 'shipping_name',
68
+ 'values' => $shipping_name_array_list
69
+ ));
70
+
71
+ $fieldset->addField('shipping_name_map', 'text', array(
72
+ 'label' => Mage::helper('qixol')->__('Shipping Name'),
73
+ 'class' => 'required-entry',
74
+ 'required' => true,
75
+ 'name' => 'shipping_name_map',
76
+ 'after_element_html' => Mage::helper('qixol')->__('Name to be send to quxion.'),
77
+ ));
78
+
79
+
80
+ if (Mage::getSingleton('adminhtml/session')->getShippingmapData()) {
81
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getShippingmapData());
82
+ Mage::getSingleton('adminhtml/session')->setShippingmapData(null);
83
+ } elseif (Mage::registry('shippingmap_data')) {
84
+ $form->setValues(Mage::registry('shippingmap_data')->getData());
85
+ }
86
+ return parent::_prepareForm();
87
+ }
88
+
89
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Shippingmap/Edit/Tabs.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Shippingmap_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+ $this->setId('qixol_tabs');
7
+ $this->setDestElementId('edit_form');
8
+ $this->setTitle(Mage::helper('qixol')->__('Shipping Map Information'));
9
+ }
10
+
11
+ protected function _beforeToHtml() {
12
+ $this->addTab('form_section', array(
13
+ 'label' => Mage::helper('qixol')->__('Shipping Map Information'),
14
+ 'alt' => Mage::helper('qixol')->__('Shipping Map Information'),
15
+ 'content' => $this->getLayout()->createBlock('qixol/adminhtml_shippingmap_edit_tab_form')->toHtml(),
16
+ ));
17
+ return parent::_beforeToHtml();
18
+ }
19
+
20
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Shippingmap/Grid.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Shippingmap_Grid extends Mage_Adminhtml_Block_Widget_Grid {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+ $this->setId('shippingmapGrid');
7
+ $this->setDefaultSort('shipping_name_map');
8
+ $this->setDefaultDir('ASC');
9
+ $this->setSaveParametersInSession(true);
10
+ }
11
+
12
+ protected function _prepareCollection() {
13
+ $collection = Mage::getModel('qixol/shippingmap')->getCollection();
14
+ $this->setCollection($collection);
15
+ return parent::_prepareCollection();
16
+ }
17
+
18
+ protected function _prepareColumns() {
19
+ $hlp = Mage::helper('qixol');
20
+ $list_map_names=Mage::getModel('qixol/shippingmap')->getCollection();
21
+
22
+ $shipping_name_array_list=Array();
23
+ $list_map_names_exists=array();
24
+
25
+ foreach ($list_map_names as $list_map){
26
+ $list_map_names_exists[$list_map->getShippingName()]=$list_map->getShippingName();
27
+ }
28
+ //returns only active list
29
+ $only_active=Mage::getStoreConfig('qixol/shippings/onlyactive');
30
+ /*if ($only_active>0)
31
+ $methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
32
+ else */
33
+ $methods = Mage::getSingleton('shipping/config')->getAllCarriers();
34
+
35
+ //$options = array();
36
+
37
+ foreach($methods as $_ccode => $_carrier)
38
+ {
39
+ $_methodOptions = array();
40
+ try{ //some methods not allowed getAllowedMethods
41
+ if($_methods = $_carrier->getAllowedMethods())
42
+ {
43
+ if(!$_title = Mage::getStoreConfig("carriers/$_ccode/title"))
44
+ $_title = $_ccode;
45
+
46
+ foreach($_methods as $_mcode => $_method)
47
+ {
48
+ $_code = $_ccode . '_' . $_mcode;
49
+ $shipping_name_array_list[$_code] = $hlp->__(trim($_method)==''?$_code:$_method)." - /".$_code."/";
50
+ if (isset($list_map_names_exists[$_code])) unset($shipping_name_array_list[$_code]);
51
+ }
52
+
53
+
54
+ // $options[] = array('value' => $_methodOptions, 'label' => $hlp->__($_title));*/
55
+ }
56
+ }
57
+ catch(Exception $e) {
58
+ continue;
59
+ }
60
+ }
61
+
62
+ if (count($list_map_names_exists)){
63
+ foreach ($list_map_names_exists as $exists_old_code)
64
+ $shipping_name_array_list[$exists_old_code] = $hlp->__($exists_old_code);
65
+
66
+ }
67
+
68
+
69
+
70
+ $this->addColumn('shipping_name', array(
71
+ 'header' => $hlp->__('Shipping Name Magento:'),
72
+ 'type' => 'shipping',
73
+ 'align' => 'left',
74
+ 'width' => '250px',
75
+ 'index' => 'shipping_name',
76
+ 'type' => 'options',
77
+ 'options' => $shipping_name_array_list
78
+ ));
79
+
80
+
81
+
82
+ $this->addColumn('shipping_name_map', array(
83
+ 'header' => $hlp->__('Shipping Name To'),
84
+ 'width' => '350px',
85
+ 'index' => 'shipping_name_map'
86
+ ));
87
+
88
+ $this->addColumn('action',
89
+ array(
90
+ 'header' => $hlp->__('Action'),
91
+ 'width' => '80',
92
+ 'type' => 'action',
93
+ 'getter' => 'getId',
94
+ 'actions' => array(
95
+ array(
96
+ 'caption' => $hlp->__('Edit'),
97
+ 'url' => array('base' => '*/*/edit'),
98
+ 'field' => 'id'
99
+ ),
100
+ array(
101
+ 'caption' => $hlp->__('Delete'),
102
+ 'url' => array('base' => '*/*/delete'),
103
+ 'field' => 'id'
104
+ )
105
+ ),
106
+ 'filter' => false,
107
+ 'sortable' => false,
108
+ 'index' => 'stores',
109
+ 'is_system' => true,
110
+ ));
111
+
112
+ return parent::_prepareColumns();
113
+ }
114
+
115
+ public function getRowUrl($row) {
116
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
117
+ }
118
+
119
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Sticker.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Sticker extends Mage_Adminhtml_Block_Widget_Grid_Container {
3
+
4
+ public function __construct() {
5
+ $this->_controller = 'adminhtml_sticker';
6
+ $this->_blockGroup = 'qixol';
7
+ $this->_headerText = Mage::helper('qixol')->__('Stickers Manager');
8
+ $this->_addButtonLabel = Mage::helper('qixol')->__('Add Sticker');
9
+ parent::__construct();
10
+ }
11
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Sticker/Edit.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Sticker_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+
7
+ $this->_objectId = 'id';
8
+ $this->_blockGroup = 'qixol';
9
+ $this->_controller = 'adminhtml_sticker';
10
+
11
+ $this->_updateButton('save', 'label', Mage::helper('qixol')->__('Save Item'));
12
+ $this->_updateButton('delete', 'label', Mage::helper('qixol')->__('Delete Item'));
13
+
14
+ $this->_addButton('saveandcontinue', array(
15
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
16
+ 'onclick' => 'saveAndContinueEdit()',
17
+ 'class' => 'save',
18
+ ), -100);
19
+
20
+ $this->_formScripts[] = "
21
+ /*function toggleEditor() {
22
+ if (tinyMCE.getInstanceById('sticker_content') == null) {
23
+ tinyMCE.execCommand('mceAddControl', false, 'sticker_content');
24
+ } else {
25
+ tinyMCE.execCommand('mceRemoveControl', false, 'sticker_content');
26
+ }
27
+ }*/
28
+
29
+ function saveAndContinueEdit(){
30
+ editForm.submit($('edit_form').action+'back/edit/');
31
+ }
32
+
33
+ function showTypeContents(){
34
+ var typeId=$('sticker_type').value;
35
+ var show = ((typeId==0)?'block':'none');
36
+ var hide = ((typeId==0)?'none':'block');
37
+ $('filename').setStyle({display:show});
38
+ $('filename_delete').setStyle({display:show});
39
+ //$('sticker_content').setStyle({display:hide});
40
+ setTimeout('stickerContentType()',1000);
41
+ alert($('filename').getStyle('display'))
42
+ }
43
+
44
+ function stickerContentType(){
45
+ var typeId=$('sticker_type').value;
46
+ var hide = ((typeId==0)?'none':'block');
47
+ $('buttonssticker_content').setStyle({display:hide});
48
+ $('sticker_content_parent').setStyle({display:hide});
49
+ }
50
+
51
+
52
+ /* Event.observe('sticker_type', 'change', function(){
53
+ showTypeContents();
54
+ });
55
+ Event.observe(window, 'load', function(){
56
+ showTypeContents();
57
+ }); */
58
+ ";
59
+ }
60
+
61
+ public function getHeaderText() {
62
+ if (Mage::registry('sticker_data') && Mage::registry('sticker_data')->getId()) {
63
+ return Mage::helper('qixol')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('sticker_data')->getTitle()));
64
+ } else {
65
+ return Mage::helper('qixol')->__('Add Item');
66
+ }
67
+ }
68
+
69
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Sticker/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Sticker_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form(array(
7
+ 'id' => 'edit_form',
8
+
9
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
+ 'method' => 'post',
11
+ 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Sticker/Edit/Tab/Form.php ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Sticker_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
3
+
4
+ protected function _prepareForm() {
5
+ $form = new Varien_Data_Form();
6
+ $this->setForm($form);
7
+ $fieldset = $form->addFieldset('sticker_form', array('legend' => Mage::helper('qixol')->__('Item information')));
8
+ $version = substr(Mage::getVersion(), 0, 3);
9
+ //$config = (($version == '1.4' || $version == '1.5') ? "'config' => Mage::getSingleton('sticker/wysiwyg_config')->getConfig()" : "'class'=>''");
10
+
11
+
12
+ $fieldset->addField('banner_link_name', 'multiselect', array(
13
+ 'label' => Mage::helper('qixol')->__('Sticker show on:'),
14
+ 'class' => 'required-entry',
15
+ 'required' => true,
16
+ 'name' => 'banner_link_name',
17
+ 'values' => Mage::getModel('qixol/bannerboxes')->getStickerOptionArray(),
18
+ 'after_element_html' => Mage::helper('qixol')->__(' '),
19
+ ));
20
+
21
+ $fieldset->addField('filename', 'image', array(
22
+ 'label' => Mage::helper('qixol')->__('Upload and use Image'),
23
+ 'required' => false,
24
+ 'name' => 'filename',
25
+ ));
26
+
27
+ /*$fieldset->addField('use_default_sticker', 'select', array(
28
+ 'label' => Mage::helper('qixol')->__('Or Default sticker for'),
29
+ 'class' => 'required-entry',
30
+ 'required' => false,
31
+ 'name' => 'use_default_sticker',
32
+ 'values' => array(
33
+ array(
34
+ 'value' => '',
35
+ 'label' => Mage::helper('qixol')->__('Not defined'),
36
+ ),
37
+ array(
38
+ 'value' => 'BOGOF',
39
+ 'label' => Mage::helper('qixol')->__('Buy one get one free'),
40
+ ),
41
+ array(
42
+ 'value' => 'BOGOR',
43
+ 'label' => Mage::helper('qixol')->__('Buy one get one reduced'),
44
+ ),
45
+ array(
46
+ 'value' => 'BUNDLE',
47
+ 'label' => Mage::helper('qixol')->__('Bundle'),
48
+ ),
49
+ array(
50
+ 'value' => 'DEAL',
51
+ 'label' => Mage::helper('qixol')->__('Deal'),
52
+ ),
53
+ array(
54
+ 'value' => 'FREEPRODUCT',
55
+ 'label' => Mage::helper('qixol')->__('Free product'),
56
+ ),
57
+ array(
58
+ 'value' => 'ISSUECOUPON',
59
+ 'label' => Mage::helper('qixol')->__('Issue coupon'),
60
+ ),
61
+ array(
62
+ 'value' => 'ISSUEPOINTS',
63
+ 'label' => Mage::helper('qixol')->__('Issue points'),
64
+ ),
65
+ array(
66
+ 'value' => 'BASKETREDUCTION',
67
+ 'label' => Mage::helper('qixol')->__('Backet reduction'),
68
+ ),
69
+ array(
70
+ 'value' => 'DELIVERYREDUCTION',
71
+ 'label' => Mage::helper('qixol')->__('Delivery reduction'),
72
+ ),
73
+ array(
74
+ 'value' => 'MULTIPLEPROMO',
75
+ 'label' => Mage::helper('qixol')->__('Multiple promos'),
76
+ ),
77
+ array(
78
+ 'value' => 'PRODUCTSREDUCTION',
79
+ 'label' => Mage::helper('qixol')->__('Product reduction'),
80
+ ),
81
+ ),
82
+ ));*/
83
+
84
+ $fieldset->addField('use_default_banner_group', 'select', array(
85
+ 'label' => Mage::helper('qixol')->__('For Default Promotion Type?'),
86
+ 'class' => 'required-entry',
87
+ 'name' => 'use_default_banner_group',
88
+ 'values' => array(
89
+ array(
90
+ 'value' => 1,
91
+ 'label' => Mage::helper('qixol')->__('Yes'),
92
+ ),
93
+ array(
94
+ 'value' => 0,
95
+ 'label' => Mage::helper('qixol')->__('No'),
96
+ ),
97
+ ),
98
+ ));
99
+
100
+ $fieldset->addField('default_banner_group', 'select', array(
101
+ 'label' => Mage::helper('qixol')->__('Default promotion type'),
102
+ 'class' => 'required-entry',
103
+ 'required' => false,
104
+ 'name' => 'default_banner_group',
105
+ 'values' => array(
106
+ array(
107
+ 'value' => '',
108
+ 'label' => Mage::helper('qixol')->__('Not defined'),
109
+ ),
110
+ array(
111
+ 'value' => 'BOGOF',
112
+ 'label' => Mage::helper('qixol')->__('Buy one get one free'),
113
+ ),
114
+ array(
115
+ 'value' => 'BOGOR',
116
+ 'label' => Mage::helper('qixol')->__('Buy one get one reduced'),
117
+ ),
118
+ array(
119
+ 'value' => 'BUNDLE',
120
+ 'label' => Mage::helper('qixol')->__('Bundle'),
121
+ ),
122
+ array(
123
+ 'value' => 'DEAL',
124
+ 'label' => Mage::helper('qixol')->__('Deal'),
125
+ ),
126
+ array(
127
+ 'value' => 'FREEPRODUCT',
128
+ 'label' => Mage::helper('qixol')->__('Free product'),
129
+ ),
130
+ array(
131
+ 'value' => 'ISSUECOUPON',
132
+ 'label' => Mage::helper('qixol')->__('Issue coupon'),
133
+ ),
134
+ array(
135
+ 'value' => 'ISSUEPOINTS',
136
+ 'label' => Mage::helper('qixol')->__('Issue points'),
137
+ ),
138
+ array(
139
+ 'value' => 'BASKETREDUCTION',
140
+ 'label' => Mage::helper('qixol')->__('Backet reduction'),
141
+ ),
142
+ array(
143
+ 'value' => 'DELIVERYREDUCTION',
144
+ 'label' => Mage::helper('qixol')->__('Delivery reduction'),
145
+ ),
146
+ /*array(
147
+ 'value' => 8,
148
+ 'label' => Mage::helper('qixol')->__('Multiple promos'),
149
+ ),*/
150
+ array(
151
+ 'value' => 'PRODUCTSREDUCTION',
152
+ 'label' => Mage::helper('qixol')->__('Product reduction'),
153
+ ),
154
+ ),
155
+ ));
156
+
157
+ $fieldset->addField('unique_banner_group', 'text', array(
158
+ 'label' => Mage::helper('qixol')->__('Unique Promotion reference'),
159
+ 'name' => 'unique_banner_group',
160
+ ));
161
+
162
+ /*if ($version == '1.4' || $version == '1.5') {
163
+ $fieldset->addField('banner_content', 'editor', array(
164
+ 'name' => 'banner_content',
165
+ 'label' => Mage::helper('qixol')->__('Content'),
166
+ 'title' => Mage::helper('qixol')->__('Content'),
167
+ 'style' => 'width:600px; height:250px;',
168
+ 'config' => Mage::getSingleton('banner/wysiwyg_config')->getConfig(),
169
+ 'wysiwyg' => true,
170
+ 'required' => false,
171
+ ));
172
+ } else {
173
+ $fieldset->addField('banner_content', 'editor', array(
174
+ 'name' => 'banner_content',
175
+ 'label' => Mage::helper('cms')->__('Content'),
176
+ 'title' => Mage::helper('cms')->__('Content'),
177
+ 'style' => 'width:600px; height:250px;',
178
+ 'wysiwyg' => false,
179
+ 'required' => false,
180
+ ));
181
+ }*/
182
+
183
+ $fieldset->addField('sort_order', 'text', array(
184
+ 'label' => Mage::helper('qixol')->__('Sort Order'),
185
+ 'name' => 'sort_order',
186
+ ));
187
+
188
+
189
+ $field_last=$fieldset->addField('status', 'select', array(
190
+ 'label' => Mage::helper('qixol')->__('Status'),
191
+ 'class' => 'required-entry',
192
+ 'name' => 'status',
193
+ 'values' => array(
194
+ array(
195
+ 'value' => 1,
196
+ 'label' => Mage::helper('qixol')->__('Enabled'),
197
+ ),
198
+ array(
199
+ 'value' => 0,
200
+ 'label' => Mage::helper('qixol')->__('Disabled'),
201
+ ),
202
+ ),
203
+ ));
204
+
205
+ $field_last->setAfterElementHtml('<script>
206
+ //< ![C
207
+ function on_change_default_banner_group(){
208
+ if ($(\'use_default_banner_group\')[$(\'use_default_banner_group\').selectedIndex].value==\'1\'){
209
+ $(\'unique_banner_group\').setValue("");
210
+ $(\'unique_banner_group\').disable();
211
+ $(\'default_banner_group\').enable();
212
+ }else {
213
+ $(\'unique_banner_group\').enable();
214
+ $(\'default_banner_group\').selectedIndex=0;
215
+ $(\'default_banner_group\').disable();
216
+ }
217
+
218
+ }
219
+ if ($(\'use_default_banner_group\')[$(\'use_default_banner_group\').selectedIndex].value==\'1\'){
220
+ $(\'unique_banner_group\').disable();
221
+ }else {
222
+ $(\'default_banner_group\').selectedIndex=0;
223
+ $(\'default_banner_group\').disable();
224
+ }
225
+
226
+
227
+ document.observe("dom:loaded", function() {
228
+
229
+ $("use_default_banner_group").observe("change",function(e){
230
+ on_change_default_banner_group();
231
+ });
232
+ });
233
+
234
+
235
+ //]]>
236
+ </script>');
237
+
238
+ if (Mage::getSingleton('adminhtml/session')->getStickerData()) {
239
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getStickerData());
240
+ Mage::getSingleton('adminhtml/session')->setStickerData(null);
241
+ } elseif (Mage::registry('sticker_data')) {
242
+ $form->setValues(Mage::registry('sticker_data')->getData());
243
+ }
244
+ return parent::_prepareForm();
245
+ }
246
+
247
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Sticker/Edit/Tabs.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Sticker_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+ $this->setId('qixol_tabs');
7
+ $this->setDestElementId('edit_form');
8
+ $this->setTitle(Mage::helper('qixol')->__('Item Information'));
9
+ }
10
+
11
+ protected function _beforeToHtml() {
12
+ $this->addTab('form_section', array(
13
+ 'label' => Mage::helper('qixol')->__('Sticker Information'),
14
+ 'alt' => Mage::helper('qixol')->__('Sticker information'),
15
+ 'content' => $this->getLayout()->createBlock('qixol/adminhtml_sticker_edit_tab_form')->toHtml(),
16
+ ));
17
+ return parent::_beforeToHtml();
18
+ }
19
+
20
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Sticker/Grid.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Sticker_Grid extends Holbi_Qixol_Block_Adminhtml_Widget_Grid {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+ $this->setId('stickerGrid');
7
+ $this->setDefaultSort('sticker_id');
8
+ $this->setDefaultDir('ASC');
9
+ $this->setSaveParametersInSession(true);
10
+ }
11
+
12
+ protected function _prepareCollection() {
13
+ $collection = Mage::getModel('qixol/sticker')->getCollection();
14
+ $this->setCollection($collection);
15
+ return parent::_prepareCollection();
16
+ }
17
+
18
+ protected function _prepareColumns() {
19
+ $this->addColumn('sticker_id', array(
20
+ 'header' => Mage::helper('qixol')->__('ID'),
21
+ 'align' => 'center',
22
+ 'width' => '30px',
23
+ 'index' => 'sticker_id',
24
+ ));
25
+
26
+ $this->addColumn('filename', array(
27
+ 'header' => Mage::helper('qixol')->__('Image'),
28
+ 'align' => 'center',
29
+ 'index' => 'filename',
30
+ 'type' => 'sticker',
31
+ 'escape' => true,
32
+ 'sortable' => false,
33
+ 'width' => '150px',
34
+ ));
35
+
36
+ $this->addColumn('banner_link_name', array(
37
+ 'header' => Mage::helper('qixol')->__('Link Name'),
38
+ 'width' => '250px',
39
+ 'index' => 'banner_link_name',
40
+ ));
41
+
42
+ $this->addColumn('use_default_banner_group', array(
43
+ 'header' => Mage::helper('qixol')->__('Use Dafault Banner Promotion?'),
44
+ 'align' => 'left',
45
+ 'width' => '80px',
46
+ 'index' => 'use_default_banner_group',
47
+ 'type' => 'options',
48
+ 'options' => array(
49
+ 0 => Mage::helper('qixol')->__('No'),
50
+ 1 => Mage::helper('qixol')->__('Yes'),
51
+ ),
52
+ ));
53
+
54
+
55
+ $this->addColumn('default_banner_group', array(
56
+ 'header' => Mage::helper('qixol')->__('Default Banner Promotion name'),
57
+ 'width' => '100px',
58
+ 'index' => 'default_banner_group',
59
+ 'type' => 'options',
60
+ 'options' => array(
61
+ '' => Mage::helper('qixol')->__('Not defined'),
62
+ 'BOGOF' => Mage::helper('qixol')->__('Buy one get one free'),
63
+ 'BOGOR' => Mage::helper('qixol')->__('Buy one get one reduced'),
64
+ 'BUNDLE' => Mage::helper('qixol')->__('Bundle'),
65
+ 'DEAL' => Mage::helper('qixol')->__('Deal'),
66
+ 'FREEPRODUCT' => Mage::helper('qixol')->__('Free product'),
67
+ 'ISSUECOUPON' => Mage::helper('qixol')->__('Issue coupon'),
68
+
69
+ 'ISSUEPOINTS' => Mage::helper('qixol')->__('Issue points'),
70
+ 'BASKETREDUCTION' => Mage::helper('qixol')->__('Basket reduction'),
71
+ 'DELIVERYREDUCTION' => Mage::helper('qixol')->__('Delivery coupon'),
72
+
73
+ /*7 => 'Issue points',
74
+ 8 => 'Multiple promos',*/
75
+ 'PRODUCTSREDUCTION' => Mage::helper('qixol')->__('Product reduction'),
76
+ ),
77
+ ));
78
+
79
+ $this->addColumn('unique_banner_group', array(
80
+ 'header' => Mage::helper('qixol')->__('Unique Banner Promotion refference'),
81
+ 'width' => '250px',
82
+ 'index' => 'unique_banner_group',
83
+ ));
84
+
85
+ $this->addColumn('status', array(
86
+ 'header' => Mage::helper('qixol')->__('Status'),
87
+ 'align' => 'left',
88
+ 'width' => '80px',
89
+ 'index' => 'status',
90
+ 'type' => 'options',
91
+ 'options' => array(
92
+ 0 => 'Disabled',
93
+ 1 => 'Enabled',
94
+ ),
95
+ ));
96
+
97
+ $this->addColumn('sort_order', array(
98
+ 'header' => Mage::helper('qixol')->__('Sort Order'),
99
+ 'width' => '80px',
100
+ 'index' => 'sort_order',
101
+ 'align' => 'center',
102
+ ));
103
+
104
+
105
+ $this->addColumn('action',
106
+ array(
107
+ 'header' => Mage::helper('qixol')->__('Action'),
108
+ 'width' => '80',
109
+ 'type' => 'action',
110
+ 'getter' => 'getId',
111
+ 'actions' => array(
112
+ array(
113
+ 'caption' => Mage::helper('qixol')->__('Edit'),
114
+ 'url' => array('base' => '*/*/edit'),
115
+ 'field' => 'id'
116
+ )
117
+ ),
118
+ 'filter' => false,
119
+ 'sortable' => false,
120
+ 'index' => 'stores',
121
+ 'is_system' => true,
122
+ ));
123
+
124
+ return parent::_prepareColumns();
125
+ }
126
+
127
+ protected function _prepareMassaction() {
128
+ $this->setMassactionIdField('sticker_id');
129
+ $this->getMassactionBlock()->setFormFieldName('sticker');
130
+
131
+ $this->getMassactionBlock()->addItem('delete', array(
132
+ 'label' => Mage::helper('qixol')->__('Delete'),
133
+ 'url' => $this->getUrl('*/*/massDelete'),
134
+ 'confirm' => Mage::helper('qixol')->__('Are you sure?')
135
+ ));
136
+
137
+ $statuses = Mage::getSingleton('qixol/status')->getOptionArray();
138
+
139
+ array_unshift($statuses, array('label' => '', 'value' => ''));
140
+ $this->getMassactionBlock()->addItem('status', array(
141
+ 'label' => Mage::helper('qixol')->__('Change status'),
142
+ 'url' => $this->getUrl('*/*/massStatus', array('_current' => true)),
143
+ 'additional' => array(
144
+ 'visibility' => array(
145
+ 'name' => 'status',
146
+ 'type' => 'select',
147
+ 'class' => 'required-entry',
148
+ 'label' => Mage::helper('qixol')->__('Status'),
149
+ 'values' => $statuses
150
+ )
151
+ )
152
+ ));
153
+ return $this;
154
+ }
155
+
156
+ public function getRowUrl($row) {
157
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
158
+ }
159
+
160
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Storesmap.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Storesmap extends Mage_Adminhtml_Block_Widget_Grid_Container {
3
+
4
+ public function __construct() {
5
+ $this->_controller = 'adminhtml_storesmap';
6
+ $this->_blockGroup = 'qixol';
7
+ $this->_headerText = Mage::helper('qixol')->__('Manage Stores Map');
8
+ $this->_addButtonLabel = Mage::helper('qixol')->__('Add Stores Map');
9
+ parent::__construct();
10
+ }
11
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Storesmap/Edit.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Storesmap_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+
7
+ $this->_objectId = 'id';
8
+ $this->_blockGroup = 'qixol';
9
+ $this->_controller = 'adminhtml_storesmap';
10
+
11
+ $this->_updateButton('save', 'label', Mage::helper('qixol')->__('Save Item'));
12
+ $this->_updateButton('delete', 'label', Mage::helper('qixol')->__('Delete Item'));
13
+
14
+ $this->_addButton('saveandcontinue', array(
15
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
16
+ 'onclick' => 'saveAndContinueEdit()',
17
+ 'class' => 'save',
18
+ ), -100);
19
+
20
+ $this->_formScripts[] = "
21
+
22
+ function saveAndContinueEdit(){
23
+ editForm.submit($('edit_form').action+'back/edit/');
24
+ }
25
+
26
+ ";
27
+ }
28
+
29
+ public function getHeaderText() {
30
+ if (Mage::registry('storesmap_data') && Mage::registry('storesmap_data')->getId()) {
31
+ return Mage::helper('qixol')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('storesmap_data')->getTitle()));
32
+ } else {
33
+ return Mage::helper('qixol')->__('Add Item');
34
+ }
35
+ }
36
+
37
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Storesmap/Edit/Form.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Storesmap_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form(array(
7
+ 'id' => 'edit_form',
8
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
9
+ 'method' => 'post',
10
+ )
11
+ );
12
+
13
+ $form->setUseContainer(true);
14
+ $this->setForm($form);
15
+ return parent::_prepareForm();
16
+ }
17
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Storesmap/Edit/Tab/Form.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Storesmap_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
3
+
4
+ protected function _prepareForm() {
5
+ $hlp=Mage::helper('qixol');
6
+ $form = new Varien_Data_Form();
7
+ $this->setForm($form);
8
+ $fieldset = $form->addFieldset('storesmap_form', array('legend' => $hlp->__('Item information')));
9
+ //$version = substr(Mage::getVersion(), 0, 3);
10
+ //$config = (($version == '1.4' || $version == '1.5') ? "'config' => Mage::getSingleton('quxol/wysiwyg_config')->getConfig()" : "'class'=>''");
11
+
12
+
13
+
14
+ $store_name_array_list=Array();
15
+ $list_map_names_exists=array();
16
+
17
+ foreach ($list_map_names as $list_map){
18
+ $list_map_names_exists[$list_map->getStoreName()]=$list_map->getStoreName();
19
+ }
20
+
21
+
22
+ foreach (Mage::app()->getWebsites() as $website) {
23
+ foreach ($website->getGroups() as $group) {
24
+ $stores = $group->getStores();
25
+ foreach ($stores as $store) {
26
+ $store_name_array_list[$store->getName()] = $store->getName();
27
+ if (isset($list_map_names_exists[$store->getName()])) unset($store_name_array_list[$store->getName()]);
28
+ }
29
+ }
30
+ }
31
+
32
+ if (count($list_map_names_exists)){
33
+ foreach ($list_map_names_exists as $exists_old_code)
34
+ $store_name_array_list[$exists_old_code] = $hlp->__($exists_old_code);
35
+
36
+ }
37
+
38
+
39
+
40
+ $fieldset->addField('store_name', 'select', array(
41
+ 'label' => Mage::helper('qixol')->__('Store Name Magento:'),
42
+ 'class' => 'required-entry',
43
+ 'required' => true,
44
+ 'name' => 'store_name',
45
+ 'values' => $store_name_array_list
46
+ ));
47
+
48
+ $fieldset->addField('store_name_map', 'text', array(
49
+ 'label' => Mage::helper('qixol')->__('Store Name To'),
50
+ 'class' => 'required-entry',
51
+ 'required' => true,
52
+ 'name' => 'store_name_map',
53
+ 'after_element_html' => Mage::helper('qixol')->__('Name to be send to quxiol.'),
54
+ ));
55
+
56
+
57
+ if (Mage::getSingleton('adminhtml/session')->getStoresmapData()) {
58
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getStoresmapData());
59
+ Mage::getSingleton('adminhtml/session')->getStoresmapData(null);
60
+ } elseif (Mage::registry('storesmap_data')) {
61
+ $form->setValues(Mage::registry('storesmap_data')->getData());
62
+ }
63
+ return parent::_prepareForm();
64
+ }
65
+
66
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Storesmap/Edit/Tabs.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Storesmap_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+ $this->setId('qixol_tabs');
7
+ $this->setDestElementId('edit_form');
8
+ $this->setTitle(Mage::helper('qixol')->__('Store Map Information'));
9
+ }
10
+
11
+ protected function _beforeToHtml() {
12
+ $this->addTab('form_section', array(
13
+ 'label' => Mage::helper('qixol')->__('Store Map Information'),
14
+ 'alt' => Mage::helper('qixol')->__('Store Map Information'),
15
+ 'content' => $this->getLayout()->createBlock('qixol/adminhtml_storesmap_edit_tab_form')->toHtml(),
16
+ ));
17
+ return parent::_beforeToHtml();
18
+ }
19
+
20
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Storesmap/Grid.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_Storesmap_Grid extends Mage_Adminhtml_Block_Widget_Grid {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+ $this->setId('storesmapGrid');
7
+ $this->setDefaultSort('store_name');
8
+ $this->setDefaultDir('ASC');
9
+ $this->setSaveParametersInSession(true);
10
+ }
11
+
12
+ protected function _prepareCollection() {
13
+ $collection = Mage::getModel('qixol/storesmap')->getCollection();
14
+ $this->setCollection($collection);
15
+ return parent::_prepareCollection();
16
+ }
17
+
18
+ protected function _prepareColumns() {
19
+ $hlp = Mage::helper('qixol');
20
+ $list_map_names=Mage::getModel('qixol/storesmap')->getCollection();
21
+
22
+ $store_name_array_list=Array();
23
+ $list_map_names_exists=array();
24
+
25
+ foreach ($list_map_names as $list_map){
26
+ $list_map_names_exists[$list_map->getStoreName()]=$list_map->getStoreName();
27
+ }
28
+
29
+
30
+ foreach (Mage::app()->getWebsites() as $website) {
31
+ foreach ($website->getGroups() as $group) {
32
+ $stores = $group->getStores();
33
+ foreach ($stores as $store) {
34
+ $store_name_array_list[$store->getName()] = $store->getName();
35
+ if (isset($list_map_names_exists[$store->getName()])) unset($store_name_array_list[$store->getName()]);
36
+ }
37
+ }
38
+ }
39
+
40
+ if (count($list_map_names_exists)){
41
+ foreach ($list_map_names_exists as $exists_old_code)
42
+ $store_name_array_list[$exists_old_code] = $hlp->__($exists_old_code);
43
+
44
+ }
45
+
46
+
47
+
48
+ $this->addColumn('store_name', array(
49
+ 'header' => $hlp->__('Store Name Magento:'),
50
+ 'type' => 'stores',
51
+ 'align' => 'left',
52
+ 'width' => '250px',
53
+ 'index' => 'store_name',
54
+ 'type' => 'options',
55
+ 'options' => $store_name_array_list
56
+ ));
57
+
58
+
59
+
60
+ $this->addColumn('store_name_map', array(
61
+ 'header' => $hlp->__('Store Name To'),
62
+ 'width' => '350px',
63
+ 'index' => 'store_name_map'
64
+ ));
65
+
66
+ $this->addColumn('action',
67
+ array(
68
+ 'header' => $hlp->__('Action'),
69
+ 'width' => '80',
70
+ 'type' => 'action',
71
+ 'getter' => 'getId',
72
+ 'actions' => array(
73
+ array(
74
+ 'caption' => $hlp->__('Edit'),
75
+ 'url' => array('base' => '*/*/edit'),
76
+ 'field' => 'id'
77
+ ),
78
+ array(
79
+ 'caption' => $hlp->__('Delete'),
80
+ 'url' => array('base' => '*/*/delete'),
81
+ 'field' => 'id'
82
+ )
83
+ ),
84
+ 'filter' => false,
85
+ 'sortable' => false,
86
+ 'index' => 'stores',
87
+ 'is_system' => true,
88
+ ));
89
+
90
+ return parent::_prepareColumns();
91
+ }
92
+
93
+ public function getRowUrl($row) {
94
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
95
+ }
96
+
97
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/System/Config/Attributes.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Adminhtml_System_Config_Attributes extends Mage_Adminhtml_Block_System_Config_Form_Field{
3
+ const CONFIG_PATH = 'qixol/productattrib/attributes'; //put here the full path from the config to your element
4
+ protected $_values = null;
5
+ protected function _construct()
6
+ {
7
+ $this->setTemplate('qixol/system/config/attributes.phtml');
8
+ return parent::_construct();
9
+ }
10
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
11
+ {
12
+ $this->setNamePrefix($element->getName())
13
+ ->setHtmlId($element->getHtmlId());
14
+ return $this->_toHtml();
15
+ }
16
+ public function getValues(){
17
+ $values = array();
18
+ //get the available values (use the source model from your question)
19
+ foreach (Mage::getSingleton('qixol/system_config_source_attributes')->toOptionArray() as $value){
20
+ $values[$value['value']] = $value['label'];
21
+ }
22
+ return $values;
23
+ }
24
+ public function getIsChecked($name){
25
+ return in_array($name, $this->getCheckedValues());
26
+ }
27
+ public function getCheckedValues(){
28
+ if (is_null($this->_values)){
29
+ $data = $this->getConfigData();
30
+ if (isset($data[self::CONFIG_PATH])){
31
+ $data = $data[self::CONFIG_PATH];
32
+ }
33
+ else{
34
+ $data = '';
35
+ }
36
+ $this->_values = explode(',', $data);
37
+ }
38
+ return $this->_values;
39
+ }
40
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Widget/Grid.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once 'Mage/Adminhtml/Block/Widget/Grid.php';
3
+ class Holbi_Qixol_Block_Adminhtml_Widget_Grid extends Mage_Adminhtml_Block_Widget_Grid {
4
+
5
+ public function addColumn($columnId, $column) {
6
+ if (is_array($column)) {
7
+ $this->_columns[$columnId] = $this->getLayout()->createBlock('qixol/adminhtml_widget_grid_column')
8
+ ->setData($column)
9
+ ->setGrid($this);
10
+ }
11
+ /* elseif ($column instanceof Varien_Object) {
12
+ $this->_columns[$columnId] = $column;
13
+ } */ else {
14
+ throw new Exception(Mage::helper('adminhtml')->__('Wrong column format'));
15
+ }
16
+
17
+ $this->_columns[$columnId]->setId($columnId);
18
+ $this->_lastColumnId = $columnId;
19
+ return $this;
20
+ }
21
+
22
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Widget/Grid/Column.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once 'Mage/Adminhtml/Block/Widget/Grid/Column.php';
3
+
4
+ class Holbi_Qixol_Block_Adminhtml_Widget_Grid_Column extends Mage_Adminhtml_Block_Widget_Grid_Column {
5
+
6
+ protected function _getRendererByType() {
7
+ switch (strtolower($this->getType())) {
8
+ case 'banner':
9
+ $rendererClass = 'qixol/adminhtml_widget_grid_column_renderer_banner';
10
+ break;
11
+ case 'sticker':
12
+ $rendererClass = 'qixol/adminhtml_widget_grid_column_renderer_sticker';
13
+ break;
14
+ default:
15
+ $rendererClass = parent::_getRendererByType();
16
+ break;
17
+ }
18
+ return $rendererClass;
19
+ }
20
+
21
+ protected function _getFilterByType() {
22
+ switch (strtolower($this->getType())) {
23
+ case 'banner':
24
+ $filterClass = 'qixol/adminhtml_widget_grid_column_filter_banner';
25
+ break;
26
+ case 'sticker':
27
+ $filterClass = 'qixol/adminhtml_widget_grid_column_filter_banner';
28
+ break;
29
+ default:
30
+ $filterClass = parent::_getFilterByType();
31
+ break;
32
+ }
33
+ return $filterClass;
34
+ }
35
+
36
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Widget/Grid/Column/Filter/Banner.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once 'Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Text.php';
4
+
5
+ class Holbi_Qixol_Block_Adminhtml_Widget_Grid_Column_Filter_Banner extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Text {
6
+
7
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Widget/Grid/Column/Renderer/Banner.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once 'Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php';
4
+ class Holbi_Qixol_Block_Adminhtml_Widget_Grid_Column_Renderer_Banner extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
5
+
6
+ public function __construct() {
7
+
8
+ }
9
+
10
+ public function render(Varien_Object $row) {
11
+ return $this->_getValue($row);
12
+ }
13
+
14
+ protected function _getValue(Varien_Object $row) {
15
+ $dored = false;
16
+ $out = '';
17
+ if ($getter = $this->getColumn()->getGetter()) {
18
+ $val = $row->$getter();
19
+ }
20
+ $val = $row->getData($this->getColumn()->getIndex());
21
+ if (trim($val)!=''){
22
+ $url = Mage::helper('qixol')->getImageUrl($val);
23
+ $size = Mage::helper('qixol')->getImageThumbSize($val);
24
+ $file_extis = Mage::helper('qixol')->getFileExists($val);
25
+ $popLink = "popWin('$url','image','width=800,height=600,resizable=yes,scrollbars=yes')";
26
+ if (is_array($size) && $file_extis)
27
+ $out = '<a href="javascript:;" onclick="'.$popLink.'"><img src="'.$url.'" width="'.$size['width'].'" height="'.$size['height'].'" style="border: 2px solid #CCCCCC;"/></a>';
28
+ }
29
+ return $out;
30
+ }
31
+ }
app/code/community/Holbi/Qixol/Block/Adminhtml/Widget/Grid/Column/Renderer/Sticker.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once 'Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php';
4
+ class Holbi_Qixol_Block_Adminhtml_Widget_Grid_Column_Renderer_Sticker extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
5
+
6
+ public function __construct() {
7
+
8
+ }
9
+
10
+ public function render(Varien_Object $row) {
11
+ return $this->_getValue($row);
12
+ }
13
+
14
+ protected function _getValue(Varien_Object $row) {
15
+ $dored = false;
16
+ $out = '';
17
+ if ($getter = $this->getColumn()->getGetter()) {
18
+ $val = $row->$getter();
19
+ }
20
+
21
+ $val = $row->getData($this->getColumn()->getIndex());
22
+ if (trim($val)!=''){
23
+ $url = Mage::helper('qixol')->getImageUrl($val);
24
+ $size = Mage::helper('qixol')->getImageThumbSize($val);
25
+ $file_extis = Mage::helper('qixol')->getFileExists($val);
26
+ $popLink = "popWin('$url','image','width=800,height=600,resizable=yes,scrollbars=yes')";
27
+ if (is_array($size) && $file_extis)
28
+ $out = '<a href="javascript:;" onclick="'.$popLink.'"><img src="'.$url.'" width="'.$size['width'].'" height="'.$size['height'].'" style="border: 2px solid #CCCCCC;"/></a>';
29
+ }else {
30
+ $val = $row->getData('use_default_sticker');
31
+ if ($val!=''){
32
+ $url=Mage::getModel('qixol/sticker')->getDefaultSticker($val);
33
+ $popLink = "popWin('$url','image','width=800,height=600,resizable=yes,scrollbars=yes')";
34
+ $out = '<a href="javascript:;" onclick="'.$popLink.'"><img src="'.$url.'" width="100" style="border: 2px solid #CCCCCC;"/></a>';
35
+ }
36
+ }
37
+ return $out;
38
+ }
39
+ }
app/code/community/Holbi/Qixol/Block/Banner.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Banner extends Mage_Core_Block_Template {
3
+
4
+ public function _prepareLayout() {
5
+ return parent::_prepareLayout();
6
+ }
7
+
8
+ public function getBanner() {
9
+ if (!$this->hasData('banner')) {
10
+ $this->setData('banner', Mage::registry('banner'));
11
+ }
12
+ return $this->getData('banner');
13
+ }
14
+
15
+ public function getResizeImage($bannerPath, $groupName, $w = 0, $h = 0) {
16
+ $name = '';
17
+ $_helper = Mage::helper('qixol');
18
+ $bannerDirPath = $_helper->updateDirSepereator($bannerPath);
19
+ $baseDir = Mage::getBaseDir();
20
+ $mediaDir = Mage::getBaseDir('media');
21
+ $mediaUrl = Mage::getBaseUrl('media');
22
+ $resizeDir = $mediaDir . DS . 'custom' . DS . 'banners' . DS . 'resize' . DS;
23
+ $resizeUrl = $mediaUrl.'custom/banners/resize/';
24
+ $imageName = basename($bannerDirPath);
25
+
26
+ if (@file_exists($mediaDir . DS . $bannerDirPath)) {
27
+ $name = $mediaDir . DS . $bannerPath;
28
+ $this->checkDir($resizeDir . $groupName);
29
+ $smallImgPath = $resizeDir . $groupName . DS . $imageName;
30
+ $smallImg = $resizeUrl . $groupName .'/'. $imageName;
31
+ }
32
+
33
+ if ($name != '') {
34
+ $resizeObject = Mage::getModel('qixol/bannerresize');
35
+ $resizeObject->setImage($name);
36
+ if ($resizeObject->resizeLimitwh($w, $h, $smallImgPath) === false) {
37
+ return $resizeObject->error();
38
+ } else {
39
+ return $smallImg;
40
+ }
41
+ } else {
42
+ return '';
43
+ }
44
+ }
45
+
46
+ protected function checkDir($directory) {
47
+ if (!is_dir($directory)) {
48
+ umask(0);
49
+ mkdir($directory, 0777,true);
50
+ return true;
51
+ }
52
+ }
53
+
54
+ }
app/code/community/Holbi/Qixol/Block/Bannerboxes.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Bannerboxes extends Mage_Core_Block_Template {
3
+
4
+ public function _prepareLayout() {
5
+ return parent::_prepareLayout();
6
+ }
7
+
8
+ public function getBannerboxes() {
9
+ if (!$this->hasData('bannerboxes')) {
10
+ $this->setData('bannerboxes', Mage::registry('bannerboxes'));
11
+ }
12
+ return $this->getData('bannerboxes');
13
+ }
14
+
15
+
16
+
17
+ }
app/code/community/Holbi/Qixol/Block/Customergrouspmap.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Customergrouspmap extends Mage_Core_Block_Template {
3
+
4
+ public function _prepareLayout() {
5
+ return parent::_prepareLayout();
6
+ }
7
+
8
+ public function getShippingmap() {
9
+ if (!$this->hasData('customergrouspmap')) {
10
+ $this->setData('customergrouspmap', Mage::registry('customergrouspmap'));
11
+ }
12
+ return $this->getData('customergrouspmap');
13
+ }
14
+
15
+
16
+
17
+ }
app/code/community/Holbi/Qixol/Block/Issuedcoupon.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Holbi_Qixol_Block_Issuedcoupon extends Mage_Customer_Block_Account_Dashboard // Mage_Core_Block_Template
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ }
10
+ }
app/code/community/Holbi/Qixol/Block/Sales/Creditmemo.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //????????????????
3
+ class Holbi_Qixol_Block_Adminhtml_Sales_Creditmemo extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
4
+ {
5
+ protected function _initTotals() {
6
+ parent::_initTotals();
7
+ $amt = $this->getSource()->getPointsAmount();
8
+ $baseAmt = $this->getSource()->getBasePointsAmount();
9
+ if ($amt != 0) {
10
+
11
+ $this->addTotal(new Varien_Object(array(
12
+ 'code' => 'points',
13
+ 'value' => $amt,
14
+ 'base_value' => $baseAmt,
15
+ 'label' => 'Rewards points discount',
16
+ )), 'points');
17
+ }
18
+ return $this;
19
+ }
20
+
21
+ }
app/code/community/Holbi/Qixol/Block/Sales/Invoice.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //????????????????
3
+ class Holbi_Qixol_Block_Adminhtml_Sales_Invoice extends Mage_Sales_Block_Order_Invoice_Totals
4
+ {
5
+ protected function _initTotals() {
6
+ parent::_initTotals();
7
+ $amt = $this->getSource()->getPointsAmount();
8
+ $baseAmt = $this->getSource()->getBasePointsAmount();
9
+ if ($amt != 0) {
10
+ $this->addTotal(new Varien_Object(array(
11
+ 'code' => 'points',
12
+ 'value' => $amt,
13
+ 'base_value' => $baseAmt,
14
+ 'label' => 'Reward Points Discount',
15
+ )), 'points');
16
+ }
17
+ return $this;
18
+ }
19
+
20
+ }
app/code/community/Holbi/Qixol/Block/Sales/Order.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //????????????????
3
+ class Holbi_Qixol_Block_Adminhtml_Sales_Order extends Mage_Sales_Block_Order_Totals
4
+ {
5
+ protected function _initTotals() {
6
+
7
+ parent::_initTotals();
8
+ $amt = $this->getSource()->getPointsAmount();
9
+ $baseAmt = $this->getSource()->getBasePointsAmount();
10
+ if ($amt != 0) {
11
+ $this->addTotal(new Varien_Object(array(
12
+ 'code' => 'points',
13
+ 'value' => $amt,
14
+ 'base_value' => $baseAmt,
15
+ 'label' => 'Reward points discount',
16
+ )), 'points');
17
+ }
18
+ return $this;
19
+ }
20
+ }
app/code/community/Holbi/Qixol/Block/Sales/Order/Total.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Sales_Order_Total extends Mage_Core_Block_Template
3
+ {
4
+ /**
5
+ * Get label cell tag properties
6
+ *
7
+ * @return string
8
+ */
9
+ public function getLabelProperties()
10
+ {
11
+ return $this->getParentBlock()->getLabelProperties();
12
+ }
13
+
14
+ /**
15
+ * Get order store object
16
+ *
17
+ * @return Mage_Sales_Model_Order
18
+ */
19
+ public function getOrder()
20
+ {
21
+ return $this->getParentBlock()->getOrder();
22
+ }
23
+
24
+ /**
25
+ * Get totals source object
26
+ *
27
+ * @return Mage_Sales_Model_Order
28
+ */
29
+ public function getSource()
30
+ {
31
+ return $this->getParentBlock()->getSource();
32
+ }
33
+
34
+ /**
35
+ * Get value cell tag properties
36
+ *
37
+ * @return string
38
+ */
39
+ public function getValueProperties()
40
+ {
41
+ return $this->getParentBlock()->getValueProperties();
42
+ }
43
+
44
+ /**
45
+ * Initialize reward points totals
46
+ *
47
+ */
48
+ public function initTotals()
49
+ {
50
+ if ((float) $this->getOrder()->getBasePointsAmount()) {
51
+ $source = $this->getSource();
52
+ $value = $source->getPointsAmount();
53
+
54
+ $this->getParentBlock()->addTotal(new Varien_Object(array(
55
+ 'code' => 'points',
56
+ 'strong' => false,
57
+ 'label' => 'Reward points discount',
58
+ 'value' => $source instanceof Mage_Sales_Model_Order_Creditmemo ? - $value : -$value
59
+ )));
60
+ }
61
+
62
+ return $this;
63
+ }
64
+ }
app/code/community/Holbi/Qixol/Block/Shippingmap.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Shippingmap extends Mage_Core_Block_Template {
3
+
4
+ public function _prepareLayout() {
5
+ return parent::_prepareLayout();
6
+ }
7
+
8
+ public function getShippingmap() {
9
+ if (!$this->hasData('shippingmap')) {
10
+ $this->setData('shippingmap', Mage::registry('shippingmap'));
11
+ }
12
+ return $this->getData('shippingmap');
13
+ }
14
+
15
+
16
+
17
+ }
app/code/community/Holbi/Qixol/Block/Startexportbutton.php ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Startexportbutton extends Mage_Adminhtml_Block_System_Config_Form_Field
3
+ {
4
+
5
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
6
+ {
7
+ $this->setElement($element);
8
+ $_hlp = Mage::helper('qixol');
9
+ $html = $this->AddJs();
10
+
11
+ $html .= '<div id="qixolexport_status_template" name="qixolexpor_status_template" style="display:none">';//none
12
+ $html .= $this->getStatusTemplateHtml();
13
+ $html .= '</div>';
14
+
15
+ $start_import_button = $this->getLayout()->createBlock('adminhtml/widget_button')
16
+ ->setType('button')
17
+ ->setClass('scalable')
18
+ ->setLabel('Export now')
19
+ ->setOnClick("start_product_export()")
20
+ ->toHtml();
21
+ $safe_mode_set = ini_get('safe_mode');
22
+ if($safe_mode_set){
23
+ $html .="<p class='sinch-error'><b>You can't start export (safe_mode is 'On'. set safe_mode = Off in php.ini )<b></p>";
24
+ } else {
25
+ $html .= $start_import_button;
26
+ }
27
+
28
+ $export=Mage::getModel('qixol/sinch');
29
+ $last_import=$export->getDataOfLatestExport();
30
+ $last_exp_status=$last_import['last_message'];
31
+ if($last_exp_status=='error'){
32
+ $html.='<div id="export_current_status_message" name="export_current_status_message" style="display:true"><br><br><hr/><p class="sinch-error">The export has failed.<br> Error reporting "'.$last_import['export_what'].'": "'.$last_import['status_export_message'].'"</p></div>';
33
+ }elseif($last_imp_status=='success'){
34
+ $html.='<div id="export_current_status_message" name="export_current_status_message" style="display:true"><br><br><hr/><p class="sinch-success">Data exported succesfully!</p></div>';
35
+ }elseif($last_imp_status=='process'){
36
+ $html.='<div id="export_current_status_message" name="export_current_status_message" style="display:true"><br><br><hr/><p>Export is running now</p></div>';
37
+ }else{
38
+ $html.='<div id="export_current_status_message" name="export_current_status_message" style="display:true"></div>';
39
+ }
40
+
41
+ return $html;
42
+ }
43
+
44
+ protected function getStatusTemplateHtml()
45
+ {
46
+ $_hlp = Mage::helper('qixol');
47
+ $run_pic=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/_run.gif";
48
+ $html="
49
+ <ul>
50
+ <li>
51
+ Start export
52
+ &nbsp
53
+ <span id='qixolexport_process'>
54
+ <img src='".$run_pic."'
55
+ alt='".$_hlp->__('product export run')."' />
56
+ </span>
57
+ </li>
58
+ <!--li>
59
+ Export finished
60
+ &nbsp
61
+ <span id='qixolexport_export_done'>
62
+ <img src='".$run_pic."'
63
+ alt='".$_hlp->__('Export finished')."' />
64
+ </span>
65
+ </li-->
66
+
67
+ </ul>
68
+ ";
69
+ return $html;
70
+ }
71
+
72
+ protected function AddJs()
73
+ {
74
+ $post_url=$this->getUrl('qixol_admin/ajax/ExportProduct');
75
+ $post_url_upd=$this->getUrl('qixol_admin/ajax/UpdateStatus');
76
+ $html = "
77
+ <script>
78
+ function start_product_export(){
79
+ set_run_icon();
80
+ status_data=document.getElementById('qixolexport_status_template');
81
+ curr_status_data=document.getElementById('export_current_status_message');
82
+ curr_status_data.style.display='none';
83
+ status_data.style.display='';
84
+ // status_data.innerHTML='';
85
+ sinch = new Sinch('$post_url','$post_url_upd');
86
+ sinch.startProductExport();
87
+
88
+ //
89
+ }
90
+ function set_run_icon(){
91
+ run_pic='<img src=\"".Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/_run.gif\""."/>';
92
+ document.getElementById('qixolexport_process').innerHTML=run_pic;
93
+ //document.getElementById('qixolexport_export_done').innerHTML=run_pic;
94
+
95
+
96
+
97
+ }
98
+
99
+ var Sinch = Class.create();
100
+ Sinch.prototype = {
101
+
102
+ initialize: function(postUrl, postUrlUpd) {
103
+ this.postUrl = postUrl;
104
+ this.postUrlUpd = postUrlUpd;
105
+ this.failureUrl = document.URL;
106
+ // unique user session ID
107
+ this.SID = null;
108
+ // object with event message data
109
+ this.objectMsg = null;
110
+ this.prevMsg = '';
111
+ // interval object
112
+ this.updateTimer = null;
113
+ // default shipping code. Display on errors
114
+
115
+ elem = 'checkoutSteps';
116
+ clickableEntity = '.head';
117
+
118
+ // overwrite Accordion class method
119
+ var headers = $$('#' + elem + ' .section ' + clickableEntity);
120
+ headers.each(function(header) {
121
+ Event.observe(header,'click',this.sectionClicked.bindAsEventListener(this));
122
+ }.bind(this));
123
+ },
124
+ startProductExport: function () {
125
+ _this = this;
126
+ new Ajax.Request(this.postUrl,
127
+ {
128
+ method:'post',
129
+ parameters: '',
130
+ requestTimeout: 10,
131
+ /*
132
+ onLoading:function(){
133
+ alert('onLoading');
134
+ },
135
+ onLoaded:function(){
136
+ alert('onLoaded');
137
+ },
138
+ */
139
+ onSuccess: function(transport) {
140
+ var response = transport.responseText || null;
141
+ _this.SID = response;
142
+ if (_this.SID) {
143
+ _this.updateTimer = setInterval(function(){_this.updateEvent();},4000);
144
+ $('session_id').value = _this.SID;
145
+ } else {
146
+ alert('Can not get your session ID. Please reload the page!');
147
+ }
148
+ },
149
+ onTimeout: function() { alert('Can not get your session ID. Timeout!'); },
150
+ onFailure: function() { alert('Something went wrong...') }
151
+ });
152
+
153
+ },
154
+
155
+ updateEvent: function () {
156
+ _this = this;
157
+ new Ajax.Request(this.postUrlUpd,
158
+ {
159
+ method: 'post',
160
+ parameters: {session_id: this.SID},
161
+ onSuccess: function(transport) {
162
+ _this.objectMsg = transport.responseText.evalJSON();
163
+ _this.prevMsg = _this.objectMsg.message;
164
+ if(_this.prevMsg!=''){
165
+ _this.updateStatusHtml();
166
+ }
167
+
168
+ if (_this.objectMsg.error == 1) {
169
+ // Do something on error
170
+ _this.clearUpdateInterval();
171
+ }
172
+
173
+ if (_this.objectMsg.finished == 1) {
174
+ _this.objectMsg.message='Import finished';
175
+ _this.updateStatusHtml();
176
+ _this.clearUpdateInterval();
177
+
178
+ }
179
+
180
+ },
181
+ onFailure: this.ajaxFailure.bind(),
182
+ });
183
+ },
184
+
185
+ updateStatusHtml: function(){
186
+ message=this.objectMsg.message.toLowerCase();
187
+ extendedmessage=this.objectMsg.extmessage.toLowerCase();
188
+ mess_id='qixolexport_'+message.replace(/\s+/g, '_');
189
+ if(!document.getElementById(mess_id)){
190
+ // alert(mess_id+' - not exist');
191
+ }
192
+ else{
193
+ //alert (mess_id+' - exist');
194
+ $(mess_id).innerHTML='<img src=\"".Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/_yes.gif"."\"/>'
195
+ if (mess_id=='qixolexport_export_done'){//if processed quicker
196
+ $('qixolexport_process').innerHTML='<img src=\"".Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/_yes.gif"."\"/>'
197
+ }
198
+ }
199
+ if (extendedmessage!='')
200
+ $('qixolexport_status_template').innerHTML=extendedmessage;
201
+ //$('qixolexport_status_template').innerHTML=htm+'<br>'+this.objectMsg.message;
202
+ },
203
+
204
+ ajaxFailure: function(){
205
+ this.clearUpdateInterval();
206
+ location.href = this.failureUrl;
207
+ },
208
+
209
+ clearUpdateInterval: function () {
210
+ clearInterval(this.updateTimer);
211
+ },
212
+
213
+
214
+ }
215
+ </script>
216
+ ";
217
+ return $html;
218
+ }
219
+ }
app/code/community/Holbi/Qixol/Block/Startimportbutton.php ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Startimportbutton extends Mage_Adminhtml_Block_System_Config_Form_Field
3
+ {
4
+
5
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
6
+ {
7
+ $this->setElement($element);
8
+ $_hlp = Mage::helper('qixol');
9
+ $html = $this->AddJs();
10
+
11
+ $html .= '<div id="qixolimport_status_template" name="qixolimport_status_template" style="display:none">';//none
12
+ $html .= $this->getStatusTemplateHtml();
13
+ $html .= '</div>';
14
+
15
+ $start_import_button = $this->getLayout()->createBlock('adminhtml/widget_button')
16
+ ->setType('button')
17
+ ->setClass('scalable')
18
+ ->setLabel('Import now')
19
+ ->setOnClick("start_promotion_import()")
20
+ ->toHtml();
21
+ $safe_mode_set = ini_get('safe_mode');
22
+ if($safe_mode_set){
23
+ $html .="<p class='sinch-error'><b>You can't start import (safe_mode is 'On'. set safe_mode = Off in php.ini )<b></p>";
24
+ } else {
25
+ $html .= $start_import_button;
26
+ }
27
+
28
+ $import=Mage::getModel('qixol/sinch');
29
+ $last_import=$import->getDataOfLatestExport();
30
+ $last_exp_status=$last_import['last_message'];
31
+ if($last_exp_status=='error'){
32
+ $html.='<div id="import_current_status_message" name="import_current_status_message" style="display:true"><br><br><hr/><p class="sinch-error">The import has failed.<br> Error reporting "'.$last_import['import_what'].'": "'.$last_import['status_import_message'].'"</p></div>';
33
+ }elseif($last_imp_status=='success'){
34
+ $html.='<div id="import_current_status_message" name="import_current_status_message" style="display:true"><br><br><hr/><p class="sinch-success">Data imported succesfully!</p></div>';
35
+ }elseif($last_imp_status=='process'){
36
+ $html.='<div id="import_current_status_message" name="import_current_status_message" style="display:true"><br><br><hr/><p>Export is running now</p></div>';
37
+ }else{
38
+ $html.='<div id="import_current_status_message" name="import_current_status_message" style="display:true"></div>';
39
+ }
40
+
41
+ return $html;
42
+ }
43
+
44
+ protected function getStatusTemplateHtml()
45
+ {
46
+ $_hlp = Mage::helper('qixol');
47
+ $run_pic=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/_run.gif";
48
+ $html="
49
+ <ul>
50
+ <li>
51
+ Start import
52
+ &nbsp
53
+ <span id='qixolimport_process'>
54
+ <img src='".$run_pic."'
55
+ alt='".$_hlp->__('promotion import run')."' />
56
+ </span>
57
+ </li>
58
+ <!--li>
59
+ Import finished
60
+ &nbsp
61
+ <span id='qixolimport_import_done'>
62
+ <img src='".$run_pic."'
63
+ alt='".$_hlp->__('Import finished')."' />
64
+ </span>
65
+ </li-->
66
+
67
+ </ul>
68
+ ";
69
+ return $html;
70
+ }
71
+
72
+ protected function AddJs()
73
+ {
74
+ $post_url=$this->getUrl('qixol_admin/ajax/ImportPromotion');
75
+ $post_url_upd=$this->getUrl('qixol_admin/ajax/UpdateImportStatus');
76
+ $html = "
77
+ <script>
78
+ function start_promotion_import(){
79
+ set_run_icon();
80
+ status_data=document.getElementById('qixolimport_status_template');
81
+ curr_status_data=document.getElementById('import_current_status_message');
82
+ curr_status_data.style.display='none';
83
+ status_data.style.display='';
84
+ // status_data.innerHTML='';
85
+ importpromo = new Import_promo('$post_url','$post_url_upd');
86
+ importpromo.startPromotionImport();
87
+
88
+ //
89
+ }
90
+ function set_run_icon(){
91
+ run_pic='<img src=\"".Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/_run.gif\""."/>';
92
+ document.getElementById('qixolimport_process').innerHTML=run_pic;
93
+ //document.getElementById('qixolimport_import_done').innerHTML=run_pic;
94
+
95
+
96
+
97
+ }
98
+
99
+ var Import_promo = Class.create();
100
+ Import_promo.prototype = {
101
+
102
+ initialize: function(postUrl, postUrlUpd) {
103
+ this.postUrl = postUrl;
104
+ this.postUrlUpd = postUrlUpd;
105
+ this.failureUrl = document.URL;
106
+ // unique user session ID
107
+ this.SID = null;
108
+ // object with event message data
109
+ this.objectMsg = null;
110
+ this.prevMsg = '';
111
+ // interval object
112
+ this.updateTimer = null;
113
+ // default shipping code. Display on errors
114
+
115
+ elem = 'checkoutSteps';
116
+ clickableEntity = '.head';
117
+
118
+ // overwrite Accordion class method
119
+ var headers = $$('#' + elem + ' .section ' + clickableEntity);
120
+ headers.each(function(header) {
121
+ Event.observe(header,'click',this.sectionClicked.bindAsEventListener(this));
122
+ }.bind(this));
123
+ },
124
+ startPromotionImport: function () {
125
+ _this = this;
126
+ new Ajax.Request(this.postUrl,
127
+ {
128
+ method:'post',
129
+ parameters: '',
130
+ requestTimeout: 10,
131
+ /*
132
+ onLoading:function(){
133
+ alert('onLoading');
134
+ },
135
+ onLoaded:function(){
136
+ alert('onLoaded');
137
+ },
138
+ */
139
+ onSuccess: function(transport) {
140
+ var response = transport.responseText || null;
141
+ _this.SID = response;
142
+ if (_this.SID) {
143
+ _this.updateTimer = setInterval(function(){_this.updateEvent();},2000);
144
+ $('session_id').value = _this.SID;
145
+ } else {
146
+ alert('Can not get your session ID. Please reload the page!');
147
+ }
148
+ },
149
+ onTimeout: function() { alert('Can not get your session ID. Timeout!'); },
150
+ onFailure: function() { alert('Something went wrong...') }
151
+ });
152
+
153
+ },
154
+
155
+ updateEvent: function () {
156
+ _this = this;
157
+ new Ajax.Request(this.postUrlUpd,
158
+ {
159
+ method: 'post',
160
+ parameters: {session_id: this.SID},
161
+ onSuccess: function(transport) {
162
+ _this.objectMsg = transport.responseText.evalJSON();
163
+ _this.prevMsg = _this.objectMsg.message;
164
+ if(_this.prevMsg!=''){
165
+ _this.updateStatusHtml();
166
+ }
167
+
168
+ if (_this.objectMsg.error == 1) {
169
+ // Do something on error
170
+ _this.clearUpdateInterval();
171
+ }
172
+
173
+ if (_this.objectMsg.finished == 1) {
174
+ _this.objectMsg.message='Import finished';
175
+ _this.updateStatusHtml();
176
+ _this.clearUpdateInterval();
177
+
178
+ }
179
+
180
+ },
181
+ onFailure: this.ajaxFailure.bind(),
182
+ });
183
+ },
184
+
185
+ updateStatusHtml: function(){
186
+ message=this.objectMsg.message.toLowerCase();
187
+ extendedmessage=this.objectMsg.extmessage.toLowerCase();
188
+ mess_id='qixolimport_'+message.replace(/\s+/g, '_');
189
+ if(!document.getElementById(mess_id)){
190
+ // alert(mess_id+' - not exist');
191
+ }
192
+ else{
193
+ //alert (mess_id+' - exist');
194
+ $(mess_id).innerHTML='<img src=\"".Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/_yes.gif"."\"/>'
195
+ if (mess_id=='qixolimport_import_done'){//if processed quicker
196
+ $('qixolimport_process').innerHTML='<img src=\"".Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/_yes.gif"."\"/>'
197
+ }
198
+ }
199
+ if (extendedmessage!='')
200
+ $('qixolimport_status_template').innerHTML=extendedmessage;
201
+ //$('qixolimport_status_template').innerHTML=htm+'<br>'+this.objectMsg.message;
202
+ },
203
+
204
+ ajaxFailure: function(){
205
+ this.clearUpdateInterval();
206
+ location.href = this.failureUrl;
207
+ },
208
+
209
+ clearUpdateInterval: function () {
210
+ clearInterval(this.updateTimer);
211
+ },
212
+
213
+
214
+ }
215
+ </script>
216
+ ";
217
+ return $html;
218
+ }
219
+ }
app/code/community/Holbi/Qixol/Block/Sticker.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Sticker extends Mage_Core_Block_Template {
3
+
4
+ public function _prepareLayout() {
5
+ return parent::_prepareLayout();
6
+ }
7
+
8
+ public function getSticker() {
9
+ if (!$this->hasData('sticker')) {
10
+ $this->setData('sticker', Mage::registry('sticker'));
11
+ }
12
+ return $this->getData('sticker');
13
+ }
14
+
15
+ public function getResizeImage($bannerPath, $groupName, $w = 0, $h = 0) {
16
+ $name = '';
17
+ $_helper = Mage::helper('qixol');
18
+ $bannerDirPath = $_helper->updateDirSepereator($bannerPath);
19
+ $baseDir = Mage::getBaseDir();
20
+ $mediaDir = Mage::getBaseDir('media');
21
+ $mediaUrl = Mage::getBaseUrl('media');
22
+ $resizeDir = $mediaDir . DS . 'custom' . DS . 'stickers' . DS . 'resize' . DS;
23
+ $resizeUrl = $mediaUrl.'custom/stickers/resize/';
24
+ $imageName = basename($bannerDirPath);
25
+
26
+ if (@file_exists($mediaDir . DS . $bannerDirPath)) {
27
+ $name = $mediaDir . DS . $bannerPath;
28
+ $this->checkDir($resizeDir . $groupName);
29
+ $smallImgPath = $resizeDir . $groupName . DS . $imageName;
30
+ $smallImg = $resizeUrl . $groupName .'/'. $imageName;
31
+ }
32
+
33
+ if ($name != '') {
34
+ $resizeObject = Mage::getModel('qixol/stickerresize');
35
+ $resizeObject->setImage($name);
36
+ if ($resizeObject->resizeLimitwh($w, $h, $smallImgPath) === false) {
37
+ return $resizeObject->error();
38
+ } else {
39
+ return $smallImg;
40
+ }
41
+ } else {
42
+ return '';
43
+ }
44
+ }
45
+
46
+ protected function checkDir($directory) {
47
+ if (!is_dir($directory)) {
48
+ umask(0);
49
+ mkdir($directory, 0777,true);
50
+ return true;
51
+ }
52
+ }
53
+
54
+ }
app/code/community/Holbi/Qixol/Block/Storesmap.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Block_Storesmap extends Mage_Core_Block_Template {
3
+
4
+ public function _prepareLayout() {
5
+ return parent::_prepareLayout();
6
+ }
7
+
8
+ public function getShippingmap() {
9
+ if (!$this->hasData('storesmap')) {
10
+ $this->setData('storesmap', Mage::registry('storesmap'));
11
+ }
12
+ return $this->getData('storesmap');
13
+ }
14
+
15
+
16
+
17
+ }
app/code/community/Holbi/Qixol/Helper/Data.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+
6
+ protected static $egridImgDir = null;
7
+ protected static $egridImgURL = null;
8
+ protected static $egridImgThumb = null;
9
+ protected static $egridImgThumbWidth = null;
10
+ protected $_allowedExtensions = Array();
11
+
12
+ public function __construct() {
13
+ self::$egridImgDir = Mage::getBaseDir('media') . DS;
14
+ self::$egridImgURL = Mage::getBaseUrl('media');
15
+ self::$egridImgThumb = "thumb/";
16
+ self::$egridImgThumbWidth = 100;
17
+ }
18
+
19
+ public function updateDirSepereator($path){
20
+ return str_replace('\\', DS, $path);
21
+ }
22
+
23
+ public function getImageUrl($image_file) {
24
+ $url = false;
25
+ if (file_exists(self::$egridImgDir . self::$egridImgThumb . $this->updateDirSepereator($image_file)))
26
+ $url = self::$egridImgURL . self::$egridImgThumb . $image_file;
27
+ else
28
+ $url = self::$egridImgURL . $image_file;
29
+ return $url;
30
+ }
31
+
32
+ public function getFileExists($image_file) {
33
+ $file_exists = false;
34
+ $file_exists = file_exists(self::$egridImgDir . $this->updateDirSepereator($image_file));
35
+ return $file_exists;
36
+ }
37
+
38
+ public function getImageThumbSize($image_file) {
39
+ $img_file = $this->updateDirSepereator(self::$egridImgDir . $image_file);
40
+ if ($image_file == '' || !file_exists($img_file))
41
+ return false;
42
+ list($width, $height, $type, $attr) = getimagesize($img_file);
43
+ $a_height = (int) ((self::$egridImgThumbWidth / $width) * $height);
44
+ return Array('width' => self::$egridImgThumbWidth, 'height' => $a_height);
45
+ }
46
+
47
+ function deleteFiles($image_file) {
48
+ $pass = true;
49
+ if (!unlink(self::$egridImgDir . $image_file))
50
+ $pass = false;
51
+ if (!unlink(self::$egridImgDir . self::$egridImgThumb . $image_file))
52
+ $pass = false;
53
+ return $pass;
54
+ }
55
+
56
+ /*public function getUniverseList() {
57
+ echo '<pre>';
58
+ var_dump('1111');
59
+ echo '</pre>';
60
+ die();
61
+ }*/
62
+ }
63
+
app/code/community/Holbi/Qixol/Model/Advert.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Advert extends Mage_Core_Model_Abstract {
3
+ function __construct(){
4
+
5
+ }
6
+ function isSticked($product,$type=''){
7
+ $image=false;
8
+ $products_has_promotion_image=Mage::getResourceSingleton('qixol/sticker');
9
+ $product_stick_images=$products_has_promotion_image->getStickerImage($product,$type);
10
+
11
+ if (is_array($product_stick_images)&&count($product_stick_images)==1) { //if 1 sticker
12
+ $image=$product_stick_images[0]['filename'];
13
+ if (($image!==false)&&strlen($image)>5)
14
+ $image=Mage::getBaseUrl('media').$image;
15
+ return $image;
16
+ }elseif(is_array($product_stick_images)&&count($product_stick_images)>1){
17
+ foreach ($product_stick_images as $image_array){
18
+ if (($image_array['filename']!==false)&&strlen($image_array['filename'])>5){
19
+ $image[]=Mage::getBaseUrl('media').$image_array['filename'];
20
+ }
21
+ }
22
+ return $image;
23
+ }
24
+ return $image;
25
+ }
26
+
27
+ function getCategoryTopAdv($_productCollection){
28
+ //replace with promotion text
29
+
30
+ $text_to_return='';
31
+
32
+ $advertisment=Mage::getResourceSingleton('qixol/banner');
33
+ $adv_array=$advertisment->getCategoryTopAdv($_productCollection);
34
+ if ($adv_array!==false&&count($adv_array)){
35
+ foreach($adv_array as $advert){
36
+ if ($advert['filename']!=''&&strlen($advert['filename'])>5){
37
+ $text_to_return.="<div>".(trim($advert['url'])!=''?"<a href='".$advert['url']."'>":"")."<img title='".$advert['promotion_text']."' src='".Mage::getBaseUrl('media').$advert['filename']."'>".(trim($advert['url'])!=''?"</a>":"")."</div>";
38
+ }else
39
+ $text_to_return.="<div>".(trim($advert['url'])!=''?"<a href='".$advert['url']."'>":"").$advert['promotion_text'].(trim($advert['url'])!=''?"</a>":"")."</div>";
40
+ }
41
+ }
42
+
43
+ return $text_to_return!=''?/*"<div><ul>".*/$text_to_return/*."</ul></div>"*/:"";
44
+ }
45
+
46
+ function getProductBottmAdv($product){
47
+ //replace with promotion text
48
+ $text_to_return='';
49
+
50
+ $products_has_promotion=Mage::getResourceSingleton('qixol/banner');
51
+ $product_data=$products_has_promotion->getProductTextAdv($product,'Bottom');
52
+ if ($product_data!==false&&count($product_data)){
53
+ foreach($product_data as $advert){
54
+ if ($advert['filename']!=''&&strlen($advert['filename'])>5){
55
+ $text_to_return.="<div>".(trim($advert['url'])!=''?"<a href='".$advert['url']."'>":"")."<img title='".$advert['promotion_text']."' src='".Mage::getBaseUrl('media').$advert['filename']."'>".(trim($advert['url'])!=''?"</a>":"")."</div>";
56
+ }else
57
+ $text_to_return.="<div>".(trim($advert['url'])!=''?"<a href='".$advert['url']."'>":"").$advert['promotion_text'].(trim($advert['url'])!=''?"</a>":"")."</div>";
58
+ }
59
+ }
60
+ return $text_to_return!=''?/*"<div><ul>".*/$text_to_return/*."</ul></div>"*/:"";
61
+
62
+ }
63
+
64
+ function getProductInfoTopAdv($product){
65
+
66
+ $text_to_return='';
67
+
68
+ $products_has_promotion=Mage::getResourceSingleton('qixol/banner');
69
+ $product_data=$products_has_promotion->getProductTextAdv($product,'Top');
70
+ if ($product_data!==false&&count($product_data)){
71
+ foreach($product_data as $advert){
72
+ if ($advert['filename']!=''&&strlen($advert['filename'])>5){
73
+ $text_to_return.="<div>".(trim($advert['url'])!=''?"<a href='".$advert['url']."'>":"")."<img title='".$advert['promotion_text']."' src='".Mage::getBaseUrl('media').$advert['filename']."'>".(trim($advert['url'])!=''?"</a>":"")."</div>";
74
+ }else
75
+ $text_to_return.="<div>".(trim($advert['url'])!=''?"<a href='".$advert['url']."'>":"").$advert['promotion_text'].(trim($advert['url'])!=''?"</a>":"")."</div>";
76
+ }
77
+ }
78
+ return $text_to_return!=''?/*"<div><ul>".*/$text_to_return/*."</ul></div>"*/:"";
79
+
80
+ }
81
+
82
+ function getProductInlineAdv($product){
83
+
84
+ $text_to_return='';
85
+
86
+ $products_has_promotion=Mage::getResourceSingleton('qixol/banner');
87
+ $product_data=$products_has_promotion->getProductTextAdv($product,'Inline');
88
+ if ($product_data!==false&&count($product_data)){
89
+ foreach($product_data as $advert){
90
+ if ($advert['filename']!=''&&strlen($advert['filename'])>5){
91
+ $text_to_return.="<div>".(trim($advert['url'])!=''?"<a href='".$advert['url']."'>":"")."<img title='".$advert['promotion_text']."' src='".Mage::getBaseUrl('media').$advert['filename']."'>".(trim($advert['url'])!=''?"</a>":"")."</div>";
92
+ }else
93
+ $text_to_return.="<div>".(trim($advert['url'])!=''?"<a href='".$advert['url']."'>":"").$advert['promotion_text'].(trim($advert['url'])!=''?"</a>":"")."</div>";
94
+ }
95
+ }
96
+ return $text_to_return!=''?/*"<div><ul>".*/$text_to_return/*."</ul></div>"*/:"";
97
+ }
98
+
99
+ function getCartInlineAdv(){
100
+ $cart_promotion=Mage::getResourceSingleton('qixol/banner');
101
+
102
+ $promotion_data=$cart_promotion->getCartInlineAdv();
103
+ if ($promotion_data!==false&&count($promotion_data)){
104
+ foreach($promotion_data as $advert){
105
+ if ($advert['filename']!=''&&strlen($advert['filename'])>5){
106
+ $text_to_return.="<div>".(trim($advert['url'])!=''?"<a href='".$advert['url']."'>":"")."<img title='".$advert['promotion_text']."' src='".Mage::getBaseUrl('media').$advert['filename']."'>".(trim($advert['url'])!=''?"</a>":"")."</div>";
107
+ }else
108
+ $text_to_return.="<div>".(trim($advert['url'])!=''?"<a href='".$advert['url']."'>":"").$advert['promotion_text'].(trim($advert['url'])!=''?"</a>":"")."</div>";
109
+ }
110
+ }
111
+ return $text_to_return!=''?/*"<div><ul>".*/$text_to_return/*."</ul></div>"*/:"";
112
+ }
113
+
114
+ function getAllProductAdv($product){
115
+
116
+ $text_to_return='';
117
+
118
+ $products_has_promotion=Mage::getResourceSingleton('qixol/banner');
119
+ $product_data=$products_has_promotion->getAllProductTextAdv($product);
120
+ if ($product_data!==false&&count($product_data)){
121
+ //$text_to_return.="";
122
+ //$text_to_return.="";
123
+ foreach($product_data as $advert) {
124
+ $text_to_return.="<tr><td>".(trim($advert['url'])!=''?"<a href='".$advert['url']."'>":"").$advert['promotion_text'].(trim($advert['url'])!=''?"</a>":"")."</td><td style='width:100px;'>".(($advert['discountpercent']>0||$advert['discountamount']>0)?($advert['discountpercent']>0?$advert['discountpercent']."%":$advert['discountamount'])." Off":"&nbsp;")."</td></tr>";
125
+ }
126
+ //$text_to_return.="";
127
+ }
128
+ return $text_to_return!=''?/*"<div><ul>".*/$text_to_return/*."</ul></div>"*/:"";
129
+ }
130
+ }
app/code/community/Holbi/Qixol/Model/Banner.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Banner extends Mage_Core_Model_Abstract {
3
+
4
+ public function _construct() {
5
+ parent::_construct();
6
+ $this->_init('qixol/banner');
7
+ }
8
+
9
+ public function load($id){
10
+ parent::load($id);
11
+ $this->getBannerImages();
12
+ return $this;
13
+ }
14
+ public function save(){
15
+ $banner_images=array();
16
+
17
+ if ($this->_data['banner_images']){
18
+ $banner_images=$this->_data['banner_images'];
19
+ unset($this->_data['banner_images']);
20
+ }
21
+ parent::save();
22
+ if ($this->getBannerId()>0){
23
+ $this->setSaveBannerImages($banner_images);
24
+ }
25
+ }
26
+ public function getAllAvailBannerIds(){
27
+ $collection = Mage::getResourceModel('qixol/banner_collection')
28
+ ->getAllIds();
29
+ return $collection;
30
+ }
31
+
32
+ public function getAllBanners() {
33
+ $collection = Mage::getResourceModel('qixol/banner_collection');
34
+ $collection->getSelect()->where('status = ?', 1);
35
+ $data = array();
36
+ foreach ($collection as $record) {
37
+ $data[$record->getId()] = array('value' => $record->getId(), 'label' => $record->getfilename());
38
+ }
39
+ return $data;
40
+ }
41
+
42
+ public function getDataByBannerIds($bannerIds) {
43
+ $data = array();
44
+ if ($bannerIds != '') {
45
+ $collection = Mage::getResourceModel('qixol/banner_collection');
46
+ $collection->getSelect()->where('banner_id IN (' . $bannerIds . ')')->order('sort_order');
47
+ foreach ($collection as $record) {
48
+ $status = $record->getStatus();
49
+ if ($status == 1) {
50
+ $data[] = $record;
51
+ }
52
+ }
53
+ }
54
+ return $data;
55
+ }
56
+
57
+ public function getBannerImages($bannerid=0) {
58
+ if ($bannerid==0) $bannerid=$this->getBannerId();
59
+ $banner_images = Mage::getResourceModel('qixol/banner')->getBannerImages($bannerid);
60
+ $parced_images=Array();
61
+ if (is_array($banner_images))
62
+ foreach ($banner_images as $banner_image){
63
+ $parced_images[]=$banner_image['banner_image_id'];
64
+ }
65
+ $this->setBannerImages($parced_images);
66
+ }
67
+
68
+ public function setSaveBannerImages($banner_images) {
69
+ Mage::getResourceModel('qixol/banner')->setBannerImages($this->getbannerId(),$banner_images);
70
+ }
71
+ }
app/code/community/Holbi/Qixol/Model/Bannerboxes.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Bannerboxes extends Mage_Core_Model_Abstract {
3
+
4
+ public function _construct() {
5
+ parent::_construct();
6
+ $this->_init('qixol/bannerboxes', "banner_box_type");
7
+ }
8
+
9
+ public function getOptionArray(){
10
+ $hlp = Mage::helper('qixol');
11
+ $collections=$this->getCollection();
12
+ $list_return=array();
13
+ foreach ($collections as $banner_box){
14
+ if (strpos((string)$banner_box->getBannerBoxType(),'STICKER')===false)
15
+ $list_return[]=array(
16
+ 'value' => (string)$banner_box->getBannerBoxType(),
17
+ 'label' => $hlp->__((string)$banner_box->getBannerBoxType())
18
+ );
19
+ }
20
+ return $list_return;
21
+ }
22
+
23
+ public function getStickerOptionArray(){
24
+ $hlp = Mage::helper('qixol');
25
+ $collections=$this->getCollection();
26
+ $list_return=array();
27
+ foreach ($collections as $banner_box){
28
+ if (strpos((string)$banner_box->getBannerBoxType(),'STICKER')!==false)
29
+ $list_return[]=array(
30
+ 'value' => (string)$banner_box->getBannerBoxType(),
31
+ 'label' => $hlp->__((string)$banner_box->getBannerBoxType())
32
+ );
33
+ }
34
+ return $list_return;
35
+ }
36
+ }
app/code/community/Holbi/Qixol/Model/Bannerimages.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Holbi_Qixol_Model_Bannerimages extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct(){
6
+
7
+ $this->_init("qixol/bannerimages",'banner_image_id');
8
+
9
+ }
10
+
11
+ public function getOptionArray(){
12
+ $hlp = Mage::helper('qixol');
13
+ $collections=$this->getCollection();
14
+ $list_return=array();
15
+ foreach ($collections as $banner_image){
16
+ $list_return[]=array(
17
+ 'value' => (string)$banner_image->getBannerImageId(),
18
+ 'label' => $hlp->__((string)$banner_image->getFilename())
19
+ );
20
+ }
21
+ return $list_return;
22
+ }
23
+
24
+ }
25
+
app/code/community/Holbi/Qixol/Model/Bannerresize.php ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ define("HOLBI_AUTO_NAME", 1);
3
+
4
+ class Holbi_Qixol_Model_Bannerresize {
5
+
6
+ var $imgFile = "";
7
+ var $imgWidth = 0;
8
+ var $imgHeight = 0;
9
+ var $imgType = "";
10
+ var $imgAttr = "";
11
+ var $type = NULL;
12
+ var $_img = NULL;
13
+ var $_error = "";
14
+
15
+ /**
16
+ * Constructor
17
+ *
18
+ * @param [String $imgFile] Image File Name
19
+ * @return RESIZEIMAGE (Class Object)
20
+ */
21
+ function Holbi_Banner_Model_Bannerresize($imgFile="") {
22
+ if (!function_exists("imagecreate")) {
23
+ $this->_error = "Error: GD Library is not available.";
24
+ return false;
25
+ }
26
+
27
+ $this->type = Array(1 => 'GIF', 2 => 'JPG', 3 => 'PNG', 4 => 'SWF', 5 => 'PSD', 6 => 'BMP', 7 => 'TIFF', 8 => 'TIFF', 9 => 'JPC', 10 => 'JP2', 11 => 'JPX', 12 => 'JB2', 13 => 'SWC', 14 => 'IFF', 15 => 'WBMP', 16 => 'XBM');
28
+ if (!empty($imgFile))
29
+ $this->setImage($imgFile);
30
+ }
31
+
32
+ /**
33
+ * Error occured while resizing the image.
34
+ *
35
+ * @return String
36
+ */
37
+ function error() {
38
+ return $this->_error;
39
+ }
40
+
41
+ /**
42
+ * Set image file name
43
+ *
44
+ * @param String $imgFile
45
+ * @return void
46
+ */
47
+ function setImage($imgFile) {
48
+ $this->imgFile = $imgFile;
49
+ return $this->_createImage();
50
+ }
51
+
52
+ /**
53
+ *
54
+ * @return void
55
+ */
56
+ function close() {
57
+ return @imagedestroy($this->_img);
58
+ }
59
+
60
+ /**
61
+ * Resize a image to given width and height and keep it's current width and height ratio
62
+ *
63
+ * @param Number $imgwidth
64
+ * @param Numnber $imgheight
65
+ * @param String $newfile
66
+ */
67
+ function resizeLimitwh($imgwidth, $imgheight, $newfile=NULL) {
68
+ $image_per = 100;
69
+ list($width, $height, $type, $attr) = @getimagesize($this->imgFile);
70
+ if ($width > $imgwidth && $imgwidth > 0)
71
+ $image_per = (double) (($imgwidth * 100) / $width);
72
+
73
+ if (floor(($height * $image_per) / 100) > $imgheight && $imgheight > 0)
74
+ $image_per = (double) (($imgheight * 100) / $height);
75
+
76
+ $this->resizePercentage($image_per, $newfile);
77
+ }
78
+
79
+ /**
80
+ * Resize an image to given percentage.
81
+ *
82
+ * @param Number $percent
83
+ * @param String $newfile
84
+ * @return Boolean
85
+ */
86
+ function resizePercentage($percent=100, $newfile=NULL) {
87
+ $newWidth = ($this->imgWidth * $percent) / 100;
88
+ $newHeight = ($this->imgHeight * $percent) / 100;
89
+ return $this->resize($newWidth, $newHeight, $newfile);
90
+ }
91
+
92
+ /**
93
+ * Resize an image to given X and Y percentage.
94
+ *
95
+ * @param Number $xpercent
96
+ * @param Number $ypercent
97
+ * @param String $newfile
98
+ * @return Boolean
99
+ */
100
+ function resizeXYpercentage($xpercent=100, $ypercent=100, $newfile=NULL) {
101
+ $newWidth = ($this->imgWidth * $xpercent) / 100;
102
+ $newHeight = ($this->imgHeight * $ypercent) / 100;
103
+ return $this->resize($newWidth, $newHeight, $newfile);
104
+ }
105
+
106
+ /**
107
+ * Resize an image to given width and height
108
+ *
109
+ * @param Number $width
110
+ * @param Number $height
111
+ * @param String $newfile
112
+ * @return Boolean
113
+ */
114
+ function resize($width, $height, $newfile=NULL) {
115
+ if (empty($this->imgFile)) {
116
+ $this->_error = "File name is not initialised.";
117
+ return false;
118
+ }
119
+ if ($this->imgWidth <= 0 || $this->imgHeight <= 0) {
120
+ $this->_error = "Could not resize given image";
121
+ return false;
122
+ }
123
+ if ($width <= 0)
124
+ $width = $this->imgWidth;
125
+ if ($height <= 0)
126
+ $height = $this->imgHeight;
127
+ return $this->_resize($width, $height, $newfile);
128
+ }
129
+
130
+ /**
131
+ * Get the image attributes
132
+ * @access Private
133
+ *
134
+ */
135
+ function _getImageInfo() {
136
+ @list($this->imgWidth, $this->imgHeight, $type, $this->imgAttr) = @getimagesize($this->imgFile);
137
+ $this->imgType = $this->type[$type];
138
+ }
139
+
140
+ /**
141
+ * Create the image resource
142
+ * @access Private
143
+ * @return Boolean
144
+ */
145
+ function _createImage() {
146
+ $this->_getImageInfo($this->imgFile);
147
+ if ($this->imgType == 'GIF') {
148
+ $this->_img = @imagecreatefromgif($this->imgFile);
149
+ } elseif ($this->imgType == 'JPG') {
150
+ $this->_img = @imagecreatefromjpeg($this->imgFile);
151
+ } elseif ($this->imgType == 'PNG') {
152
+ $this->_img = @imagecreatefrompng($this->imgFile);
153
+ }
154
+ if (!$this->_img || !@is_resource($this->_img)) {
155
+ $this->_error = "Error loading " . $this->imgFile;
156
+ return false;
157
+ }
158
+ return true;
159
+ }
160
+
161
+ /**
162
+ * Function is used to resize the image
163
+ *
164
+ * @access Private
165
+ * @param Number $width
166
+ * @param Number $height
167
+ * @param String $newfile
168
+ * @return Boolean
169
+ */
170
+ function _resize($width, $height, $newfile=NULL) {
171
+ if (!function_exists("imagecreate")) {
172
+ $this->_error = "Error: GD Library is not available.";
173
+ return false;
174
+ }
175
+
176
+ $newimg = @imagecreatetruecolor($width, $height);
177
+ //imagecolortransparent( $newimg, imagecolorat( $newimg, 0, 0 ) );
178
+
179
+ if ($this->imgType == 'GIF' || $this->imgType == 'PNG') {
180
+ /** Code to keep transparency of image * */
181
+ $colorcount = imagecolorstotal($this->_img);
182
+ if ($colorcount == 0)
183
+ $colorcount = 256;
184
+ imagetruecolortopalette($newimg, true, $colorcount);
185
+ imagepalettecopy($newimg, $this->_img);
186
+ $transparentcolor = imagecolortransparent($this->_img);
187
+ imagefill($newimg, 0, 0, $transparentcolor);
188
+ imagecolortransparent($newimg, $transparentcolor);
189
+ }
190
+
191
+ @imagecopyresampled($newimg, $this->_img, 0, 0, 0, 0, $width, $height, $this->imgWidth, $this->imgHeight);
192
+
193
+
194
+
195
+ if ($newfile === HOLBI_AUTO_NAME) {
196
+ if (@preg_match("/\..*+$/", @basename($this->imgFile), $matches))
197
+ $newfile = @substr_replace($this->imgFile, "_har", -@strlen($matches[0]), 0);
198
+ }
199
+ elseif (!empty($newfile)) {
200
+ if (!@preg_match("/\..*+$/", @basename($newfile))) {
201
+ if (@preg_match("/\..*+$/", @basename($this->imgFile), $matches))
202
+ $newfile = $newfile . $matches[0];
203
+ }
204
+ }
205
+ if ($this->imgType == 'GIF') {
206
+ if (!empty($newfile))
207
+ @imagegif($newimg, $newfile);
208
+ else {
209
+ @header("Content-type: image/gif");
210
+ @imagegif($newimg);
211
+ }
212
+ } elseif ($this->imgType == 'JPG') {
213
+ if (!empty($newfile)) {
214
+ @imagejpeg($newimg, $newfile);
215
+ } else {
216
+ @header("Content-type: image/jpeg");
217
+ @imagejpeg($newimg);
218
+ }
219
+ } elseif ($this->imgType == 'PNG') {
220
+ if (!empty($newfile))
221
+ @imagepng($newimg, $newfile);
222
+ else {
223
+ @header("Content-type: image/png");
224
+ @imagepng($newimg);
225
+ }
226
+ }
227
+ @imagedestroy($newimg);
228
+ }
229
+
230
+ }
231
+
232
+ ?>
app/code/community/Holbi/Qixol/Model/Bonuspoints.php ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Bonuspoints extends Mage_Core_Model_Abstract
3
+ {
4
+ protected $customerId = -1;
5
+ protected $storeId = -1;
6
+ protected $currentPoints = NULL;
7
+ protected $earnedPoints = NULL;
8
+ protected $spentPoints = NULL;
9
+
10
+ public function _construct()
11
+ {
12
+ parent::_construct();
13
+ $this->_init('qixol/bonuspoints','points_account_id');
14
+ }
15
+
16
+
17
+
18
+ public function save() {
19
+ $connection = Mage::getSingleton('core/resource')->getConnection('bonuspoints_write');
20
+
21
+ $connection->beginTransaction();
22
+ $fields = array();
23
+ $fields['customer_id'] = $this->customerId;
24
+ $fields['store_id'] = (int)$this->storeId;
25
+ $fields['current_points'] = (int)$this->currentPoints;
26
+ $fields['earned_points'] = (int)$this->earnedPoints;
27
+ $fields['spent_points'] = (int)$this->spentPoints;
28
+
29
+
30
+ try {
31
+ $this->_beforeSave();
32
+ if (!is_null($this->pointsAccountId)) {
33
+
34
+
35
+ $where = $connection->quoteInto('customer_id=?',$fields['customer_id']);
36
+ $connection->update('qixol_cutomer_points', $fields, $where);
37
+ }
38
+ else {
39
+ $connection->insert('qixol_cutomer_points', $fields);
40
+ //$this->rewardpointsAccountId =$connection->lastInsertId('rewardpoints_account');
41
+ //$this->rewardpointsAccountId =2;
42
+ }
43
+ $connection->commit();
44
+ $this->_afterSave();
45
+ }
46
+ catch (Exception $e) {
47
+ $connection->rollBack();
48
+ throw $e;
49
+ }
50
+ return $this;
51
+ }
52
+
53
+ public function load($id , $field=null) {
54
+ if ($field === null) {
55
+ $field = 'customer_id';
56
+ }
57
+ $connection = Mage::getSingleton('core/resource')->getConnection('bonuspoints_read');
58
+ $select = $connection->select()->from('qixol_cutomer_points')->where('qixol_cutomer_points.'.$field.'=?', $id);
59
+ $data = $connection->fetchRow($select);
60
+ if (!$data) {
61
+ return $this;
62
+ }
63
+ $this->setPointsAccountId($data['points_account_id']);
64
+ $this->setCustomerId($data['customer_id']);
65
+ $this->setStoreId($data['store_id']);
66
+ $this->setCurrentPoints($data['current_points']);
67
+ $this->setEarnedPoints($data['earned_points']);
68
+ $this->setSpentPoints($data['spent_points']);
69
+ $this->_afterLoad();
70
+ return $this;
71
+ }
72
+
73
+
74
+ public function addPoints($p, $customerId) {
75
+ $collpoint = Mage::getModel('qixol/bonuspoints')->load($customerId);
76
+ if($collpoint){
77
+ $currentPoints = $collpoint->getCurrentPoints();
78
+ $earnedPoints = $collpoint->getEarnedPoints();
79
+ $spentPoints = $collpoint->getSpentPoints();
80
+ }
81
+ else{
82
+ $spentPoints = 0;
83
+ $currentPoints = 0;
84
+ $earnedPoints = 0;
85
+ }
86
+ $storeId = Mage::app()->getStore()->getStoreId();;
87
+ Mage::log('add points $p: '. $p);
88
+ $this->currentPoints = $currentPoints + $p;
89
+ $this->earnedPoints = $earnedPoints + $p;
90
+ $this->spentPoints = $spentPoints;
91
+ $this->customerId = $customerId;
92
+ $this->storeId = $storeId;
93
+ }
94
+
95
+ public function subtractPoints($p, $customerId) {
96
+ $collpoint = Mage::getModel('qixol/bonuspoints')->load($customerId);
97
+ if($collpoint){
98
+ $currentPoints = $collpoint->getCurrentPoints();
99
+ $earnedPoints = $collpoint->getEarnedPoints();
100
+ $spentPoints = $collpoint->getSpentPoints();
101
+ }
102
+ else{
103
+ $spentPoints = 0;
104
+ $currentPoints = 0;
105
+ $earnedPoints = 0;
106
+ }
107
+ $storeId = Mage::app()->getStore()->getStoreId();;
108
+ Mage::log('substract points $p: '. $p);
109
+ $this->currentPoints = $currentPoints - $p;
110
+ $this->spentPoints = $spentPoints + $p;
111
+ $this->customerId = $customerId;
112
+ $this->earnedPoints = $earnedPoints;
113
+ $this->storeId = $storeId;
114
+ }
115
+
116
+
117
+ }
app/code/community/Holbi/Qixol/Model/Creditmemopoints.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Creditmemopoints extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract {
3
+
4
+ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo) {
5
+
6
+ echo "call Holbi_Qixol_Model_Creditmemopoints";
7
+ die();
8
+ $creditmemo->setGrandTotal($creditmemo->getGrandTotal() - $creditmemo->getPointsAmount());
9
+ $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() - $creditmemo->getBasePointsAmount());
10
+ /*
11
+ // ???????????????????
12
+ $creditmemo->setPointsAmount($creditmemo->getPointsAmount());
13
+ $creditmemo->setBasePointsAmount($creditmemo->getBasePointsAmount());
14
+ */
15
+ return $this;
16
+ }
17
+
18
+ }
app/code/community/Holbi/Qixol/Model/Cron.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Cron{
3
+ public function runExportSynch(){
4
+ $export=Mage::getModel('qixol/sinch');
5
+ //process export here
6
+ //export to qixol
7
+ $export->cron_run_export();
8
+ }
9
+
10
+ public function runImportProductPromotionSynch(){
11
+ $export=Mage::getModel('qixol/sinch');
12
+ //process export here
13
+ //export products
14
+ $export->cron_run_import_promo();
15
+ }
16
+ }
app/code/community/Holbi/Qixol/Model/Customergrouspmap.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Customergrouspmap extends Mage_Core_Model_Abstract {
3
+
4
+ public function _construct() {
5
+ parent::_construct();
6
+ $this->_init('qixol/customergrouspmap', "customer_group_name");
7
+ }
8
+
9
+ public function getOptionArray(){
10
+ $hlp = Mage::helper('qixol');
11
+ $collections=$this->getCollection();
12
+ $list_return=array();
13
+ foreach ($collections as $item){
14
+ $list_return[]=array(
15
+ 'value' => (string)$item->getCustomerGroupName(),
16
+ 'label' => $hlp->__((string)$item->getCustomerGroupName())
17
+ );
18
+ }
19
+ return $list_return;
20
+ }
21
+ }
app/code/community/Holbi/Qixol/Model/Deletedproduct.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Holbi_Qixol_Model_Deletedproduct extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct(){
6
+
7
+ $this->_init("qixol/deletedproduct",'entity_id');
8
+
9
+ }
10
+
11
+ }
12
+
app/code/community/Holbi/Qixol/Model/Exportstat.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Holbi_Qixol_Model_Exportstat extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct(){
6
+
7
+ $this->_init("qixol/exportstat",'export_id');
8
+
9
+ }
10
+
11
+ }
12
+
app/code/community/Holbi/Qixol/Model/Exprpocessstat.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Holbi_Qixol_Model_Exprpocessstat extends Mage_Core_Model_Abstract
4
+ {
5
+ protected function _construct(){
6
+
7
+ $this->_init("qixol/exprpocessstat",'id');
8
+
9
+ }
10
+
11
+ }
12
+
app/code/community/Holbi/Qixol/Model/Invoicepoints.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Invoicepoints extends Mage_Sales_Model_Order_Invoice_Total_Abstract {
3
+
4
+ public function collect(Mage_Sales_Model_Order_Invoice $invoice) {
5
+ echo "call Holbi_Qixol_Model_Invoicepoints";
6
+ die();
7
+ $invoice->setGrandTotal($invoice->getGrandTotal() - $invoice->getPointsAmount());
8
+ $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() - $invoice->getBasePointsAmount());
9
+
10
+ /*
11
+ //?????????????????????????
12
+ $invoice->setPointsAmount($invoice->getPointsAmount());
13
+ $invoice->setBasePointsAmount($invoice->getBasePointsAmount());
14
+ */
15
+ //Mage::log('invoice11: ');
16
+ return $this;
17
+
18
+ }
19
+
20
+ }
app/code/community/Holbi/Qixol/Model/Issuedcoupon.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Holbi_Qixol_Model_Issuedcoupon extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct(){
6
+
7
+ $this->_init("qixol/issuedcoupon",'entity_id');
8
+
9
+ }
10
+
11
+ public function getCustomerIssuedcoupons($customer_id) {
12
+ $collection = Mage::getResourceModel('qixol/issuedcoupon_collection');
13
+ $collection->getSelect()->where('customer_id = ?', $customer_id);
14
+ return $collection;
15
+ }
16
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Banner.php ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Banner extends Mage_Core_Model_Mysql4_Abstract {
3
+ private $category_top_advertisment_name='CATEGORY_TOP';
4
+ private $product_top_advertisment_name='PRODUCT_TOP';
5
+ private $product_bottom_advertisment_name='PRODUCT_BOTTOM';
6
+ private $product_inline_advertisment_name='PRODUCT_INLINE';
7
+ private $backet_inline_advertisment_name='BACKET_INLINE';
8
+ private $category_stickers_advertisment_name='CATEGORY_STICKERS';
9
+ private $product_stickers_advertisment_name='PRODUCT_INFO_STICKERS';
10
+
11
+ public function _construct() {
12
+ // Note that the banner_id refers to the key field in your database table.
13
+ $this->_init('qixol/banner', 'banner_id');
14
+ }
15
+
16
+ public function getStickerImage($product,$adv_type='product') {
17
+ //create the list of product->child if parent
18
+ $product_id=$product->getId();
19
+ $child_ids=array();
20
+ if ($product->isConfigurable()){
21
+ $associatedProducts = $product->getTypeInstance()->getConfigurableAttributesAsArray($product);
22
+ foreach ($product->getTypeInstance()->getUsedProducts() as $childProduct) {
23
+ $child_ids[]=$childProduct->getId();
24
+ }
25
+ }
26
+
27
+ switch ($adv_type){
28
+ case "category":
29
+ $banner_link_name=$this->category_stickers_advertisment_name;
30
+ break;
31
+ case "product":
32
+ default :
33
+ $banner_link_name=$this->product_stickers_advertisment_name;
34
+ break;
35
+ }
36
+
37
+ $condition_1 = $this->_getReadAdapter()->quoteInto('qphp.promotion_id=pt.promotion_id','');
38
+ $condition_2 = $this->_getReadAdapter()->quoteInto('b.banner_group=pt.promotion_type','');
39
+ $select = $this->_getReadAdapter()->select()->from(array('qphp'=>$this->getTable('promotionhasproduct')))
40
+ ->join(array('pt'=>$this->getTable('promotions')), $condition_1)
41
+ ->join(array('b'=>$this->getTable('qixol/banner')), $condition_2)
42
+ ->where((count($child_ids)?
43
+ " ((qphp.parent_product_id='".(int)$product_id."' and qphp.product_id in (".join(",",$child_ids).")) or (qphp.product_id='".(int)$product_id."' and qphp.parent_product_id=0) )":
44
+ " qphp.product_id='".(int)$product_id."' and qphp.parent_product_id=0")." and b.status>0 and b.filename!='' and b.banner_link_name like '%".$banner_link_name."%'".
45
+ " and (pt.is_everyday=0 or (pt.from_date='0000-00-00 00:00:00' or TIME(pt.from_date)<CURTIME()) and (pt.till_date='0000-00-00 00:00:00' or TIME(pt.till_date)>CURTIME()))" )
46
+ // I don't know why by they have only time when promotion works(so for all dates)
47
+ ->group("qphp.promotion_id")->order('b.sort_order')
48
+ ->reset('columns')->columns(array('b.filename'));
49
+
50
+ $data=$this->_getReadAdapter()->fetchAll($select);
51
+ if (count($data)) return $data;
52
+ return false;
53
+ }
54
+
55
+ public function getCategoryTopAdv($_productCollection) {
56
+ $advertisment_text='';
57
+ $product_to_child=array();
58
+ foreach ($_productCollection as $_product){
59
+ $product_to_child[$_product->getId()]=array();
60
+ if ($_product->isConfigurable()){
61
+ $child_ids=array();
62
+ $associatedProducts = $_product->getTypeInstance()->getConfigurableAttributesAsArray($_product);
63
+ foreach ($_product->getTypeInstance()->getUsedProducts() as $childProduct) {
64
+ $child_ids[]=$childProduct->getId();
65
+ }
66
+ $product_to_child[$_product->getId()]=$child_ids;
67
+ }
68
+
69
+ }
70
+
71
+ $where='';
72
+ foreach ($product_to_child as $product_id=>$childs){
73
+ $where.=(strlen($where)>0?" or ":"")."(".((count($childs)?
74
+ " ((qphp.parent_product_id='".(int)$product_id."' and qphp.product_id in (".join(",",$childs).")) or (qphp.product_id='".(int)$product_id."' and qphp.parent_product_id=0) )":
75
+ " qphp.product_id='".(int)$product_id."' and qphp.parent_product_id=0")." ")." ) ";
76
+ }
77
+
78
+ /* $where=" (".$where.") and b.status>0 and (pt.promotion_text!='' or bi.filename!='') and b.banner_link_name like '%".$this->category_top_advertisment_name."%' ";
79
+
80
+ $condition_1 = $this->_getReadAdapter()->quoteInto("qphp.promotion_id=pt.promotion_id ",'');
81
+ $condition_2 = $this->_getReadAdapter()->quoteInto('b.banner_group=pt.promotion_type','');
82
+ $condition_3 = $this->_getReadAdapter()->quoteInto('bhi.banner_id=b.banner_id','');
83
+ $condition_4 = $this->_getReadAdapter()->quoteInto('bi.banner_image_id=bhi.banner_image_id','');
84
+ $select = $this->_getReadAdapter()->select()->from(array('qphp'=>$this->getTable('promotionhasproduct')))
85
+ ->join(array('pt'=>$this->getTable('promotions')), $condition_1)
86
+ ->join(array('b'=>$this->getTable('qixol/banner')), $condition_2)
87
+ ->joinLeft(array('bhi'=>$this->getTable('qixol/bannertoimage')), $condition_3)
88
+ ->joinLeft(array('bi'=>$this->getTable('qixol/bannerimages')), $condition_4)
89
+ ->where($where)->group("qphp.promotion_id")->order('b.sort_order')->reset('columns')->columns(array('pt.promotion_text','bi.filename',"b.url"));
90
+ */
91
+ $condition_1 = $this->_getReadAdapter()->quoteInto('bhi.banner_id=b.banner_id','');
92
+ $condition_2 = $this->_getReadAdapter()->quoteInto('bi.banner_image_id=bhi.banner_image_id','');
93
+ $condition_3 = $this->_getReadAdapter()->quoteInto('b.banner_group=pt.promotion_type','');
94
+ $condition_4 = $this->_getReadAdapter()->quoteInto("qphp.promotion_id=pt.promotion_id ",'');
95
+
96
+ $where=" b.status>0 and (pt.promotion_text!='' or pt.promotion_text is null or bi.filename!='') and b.banner_link_name like '%".$this->category_top_advertisment_name."%' and (qphp.promotion_id is null or (".$where."))";
97
+
98
+ $select = $this->_getReadAdapter()->select()->from(array('b'=>$this->getTable('qixol/banner')))
99
+ ->joinLeft(array('bhi'=>$this->getTable('qixol/bannertoimage')), $condition_1)
100
+ ->joinLeft(array('bi'=>$this->getTable('qixol/bannerimages')), $condition_2)
101
+ ->joinLeft(array('pt'=>$this->getTable('promotions')), $condition_3)
102
+ ->joinLeft(array('qphp'=>$this->getTable('promotionhasproduct')), $condition_4)
103
+ ->where($where)->group(array("b.banner_id","bi.banner_image_id"))->order('b.sort_order')->reset('columns')->columns(array('pt.promotion_text','bi.filename',"b.url"));
104
+
105
+
106
+ $data=$this->_getReadAdapter()->fetchAll($select);
107
+
108
+ if (count($data)) return $data;
109
+ return false;
110
+ }
111
+
112
+
113
+ public function getProductTextAdv($product,$adv_type='Inline') {
114
+ //create the list of product->child if parent
115
+ $product_id=$product->getId();
116
+ $child_ids=array();
117
+ if ($product->isConfigurable()){
118
+ $associatedProducts = $product->getTypeInstance()->getConfigurableAttributesAsArray($product);
119
+ foreach ($product->getTypeInstance()->getUsedProducts() as $childProduct) {
120
+ $child_ids[]=$childProduct->getId();
121
+ }
122
+ }
123
+
124
+ switch ($adv_type){
125
+ case "Bottom":
126
+ $banner_link_name=$this->product_bottom_advertisment_name;
127
+ break;
128
+ case "Top":
129
+ $banner_link_name=$this->product_top_advertisment_name;
130
+ break;
131
+ case "Inline":
132
+ default :
133
+ $banner_link_name=$this->product_inline_advertisment_name;
134
+ break;
135
+ }
136
+ /*
137
+ $condition_1 = $this->_getReadAdapter()->quoteInto("qphp.promotion_id=pt.promotion_id ",'');
138
+ $condition_2 = $this->_getReadAdapter()->quoteInto('b.banner_group=pt.promotion_type','');
139
+ $condition_3 = $this->_getReadAdapter()->quoteInto('bhi.banner_id=b.banner_id','');
140
+ $condition_4 = $this->_getReadAdapter()->quoteInto('bi.banner_image_id=bhi.banner_image_id','');
141
+ $select = $this->_getReadAdapter()->select()->from(array('qphp'=>$this->getTable('promotionhasproduct')))
142
+ ->join(array('pt'=>$this->getTable('promotions')), $condition_1)
143
+ ->join(array('b'=>$this->getTable('qixol/banner')), $condition_2)
144
+ ->joinLeft(array('bhi'=>$this->getTable('qixol/bannertoimage')), $condition_3)
145
+ ->joinLeft(array('bi'=>$this->getTable('qixol/bannerimages')), $condition_4)
146
+ ->where((count($child_ids)?
147
+ " ((qphp.parent_product_id='".(int)$product_id."' and qphp.product_id in (".join(",",$child_ids).")) or (qphp.product_id='".(int)$product_id."' and qphp.parent_product_id=0) )":
148
+ " qphp.product_id='".(int)$product_id."' and qphp.parent_product_id=0")." and b.status>0 and (pt.promotion_text!='' or bi.filename!='') and b.banner_link_name like '%".$banner_link_name."%'")
149
+ ->group("qphp.promotion_id")->order('b.sort_order')
150
+ ->reset('columns')->columns(array('pt.promotion_text','bi.filename',"b.url"));
151
+ */
152
+ $condition_1 = $this->_getReadAdapter()->quoteInto('bhi.banner_id=b.banner_id','');
153
+ $condition_2 = $this->_getReadAdapter()->quoteInto('bi.banner_image_id=bhi.banner_image_id','');
154
+ $condition_3 = $this->_getReadAdapter()->quoteInto('b.banner_group=pt.promotion_type','');
155
+ $condition_4 = $this->_getReadAdapter()->quoteInto("qphp.promotion_id=pt.promotion_id ",'');
156
+
157
+ $where=" b.status>0 and (pt.promotion_text is null or pt.promotion_text!='' or bi.filename!='') and b.banner_link_name like '%".$banner_link_name."%' and (qphp.promotion_id is null or (".
158
+ (count($child_ids)?
159
+ " ((qphp.parent_product_id='".(int)$product_id."' and qphp.product_id in (".join(",",$child_ids).")) or (qphp.product_id='".(int)$product_id."' and qphp.parent_product_id=0) )":
160
+ " qphp.product_id='".(int)$product_id."' and qphp.parent_product_id=0")
161
+ ."))";
162
+
163
+ $select = $this->_getReadAdapter()->select()->from(array('b'=>$this->getTable('qixol/banner')))
164
+ ->joinLeft(array('bhi'=>$this->getTable('qixol/bannertoimage')), $condition_1)
165
+ ->joinLeft(array('bi'=>$this->getTable('qixol/bannerimages')), $condition_2)
166
+ ->joinLeft(array('pt'=>$this->getTable('promotions')), $condition_3)
167
+ ->joinLeft(array('qphp'=>$this->getTable('promotionhasproduct')), $condition_4)
168
+ ->where($where)->group(array("b.banner_id","bi.banner_image_id"))->order('b.sort_order')->reset('columns')->columns(array('pt.promotion_text','bi.filename',"b.url"));
169
+
170
+ $data=$this->_getReadAdapter()->fetchAll($select);
171
+
172
+ if (count($data)) return $data;
173
+ return false;
174
+ }
175
+
176
+ public function getAllProductTextAdv($product,$adv_type='Inline') {
177
+ //create the list of product->child if parent
178
+ $product_id=$product->getId();
179
+ $child_ids=array();
180
+ if ($product->isConfigurable()){
181
+ $associatedProducts = $product->getTypeInstance()->getConfigurableAttributesAsArray($product);
182
+ foreach ($product->getTypeInstance()->getUsedProducts() as $childProduct) {
183
+ $child_ids[]=$childProduct->getId();
184
+ }
185
+ }
186
+ //
187
+ $condition_4 = $this->_getReadAdapter()->quoteInto("qphp.promotion_id=pt.promotion_id ",'');
188
+ $where=
189
+ (count($child_ids)?
190
+ " ((qphp.parent_product_id='".(int)$product_id."' and qphp.product_id in (".join(",",$child_ids).")) or (qphp.product_id='".(int)$product_id."' and qphp.parent_product_id=0) )":
191
+ " qphp.product_id='".(int)$product_id."' and qphp.parent_product_id=0");
192
+
193
+ $select = $this->_getReadAdapter()->select()->from(array('qphp'=>$this->getTable('promotionhasproduct')))
194
+ ->joinLeft(array('pt'=>$this->getTable('promotions')), $condition_4)
195
+ ->where($where)->group(array("pt.promotion_id"))->reset('columns')->columns(array('pt.promotion_text','pt.discountpercent','pt.discountamount'));
196
+
197
+ $data=$this->_getReadAdapter()->fetchAll($select);
198
+ if (count($data)) return $data;
199
+ return false;
200
+ }
201
+
202
+ public function getCartInlineAdv(){
203
+ $where = $this->_getReadAdapter()->quoteInto(" is_for_product = ? ",0);
204
+ $condition_1 = $this->_getReadAdapter()->quoteInto('b.banner_group=pt.promotion_type','');
205
+ $condition_3 = $this->_getReadAdapter()->quoteInto('bhi.banner_id=b.banner_id','');
206
+ $condition_4 = $this->_getReadAdapter()->quoteInto('bi.banner_image_id=bhi.banner_image_id','');
207
+ $select = $this->_getReadAdapter()->select()->from(array('pt'=>$this->getTable('promotions')))
208
+ ->join(array('b'=>$this->getTable('qixol/banner')), $condition_1)
209
+ ->joinLeft(array('bhi'=>$this->getTable('qixol/bannertoimage')), $condition_3)
210
+ ->joinLeft(array('bi'=>$this->getTable('qixol/bannerimages')), $condition_4)
211
+ ->where($where." and b.status>0 and b.banner_link_name like '%".$this->backet_inline_advertisment_name."%'")
212
+ ->order('b.sort_order')
213
+ ->reset('columns')->columns(array('promotion_text','bi.filename',"b.url","b.url"));
214
+ $data=$this->_getReadAdapter()->fetchAll($select);
215
+ if (count($data)) return $data;
216
+ return false;
217
+ }
218
+
219
+ public function getBannerImages($bannerid){
220
+ $where = $this->_getReadAdapter()->quoteInto(" banner_id = ? ",$bannerid);
221
+ $select = $this->_getReadAdapter()->select()->from(array('b'=>$this->getTable('qixol/bannertoimage')))->where($where);
222
+ $data=$this->_getReadAdapter()->fetchAll($select);
223
+ if (count($data)) return $data;
224
+ return array();
225
+ }
226
+
227
+ public function setBannerImages($bannerid,$banner_images){
228
+ if ($bannerid>0&&count($banner_images)>0){
229
+ $where = $this->_getWriteAdapter()->quoteInto(" banner_id = ? ",$bannerid);
230
+ $this->_getWriteAdapter()->delete($this->getTable('qixol/bannertoimage'),$where);
231
+ foreach ($banner_images as $banner_image_id){
232
+ $this->_getWriteAdapter()->insert(
233
+ $this->getTable('qixol/bannertoimage'),
234
+ array("banner_id" => $bannerid, "banner_image_id" => $banner_image_id)
235
+ );
236
+ }
237
+ }
238
+ }
239
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Banner/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Banner_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
3
+
4
+ public function _construct() {
5
+ parent::_construct();
6
+ $this->_init('qixol/banner');
7
+ }
8
+
9
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Bannerboxes.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Bannerboxes extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected $_isPkAutoIncrement = false;
5
+ public function _construct()
6
+ {
7
+ $this->_init("qixol/bannerboxes", "banner_box_type");
8
+ }
9
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Bannerboxes/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Bannerboxes_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
3
+
4
+ public function _construct() {
5
+ parent::_construct();
6
+ $this->_init('qixol/bannerboxes');
7
+ }
8
+
9
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Bannerimages.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Bannerimages extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ $this->_init('qixol/bannerimages','banner_image_id');
7
+ }
8
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Bannerimages/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Bannerimages_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
3
+
4
+ public function _construct() {
5
+ parent::_construct();
6
+ $this->_init('qixol/bannerimages');
7
+ }
8
+
9
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Bonuspoints.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Bonuspoints extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ $this->_init('qixol/bonuspoints','points_account_id');
7
+ }
8
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Bonuspoints/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Bonuspoints_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->_init('qixol/bonuspoints');
8
+ }
9
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Customergrouspmap.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Customergrouspmap extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected $_isPkAutoIncrement = false;
5
+ public function _construct()
6
+ {
7
+ $this->_init("qixol/customergrouspmap", "customer_group_name");
8
+ }
9
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Customergrouspmap/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Customergrouspmap_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
3
+
4
+ public function _construct() {
5
+ parent::_construct();
6
+ $this->_init('qixol/customergrouspmap');
7
+ }
8
+
9
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Deletedproduct.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Deletedproduct extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("qixol/deletedproduct", "entity_id");
7
+ }
8
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Deletedproduct/Collection.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Deletedproduct_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+
5
+ public function _construct(){
6
+ $this->_init("qixol/deletedproduct");
7
+ }
8
+
9
+
10
+
11
+ }
12
+
app/code/community/Holbi/Qixol/Model/Mysql4/Exportstat.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Exportstat extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("qixol/exportstat", "export_id");
7
+ }
8
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Exportstat/Collection.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Exportstat_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+
5
+ public function _construct(){
6
+ $this->_init("qixol/exportstat");
7
+ }
8
+
9
+
10
+
11
+ }
12
+
app/code/community/Holbi/Qixol/Model/Mysql4/Exprpocessstat.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Exprpocessstat extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("qixol/exprpocessstat", "id");
7
+ }
8
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Exprpocessstat/Collection.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Exprpocessstat_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+
5
+ public function _construct(){
6
+ $this->_init("qixol/exprpocessstat");
7
+ }
8
+
9
+
10
+
11
+ }
12
+
app/code/community/Holbi/Qixol/Model/Mysql4/Issuedcoupon.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Issuedcoupon extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init("qixol/issuedcoupon", "entity_id");
7
+ }
8
+
9
+
10
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Issuedcoupon/Collection.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Issuedcoupon_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+
5
+ public function _construct(){
6
+ $this->_init("qixol/issuedcoupon");
7
+ }
8
+
9
+
10
+
11
+ }
12
+
app/code/community/Holbi/Qixol/Model/Mysql4/Promotions.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Promotions extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected $_isPkAutoIncrement = false;
5
+
6
+ protected function _construct()
7
+ {
8
+ $this->_init("qixol/promotions", "promotion_id");
9
+ }
10
+
11
+ function removeOldPromotion(){
12
+ //should be one hour, but because of time difference
13
+ $this->_getWriteAdapter()->delete($this->getTable('promotions'), " is_for_product=1 and (update_time!='0000-00-00 00:00:00' and update_time <= '".date("Y-m-d H:i:s",strtotime(" -2 hour"))."' )");
14
+
15
+ return ;
16
+ }
17
+
18
+ function removeOldDayPromotion(){
19
+ //should be one day, but because of time difference
20
+ $this->_getWriteAdapter()->delete($this->getTable('promotions'), " is_for_product=0 and (update_time!='0000-00-00 00:00:00' and update_time <= '".date("Y-m-d H:i:s",strtotime(" -24 hour"))."' )");//remove previous day not updated promotion
21
+ return ;
22
+ }
23
+
24
+ function updatePromotionProduct($datatoupdate){
25
+ //print_r($datatoupdate);
26
+
27
+ if ($datatoupdate['product_id']>0&&$datatoupdate['promotion_id']>0){
28
+ $condition = $this->_getWriteAdapter()->quoteInto('(product_id = ?', $datatoupdate['product_id']);
29
+ $condition = $this->_getWriteAdapter()->quoteInto($condition. " and parent_product_id = ? ", $datatoupdate['parent_product_id']);
30
+ $condition = $this->_getWriteAdapter()->quoteInto($condition. " and promotion_id = ? )", $datatoupdate['promotion_id']);
31
+
32
+ //delete old, insert new
33
+
34
+ $this->_getWriteAdapter()->delete($this->getTable('promotionhasproduct'), $condition);
35
+
36
+ $this->_getWriteAdapter()->insert($this->getTable('promotionhasproduct'), $datatoupdate);
37
+ }
38
+
39
+ }
40
+
41
+ function removeOldPromotedProduct(){
42
+ //should be one day, but because of time difference
43
+ $this->_getWriteAdapter()->delete($this->getTable('promotionhasproduct'), "(update_time!='0000-00-00 00:00:00' and update_time <= ('".date("Y-m-d H:i:s",strtotime(" -2 hour"))."') )");
44
+ return ;
45
+ }
46
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Promotions/Collection.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Promotions_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+
5
+ public function _construct(){
6
+ $this->_init("qixol/promotions");
7
+ }
8
+
9
+
10
+
11
+ }
12
+
app/code/community/Holbi/Qixol/Model/Mysql4/Shippingmap.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Shippingmap extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected $_isPkAutoIncrement = false;
5
+ public function _construct()
6
+ {
7
+ $this->_init("qixol/shippingmap", "shipping_name");
8
+ }
9
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Shippingmap/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Shippingmap_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
3
+
4
+ public function _construct() {
5
+ parent::_construct();
6
+ $this->_init('qixol/shippingmap');
7
+ }
8
+
9
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Sticker.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Sticker extends Mage_Core_Model_Mysql4_Abstract {
3
+ private $category_stickers_advertisment_name='CATEGORY_STICKERS';
4
+ private $product_stickers_advertisment_name='PRODUCT_INFO_STICKERS';
5
+
6
+ public function _construct() {
7
+ // Note that the banner_id refers to the key field in your database table.
8
+ $this->_init('qixol/sticker', 'sticker_id');
9
+ }
10
+
11
+ public function getStickerImage($product,$adv_type='product') {
12
+ //create the list of product->child if parent
13
+ $product_id=$product->getId();
14
+ $child_ids=array();
15
+ if ($product->isConfigurable()){
16
+ $associatedProducts = $product->getTypeInstance()->getConfigurableAttributesAsArray($product);
17
+ foreach ($product->getTypeInstance()->getUsedProducts() as $childProduct) {
18
+ $child_ids[]=$childProduct->getId();
19
+ }
20
+ }
21
+
22
+ switch ($adv_type){
23
+ case "category":
24
+ $banner_link_name=$this->category_stickers_advertisment_name;
25
+ break;
26
+ case "product":
27
+ default :
28
+ $banner_link_name=$this->product_stickers_advertisment_name;
29
+ break;
30
+ }
31
+
32
+ $condition_1 = $this->_getReadAdapter()->quoteInto('(qphp.promotion_id=pt.promotion_id)','');
33
+ $condition_2 = $this->_getReadAdapter()->quoteInto('((b.use_default_banner_group>0 && b.default_banner_group=pt.promotion_type) or (b.use_default_banner_group=0 && pt.yourref!="" && b.unique_banner_group=pt.yourref))','');
34
+ $select = $this->_getReadAdapter()->select()->from(array('qphp'=>$this->getTable('promotionhasproduct')))
35
+ ->join(array('pt'=>$this->getTable('promotions')), $condition_1)
36
+ ->join(array('b'=>$this->getTable('qixol/sticker')), $condition_2)
37
+ ->where((count($child_ids)?
38
+ " ((qphp.parent_product_id='".(int)$product_id."' and qphp.product_id in (".join(",",$child_ids).")) or (qphp.product_id='".(int)$product_id."' and qphp.parent_product_id=0) )":
39
+ " qphp.product_id='".(int)$product_id."' and qphp.parent_product_id=0")." and b.status>0 and b.filename!='' and b.banner_link_name like '%".$banner_link_name."%'".
40
+ " and (pt.is_everyday=0 or (pt.from_date='0000-00-00 00:00:00' or TIME(pt.from_date)<CURTIME()) and (pt.till_date='0000-00-00 00:00:00' or TIME(pt.till_date)>CURTIME()))" )
41
+ // I don't know why by they have only time when promotion works(so for all dates)
42
+ ->group("qphp.promotion_id")->order('b.sort_order')
43
+ ->reset('columns')->columns(array('b.filename'));
44
+
45
+ $data=$this->_getReadAdapter()->fetchAll($select);
46
+ if (count($data)) return $data;
47
+ return false;
48
+ }
49
+
50
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Sticker/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Sticker_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
3
+
4
+ public function _construct() {
5
+ parent::_construct();
6
+ $this->_init('qixol/sticker');
7
+ }
8
+
9
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Storesmap.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Storesmap extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected $_isPkAutoIncrement = false;
5
+ public function _construct()
6
+ {
7
+ $this->_init("qixol/storesmap", "store_name");
8
+ }
9
+ }
app/code/community/Holbi/Qixol/Model/Mysql4/Storesmap/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Mysql4_Storesmap_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
3
+
4
+ public function _construct() {
5
+ parent::_construct();
6
+ $this->_init('qixol/storesmap');
7
+ }
8
+
9
+ }
app/code/community/Holbi/Qixol/Model/Observer.php ADDED
@@ -0,0 +1,819 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Observer
3
+ {
4
+ protected $structure_to_store_in_order=array();
5
+
6
+ public function updateCartAjaxUpdate(Varien_Event_Observer $observer){
7
+ global $_SESSION;
8
+ $controller = $observer->getEvent()->getControllerAction();
9
+ $id_cart = $controller->getRequest()->getParam('id');
10
+ $qty_cart = $controller->getRequest()->getParam('qty');
11
+ $result = array();
12
+ if ($id_cart>0){
13
+ $is_updated=false;
14
+
15
+ if ($qty_cart>0&&
16
+ $_SESSION['qixol_quoted_items']['items'][$id_cart]['data']['quantity']>$_SESSION['qixol_quoted_items']['items'][$id_cart]['data']['originalquantity']){
17
+
18
+ $difference=$_SESSION['qixol_quoted_items']['items'][$id_cart]['data']['quantity']-$_SESSION['qixol_quoted_items']['items'][$id_cart]['data']['originalquantity'];
19
+ if ($qty_cart<=$difference) $qty_cart=0;
20
+ $qty_cart-=$difference;
21
+ $is_updated=true;
22
+ }elseif($qty_cart>0
23
+ &&$_SESSION['qixol_quoted_items']['items'][$id_cart]['data']['generated']>0
24
+ &&$_SESSION['qixol_quoted_items']['items'][$id_cart]['data']['quantity']==$_SESSION['qixol_quoted_items']['items'][$id_cart]['data']['originalquantity']
25
+ &&$qty_cart==$_SESSION['qixol_quoted_items']['items'][$id_cart]['data']['quantity']){
26
+ //only free items - do nothing
27
+ $controller->getResponse()->setHeader('Content-type', 'application/json');
28
+ $result['success'] = 1;
29
+ $result['message'] = Mage::helper('qixol')->__('Item was updated successfully.');
30
+ $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
31
+ $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
32
+ return ;
33
+ }elseif($qty_cart>0
34
+ &&$_SESSION['qixol_quoted_items']['items'][$id_cart]['data']['generated']>0
35
+ &&$_SESSION['qixol_quoted_items']['items'][$id_cart]['data']['quantity']==$_SESSION['qixol_quoted_items']['items'][$id_cart]['data']['originalquantity']
36
+ &&$qty_cart>$_SESSION['qixol_quoted_items']['items'][$id_cart]['data']['quantity']){
37
+ $qty_cart-=$_SESSION['qixol_quoted_items']['items'][$id_cart]['data']['originalquantity'];
38
+ if ($qty_cart<0) $qty_cart=0;
39
+ $is_updated=true;
40
+ }
41
+
42
+
43
+ $session = Mage::getSingleton('checkout/session');
44
+ $cart=Mage::getSingleton('checkout/cart');
45
+ $quote = $session->getQuote();
46
+ $exists_in_cart=array();
47
+ foreach ($quote->getAllVisibleItems() as $item) {
48
+ $exists_in_cart[$item->getItemId()]=$item->getQty();
49
+ }
50
+
51
+ //in cart but difference=0, delete it
52
+ if (isset($exists_in_cart[$id_cart])&&$qty_cart==0){
53
+ // The action controller's constructor expects request and response objects;
54
+ $cart_controllerInstance = Mage::getControllerInstance(
55
+ 'Mage_Checkout_CartController',
56
+ $controller->getRequest(), // you can replace this with the actual request
57
+ new Mage_Core_Controller_Response_Http()
58
+ );
59
+ $cart_controllerInstance->ajaxDeleteAction();
60
+ $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
61
+ return ;
62
+ //exists but qty possible chaged nad it pozitive
63
+ }elseif(isset($exists_in_cart[$id_cart])&&$qty_cart>0){
64
+ // The action controller's constructor expects request and response objects;
65
+ $the_request=$controller->getRequest();
66
+ $the_request->setParam('qty',$qty_cart);
67
+ $cart_controllerInstance = Mage::getControllerInstance(
68
+ 'Mage_Checkout_CartController',
69
+ $the_request, // you can replace this with the actual request
70
+ new Mage_Core_Controller_Response_Http()
71
+ );
72
+ $cart_controllerInstance->ajaxUpdateAction();
73
+ $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
74
+ $result['success'] = 1;
75
+ $result['message'] = Mage::helper('qixol')->__('Item was updated successfully.');
76
+ $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
77
+ return ;
78
+ }elseif((!isset($exists_in_cart[$id_cart]))&&$qty_cart>0){
79
+ //add new item
80
+
81
+
82
+
83
+ if (isset($_SESSION['qixol_quoted_items']['items'][$id_cart]['data'])){
84
+ $qxol_item=$_SESSION['qixol_quoted_items']['items'][$id_cart]['data'];
85
+ $add_params_array=array();
86
+ if ((string)$qxol_item['variantcode']!=''){//configurable
87
+ $simple_product_id=Mage::getModel('catalog/product')->getIdBySku((string)$qxol_item['variantcode']);
88
+ $parent_product_id=Mage::getModel('catalog/product')->getIdBySku((string)$qxol_item['productcode']);
89
+ $parent_product=Mage::getModel('catalog/product')
90
+ ->setStoreId(Mage::app()->getStore()->getId())
91
+ ->load($parent_product_id);
92
+ $simple_product=Mage::getModel('catalog/product')
93
+ ->setStoreId(Mage::app()->getStore()->getId())
94
+ ->load($simple_product_id);
95
+ $add_params_array['product']=$parent_product_id;
96
+ $attributes = $parent_product->getTypeInstance(true)->getConfigurableAttributesAsArray($parent_product);
97
+ foreach ($attributes as $attribute){
98
+ foreach ($attribute['values'] as $value){
99
+ $childValue = $simple_product->getData($attribute['attribute_code']);
100
+ if ($value['value_index'] == $childValue){
101
+ $add_params_array['super_attribute'][$attribute['attribute_id']]=$value['value_index'];
102
+ }
103
+ }
104
+ }
105
+
106
+ }else {
107
+ $parent_product_id=Mage::getModel('catalog/product')->getIdBySku((string)$qxol_item['productcode']);
108
+ $parent_product=Mage::getModel('catalog/product')
109
+ ->setStoreId(Mage::app()->getStore()->getId())
110
+ ->load($parent_product_id);
111
+ $add_params_array['product']=$parent_product_id;
112
+ }
113
+ $filter = new Zend_Filter_LocalizedToNormalized(
114
+ array('locale' => Mage::app()->getLocale()->getLocaleCode())
115
+ );
116
+ $add_params_array['qty'] = $filter->filter($qty_cart);
117
+ $add_params_array['related_product']='';
118
+ $controller->getRequest()->setParam('qty',$qty_cart);
119
+
120
+ $cart->addProduct($parent_product, $add_params_array);
121
+
122
+
123
+ }
124
+ $result['success'] = 1;
125
+ $result['message'] = Mage::helper('qixol')->__('Item was updated successfully.');
126
+
127
+ $controller->getResponse()->setHeader('Content-type', 'application/json');
128
+ $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
129
+ $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
130
+ $result['success'] = 1;
131
+ $result['message'] = Mage::helper('qixol')->__('Item was updated successfully.');
132
+ $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
133
+ return ;
134
+
135
+ }
136
+
137
+ }else {
138
+ $controller->getResponse()->setHeader('Content-type', 'application/json');
139
+ $result['success'] = 1;
140
+ $result['message'] = Mage::helper('qixol')->__('Item was updated successfully.');
141
+ $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
142
+ $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
143
+ return ;
144
+ }
145
+ }
146
+
147
+ public function updateCartAjaxDelete(Varien_Event_Observer $observer){
148
+ global $_SESSION;
149
+ $controller = $observer->getEvent()->getControllerAction();
150
+ $id = (int) $controller->getRequest()->getParam('id');
151
+
152
+ if ($id==0||(isset($_SESSION['qixol_quoted_items']['items'][$id]) &&
153
+ $_SESSION['qixol_quoted_items']['items'][$id]['new']>0 &&
154
+ $_SESSION['qixol_quoted_items']['items'][$id]['data']['generated']>0)){
155
+ $result['success'] = 0;
156
+ $result['error'] = Mage::helper('qixol')->__('Can not remove the Free item.');
157
+ $controller->getResponse()->setHeader('Content-type', 'application/json');
158
+ $controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
159
+ $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
160
+ return;
161
+ }
162
+ // The action controller's constructor expects request and response objects;
163
+ $cart_controllerInstance = Mage::getControllerInstance(
164
+ 'Mage_Checkout_CartController',
165
+ $controller->getRequest(), // you can replace this with the actual request
166
+ new Mage_Core_Controller_Response_Http()
167
+ );
168
+ $cart_controllerInstance->ajaxDeleteAction();
169
+ //$controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
170
+ }
171
+
172
+ public function updateCartPostAction(Varien_Event_Observer $observer){
173
+ global $_SESSION;
174
+ $controller = $observer->getEvent()->getControllerAction();
175
+ $post_cart = $controller->getRequest()->getParam('cart');
176
+ $post_cart_action = $controller->getRequest()->getParam('update_cart_action');
177
+ if ($post_cart_action=='update_qty'){
178
+ $is_updated=false;
179
+ foreach ($post_cart as $cart_idx=>$cart_value){
180
+ if ($cart_value['qty']>0&&
181
+ $_SESSION['qixol_quoted_items']['items'][$cart_idx]['data']['quantity']>$_SESSION['qixol_quoted_items']['items'][$cart_idx]['data']['originalquantity']){
182
+ $difference=$_SESSION['qixol_quoted_items']['items'][$cart_idx]['data']['quantity']-$_SESSION['qixol_quoted_items']['items'][$cart_idx]['data']['originalquantity'];
183
+ if ($cart_value['qty']<=$difference) $cart_value['qty']=0;
184
+ $cart_value['qty']-=$difference;
185
+ //cart add item
186
+ $post_cart[$cart_idx]=$cart_value;
187
+ $is_updated=true;
188
+ }elseif($cart_value['qty']>0
189
+ &&$_SESSION['qixol_quoted_items']['items'][$cart_idx]['data']['generated']>0
190
+ &&$_SESSION['qixol_quoted_items']['items'][$cart_idx]['data']['quantity']==$_SESSION['qixol_quoted_items']['items'][$cart_idx]['data']['originalquantity']
191
+ &&$cart_value['qty']==$_SESSION['qixol_quoted_items']['items'][$cart_idx]['data']['quantity']){
192
+ //only free items - remove from cart
193
+ unset($post_cart[$cart_idx]);
194
+ $is_updated=true;
195
+ }elseif($cart_value['qty']>0
196
+ &&$_SESSION['qixol_quoted_items']['items'][$cart_idx]['data']['generated']>0
197
+ &&$_SESSION['qixol_quoted_items']['items'][$cart_idx]['data']['quantity']==$_SESSION['qixol_quoted_items']['items'][$cart_idx]['data']['originalquantity']
198
+ &&$cart_value['qty']>$_SESSION['qixol_quoted_items']['items'][$cart_idx]['data']['quantity']){
199
+ $cart_value['qty']-=$_SESSION['qixol_quoted_items']['items'][$cart_idx]['data']['originalquantity'];
200
+ if ($cart_value['qty']<0) $cart_value['qty']=0;
201
+ //cart add item
202
+ $post_cart[$cart_idx]=$cart_value;
203
+ $is_updated=true;
204
+ }
205
+ }
206
+
207
+ $session = Mage::getSingleton('checkout/session');
208
+ $cart=Mage::getSingleton('checkout/cart');
209
+ $quote = $session->getQuote();
210
+ $exists_in_cart=array();
211
+ foreach ($quote->getAllVisibleItems() as $item) {
212
+ $exists_in_cart[$item->getItemId()]=$item->getQty();
213
+ }
214
+ foreach($post_cart as $cart_idx=>$cart_value){
215
+ if ((!isset($exists_in_cart[$cart_idx]))){
216
+ if (isset($_SESSION['qixol_quoted_items']['items'][$cart_idx]['data'])){
217
+ $qxol_item=$_SESSION['qixol_quoted_items']['items'][$cart_idx]['data'];
218
+ $add_params_array=array();
219
+ if ((string)$qxol_item['variantcode']!=''){//configurable
220
+ $simple_product_id=Mage::getModel('catalog/product')->getIdBySku((string)$qxol_item['variantcode']);
221
+ $parent_product_id=Mage::getModel('catalog/product')->getIdBySku((string)$qxol_item['productcode']);
222
+ $parent_product=Mage::getModel('catalog/product')
223
+ ->setStoreId(Mage::app()->getStore()->getId())
224
+ ->load($parent_product_id);
225
+ $simple_product=Mage::getModel('catalog/product')
226
+ ->setStoreId(Mage::app()->getStore()->getId())
227
+ ->load($simple_product_id);
228
+ $add_params_array['product']=$parent_product_id;
229
+ $attributes = $parent_product->getTypeInstance(true)->getConfigurableAttributesAsArray($parent_product);
230
+ foreach ($attributes as $attribute){
231
+ foreach ($attribute['values'] as $value){
232
+ $childValue = $simple_product->getData($attribute['attribute_code']);
233
+ if ($value['value_index'] == $childValue){
234
+ $add_params_array['super_attribute'][$attribute['attribute_id']]=$value['value_index'];
235
+ }
236
+ }
237
+ }
238
+
239
+ }else {
240
+ $parent_product_id=Mage::getModel('catalog/product')->getIdBySku((string)$qxol_item['productcode']);
241
+ $parent_product=Mage::getModel('catalog/product')
242
+ ->setStoreId(Mage::app()->getStore()->getId())
243
+ ->load($parent_product_id);
244
+ $add_params_array['product']=$parent_product_id;
245
+ }
246
+ $filter = new Zend_Filter_LocalizedToNormalized(
247
+ array('locale' => Mage::app()->getLocale()->getLocaleCode())
248
+ );
249
+ $add_params_array['qty'] = $filter->filter($cart_value['qty']);
250
+ $add_params_array['related_product']='';
251
+ $controller->getRequest()->setParam('qty',$cart_value['qty']);
252
+ $cart->addProduct($parent_product, $add_params_array);
253
+
254
+
255
+ }
256
+ //add new item in cart
257
+
258
+ }
259
+ }
260
+
261
+
262
+ if ($is_updated){
263
+ $controller->getRequest()->setParam('cart',$post_cart);
264
+ }
265
+ // The action controller's constructor expects request and response objects;
266
+ $cart_controllerInstance = Mage::getControllerInstance(
267
+ 'Mage_Checkout_CartController',
268
+ $controller->getRequest(), // you can replace this with the actual request
269
+ new Mage_Core_Controller_Response_Http()
270
+ );
271
+ $cart_controllerInstance->updatePostAction();
272
+ //$controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
273
+ }else {
274
+ // The action controller's constructor expects request and response objects;
275
+ $cart_controllerInstance = Mage::getControllerInstance(
276
+ 'Mage_Checkout_CartController',
277
+ $controller->getRequest(), // you can replace this with the actual request
278
+ new Mage_Core_Controller_Response_Http()
279
+ );
280
+ $cart_controllerInstance->updatePostAction();
281
+ //$controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
282
+ }
283
+ }
284
+
285
+ public function deleteCartAction(Varien_Event_Observer $observer){
286
+ global $_SESSION;
287
+ $controller = $observer->getEvent()->getControllerAction();
288
+ $id = (int) $controller->getRequest()->getParam('id');
289
+
290
+ if ($id==0||(isset($_SESSION['qixol_quoted_items']['items'][$id]) &&
291
+ $_SESSION['qixol_quoted_items']['items'][$id]['new']>0 &&
292
+ $_SESSION['qixol_quoted_items']['items'][$id]['data']['generated']>0)){
293
+ $session = Mage::getSingleton('checkout/session');
294
+ $session->addError('Free item couldn\'t be deleted');
295
+ unset($_SESSION['tmp_set']);
296
+ $controller->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
297
+ return;
298
+ }
299
+ // The action controller's constructor expects request and response objects;
300
+ $cart_controllerInstance = Mage::getControllerInstance(
301
+ 'Mage_Checkout_CartController',
302
+ $controller->getRequest(), // you can replace this with the actual request
303
+ new Mage_Core_Controller_Response_Http()
304
+ );
305
+ $cart_controllerInstance->deleteAction();
306
+ $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
307
+ $controller->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
308
+ }
309
+
310
+ public function checkQixolCoupon(Varien_Event_Observer $observer){
311
+ global $_SESSION;
312
+ /* @var Mage_Core_Controller_Front_Action $controller */
313
+ $controller = $observer->getEvent()->getControllerAction();
314
+ if (trim($controller->getRequest()->getParam('coupon_code')) !='') {
315
+ if ((!isset($_SESSION['qixol_quoted_items']['cart_session_id']))||$_SESSION['qixol_quoted_items']['cart_session_id']=='') $_SESSION['qixol_quoted_items']['cart_session_id']=md5(time());
316
+ unset($_SESSION['qixol_quoted_items']['coupons']);
317
+ $_SESSION['qixol_quoted_items']['coupons'][trim($controller->getRequest()->getParam('coupon_code'))]['code']=trim($controller->getRequest()->getParam('coupon_code'));
318
+ //$this->__('Coupon code "%s" was applied.', Mage::helper('core')->escapeHtml($couponCode))
319
+ $session = Mage::getSingleton('checkout/session');
320
+ $quote = $session->getQuote();
321
+ $getSinch=Mage::getModel('qixol/sinch');
322
+ if ($qixol_quoted_items_new=$getSinch->run_ImportCart($quote)){
323
+ $qixol_quoted_items=$qixol_quoted_items_new; //if returned new structure
324
+ $qixol_quoted_items['cart_session_id']=$_SESSION['qixol_quoted_items']['cart_session_id'];
325
+ }
326
+ $qixol_quoted_items['time_checked']=time();
327
+ $_SESSION['qixol_quoted_items']=$qixol_quoted_items;
328
+
329
+ if ($_SESSION['qixol_quoted_items']['coupons'][trim($controller->getRequest()->getParam('coupon_code'))]['code']!=''){
330
+ $coupon_text='';
331
+ foreach ($_SESSION['qixol_quoted_items']['coupons'] as $coupon_stored_data){
332
+ if ((bool)$coupon_stored_data['issued']==false)
333
+ $coupon_text.=$coupon_stored_data['description'].", ";
334
+ }
335
+ $session->addSuccess(Mage::helper('qixol')->__("Qixol coupon '%s' was applied to your order.", $coupon_text ));
336
+ }
337
+ else
338
+ $session->addError(Mage::helper('qixol')->__("Qixol coupon '%s' not applicable.", trim($controller->getRequest()->getParam('coupon_code')) ));
339
+ //compleatly /*intercept*/
340
+ $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
341
+ $controller->getResponse()->setRedirect(Mage::getUrl('checkout/cart')); }
342
+ }
343
+
344
+ public function markDletedProduct(Varien_Event_Observer $observer)
345
+ {
346
+ $product = $observer->getEvent()->getProduct();
347
+ //temporary until we rebuild
348
+ /*$deleted = Mage::getModel('qixol/Deletedproduct');
349
+ $deleted->setId($product->getId());
350
+ $deleted->setDeletedTime(date("Y-m-d H:i:s"));
351
+ $query=$deleted->save();*/
352
+ //temporary , should be redeveloped to work us abowe
353
+ $parentId = Mage::getResourceSingleton('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
354
+
355
+ if (is_array($parentId)&&count($parentId)>0){
356
+ foreach ($parentId as $parent_product_id){
357
+ $parent_product=Mage::getModel('catalog/product')->load($parent_product_id);
358
+ break; //we think only one parent for a child
359
+ }
360
+ //store child deleted
361
+ $store_deleted='replace into qixol_product_to_delete(entity_id,product_sku,child_sku,deleted_time) values('.(int)$product->getId().',"'.$parent_product->getSku().'","'.$product->getSku().'",now())';
362
+ } else {
363
+ //store parent deleted
364
+ $store_deleted='replace into qixol_product_to_delete(entity_id,product_sku,child_sku,deleted_time) values('.(int)$product->getId().',"'.$product->getSku().'","",now())';
365
+ }
366
+ $write_db = Mage::getSingleton('core/resource')->getConnection('core_write');
367
+ $write_db->query($store_deleted);
368
+ }
369
+
370
+
371
+ public function processApplyCartPromo(Varien_Event_Observer $observer)
372
+ {
373
+ global $_SESSION;
374
+ if (isset($_SESSION['inside_request'])&&(time()-$_SESSION['inside_request'])<2){//3 second prevent duplicate confirmation request
375
+ //echo "@".(time()-$_SESSION['inside_request'])."@";
376
+ return ;
377
+ }
378
+
379
+ $_SESSION['inside_request']=time();
380
+ $quote = $observer->getQuote();
381
+
382
+ $promotions_data_hash=array();
383
+
384
+ $getSinch=Mage::getModel('qixol/sinch');
385
+ $unlink_coupon_codes=array();
386
+ foreach ($_SESSION['qixol_quoted_items']['coupons'] as $coupon_id=>$coupon_stored_data){
387
+ if ((bool)$coupon_stored_data['issued']==true)
388
+ $unlink_coupon_codes[]=$coupon_id;
389
+
390
+ }
391
+ foreach ($unlink_coupon_codes as $coupon_id){
392
+ //$_Cart=Mage::getModel('checkout/cart');
393
+ unset($_SESSION['qixol_quoted_items']['coupons'][$coupon_id]);
394
+ }
395
+ unset($unlink_coupon_codes);
396
+
397
+ $qixol_quoted_items=$getSinch->run_processOrder($quote);
398
+ $_SESSION['qixol_quoted_items']=$qixol_quoted_items;
399
+
400
+ $delivery_discount_amount=0;
401
+ $recalcualte_totals=false;
402
+ $totaldiscountAmount=0;
403
+ $this->structure_to_store_in_order=array();
404
+ $this->structure_to_store_in_order['items']=array();
405
+ $this->structure_to_store_in_order['promotion_summary']=$_SESSION['qixol_quoted_items']['summary'];
406
+ if (is_array($_SESSION['qixol_quoted_items'])){
407
+ foreach ($quote->getAllItems() as $item) {
408
+ //calculate total discount first
409
+ if (isset($_SESSION['qixol_quoted_items']['items'][$item->getId()]))
410
+ if ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_price']){
411
+ $row_total_before_discount=$item->getRowTotal();
412
+ $dicount_value=$row_total_before_discount-(float)$_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['lineamount'];
413
+
414
+ $this->structure_to_store_in_order['items'][$item->getId()]['discount']=$dicount_value;
415
+ $this->structure_to_store_in_order['items'][$item->getId()]['originalquantity']=$_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['originalquantity'];
416
+ $this->structure_to_store_in_order['items'][$item->getId()]['quantity']=$_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['quantity'];
417
+ $this->structure_to_store_in_order['items'][$item->getId()]['promotions']=$_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions'];
418
+ if (is_array($promotions_data_hash))
419
+ foreach ($this->structure_to_store_in_order['items'][$item->getId()]['promotions'] as $promotion_id=>$promotion_arr){
420
+ if (isset($promotions_data_hash[$promotion_id])){
421
+ $this->structure_to_store_in_order['items'][$item->getId()]['promotions'][$promotion_id]['description']=$promotions_data_hash[$promotion_id];
422
+ }else {
423
+ $cart_promotion_data=Mage::getModel('qixol/promotions')->load($promotion_id);
424
+ $promotions_data_hash[$promotion_id]=$cart_promotion_data->getPromotionText();
425
+ $this->structure_to_store_in_order['items'][$item->getId()]['promotions'][$promotion_id]['description']=$promotions_data_hash[$promotion_id];
426
+ }
427
+ }
428
+
429
+ if ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['free_added']>0){
430
+ $this->structure_to_store_in_order['items'][$item->getId()]['free_added']=$_SESSION['qixol_quoted_items']['items'][$item->getId()]['free_added'];
431
+ }
432
+ /*
433
+ $item->setCustomPrice((float)$_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['price']);
434
+ $item->setOriginalCustomPrice((float)$_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['price']);
435
+ $item->setDiscountAmount($dicount_value);
436
+ $item->setBaseDiscountAmount($dicount_value);
437
+ $item->setRowTotalWithDiscount($row_total_before_discount - $dicount_value);
438
+ */
439
+ //$item->setRowTotal($row_total_before_discount-$dicount_value);
440
+ //$item->setBaseRowTotal($row_total_before_discount-$dicount_value);
441
+ /*
442
+ $item->getProduct()->setIsSuperMode(true);
443
+ $item->save();
444
+ **/
445
+ $totaldiscountAmount+=$dicount_value;
446
+ /*$quote->setGrandTotal($quote->getGrandTotal()-$dicount_value);
447
+ $quote->setBaseGrandTotal($quote->getBaseSubtotal()-$dicount_value);
448
+ $quote->setSubtotal($quote->getBaseSubtotal()-$dicount_value);
449
+ $quote->setBaseSubtotal($quote->getBaseSubtotal()-$dicount_value);
450
+ $quote->setSubtotalWithDiscount($quote->getBaseSubtotal()-$dicount_value);
451
+ $quote->setBaseSubtotalWithDiscount($quote->getBaseSubtotal()-$dicount_value);*/
452
+ $recalcualte_totals=true;
453
+ }
454
+ /*elseif($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['isdelivery']){
455
+ foreach ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions'] as $delivery_promotion){
456
+ if ($delivery_promotion['discountamount']>0){
457
+ $delivery_discount_amount+=$delivery_promotion['discountamount'];
458
+ $recalcualte_totals=true;
459
+ }
460
+ }
461
+ }*/
462
+ elseif(is_array($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions'])){ //sometimes no linediscount,discount or other need to llok in ['items'][xxx]['promotions'][xxx][discountamount]
463
+ foreach ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions'] as $promotion_id=>$check_promotion){
464
+ if ($check_promotion['discountamount']>0&&$check_promotion['basketlevel']>0){
465
+ $dicount_value+=$check_promotion['discountamount'];
466
+ $this->structure_to_store_in_order['items'][$item->getId()]['promotions'][$promotion_id]=$_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions'][$promotion_id];
467
+ if (is_array($promotions_data_hash))
468
+ if (isset($promotions_data_hash[$promotion_id])){
469
+ $this->structure_to_store_in_order['items'][$item->getId()]['promotions'][$promotion_id]['description']=$promotions_data_hash[$promotion_id];
470
+ }else {
471
+ $cart_promotion_data=Mage::getModel('qixol/promotions')->load($promotion_id);
472
+ $promotions_data_hash[$promotion_id]=$cart_promotion_data->getPromotionText();
473
+ $this->structure_to_store_in_order['items'][$item->getId()]['promotions'][$promotion_id]['description']=$promotions_data_hash[$promotion_id];
474
+ }
475
+ $totaldiscountAmount+=$dicount_value;
476
+ }
477
+ }
478
+ }/*elseif($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['isdelivery']){
479
+ foreach ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions'] as $delivery_promotion){
480
+ if ($delivery_promotion['discountamount']>0){
481
+ $delivery_discount_amount+=$delivery_promotion['discountamount'];
482
+ $recalcualte_totals=true;
483
+ }
484
+ }
485
+ }*/
486
+ }
487
+ //as customer described
488
+ if (isset($_SESSION['qixol_quoted_items']['cart_data']['deliverytotaldiscount'])&&$_SESSION['qixol_quoted_items']['cart_data']['deliverytotaldiscount']>0){
489
+ $delivery_discount_amount=$_SESSION['qixol_quoted_items']['cart_data']['deliverytotaldiscount'];
490
+ $recalcualte_totals=true;
491
+ }
492
+ }
493
+
494
+ if ($recalcualte_totals){
495
+
496
+ $total=$quote->getBaseSubtotal();
497
+ $quote->setSubtotal(0);
498
+ $quote->setBaseSubtotal(0);
499
+
500
+ $quote->setSubtotalWithDiscount(0);
501
+ $quote->setBaseSubtotalWithDiscount(0);
502
+
503
+ $quote->setGrandTotal(0);
504
+ $quote->setBaseGrandTotal(0);
505
+
506
+
507
+ $canAddItems = $quote->isVirtual()? ('billing') : ('shipping');
508
+ foreach ($quote->getAllAddresses() as $address) {
509
+
510
+
511
+ $address->setSubtotal(0);
512
+ $address->setBaseSubtotal(0);
513
+
514
+ $address->setGrandTotal(0);
515
+ $address->setBaseGrandTotal(0);
516
+
517
+ $address->collectTotals();
518
+
519
+ $quote->setSubtotal((float) $quote->getSubtotal() + $address->getSubtotal());
520
+ $quote->setBaseSubtotal((float) $quote->getBaseSubtotal() + $address->getBaseSubtotal());
521
+
522
+ $quote->setSubtotalWithDiscount(
523
+ (float) $quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount()
524
+ );
525
+ $quote->setBaseSubtotalWithDiscount(
526
+ (float) $quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount()
527
+ );
528
+
529
+ $quote->setGrandTotal((float) $quote->getGrandTotal() + $address->getGrandTotal());
530
+ $quote->setBaseGrandTotal((float) $quote->getBaseGrandTotal() + $address->getBaseGrandTotal());
531
+
532
+ $quote ->save();
533
+
534
+ $quote->setGrandTotal($quote->getBaseSubtotal()-$totaldiscountAmount-$delivery_discount_amount)
535
+ ->setBaseGrandTotal($quote->getBaseSubtotal()-$totaldiscountAmount-$delivery_discount_amount)
536
+ ->setSubtotalWithDiscount($quote->getBaseSubtotal()-$totaldiscountAmount-$delivery_discount_amount)
537
+ ->setBaseSubtotalWithDiscount($quote->getBaseSubtotal()-$totaldiscountAmount-$delivery_discount_amount)
538
+ ->save();
539
+
540
+
541
+ if($address->getAddressType()==$canAddItems) {
542
+
543
+ //echo $address->setDiscountAmount; exit;
544
+ $address->setSubtotalWithDiscount((float) $address->getSubtotalWithDiscount()-$totaldiscountAmount-$delivery_discount_amount);
545
+ $address->setGrandTotal((float) $address->getGrandTotal()-$totaldiscountAmount-$delivery_discount_amount);
546
+ $address->setBaseSubtotalWithDiscount((float) $address->getBaseSubtotalWithDiscount()-$totaldiscountAmount-$delivery_discount_amount);
547
+ $address->setBaseGrandTotal((float) $address->getBaseGrandTotal()-$totaldiscountAmount-$delivery_discount_amount);
548
+
549
+ if($address->getDiscountDescription()){
550
+
551
+ $address->setDiscountAmount(-($address->getDiscountAmount()+$totaldiscountAmount+$delivery_discount_amount));
552
+ $address->setDiscountDescription($address->getDiscountDescription().($totaldiscountAmount>0?', Qixol Discount':"").($delivery_discount_amount>0?", Delivery Discount":""));
553
+ $address->setBaseDiscountAmount(-($address->getBaseDiscountAmount()+$totaldiscountAmount+$delivery_discount_amount));
554
+ }else {
555
+
556
+ $address->setDiscountAmount(-($totaldiscountAmount+$delivery_discount_amount));
557
+ $address->setDiscountDescription(($totaldiscountAmount>0?' Qixol Discount':"").($delivery_discount_amount>0?($totaldiscountAmount>0?",":"")." Delivery Discount":""));
558
+ $address->setBaseDiscountAmount(-($totaldiscountAmount+$delivery_discount_amount));
559
+ }
560
+
561
+ $address->save();
562
+ }
563
+ }
564
+ //add free items
565
+
566
+ if (is_array($_SESSION['qixol_quoted_items'])){
567
+ foreach ($quote->getAllItems() as $item) {
568
+ if (isset($_SESSION['qixol_quoted_items']['items'][$item->getId()]))
569
+ if ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_price']){
570
+ $row_total_before_discount=$item->getRowTotal();
571
+ //$item->setCustomPrice((float)$_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['price']);
572
+ //$item->setOriginalCustomPrice((float)$_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['price']);
573
+ $dicount_value=$row_total_before_discount-(float)$_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['lineamount'];
574
+ $item->setDiscountAmount($dicount_value);
575
+ $item->setBaseDiscountAmount($dicount_value);
576
+ $item->setRowTotalWithDiscount($row_total_before_discount-$dicount_value);
577
+ //$item->setRowTotal($row_total_before_discount-$dicount_value);
578
+ //$item->setBaseRowTotal($row_total_before_discount-$dicount_value);
579
+ $item->getProduct()->setIsSuperMode(true);
580
+ $item->save();
581
+ }
582
+ if ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['free_added']>0){
583
+ $item->setQty($item->getQty()+$_SESSION['qixol_quoted_items']['items'][$item->getId()]['free_added']);
584
+ $item->setDiscountAmount($item->getDiscountAmount()+($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['originalprice']*$_SESSION['qixol_quoted_items']['items'][$item->getId()]['free_added']));
585
+ $item->setBaseDiscountAmount($item->getBaseDiscountAmount()+($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['originalprice']*$_SESSION['qixol_quoted_items']['items'][$item->getId()]['free_added']));
586
+ $dicount_value=$dicount_value+($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['originalprice']*$_SESSION['qixol_quoted_items']['items'][$item->getId()]['free_added']);
587
+ $item->getProduct()->setIsSuperMode(true);
588
+ $item->save();
589
+ }
590
+ }
591
+
592
+ //add free prroducts
593
+ foreach ($_SESSION['qixol_quoted_items']['items'] as $qixol_cart_items){
594
+ if ($qixol_cart_items['new']&&$qixol_cart_items['data']['isdelivery']==0){
595
+ if ($productId=Mage::getModel('catalog/product')->getIdBySku((string)$qixol_cart_items['data']['variantcode']!=''?(string)$qixol_cart_items['data']['variantcode']:(string)$qixol_cart_items['data']['productcode'])){
596
+ $productObj = Mage::getModel('catalog/product')
597
+ ->setStoreId(Mage::app()->getStore()->getId())
598
+ ->load($productId);
599
+ $item=$quote->addProduct($productObj,(int)$qixol_cart_items['data']['quantity']);
600
+ $item->setCustomPrice(0);
601
+ $item->save();
602
+ }
603
+ }
604
+ }
605
+ }
606
+
607
+ }
608
+
609
+ if (isset($_SESSION['qixol_quoted_items']['coupons'])&&count($_SESSION['qixol_quoted_items']['coupons'])){
610
+ $coupons_issued='';
611
+ $customerData_to_work_with = Mage::getSingleton('customer/session')->getCustomer();
612
+ foreach ($_SESSION['qixol_quoted_items']['coupons'] as $_coupons_code=>$tmp_val){
613
+ if ((bool)$tmp_val['issued']==true){
614
+ $coupons_issued.="(".$_coupons_code.") - ".$tmp_val['description'];
615
+ //save issued coupon
616
+ $issued_coupon_model = Mage::getModel('qixol/issuedcoupon');
617
+ $issued_coupon_model->setCustomerId($customerData_to_work_with->getId());
618
+ $issued_coupon_model->setCouponCodeValue($_coupons_code);
619
+ $issued_coupon_model->setCouponValidTill($tmp_val['validtill']);
620
+ $issued_coupon_model->setCouponDescription($tmp_val['description']);
621
+ $issued_coupon_model->setCreatedTime(now());
622
+ $issued_coupon_model->save();
623
+ }
624
+ }
625
+ if (trim($coupons_issued)!=''){
626
+ $order = $observer->getOrder();
627
+ $order->addStatusHistoryComment(Mage::helper('qixol')->__("You have obtined coupon(s):".$coupons_issued), $order->getStatus())
628
+ ->setIsVisibleOnFront(true)
629
+ ->setIsCustomerNotified(true);
630
+ }
631
+ }
632
+
633
+ $order = $observer->getOrder();
634
+ $order->setPromotionDataApplied(serialize($this->structure_to_store_in_order));
635
+ //save issued points to customer
636
+ foreach ($_SESSION['qixol_quoted_items']['summary'] as $summary_data_process){
637
+ if($summary_data_process['data']['issuedpoints']>0){
638
+ if (!isset($customerData_to_work_with))
639
+ $customerData_to_work_with = Mage::getSingleton('customer/session')->getCustomer();
640
+ $this->recordPoints($summary_data_process['data']['issuedpoints'], $customerData_to_work_with->getId());
641
+ }
642
+ }
643
+
644
+
645
+ $discounted_points = Mage::getSingleton('customer/session')->getPointsAmount();
646
+ //subtract points for this order
647
+ if ($discounted_points>0){
648
+ if (!isset($customerData_to_work_with))
649
+ $customerData_to_work_with = Mage::getSingleton('customer/session')->getCustomer();
650
+ $this->usePoints($discounted_points, $customerData_to_work_with->getId());
651
+ }
652
+
653
+
654
+ /*foreach ($order->getAllItems() as $item) {
655
+ if (isset($_SESSION['qixol_quoted_items']['items'][$item->getQuoteId()])){
656
+ if ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['free_added']>0){
657
+ $item->setQtyOrdered($item->getQtyOrdered()+$_SESSION['qixol_quoted_items']['items'][$item->getId()]['free_added']);
658
+ $item->save();
659
+ }
660
+ }
661
+
662
+ }*/
663
+ //$order->save();
664
+ //unset old shopping cart
665
+ //print_r($_SESSION['qixol_quoted_items']);
666
+ unset($_SESSION['qixol_quoted_items']);
667
+ unset($_SESSION['inside_request']);
668
+ $_SESSION['structure_to_store_in_order']=$this->structure_to_store_in_order;
669
+
670
+ }
671
+
672
+
673
+ public function processSavePromotionsToOrder($observer){
674
+ global $_SESSION;
675
+ $order = $observer->getOrder();
676
+ $order->setPromotionDataApplied(serialize($_SESSION['structure_to_store_in_order']));
677
+ $order->save();
678
+ $this->structure_to_store_in_order=array();
679
+ unset($_SESSION['structure_to_store_in_order']);
680
+ }
681
+
682
+ public function processShippingUpdated(Varien_Event_Observer $observer)
683
+ {
684
+ global $_SESSION;
685
+ if (isset($_SESSION['inside_request'])&&(time()-$_SESSION['inside_request'])<1){//7 second prevent duplicate request
686
+ //echo "@".(time()-$_SESSION['inside_request'])."@";
687
+ return ;
688
+ }
689
+
690
+
691
+ $_SESSION['inside_request']=time();
692
+
693
+ $getSinch=Mage::getModel('qixol/sinch');
694
+ $cart=$observer->getEvent()->getQuote();
695
+ if ($qixol_quoted_items_new=$getSinch->run_ImportCart($cart)){
696
+ $qixol_quoted_items=$qixol_quoted_items_new; //if returned new structure
697
+ }
698
+ $qixol_quoted_items['time_checked']=time();
699
+ $qixol_quoted_items['short_data']=$_SESSION['qixol_quoted_items']['short_data'];
700
+ $qixol_quoted_items['cart_session_id']=$_SESSION['qixol_quoted_items']['cart_session_id'];
701
+ $_SESSION['qixol_quoted_items']=$qixol_quoted_items;
702
+
703
+ unset($_SESSION['inside_request']);
704
+ }
705
+
706
+ public function processGetCartPromo(Varien_Event_Observer $observer)
707
+ {
708
+ global $_SESSION;
709
+ if (isset($_SESSION['inside_request'])&&(time()-$_SESSION['inside_request'])<4){//7 second prevent duplicate request
710
+ //echo "@".(time()-$_SESSION['inside_request'])."@";
711
+ return ;
712
+ }
713
+
714
+ $_SESSION['inside_request']=time();
715
+ if ((!isset($_SESSION['qixol_quoted_items']['cart_session_id']))||$_SESSION['qixol_quoted_items']['cart_session_id']=='') $_SESSION['qixol_quoted_items']['cart_session_id']=md5(time());
716
+ $qixol_quoted_items=array();
717
+ $make_request_again=false;
718
+ if (isset($_SESSION['qixol_quoted_items']))
719
+ $qixol_quoted_items=$_SESSION['qixol_quoted_items'];
720
+ else $make_request_again=true;
721
+
722
+ //check difference between cards in productid and it quantity
723
+ $cart = $observer->getEvent()->getCart()->getQuote();
724
+ foreach ($cart->getAllItems() as $item) {
725
+ $product_search_tmp = Mage::getModel('catalog/product')->load($item->getProductId());
726
+ //$product_search_tmp->getSku().$item->getProduct()->getSku() use this structure to have unique combinations for simple and configured products
727
+ $short_data[$product_search_tmp->getSku().$item->getProduct()->getSku()]['qty']=$item->getQty();
728
+ }
729
+
730
+
731
+ if (!$make_request_again)
732
+ if (!is_array($_SESSION['qixol_quoted_items']['short_data'])){
733
+ $make_request_again=true;
734
+ } elseif(count($_SESSION['qixol_quoted_items']['short_data'])!=count($short_data)) {
735
+ $make_request_again=true;
736
+ } else {
737
+ $short_data_old=$_SESSION['qixol_quoted_items']['short_data'];
738
+ }
739
+
740
+ if ((!isset($_SESSION['qixol_quoted_items']['time_checked']))||(($_SESSION['qixol_quoted_items']['time_checked']+1200)<time())){ // rerequest in 10 minutes
741
+ $make_request_again=true;
742
+ }
743
+
744
+
745
+ if (!$make_request_again){
746
+ //now the cart have the same dimension, so if any product diffenrence it vill be visible simply
747
+ foreach($short_data as $current_id=>$current_prod_obj){
748
+ if ((!isset($short_data_old[$current_id]))||$short_data_old[$current_id]['qty']!=$current_prod_obj['qty']){
749
+ $make_request_again=true;
750
+ break;
751
+ }
752
+ }
753
+ }
754
+
755
+ if ((!$make_request_again)){
756
+ $shipping_price_exists=$cart->getShippingAddress()->getShippingAmount();
757
+ if ($shipping_price_exists!=(float)$_SESSION['qixol_quoted_items']['cart_data']['deliveryoriginalprice']){
758
+ $make_request_again=true;
759
+ }
760
+ }
761
+ if (count($cart->getAllItems())==0){
762
+ unset($_SESSION['qixol_quoted_items']['items']);
763
+ unset($_SESSION['qixol_quoted_items']['cart_data']);
764
+ unset($_SESSION['qixol_quoted_items']['short_data']);
765
+ unset($_SESSION['qixol_quoted_items']['promotions']);
766
+ unset($_SESSION['qixol_quoted_items']['messages']);
767
+ unset($_SESSION['qixol_quoted_items']['summary']);
768
+ $unlink_coupon=array();
769
+ foreach ($_SESSION['qixol_quoted_items']['coupons'] as $key_coupon_id => $coupon_data_tmp){
770
+ if ((bool)$coupon_data_tmp['issued']==true)
771
+ $unlink_coupon[$key_coupon_id]=$key_coupon_id;
772
+ }
773
+ if (count($unlink_coupon)>0)
774
+ foreach ($unlink_coupon as $key_coupon_id){
775
+ unset($_SESSION['qixol_quoted_items']['coupons'][$key_coupon_id]);
776
+ }
777
+ unset($qixol_quoted_items);
778
+ unset($short_data);
779
+ //print_r($_SESSION['qixol_quoted_items']);
780
+ //die();
781
+ }
782
+
783
+ //!!!!!!!!!!!!!!!!!!!!!!!
784
+ //$make_request_again=true;
785
+ //!!!!!!!!!!!!!!!!!!!!!!!
786
+ if ($make_request_again){
787
+ //echo "make_new_request<br>";
788
+ $getSinch=Mage::getModel('qixol/sinch');
789
+ if ($qixol_quoted_items_new=$getSinch->run_ImportCart($cart)){
790
+ $qixol_quoted_items=$qixol_quoted_items_new; //if returned new structure
791
+ }
792
+ $qixol_quoted_items['time_checked']=time();
793
+ $qixol_quoted_items['short_data']=$short_data;
794
+ $qixol_quoted_items['cart_session_id']=$_SESSION['qixol_quoted_items']['cart_session_id'];
795
+ $_SESSION['qixol_quoted_items']=$qixol_quoted_items;
796
+ //print_r($_SESSION['qixol_quoted_items']);
797
+ //die();
798
+ }
799
+ /*echo "<pre>";
800
+ print_r($_SESSION['qixol_quoted_items']);
801
+ echo "</pre>";*/
802
+ unset($_SESSION['inside_request']);
803
+ }
804
+
805
+ public function recordPoints($pointsInt, $customerId) {
806
+ $points = Mage::getModel('qixol/bonuspoints')->load($customerId);
807
+ $points->addPoints($pointsInt, $customerId);
808
+ $points->save();
809
+
810
+ }
811
+
812
+
813
+ public function usePoints($discounted, $customerId) {
814
+ $pointsAmt = $discounted;
815
+ $points = Mage::getModel('qixol/bonuspoints')->load($customerId);
816
+ $points->subtractPoints($pointsAmt, $customerId);
817
+ $points->save();
818
+ }
819
+ }
app/code/community/Holbi/Qixol/Model/Ordertotalpoints.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Ordertotalpoints extends Mage_Sales_Model_Quote_Address_Total_Abstract {
3
+
4
+ protected $_code = 'points';
5
+
6
+ public function collect(Mage_Sales_Model_Quote_Address $address) {
7
+ parent::collect($address);
8
+
9
+ $this->_setAmount(0);
10
+ $this->_setBaseAmount(0);
11
+
12
+ $items = $this->_getAddressItems($address);
13
+ if (!count($items)) {
14
+ return $this; //this makes only address type shipping to come through
15
+ }
16
+
17
+ $quote = $address->getQuote();
18
+
19
+ if(true/*$address->getData('address_type') == 'billing'*/){
20
+ $points_convertrate=1;
21
+ if ((int)Mage::getStoreConfig('qixol/issuedpoints/convertrate')>0)
22
+ $points_convertrate=(int)Mage::getStoreConfig('qixol/issuedpoints/convertrate');
23
+
24
+ $exist_amount = $quote->getPointsAmount()*$points_convertrate;
25
+ $new_points_amount = Mage::getSingleton('customer/session')->getPointsAmount(); //your discount
26
+ $balance = $new_points_amount - $exist_amount;
27
+
28
+ $address->setPointsAmount($new_points_amount/$points_convertrate);
29
+ $address->setBasePointsAmount($new_points_amount/$points_convertrate);
30
+
31
+
32
+ $grandTotal = $address->getGrandTotal();
33
+ $baseGrandTotal = $address->getBaseGrandTotal();
34
+ $quote->setFeeAmount($new_points_amount/$points_convertrate);
35
+
36
+ $address->setGrandTotal($grandTotal - ($balance/$points_convertrate));
37
+ $address->setBaseGrandTotal($baseGrandTotal - ($balance/$points_convertrate));
38
+ }
39
+ return $this;
40
+ }
41
+
42
+ public function fetch(Mage_Sales_Model_Quote_Address $address)
43
+ {
44
+ $rewards1 = $address->getPointsAmount();
45
+ if ($rewards1!=0) {
46
+ $address->addTotal(array(
47
+ 'code'=>$this->getCode(),
48
+ 'title'=>Mage::helper('qixol')->__('Reward Points Discount'),
49
+ 'value'=>"-".$rewards1
50
+ ));
51
+
52
+ }
53
+ return $this;
54
+ }
55
+
56
+ }
app/code/community/Holbi/Qixol/Model/Promotions.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Holbi_Qixol_Model_Promotions extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct(){
6
+
7
+ $this->_init("qixol/promotions",'promotion_id');
8
+
9
+ }
10
+
11
+ }
12
+
app/code/community/Holbi/Qixol/Model/Shippingmap.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Shippingmap extends Mage_Core_Model_Abstract {
3
+
4
+ public function _construct() {
5
+ parent::_construct();
6
+ $this->_init('qixol/shippingmap', "shipping_name");
7
+ }
8
+
9
+ public function getOptionArray(){
10
+ $hlp = Mage::helper('qixol');
11
+ $collections=$this->getCollection();
12
+ $list_return=array();
13
+ foreach ($collections as $item){
14
+ $list_return[]=array(
15
+ 'value' => (string)$item->getShippingName(),
16
+ 'label' => $hlp->__((string)$item->getShippingName())
17
+ );
18
+ }
19
+ return $list_return;
20
+ }
21
+ }
app/code/community/Holbi/Qixol/Model/Sinch.php ADDED
@@ -0,0 +1,1303 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ //ini_set('memory_limit','256M');
4
+ require_once ('config.php');
5
+ class Holbi_Qixol_Model_Sinch extends Mage_Core_Model_Abstract {
6
+ private $process_export_status_table;
7
+ private $process_export_status_id=array();
8
+ private $export_poducts_statistic_table;
9
+ private $export_poducts_statistic_id=array();
10
+ private $export_by = 'MANUAL';
11
+
12
+ function __construct(){
13
+ //teble for store current sate
14
+ $this->process_export_status_table=Mage::getSingleton('core/resource')->getTableName('qixol_process_export_status_table');
15
+ //teble for store global state result
16
+ $this->export_poducts_statistic_table=Mage::getSingleton('core/resource')->getTableName('qixol_product_export_stat');
17
+ $this->_logFile=LOG_FILE;
18
+ $this->pushLog("constructor");
19
+ }
20
+
21
+ function pushLog($log){
22
+
23
+ if(trim($log)!=''){
24
+ Mage::log($log, null, $this->_logFile);
25
+ //store in some log table if required
26
+ }
27
+ }
28
+
29
+ function cron_run_export(){//call from cron product export
30
+ $this->pushLog("Start export from cron:".date("Y-m-d H:i:s"));
31
+ $this->export_by='CRON';
32
+ $this->run_export_qixolData();
33
+ $this->pushLog("Finish export from cron".date("Y-m-d H:i:s"));
34
+ }
35
+
36
+ function cron_run_import(){//call from cron product export
37
+ $this->pushLog("Start export from cron:".date("Y-m-d H:i:s"));
38
+ $this->export_by='CRON';
39
+ if (Mage::getStoreConfig('holbi/qixol/enabled')>0){
40
+ $this->run_import_Promotions();
41
+ $this->run_import_DayPromotions();
42
+ }
43
+ $this->pushLog("Finish export from cron".date("Y-m-d H:i:s"));
44
+ }
45
+
46
+ function getDataOfLatestExport(){
47
+ $_status=array();
48
+ //return only first erroror or all success, or notjhing
49
+ $tmp_data=$this->getExportStatus('customers');
50
+ if ($tmp_data['id']>0&&$tmp_data['message']=='error'){
51
+ $_status=array('last_message'=>'error','export_what'=>'Customers','status_export_message'=>$tmp_data['extended_message']);
52
+ return $_status;
53
+ }
54
+ elseif($tmp_data['id']>0) $_status=array('last_message'=>'success','export_what'=>'Customers');
55
+
56
+ $tmp_data=$this->getExportStatus('delivery');
57
+ if ($tmp_data['id']>0&&$tmp_data['message']=='error'){
58
+ $_status=array('last_message'=>'error','export_what'=>'Delivery','status_export_message'=>$tmp_data['extended_message']);
59
+ }
60
+ elseif ($tmp_data['id']>0) $_status=array('last_message'=>'success','export_what'=>'Delivery');
61
+
62
+ $tmp_data=$this->getExportStatus('products');
63
+ if ($tmp_data['id']>0&&$tmp_data['message']=='error'){
64
+ $_status=array('last_message'=>'error','export_what'=>'Products','status_export_message'=>$tmp_data['extended_message']);
65
+ }
66
+ elseif ($tmp_data['id']>0) $_status=array('last_message'=>'success','export_what'=>'Customers');
67
+
68
+ $tmp_data=$this->getExportStatus('currency');
69
+ if ($tmp_data['id']>0&&$tmp_data['message']=='error'){
70
+ $_status=array('last_message'=>'error','export_what'=>'Currency','status_export_message'=>$tmp_data['extended_message']);
71
+ }
72
+ elseif ($tmp_data['id']>0) $_status=array('last_message'=>'success','export_what'=>'Currency');
73
+
74
+ $tmp_data=$this->getExportStatus('store');
75
+ if ($tmp_data['id']>0&&$tmp_data['message']=='error'){
76
+ $_status=array('last_message'=>'error','export_what'=>'Store','status_export_message'=>$tmp_data['extended_message']);
77
+ }
78
+ elseif ($tmp_data['id']>0) $_status=array('last_message'=>'success','export_what'=>'Store');
79
+ //disabled ad duplicate now functionality of satat
80
+ /*$query="SELECT
81
+ *
82
+ FROM ".$this->export_poducts_statistic_table."
83
+ ORDER BY export_id DESC LIMIT 1";
84
+ $read_data = Mage::getSingleton('core/resource')->getConnection('core_read');
85
+ // now $write is an instance of Zend_Db_Adapter_Abstract
86
+ $readresult=$read_data->query($query);
87
+ $_status = $readresult->fetch();*/
88
+ return $_status;
89
+ }
90
+
91
+ function run_export(){ //run from admin area
92
+ $this->run_export_qixolData();
93
+ echo "done";
94
+ }
95
+
96
+ function run_import(){
97
+ if (Mage::getStoreConfig('holbi/qixol/enabled')>0){
98
+ //temporary run here but should be by cron only...
99
+ $this->run_import_Promotions();
100
+ //temporary run here but should be by cron only...
101
+ $this->run_import_DayPromotions();
102
+ }
103
+ echo "done";
104
+ }
105
+
106
+ function run_processOrder($cart){
107
+ global $_SESSION;
108
+ /* as customer described, there is no need to get validated cart , just set confirmed flag to ValidateBasket
109
+ $soapclient = new soapclient('http://evaluation.qixolpromo.com/BasketService.svc?singleWsdl', array('trace' => 1));
110
+ $types_array = $soapclient->__getTypes();
111
+ $functions_array = $soapclient->__getFunctions();
112
+ if (isset($_SESSION['qixol_quoted_items']['cart_data']['id'])){
113
+ try {
114
+ $result = $soapclient->__soapCall('RetrieveValidatedBasket', array('RetrieveValidatedBasket' => array('companyKey' => Mage::getStoreConfig('qixol/integraion/companykey'),'basketRef'=>$_SESSION['qixol_quoted_items']['cart_data']['id'])));
115
+ print_r($result);
116
+ //$xml_shopping_cart_validated=$result->ValidateBasketResult;
117
+ //replace backet and store order
118
+
119
+ } catch (SoapFault $e) {
120
+ echo "REQUEST:\n" . $soapclient->__getLastRequestHeaders();
121
+ echo $soapclient->__getLastRequest() . "\n";
122
+
123
+ echo "RESPONSE:\n" . $soapclient->__getLastResponseHeaders();
124
+ echo $soapclient->__getLastResponse() . "\n";
125
+ }
126
+ }*/
127
+
128
+ return $this->run_ImportCart($cart,true);// set true to confirm cart(process cart)
129
+
130
+ }
131
+
132
+ function run_ImportCart($cart,$set_confirmed=false){
133
+ global $_SESSION;
134
+ $_SESSION['inside_request']=time();
135
+
136
+ $item_id=0;
137
+ $data_products='';
138
+ $coupons_applyed='';
139
+ $customer_groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
140
+ if ($customer_groupId>0){
141
+ $customergroup = Mage::getModel('customer/group')->load($customer_groupId);
142
+ $customergroupName=$customergroup->getCode($customergroup);
143
+ }else
144
+ $customergroupName='NOT LOGGED IN';
145
+
146
+ foreach ($cart->getAllVisibleItems() as $item) {
147
+ $item_id++;
148
+ //getProduct()->getIsVirtual()
149
+ $data_products.='<item id="'.$item->getId()/*$item_id*/.'" ';
150
+ if ($item->getProductType()=='configurable'){
151
+ //$item->getOptionByCode('simple_product')->getValue();
152
+ $product_search_tmp = Mage::getModel('catalog/product')->load($item->getProductId());
153
+ $data_products.='productcode="'.$product_search_tmp->getSku().'" variantcode="'.$item->getSku().'"';
154
+ //print_r($item->_getData('product'));
155
+ }/*else if ($item->getProductType()=='grouped'){
156
+ //do not apply now
157
+ }else if ($item->getProductType()=='bundle'){
158
+ //do not apply now
159
+ }*/else { //simple
160
+ $data_products.=' productcode="'.$item->getSku().'" variantcode="" ';
161
+ }
162
+ $data_products.=' barcode="" quantity="'.$item->getQty().'" price="'.$item->getPrice().'" ></item>';
163
+ //print_r(Zend_Debug::dump($item->debug()));
164
+
165
+ //print_r(Zend_Debug::dump($item->debug()));
166
+ //echo $data_products."<br>\n";
167
+
168
+ }
169
+ //delivery methid if exists and delivery price....
170
+ $shipping_method_exists=$cart->getShippingAddress()->getShippingMethod();
171
+ $shipping_price_exists=0;
172
+ $product_to_enter_in_cart=array();
173
+ if ($shipping_method_exists!=''){
174
+ $shipping_price_exists=$cart->getShippingAddress()->getShippingAmount();
175
+ if ($shipping_price_exists==0){//somethimes returns zero
176
+ // sometimes magento returning shipping method but not returning correct price
177
+ //searching price for method
178
+ $address = $cart->getShippingAddress();
179
+ $rates = $address->collectShippingRates()
180
+ ->getGroupedAllShippingRates();
181
+ foreach ($rates as $carrier) {
182
+ foreach ($carrier as $rate) {
183
+ if ($rate->getCode()==$shipping_method_exists){
184
+ $shipping_price_exists=$rate->getPrice();
185
+ break;
186
+ }
187
+ }
188
+ }
189
+ }
190
+ }
191
+
192
+
193
+ if (isset($_SESSION['qixol_quoted_items']['coupons'])&&count($_SESSION['qixol_quoted_items']['coupons'])){
194
+ $coupons_applyed.='<coupons>';
195
+ foreach ($_SESSION['qixol_quoted_items']['coupons'] as $entered_coupons=>$tmp_val){
196
+ if ((bool)$tmp_val['issued']==false)
197
+ $coupons_applyed.='<coupon code="'.trim($entered_coupons).'"/>';
198
+ }
199
+ $coupons_applyed.='</coupons>';
200
+ }
201
+
202
+ //get mapping
203
+ $list_customer_map_names=Mage::getModel('qixol/Customergrouspmap')->getCollection();
204
+
205
+ $list_customer_map_names_exists=array();
206
+
207
+ foreach ($list_customer_map_names as $list_map){
208
+ $list_customer_map_names_exists[$list_map->getCustomerGroupName()]=$list_map->getCustomerGroupNameMap();
209
+ }
210
+ // end mapping array
211
+
212
+ if (isset($list_customer_map_names_exists[$customergroupName])){
213
+ $customergroupName=$list_customer_map_names_exists[$customergroupName];
214
+ }
215
+
216
+ //get mapping
217
+ $list_store_map_names=Mage::getModel('qixol/Storesmap')->getCollection();
218
+
219
+ $list_store_map_names_exists=array();
220
+
221
+ foreach ($list_store_map_names as $list_map){
222
+ $list_store_map_names_exists[$list_map->getCustomerGroupName()]=$list_map->getCustomerGroupNameMap();
223
+ }
224
+ // end mapping array
225
+
226
+ //get mapping
227
+ $list_shipping_map_names=Mage::getModel('qixol/Shippingmap')->getCollection();
228
+
229
+ $list_shipping_map_names_exists=array();
230
+
231
+ foreach ($list_shipping_map_names as $list_map){
232
+ $list_shipping_map_names_exists[$list_map->getShippingName()]=$list_map->getShippingNameMap();
233
+ }
234
+ // end mapping array
235
+
236
+ if ($data_products!=''){
237
+ //echo "call promotions";
238
+ $promotions='<basket id="'./*Mage::getSingleton("core/session")->getEncryptedSessionId()*/$_SESSION['qixol_quoted_items']['cart_session_id'].'" companykey="'.Mage::getStoreConfig('qixol/integraion/companykey').
239
+ '" baskettotal="'.$cart->getGrandTotal().
240
+ '" basketdate="'.date("Y-m-d\TH:i:s",strtotime("+ 1 DAY")).'" channel="'.Mage::getStoreConfig('qixol/syhchronized/channel').
241
+ '" storegroup="'.Mage::getStoreConfig('qixol/syhchronized/storegroup').'" store="'.(
242
+ (isset($list_store_map_names_exists[Mage::app()->getStore()->getName()])&&trim($list_store_map_names_exists[Mage::app()->getStore()->getName()])!='')?
243
+ $list_store_map_names_exists[Mage::app()->getStore()->getName()]:
244
+ Mage::app()->getStore()->getName())/*Mage::getStoreConfig('qixol/syhchronized/channel')*/.
245
+
246
+ ($shipping_method_exists!=''?'" deliverymethod="'.$shipping_method_exists:"").
247
+ ($shipping_price_exists>0?'" deliveryprice="'.$shipping_price_exists:"").
248
+
249
+ '" customergroup="'.$customergroupName.
250
+ '" currencycode="'.Mage::app()->getStore()->getCurrentCurrencyCode().
251
+ ($set_confirmed?'" confirmed="true':"").
252
+ '" >'.$coupons_applyed.'<items>'.$data_products.'</items></basket>';
253
+ //echo $promotions."\n\n\n";
254
+ $soapclient = new soapclient('http://evaluation.qixolpromo.com/BasketService.svc?singleWsdl', array('trace' => 1));
255
+ //$types_array = $soapclient->__getTypes();
256
+ //$functions_array = $soapclient->__getFunctions();
257
+
258
+ try {
259
+
260
+ $result = $soapclient->__soapCall('ValidateBasket', array('ValidateBasket' => array('basketXml' => $promotions)));
261
+ $xml_shopping_cart_validated=$result->ValidateBasketResult;
262
+ //print_r($xml_shopping_cart_validated);
263
+ //echo $xml_shopping_cart_validated."\n\n\n";
264
+ //temporary....
265
+ //$xml_shopping_cart_validated='<response id="2d2pi81tbatge0pm14gkhr7ru5" date="2015-12-22T17:43:06" companykey="2U-6DyxID02m1-rddeplwA" customergroup="NOT LOGGED IN" channel="WEB" store="WEB" storegroup="WEB" manualdiscount="0" basketdiscount="15.0000" linesdiscount="0" totaldiscount="15.0000" baskettotal="78.0000" originalbaskettotal="78" deliverymanualdiscount="0" deliveryprice="0" deliverypromotiondiscount="0" deliverytotaldiscount="0" deliveryoriginalprice="0" totalissuedpoints="7800"><items><item id="46" engineid="1613" productcode="test_5" variantcode="" barcode="" price="33" manualdiscount="0" quantity="1" linepromotiondiscount="0" totaldiscount="0" originalprice="33" originalquantity="1" originalamount="33" appliedpromotioncount="2" isdelivery="false" lineamount="33"><description>test product 5</description><promotions><promotion id="119" discountamount="0" instance="1" forlineid="46" basketlevel="true" /><promotion id="116" discountamount="0" instance="1" forlineid="46" basketlevel="true" /></promotions></item><item id="47" engineid="1503" productcode="Test1_01" variantcode="" barcode="" price="9" manualdiscount="0" quantity="5" linepromotiondiscount="0" totaldiscount="0" originalprice="9" originalquantity="5" originalamount="45" appliedpromotioncount="2" isdelivery="false" lineamount="45"><description>test product 1</description><promotions><promotion id="119" discountamount="0" instance="1" forlineid="47" basketlevel="true" /><promotion id="116" discountamount="0" instance="1" forlineid="47" basketlevel="true" /></promotions></item><item id="48" engineid="0" productcode="123456" price="15.0000" manualdiscount="0" quantity="1" linepromotiondiscount="0" totaldiscount="0" originalprice="15.0000" originalquantity="1" originalamount="15.0000" appliedpromotioncount="1" isdelivery="false" generated="true" lineamount="15.0000"><description>test product 2</description><promotions><promotion id="116" discountamount="15.0000" instance="1" forlineid="48" basketlevel="true" /></promotions></item></items><coupons /><summary result="true" promotionsapplied="2"><promotions><promotion type="FREEPRODUCT" display="Free product" id="116" discountamount="15.0000" instance="1" basketlevel="true"><name>Qixol 7a</name><displaytext>Buy "test product 1 / Test1_01" get "test product 2 / 123456" free (applies ONCE only)</displaytext></promotion><promotion type="ISSUEPOINTS" display="Receive points" id="119" discountamount="0" instance="1" issuedpoints="7800" basketlevel="true"><name>Qixol 9</name><displaytext>Spend more than 50.00 - get points</displaytext></promotion></promotions><messages /></summary></response>';
266
+ //$xml_shopping_cart_validated='<response id="508ke06681i38qt23gmfv239n4" date="2015-12-23T14:11:44" companykey="2U-6DyxID02m1-rddeplwA" customergroup="NOT LOGGED IN" channel="WEB" store="WEB" storegroup="WEB" manualdiscount="0" basketdiscount="0" linesdiscount="13.50" totaldiscount="13.50" baskettotal="31.49" originalbaskettotal="44.99" deliverymanualdiscount="0" deliveryprice="0" deliverypromotiondiscount="0" deliverytotaldiscount="0" deliveryoriginalprice="0"><items><item id="62" engineid="1611" productcode="config_1" variantcode="test2_01_01" barcode="" price="31.49" manualdiscount="0" quantity="1" linepromotiondiscount="13.50" totaldiscount="13.50" originalprice="44.99" originalquantity="1" originalamount="44.99" appliedpromotioncount="1" isdelivery="false" lineamount="31.49"><description>Child 1</description><promotions><promotion id="121" discountamount="13.50" instance="1" forlineid="62" /></promotions></item></items><coupons /><summary result="true" promotionsapplied="1"><promotions><promotion type="PRODUCTSREDUCTION" display="Product discount" id="121" discountamount="13.50" instance="1"><name>Qixol 10</name><displaytext>Use an issued coupon, get 30% off any Size = L product</displaytext></promotion></promotions><messages /></summary></response>';
267
+ $new_cart_structure=array();
268
+ //$update_cart=false;
269
+ if (strlen($xml_shopping_cart_validated)>10){
270
+ $xml_object = simplexml_load_string($xml_shopping_cart_validated);
271
+ //print_r($xml_object);
272
+
273
+
274
+ $attributes_cart=$xml_object->attributes();
275
+ $new_cart_structure['cart_data']=array();
276
+ $new_cart_structure['cart_data']['id']=(isset($attributes_cart['id'])?(string)$attributes_cart['id']:0);
277
+ $new_cart_structure['cart_data']['manualdiscount']=(isset($attributes_cart['manualdiscount'])?(float)$attributes_cart['manualdiscount']:0);
278
+ $new_cart_structure['cart_data']['basketdiscount']=(isset($attributes_cart['basketdiscount'])?(float)$attributes_cart['basketdiscount']:0);
279
+ $new_cart_structure['cart_data']['linesdiscount']=(isset($attributes_cart['linesdiscount'])?(float)$attributes_cart['linesdiscount']:0);
280
+ $new_cart_structure['cart_data']['totaldiscount']=(isset($attributes_cart['totaldiscount'])?(float)$attributes_cart['totaldiscount']:0);
281
+ $new_cart_structure['cart_data']['baskettotal']=(isset($attributes_cart['baskettotal'])?(float)$attributes_cart['baskettotal']:0);
282
+ $new_cart_structure['cart_data']['originalbaskettotal']=(isset($attributes_cart['originalbaskettotal'])?(float)$attributes_cart['originalbaskettotal']:0);
283
+ $new_cart_structure['cart_data']['deliverymanualdiscount']=(isset($attributes_cart['deliverymanualdiscount'])?(float)$attributes_cart['deliverymanualdiscount']:0);
284
+ $new_cart_structure['cart_data']['deliveryprice']=(isset($attributes_cart['deliveryprice'])?(float)$attributes_cart['deliveryprice']:0);
285
+ $new_cart_structure['cart_data']['deliverypromotiondiscount']=(isset($attributes_cart['deliverypromotiondiscount'])?(float)$attributes_cart['deliverypromotiondiscount']:0);
286
+ $new_cart_structure['cart_data']['deliverytotaldiscount']=(isset($attributes_cart['deliverytotaldiscount'])?(float)$attributes_cart['deliverytotaldiscount']:0);
287
+ $new_cart_structure['cart_data']['deliveryoriginalprice']=(isset($attributes_cart['deliveryoriginalprice'])?(float)$attributes_cart['deliveryoriginalprice']:0);
288
+
289
+
290
+ if ($xml_object instanceof SimpleXMLElement) {
291
+ foreach ($xml_object as $xml_root_key=>$xml_object_sub){
292
+ if ($xml_root_key=='items'){
293
+ $new_cart_structure['items']=array();
294
+ foreach ($xml_object_sub as $item_key=>$xml_items_sub){
295
+ $item_attributes=$xml_items_sub->attributes();
296
+
297
+ $new_cart_structure['items'][(int)$item_attributes['id']]=array();
298
+
299
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['quoteid']=(int)$item_attributes['id'];
300
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['productcode']=(isset($item_attributes['productcode'])?(string)$item_attributes['productcode']:'');
301
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['variantcode']=(isset($item_attributes['variantcode'])?(string)$item_attributes['variantcode']:'');
302
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['price']=(isset($item_attributes['price'])?(float)$item_attributes['price']:0.0);
303
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['manualdiscount']=(isset($item_attributes['manualdiscount'])?(float)$item_attributes['manualdiscount']:0);
304
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['quantity']=(isset($item_attributes['quantity'])?(float)$item_attributes['quantity']:0);
305
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['linepromotiondiscount']=(isset($item_attributes['linepromotiondiscount'])?(float)$item_attributes['linepromotiondiscount']:0);
306
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['totaldiscount']=(isset($item_attributes['totaldiscount'])?(float)$item_attributes['totaldiscount']:0);
307
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['originalprice']=(isset($item_attributes['originalprice'])?(float)$item_attributes['originalprice']:0);
308
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['originalquantity']=(isset($item_attributes['originalquantity'])?(float)$item_attributes['originalquantity']:0);
309
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['originalamount']=(isset($item_attributes['originalamount'])?(float)$item_attributes['originalamount']:0);
310
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['appliedpromotioncount']=(isset($item_attributes['appliedpromotioncount'])?(float)$item_attributes['appliedpromotioncount']:0);
311
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['isdelivery']=(isset($item_attributes['isdelivery'])&&strtolower((string)$item_attributes['isdelivery'])=='true'?true:false);
312
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['totalissuedpoints']=(isset($item_attributes['totalissuedpoints'])?(int)$item_attributes['totalissuedpoints']:0);
313
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['splitfromlineid']=(isset($item_attributes['splitfromlineid'])?(int)$item_attributes['splitfromlineid']:0);
314
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['alwaysexcluded']=(isset($item_attributes['alwaysexcluded'])?(int)$item_attributes['alwaysexcluded']:0);
315
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['generated']=(isset($item_attributes['generated'])&&strtolower($item_attributes['generated'])=='true'?(true):false);
316
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['appliedpromotioncount']=(isset($item_attributes['appliedpromotioncount'])?(float)$item_attributes['appliedpromotioncount']:0);
317
+ $new_cart_structure['items'][(int)$item_attributes['id']]['description']=(isset($xml_items_sub->description)?(string)$xml_items_sub->description:'');
318
+ $new_cart_structure['items'][(int)$item_attributes['id']]['data']['lineamount']=(isset($item_attributes['lineamount'])?(float)$item_attributes['lineamount']:0);
319
+
320
+
321
+ //get cart item by cart item iD returned from validation
322
+
323
+ $item_not_found=true;
324
+ foreach ($cart->getAllVisibleItems() as $item) {
325
+ if ($item->getId()==(int)$item_attributes['id']){
326
+ $item_not_found=false;
327
+ $cart_item=$item;
328
+ unset($product_search_tmp_sku);
329
+ if ($cart_item->getProductType()=='configurable'){
330
+ $product_search_tmp = Mage::getModel('catalog/product')->load($cart_item->getProductId());
331
+ $product_search_tmp_sku=$product_search_tmp->getSku();
332
+ }
333
+ $new_cart_structure['items'][(int)$item_attributes['id']]['updated_qty']=false;
334
+ $new_cart_structure['items'][(int)$item_attributes['id']]['updated_price']=false;
335
+ $product_updated=false;
336
+ //echo "/".$cart_item->getProductType()."||".(string)$item_attributes['productcode']."==".$product_search_tmp_sku."+".(string)$item_attributes['variantcode']."==".$cart_item->getSku()."||";
337
+ if ((!$cart_item->isDeleted() && !$cart_item->getParentItemId()/*check is visible*/)&&($cart_item->getProductType()=='configurable'&&(string)$item_attributes['productcode']==$product_search_tmp_sku&&(string)$item_attributes['variantcode']==$cart_item->getSku())
338
+ || ((string)$item_attributes['variantcode']==''&&(string)$item_attributes['productcode']==$cart_item->getSku())){
339
+ if ($item_attributes['quantity']!=$cart_item->getQty()){
340
+ $new_cart_structure['items'][(int)$item_attributes['id']]['updated_qty']=true;
341
+ /* $cart_item->setQty($item_attributes['quantity']);
342
+ $product_updated=true;
343
+ */
344
+ }
345
+ if ((float)$item_attributes['lineamount']!=($cart_item->getPrice()*$cart_item->getQty())){
346
+ /* echo "discount:".((float)$item_attributes['lineamount']/(float)$item_attributes['quantity'])."\n<br>\n";
347
+ $cart_item->setCustomPrice((float)$item_attributes['lineamount']/(float)$item_attributes['quantity']);
348
+ $cart_item->setOriginalCustomPrice((float)$item_attributes['lineamount']/(float)$item_attributes['quantity']);
349
+ $cart_item->getProduct()->setIsSuperMode(true);*/
350
+ $new_cart_structure['items'][(int)$item_attributes['id']]['updated_price']=true;
351
+ //$product_updated=true;
352
+ }
353
+
354
+ /*if ($product_updated){
355
+ $update_cart=true;
356
+ $cart_item->save();
357
+ }
358
+ echo $cart_item->getProductId().",,,,";*/
359
+
360
+ } else {
361
+ //echo "different<br>";
362
+ if ((int)Mage::getStoreConfig('qixol/advanced/separateitem')>0){
363
+ $new_cart_structure['items'][(int)$item_attributes['id']]['new']=true;
364
+ } else {
365
+ $new_cart_structure['items'][(int)$item_attributes['id']]['updated_qty']=true;
366
+ }
367
+ //$product_to_enter_in_cart[]=$item_attributes;
368
+ }
369
+ }
370
+ }
371
+ $is_splitted_line=false;
372
+ if ($item_not_found){
373
+ if (!isset($item_attributes['splitfromlineid'])||(int)$item_attributes['splitfromlineid']==0){
374
+ //$product_to_enter_in_cart[]=$item_attributes;
375
+ if ((int)Mage::getStoreConfig('qixol/advanced/separateitem')>0){
376
+ $new_cart_structure['items'][(int)$item_attributes['id']]['new']=true;
377
+ }else {
378
+ $check_exists_in_cart=false;
379
+ foreach ($new_cart_structure['items'] as $current_item_cart_position => $cart_item_to_check){
380
+ if ($current_item_cart_position == (int)$item_attributes['id']) continue ;
381
+ if ($cart_item_to_check['data']['productcode']==(string)$item_attributes['productcode']&&$cart_item_to_check['data']['variantcode']==(string)$item_attributes['variantcode']){
382
+ $new_cart_structure['items'][$current_item_cart_position]['updated_qty']=true;
383
+ $new_cart_structure['items'][$current_item_cart_position]['free_added']=(isset($item_attributes['quantity'])?(float)$item_attributes['quantity']:0);
384
+ //$new_cart_structure['items'][$current_item_cart_position]['updated_price']=true;
385
+ //$new_cart_structure['items'][$current_item_cart_position]['data']['price']+=(isset($item_attributes['price'])?(float)$item_attributes['price']:0.0);
386
+ $new_cart_structure['items'][$current_item_cart_position]['data']['quantity']+=(isset($item_attributes['quantity'])?(float)$item_attributes['quantity']:0);
387
+ //$new_cart_structure['items'][$current_item_cart_position]['data']['originalamount']+=(isset($item_attributes['originalamount'])?(float)$item_attributes['originalamount']:0.0);
388
+ //$new_cart_structure['items'][$current_item_cart_position]['data']['totaldiscount']=(isset($item_attributes['originalamount'])?(float)$item_attributes['originalamount']:0.0);
389
+ $check_exists_in_cart=true;
390
+ }
391
+ }
392
+ if (!$check_exists_in_cart){
393
+ $new_cart_structure['items'][(int)$item_attributes['id']]['new']=true;
394
+ if ($new_cart_structure['items'][(int)$item_attributes['id']]['data']['lineamount']==0)
395
+ $new_cart_structure['items'][$current_item_cart_position]['free_added']=(isset($item_attributes['quantity'])?(float)$item_attributes['quantity']:0);
396
+ }
397
+
398
+ }
399
+ } elseif((int)$item_attributes['splitfromlineid']>0) {
400
+ //$new_cart_structure['items'][(int)$item_attributes['splitfromlineid']]['data']['quantity']+=(isset($item_attributes['quantity'])?(float)$item_attributes['quantity']:0);
401
+ //remove updated quantity for splitted
402
+ $new_cart_structure['items'][(int)$item_attributes['splitfromlineid']]['updated_qty']=0;
403
+ //for splitted there is possible different discount, should be recalcualted in main produc tdiscount
404
+ $new_cart_structure['items'][(int)$item_attributes['splitfromlineid']]['data']['totaldiscount']+=(float)$item_attributes['totaldiscount'];
405
+ $calcualted_discount=$new_cart_structure['items'][(int)$item_attributes['splitfromlineid']]['data']['totaldiscount']/$new_cart_structure['items'][(int)$item_attributes['splitfromlineid']]['data']['originalquantity'];
406
+ $new_cart_structure['items'][(int)$item_attributes['splitfromlineid']]['data']['price']=$new_cart_structure['items'][(int)$item_attributes['splitfromlineid']]['data']['originalprice']-$calcualted_discount;
407
+ $new_cart_structure['items'][(int)$item_attributes['splitfromlineid']]['data']['lineamount']=($new_cart_structure['items'][(int)$item_attributes['splitfromlineid']]['data']['price']*$new_cart_structure['items'][(int)$item_attributes['splitfromlineid']]['data']['originalquantity']);
408
+ $is_splitted_line=true;
409
+ }
410
+ //echo "new_item";
411
+ }
412
+
413
+
414
+ foreach ($xml_items_sub as $item_tag_key=>$xml_item_sub){
415
+ if($item_tag_key=='promotions'){
416
+ $new_cart_structure['items'][(int)$item_attributes['id']]['promotions']=array();
417
+ foreach ($xml_item_sub as $promotion_id=>$promotion){
418
+ $promotion_attributes=$promotion->attributes();
419
+ $new_cart_structure['items'][(int)$item_attributes['id']]['promotions'][(int)$promotion_attributes['id']]=array();
420
+ //print_r($promotion_attributes);
421
+ $new_cart_structure['items'][(int)$item_attributes['id']]['promotions'][(int)$promotion_attributes['id']]['id']=(int)$promotion_attributes['id'];
422
+
423
+ //$new_cart_structure['items'][(int)$item_attributes['id']]['promotions'][(int)$promotion_attributes['id']]['id']=(isset($promotion_attributes['discountamount'])?(float)$promotion_attributes['discountamount']:0);
424
+ $new_cart_structure['items'][(int)$item_attributes['id']]['promotions'][(int)$promotion_attributes['id']]['instance']=(isset($promotion_attributes['instance'])?(int)$promotion_attributes['instance']:0);
425
+ $new_cart_structure['items'][(int)$item_attributes['id']]['promotions'][(int)$promotion_attributes['id']]['basketlevel']=(isset($promotion_attributes['basketlevel'])&&strtolower($promotion_attributes['basketlevel'])=='true'?(true):false);
426
+ $new_cart_structure['items'][(int)$item_attributes['id']]['promotions'][(int)$promotion_attributes['id']]['discountamount']=(isset($promotion_attributes['discountamount'])?(float)$promotion_attributes['discountamount']:0);
427
+ if ($is_splitted_line){ //check is promotion exists in main linea
428
+ if (!isset($new_cart_structure['items'][(int)$item_attributes['splitfromlineid']]['promotions'][(int)$promotion_attributes['id']])){
429
+ $new_cart_structure['items'][(int)$item_attributes['splitfromlineid']]['promotions'][(int)$promotion_attributes['id']]=$new_cart_structure['items'][(int)$item_attributes['id']]['promotions'][(int)$promotion_attributes['id']];
430
+ }
431
+ }
432
+ //the text and promotion data will be parsed from summary
433
+ /*if ((bool)$promotion_attributes['basketlevel']!=true){
434
+ $promotion_data=Mage::getModel('qixol/promotions')->load((int)$promotion_attributes['id']);
435
+ //print_r($promotion_data->getPromotionType());
436
+ //print_r($promotion_data->getPromotionText());
437
+ }*/
438
+ }
439
+
440
+ }
441
+ }
442
+ }
443
+ } elseif($xml_root_key=='coupons') {
444
+ $new_cart_structure['coupons']=array();
445
+ //print_r($xml_object_sub);
446
+ foreach ($xml_object_sub as $item_key=>$xml_items_sub){
447
+ if ($item_key=='coupon'){
448
+ $coupon_attributes=$xml_items_sub->attributes();
449
+ if (!(strtolower((string)$coupon_attributes['issued'])=='true')){
450
+ if(isset($coupon_attributes['code'])&&(string)$coupon_attributes['code']!=''){
451
+ $new_cart_structure['coupons'][(string)$coupon_attributes['code']]['issued']=false;
452
+ $new_cart_structure['coupons'][(string)$coupon_attributes['code']]['code']=(string)$coupon_attributes['code'];
453
+ $new_cart_structure['coupons'][(string)$coupon_attributes['code']]['description']=(isset($xml_items_sub->couponname)&&(string)$xml_items_sub->couponname!=''?(string)$xml_items_sub->couponname:(string)$coupon_attributes['code']);
454
+ } else {
455
+ unset($_SESSION['qixol_quoted_items']['coupons'][(string)$coupon_attributes['code']]);
456
+ }
457
+ }else {
458
+
459
+
460
+ //!!!!!!!!!!!!!!! get valid to for coupon
461
+ $validtill='0000-00-00 00:00:00';
462
+ $soapclient_coupon = new soapclient('http://evaluation.qixolpromo.com/BasketService.svc?singleWsdl', array('trace' => 1));
463
+ try {
464
+ $update_item=false;
465
+ $result_coupon = $soapclient_coupon->__soapCall('ValidateCouponCode', array('ValidateCouponCode' => array('companyKey' => Mage::getStoreConfig('qixol/integraion/companykey'),'couponCode' => (string)$coupon_attributes['code'])));
466
+ $xml_coupon_code_validated=$result_coupon->ValidateCouponCodeResult;
467
+ if (strlen($xml_coupon_code_validated)>10){
468
+ $xml_coupon_object = simplexml_load_string($xml_coupon_code_validated);
469
+ foreach ($xml_coupon_object as $xml_coupon_object_root_key=>$xml_coupon_object_object_sub){
470
+ if ($xml_coupon_object_root_key=='coupon'){
471
+ foreach ($xml_coupon_object_object_sub as $xml_coupon_object_coupon_key=>$xml_coupon_object_object_coupon){
472
+ if ($xml_coupon_object_coupon_key=='codes'){
473
+ foreach ($xml_coupon_object_object_coupon as $xml_coupon_object_object_coupon_obj){
474
+ $xml_coupon_object_object_coupon_attributes=$xml_coupon_object_object_coupon_obj->attributes();
475
+ $validtill=date("Y-m-d H:i:s",strtotime((string)$xml_coupon_object_object_coupon_attributes['validto']));
476
+ }
477
+ }
478
+ }
479
+ }
480
+ }
481
+ }
482
+
483
+ } catch (SoapFault $e) {
484
+ ;
485
+ }
486
+ //!!!!!!!!!!!!!!! end valid to for coupon
487
+ $new_cart_structure['coupons'][(string)$coupon_attributes['code']]['description']=(string)$xml_items_sub->couponname;//(string)$coupon_attributes['reportingcode']
488
+ $new_cart_structure['coupons'][(string)$coupon_attributes['code']]['validtill']=($validtill=='1970-01-01 00:00:00'?"0000-00-00 00:00:00":$validtill);//(string)$coupon_attributes['code']
489
+ $new_cart_structure['coupons'][(string)$coupon_attributes['code']]['issued']=true;
490
+
491
+ }
492
+ }
493
+ }
494
+ //parce in future
495
+ } elseif($xml_root_key=='summary') {
496
+ $new_cart_structure['summary']=array();
497
+ foreach ($xml_object_sub as $item_key=>$xml_items_sub){
498
+ if ($item_key=='promotions'){
499
+ foreach ($xml_items_sub as $item_1_key=>$xml_item_promotion){
500
+
501
+ $promotion_attributes=$xml_item_promotion->attributes();
502
+ $new_cart_structure['summary'][(int)$promotion_attributes['id']]['data']['type']=(string)$promotion_attributes['type'];
503
+ $new_cart_structure['summary'][(int)$promotion_attributes['id']]['data']['display']=(string)$promotion_attributes['display'];
504
+ $new_cart_structure['summary'][(int)$promotion_attributes['id']]['data']['display_text']=(isset($xml_item_promotion->displaytext)?(string)$xml_item_promotion->displaytext:'');
505
+ $new_cart_structure['summary'][(int)$promotion_attributes['id']]['data']['discountamount']=(isset($promotion_attributes['discountamount'])?(float)$promotion_attributes['discountamount']:0);
506
+ $new_cart_structure['summary'][(int)$promotion_attributes['id']]['data']['basketlevel']=(isset($promotion_attributes['basketlevel'])&&strtolower($promotion_attributes['basketlevel'])=='true'?(true):false);
507
+ $new_cart_structure['summary'][(int)$promotion_attributes['id']]['data']['deliverylevel']=(isset($promotion_attributes['deliverylevel'])&&strtolower($promotion_attributes['deliverylevel'])=='true'?(true):false);
508
+ $new_cart_structure['summary'][(int)$promotion_attributes['id']]['data']['issuedpoints']=(isset($promotion_attributes['issuedpoints'])?((int)$promotion_attributes['issuedpoints']):0);
509
+ $new_cart_structure['summary'][(int)$promotion_attributes['id']]['data']['issuedcoupon']=(isset($promotion_attributes['issuedcoupon'])&&strtolower($promotion_attributes['issuedcoupon'])=='true'?(true):false);
510
+ $new_cart_structure['summary'][(int)$promotion_attributes['id']]['data']['unpublished']=(isset($promotion_attributes['unpublished'])&&strtolower($promotion_attributes['unpublished'])=='true'?(true):false);
511
+ $new_cart_structure['summary'][(int)$promotion_attributes['id']]['data']['issuedproduct']=(isset($promotion_attributes['issuedproduct'])&&strtolower($promotion_attributes['issuedproduct'])=='true'?(true):false);
512
+ $new_cart_structure['summary'][(int)$promotion_attributes['id']]['data']['description']=(isset($xml_item_promotion->description)?(string)$xml_item_promotion->description:'');
513
+ $new_cart_structure['summary'][(int)$promotion_attributes['id']]['data']['name']=(isset($xml_item_promotion->name)?(string)$xml_item_promotion->name:'');
514
+ }
515
+ }elseif($item_key=='messages'){
516
+ //messages will be here;
517
+ $new_cart_structure['messages']=array();
518
+ }
519
+ }
520
+
521
+ }
522
+ }
523
+ }
524
+ }
525
+
526
+ /* NO UPDATE CART HERE AS FOR NOW, WILL UPDETE BEFORE ORDER CREATION
527
+ if ($product_to_enter_in_cart){
528
+ print_r($product_to_enter_in_cart);
529
+ //add free product in cart
530
+ $product_added=false;
531
+ foreach ($product_to_enter_in_cart as $p_t_e){
532
+ $product_got_id = Mage::getModel('catalog/product')->getIdBySku((string)$p_t_e['productcode']);
533
+ if ($product_got_id>0){
534
+ $product_to_add = Mage::getModel('catalog/product')
535
+ ->setStoreId(Mage::app()->getStore()->getId())
536
+ ->load($product_got_id);
537
+ $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_to_add);
538
+ $qty = $stockItem->getQty();
539
+ // to do, check if product inventory is managed otherwise this can become a minus qty
540
+ if($product_to_add->isSaleable()&&$qty >= 0) {
541
+ $cart->addProduct($product_to_add);
542
+ $product_added=true;
543
+ }else {
544
+ echo "error stock";
545
+ //$cart->addNotificationMessage($cart,'notice',(string)$product_to_enter_in_cart['productcode']. ' cannot be added to the cart!');
546
+ }
547
+ } else {
548
+ echo "error code";
549
+ //$cart->addNotificationMessage($cart,'notice',(string)$product_to_enter_in_cart['productcode']. ' '. $this->__(' cannot be added to the cart!'));
550
+ }
551
+ }
552
+ }
553
+
554
+ if ($product_added||$update_cart){
555
+ echo "cart update";
556
+ $cart->save();
557
+ }
558
+ */
559
+
560
+
561
+ //set own price
562
+ //$item->setCustomPrice($price);
563
+ //$item->setOriginalCustomPrice($price);
564
+ /*$promotions_xml=$result->RetrievePromotionsForProductsResult;
565
+ //print_r($result->RetrievePromotionsForProductsResult);*/
566
+
567
+ //store in database for promotions here
568
+ //$result->RetrievePromotionsForProductsResult
569
+
570
+
571
+ } catch (SoapFault $e) {
572
+
573
+ echo "REQUEST:\n" . $soapclient->__getLastRequestHeaders();
574
+ echo $soapclient->__getLastRequest() . "\n";
575
+
576
+ echo "RESPONSE:\n" . $soapclient->__getLastResponseHeaders();
577
+ echo $soapclient->__getLastResponse() . "\n";
578
+
579
+ // print_r($e->faultstring);
580
+
581
+
582
+ }
583
+ }
584
+ //print_r($new_cart_structure);
585
+ //die();
586
+ if (isset($new_cart_structure)&&count($new_cart_structure)>0)
587
+ return $new_cart_structure;
588
+
589
+ }
590
+
591
+ function parseDayPromotions($promotion_new_xml=''){
592
+ $xml_object = simplexml_load_string($promotion_new_xml);
593
+
594
+ $xml_object = simplexml_load_string($promotion_new_xml);
595
+ //print_r($xml_object);
596
+ if ($xml_object instanceof SimpleXMLElement) {
597
+ foreach ($xml_object as $xml_root_key=>$xml_object_sub){
598
+ if ($xml_root_key=='promotions'){
599
+ foreach ($xml_object_sub as $xml_promotions){
600
+ unset($promotion_model);
601
+ $attributes=$xml_promotions->attributes();
602
+ $promotion_model=Mage::getModel('qixol/promotions')->load((int)$attributes['id']);
603
+ if (count($promotion_model->getData())>0){
604
+ $promotion_model->setUpdateTime(date("Y-m-d H:i:s"));
605
+
606
+ } else {
607
+ unset($promotion_model);
608
+ $promotion_model=Mage::getModel('qixol/promotions');
609
+ $promotion_model->setCreatedTime(date("Y-m-d H:i:s"));
610
+ $promotion_model->setUpdateTime('0000-00-00 00:00:00');
611
+ }
612
+
613
+ $promotion_model->setPromotionId((int)$attributes['id']);
614
+ $promotion_model->setPromotionType(isset($attributes['type'])?(string)$attributes['type']:"");
615
+
616
+ $promotion_model->setDiscountpercent(isset($attributes['discountpercent'])?(double)$attributes['discountpercent']:0);
617
+ $promotion_model->setDiscountamount(isset($attributes['discountamount'])?(double)$attributes['discountamount']:0);
618
+ $promotion_model->setHascouponrestrictions(isset($attributes['hascouponrestrictions'])?(int)$attributes['hascouponrestrictions']:0);
619
+
620
+ $promotion_model->setPromotionName(isset($xml_promotions->name)?(string)$xml_promotions->name:"");
621
+ $promotion_model->setPromotionText(isset($xml_promotions->displaytext)?(string)$xml_promotions->displaytext:"");
622
+
623
+ try {
624
+ $promotion_model->save();
625
+ } catch(Exception $e) {
626
+ print_r($e);
627
+ }
628
+
629
+
630
+ }
631
+ }
632
+ }
633
+ //delete not updated simple way
634
+ $promotion_has_products=Mage::getResourceModel('qixol/promotions');
635
+ $promotion_has_products->removeOldDayPromotion();
636
+ }
637
+ }
638
+
639
+ function parsePromotions($promotion_new_xml=''){
640
+ $active_promotions=array();
641
+ $new_promotions=array();
642
+ $promotions_list=Mage::getModel('qixol/Promotions')->getCollection();
643
+ foreach ($promotions_list as $current_promotion){
644
+ $active_promotions[$current_promotion->getPromotionId()]=$current_promotion->getPromotionType();
645
+ }
646
+ //first test data
647
+ //$promotion_new_xml='<response><promotions><promotion id="106" type="BUNDLE" yourref="QIXOL-2" bundleprice="50.00"><name>Qixol 2</name><displaytext>Buy three test config products for 50</displaytext></promotion><promotion id="107" type="BOGOF" discountpercent="50.00"><name>Qixol 3a</name><displaytext>test config product 4 - BOGOF</displaytext></promotion><promotion id="108" type="BOGOF" discountpercent="50.00"><name>Qixol 3b</name><displaytext>Test Config product 5 BOGOF</displaytext></promotion><promotion id="109" type="BOGOR" discountpercent="50.00"><name>Qixol 4a</name><displaytext>test config product 6 BOGOR</displaytext></promotion><promotion id="110" type="BOGOR" discountpercent="2.00"><name>Qixol 4b</name><displaytext>test config product 7 BOGOR</displaytext></promotion><promotion id="111" type="BOGOR" discountpercent="24.99"><name>Qixol 4c</name><displaytext>Buy two "Test config product 8" get the second for 24.99</displaytext></promotion><promotion id="112" type="DEAL"><name>Qixol 5a</name><displaytext>Buy a small green, small black and small white product, get the cheapest free</displaytext></promotion><promotion id="113" type="DEAL"><name>Qixol 5b</name><displaytext>Buy a medium red, medium white and medium black product for 19.99</displaytext></promotion><promotion id="116" type="FREEPRODUCT"><name>Qixol 7a</name><displaytext>Buy "test product 1 / Test1_01" get "test product 2 / 123456" free (applies ONCE only)</displaytext></promotion><promotion id="117" type="FREEPRODUCT"><name>Qixol 7b</name><displaytext>Buy "test product 4 / test_4" get "test product 5 / test_5" free for each "test product 4"</displaytext></promotion><promotion id="118" type="ISSUECOUPON"><name>Qixol 8a</name><displaytext>Buy "testing" (test2_01) get a coupon code</displaytext></promotion><promotion id="121" type="PRODUCTSREDUCTION" discountpercent="30.00"><name>Qixol 10</name><displaytext>Use an issued coupon, get 30% off any Size = L product</displaytext></promotion></promotions><products><product productcode="config_11"/><product productcode="config_11" variantcode="test2_01_01"><promotions><promotion id="121" requiredqty="1"/></promotions></product><product productcode="config_11" variantcode="test2_01_03"/><product productcode="config_11" variantcode="test1_1"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_11" variantcode="test2_2"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_11" variantcode="test3_3"/><product productcode="config_11" variantcode="test4_4"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_11" variantcode="test5_5"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_11" variantcode="Test6_6"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_11" variantcode="test7_7"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_11" variantcode="test8_8"><promotions><promotion id="121" requiredqty="1"/></promotions></product><product productcode="config_10"/><product productcode="config_10" variantcode="test2_01_01"><promotions><promotion id="121" requiredqty="1"/></promotions></product><product productcode="config_10" variantcode="test2_01_03"/><product productcode="config_10" variantcode="test1_1"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_10" variantcode="test2_2"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_10" variantcode="test3_3"/><product productcode="config_10" variantcode="test4_4"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_9"/><product productcode="config_9" variantcode="test1_1"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_9" variantcode="test2_2"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_9" variantcode="test5_5"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_9" variantcode="Test6_6"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_9" variantcode="test7_7"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_9" variantcode="test8_8"><promotions><promotion id="121" requiredqty="1"/></promotions></product><product productcode="test8_8"/><product productcode="test7_7"/><product productcode="config_8"><promotions><promotion id="111" requiredqty="2"/></promotions></product><product productcode="config_8" variantcode="test2_01_01"><promotions><promotion id="121" requiredqty="1"/><promotion id="111" requiredqty="2"/></promotions></product><product productcode="config_8" variantcode="test2_01_03"><promotions><promotion id="111" requiredqty="2"/></promotions></product><product productcode="config_8" variantcode="test1_1"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/><promotion id="111" requiredqty="2"/></promotions></product><product productcode="config_8" variantcode="test2_2"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/><promotion id="111" requiredqty="2"/></promotions></product><product productcode="config_8" variantcode="test3_3"><promotions><promotion id="111" requiredqty="2"/></promotions></product><product productcode="config_7"><promotions><promotion id="110" requiredqty="2"/></promotions></product><product productcode="config_7" variantcode="test2_01_01"><promotions><promotion id="121" requiredqty="1"/><promotion id="110" requiredqty="2"/></promotions></product><product productcode="config_7" variantcode="test2_01_03"><promotions><promotion id="110" requiredqty="2"/></promotions></product><product productcode="config_7" variantcode="test1_1"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/><promotion id="110" requiredqty="2"/></promotions></product><product productcode="config_7" variantcode="test2_2"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/><promotion id="110" requiredqty="2"/></promotions></product><product productcode="config_7" variantcode="test3_3"><promotions><promotion id="110" requiredqty="2"/></promotions></product><product productcode="config_7" variantcode="test4_4"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/><promotion id="110" requiredqty="2"/></promotions></product><product productcode="config_7" variantcode="test5_5"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/><promotion id="110" requiredqty="2"/></promotions></product><product productcode="config_7" variantcode="Test6_6"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/><promotion id="110" requiredqty="2"/></promotions></product><product productcode="config_6"><promotions><promotion id="109" requiredqty="2"/></promotions></product><product productcode="config_6" variantcode="test1_1"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/><promotion id="109" requiredqty="2"/></promotions></product><product productcode="config_6" variantcode="test2_2"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/><promotion id="109" requiredqty="2"/></promotions></product><product productcode="config_6" variantcode="test4_4"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/><promotion id="109" requiredqty="2"/></promotions></product><product productcode="config_6" variantcode="test5_5"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/><promotion id="109" requiredqty="2"/></promotions></product><product productcode="config_6" variantcode="Test6_6"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/><promotion id="109" requiredqty="2"/></promotions></product><product productcode="config_5"><promotions><promotion id="108" requiredqty="2"/></promotions></product><product productcode="config_5" variantcode="test2_01_01"><promotions><promotion id="121" requiredqty="1"/><promotion id="108" requiredqty="2"/></promotions></product><product productcode="config_5" variantcode="test2_01_03"><promotions><promotion id="108" requiredqty="2"/></promotions></product><product productcode="config_5" variantcode="test1_1"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/><promotion id="108" requiredqty="2"/></promotions></product><product productcode="config_5" variantcode="test3_3"><promotions><promotion id="108" requiredqty="2"/></promotions></product><product productcode="config_5" variantcode="test4_4"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/><promotion id="108" requiredqty="2"/></promotions></product><product productcode="config_5" variantcode="test5_5"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/><promotion id="108" requiredqty="2"/></promotions></product><product productcode="config_5" variantcode="Test6_6"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/><promotion id="108" requiredqty="2"/></promotions></product><product productcode="Test6_6"/><product productcode="test5_5"/><product productcode="test4_4"/><product productcode="test3_3"/><product productcode="config_4"><promotions><promotion id="107" requiredqty="2"/></promotions></product><product productcode="config_4" variantcode="test2_01_01"><promotions><promotion id="121" requiredqty="1"/><promotion id="107" requiredqty="2"/></promotions></product><product productcode="config_4" variantcode="test2_01_03"><promotions><promotion id="107" requiredqty="2"/></promotions></product><product productcode="config_4" variantcode="test1_1"><promotions><promotion id="112" requiredqty="1" multipleproductrestrictions="1"/><promotion id="107" requiredqty="2"/></promotions></product><product productcode="config_4" variantcode="test2_2"><promotions><promotion id="113" requiredqty="1" multipleproductrestrictions="1"/><promotion id="107" requiredqty="2"/></promotions></product><product productcode="test2_2"/><product productcode="test1_1"/><product productcode="config_3"><promotions><promotion id="106" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_3" variantcode="test2_01_01"><promotions><promotion id="121" requiredqty="1"/><promotion id="106" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_3" variantcode="test2_01_03"><promotions><promotion id="106" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_2"><promotions><promotion id="106" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_2" variantcode="test2_01_01"><promotions><promotion id="121" requiredqty="1"/><promotion id="106" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_2" variantcode="test2_01_03"><promotions><promotion id="106" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_1"><promotions><promotion id="106" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_1" variantcode="test2_01_01"><promotions><promotion id="121" requiredqty="1"/><promotion id="106" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="config_1" variantcode="test2_01_03"><promotions><promotion id="106" requiredqty="1" multipleproductrestrictions="1"/></promotions></product><product productcode="test_5"/><product productcode="test_4"><promotions><promotion id="117" requiredqty="1"/></promotions></product><product productcode="test_3"/><product productcode="123456"/><product productcode="test2_01_03"/><product productcode="test2_01_01"><promotions><promotion id="121" requiredqty="1"/></promotions></product><product productcode="test2_01"><promotions><promotion id="118" requiredqty="1"/></promotions></product><product productcode="test2_01" variantcode="test2_01_01"><promotions><promotion id="118" requiredqty="1"/><promotion id="121" requiredqty="1"/></promotions></product><product productcode="test2_01" variantcode="test2_01_03"><promotions><promotion id="118" requiredqty="1"/></promotions></product><product productcode="Test1_01"><promotions><promotion id="116" requiredqty="1"/></promotions></product></products><summary result="true"/></response>';
648
+ $xml_object = simplexml_load_string($promotion_new_xml);
649
+ //print_r($xml_object);
650
+ if ($xml_object instanceof SimpleXMLElement) {
651
+ foreach ($xml_object->promotions->promotion as $xml_promotions){
652
+ unset($promotion_model);
653
+ $attributes=$xml_promotions->attributes();
654
+ $promotion_model=Mage::getModel('qixol/promotions')->load((int)$attributes['id']);
655
+ if (count($promotion_model->getData())>0){
656
+ $promotion_model->setUpdateTime(date("Y-m-d H:i:s"));
657
+
658
+ } else {
659
+ unset($promotion_model);
660
+ $promotion_model=Mage::getModel('qixol/promotions');
661
+ $promotion_model->setCreatedTime(date("Y-m-d H:i:s"));
662
+ $promotion_model->setUpdateTime('0000-00-00 00:00:00');
663
+ }
664
+
665
+ $promotion_model->setPromotionId((int)$attributes['id']);
666
+ $promotion_model->setIsForProduct(1);
667
+ $promotion_model->setPromotionType(isset($attributes['type'])?(string)$attributes['type']:"");
668
+ $new_promotions[$promotion_model->getPromotionId()]=$promotion_model->getPromotionType();
669
+
670
+ $promotion_model->setDiscountamount(isset($attributes['discountamount'])?(double)$attributes['discountamount']:0);
671
+
672
+ $promotion_model->setDiscountpercent(isset($attributes['discountpercent'])?(double)$attributes['discountpercent']:0);
673
+ $promotion_model->setYourref(isset($attributes['yourref'])?(string)$attributes['yourref']:"");
674
+
675
+ $promotion_model->setBundleprice(isset($attributes['bundleprice'])?(double)$attributes['bundleprice']:0);
676
+ $promotion_model->setPromotionName(isset($xml_promotions->name)?(string)$xml_promotions->name:"");
677
+ $promotion_model->setPromotionText(isset($xml_promotions->displaytext)?(string)$xml_promotions->displaytext:"");
678
+ $promotion_model->setFromDate('0000-00-00 00:00:00');
679
+ $promotion_model->setTillDate('0000-00-00 00:00:00');
680
+
681
+ if (isset($xml_promotions->availabletimes)&&isset($xml_promotions->availabletimes->availabletime)){
682
+ foreach ($xml_promotions->availabletimes->availabletime as $availabletime){
683
+ $time_attributes=$availabletime->attributes();
684
+ if ((string)$time_attributes['start']!=''){
685
+ $promotion_model->setFromDate('2000-01-01 '.(string)$time_attributes['start']);
686
+ $promotion_model->setIsEveryday(1);
687
+ }
688
+ if ((string)$time_attributes['start']!=''){
689
+ $promotion_model->setTillDate('2000-01-01 '.(string)$time_attributes['end']);
690
+ $promotion_model->setIsEveryday(1);
691
+ }
692
+ }
693
+ }
694
+ if ($promotion_model->getFromDate()=='0000-00-00 00:00:00'&&$promotion_model->setTillDate()=='0000-00-00 00:00:00'){
695
+ $promotion_model->setIsEveryday(0);
696
+ }
697
+ try {
698
+ $promotion_model->save();
699
+ } catch(Exception $e) {
700
+ print_r($e);
701
+ }
702
+
703
+
704
+ }
705
+
706
+ //temporary because of bag settings this flag
707
+ $write_data = Mage::getSingleton('core/resource')->getConnection('core_write');
708
+ $write_data->query("update qixol_promotions_type set is_everyday=1 where from_date!='0000-00-00 00:00:00' or till_date!='0000-00-00 00:00:00'");
709
+
710
+ foreach ($xml_object->products->product as $xml_products){
711
+ //print_r($xml_products);
712
+ $attributes=$xml_products->attributes();
713
+ if (isset($xml_products->promotions)&&!isset($xml_products->promotions->promotion[0])){
714
+ $ttemp_data=$xml_products->promotions->promotion;
715
+ unset($xml_products->promotions->promotion);
716
+ $xml_products->promotions->promotion[0]=$ttemp_data;
717
+ unset($ttemp_data);
718
+ }
719
+ foreach ($xml_products->promotions->promotion as $idx_name=>$xml_promotion_data){
720
+
721
+
722
+ //if ($idx_name=='promotions'){
723
+ //foreach ($xml_promotion as $xml_promotion_data){
724
+ $xml_promotion_data_attributes=$xml_promotion_data->attributes();
725
+ $promotion_to_product_array=array();
726
+ $promotion_to_product_array['created_time']=date("Y-m-d H:i:s");
727
+ $promotion_to_product_array['update_time']=date("Y-m-d H:i:s");
728
+ //get product id
729
+ $promotion_to_product_array['product_id']=0;
730
+ $product_search_tmp = Mage::getModel('catalog/product');
731
+ if ($product_id_tmp=$product_search_tmp->getIdBySku(((string)$attributes['variantcode']!=''?(string)$attributes['variantcode']:(string)$attributes['productcode']))){
732
+ $promotion_to_product_array['product_id']=(int)$product_id_tmp;
733
+ }
734
+ //get parent_id
735
+ $promotion_to_product_array['parent_product_id']=0;
736
+ if ((string)$attributes['variantcode']!=''){
737
+ $product_search_tmp = Mage::getModel('catalog/product');
738
+ if ($product_id_tmp=$product_search_tmp->getIdBySku((string)$attributes['productcode'])){
739
+ $promotion_to_product_array['parent_product_id']=(int)$product_id_tmp;
740
+ }
741
+ }
742
+
743
+ $promotion_to_product_array['promotion_id']=(int)$xml_promotion_data_attributes['id'];;
744
+ $promotion_to_product_array['parentsku']=((string)$attributes['variantcode']!=''?(string)$attributes['productcode']:'');
745
+ $promotion_to_product_array['sku']=((string)$attributes['variantcode']!=''?(string)$attributes['variantcode']:(string)$attributes['productcode']);
746
+
747
+ $promotion_to_product_array['requiredqty']=(isset($xml_promotion_data_attributes['requiredqty'])?(int)$xml_promotion_data_attributes['requiredqty']:0);
748
+ $promotion_to_product_array['multipleproductrestrictions']=isset($xml_promotion_data_attributes['multipleproductrestrictions'])?(int)$xml_promotion_data_attributes['multipleproductrestrictions']:0;
749
+ $promotion_has_products=Mage::getResourceSingleton('qixol/promotions');
750
+ $promotion_has_products->updatePromotionProduct($promotion_to_product_array);
751
+ }
752
+ // }
753
+ //}
754
+
755
+ }
756
+ //delete not updated simple way
757
+ $promotion_has_products=Mage::getResourceModel('qixol/promotions');
758
+ $promotion_has_products->removeOldPromotion();
759
+ $promotion_has_products->removeOldPromotedProduct();
760
+ /* $condition=$promotion_has_products->_getWriteAdapter()->quoteInto('(update_time <= ?)', "(now() - interval 1 hour)");
761
+ $promotion_has_products->_getWriteAdapter()->delete($this->getTable('promotions'), $condition);
762
+ */
763
+
764
+ /*foreach ($active_promotions as $p_id=>$p_type){
765
+ if (!isset($new_promotions[$p_id])){
766
+ //delete
767
+ }elseif($new_promotions[$p_id]!=$p_type){
768
+ //promotion type changed ???
769
+ }
770
+
771
+ }*/
772
+
773
+ }
774
+ }
775
+
776
+
777
+ function run_import_Promotions(){
778
+ //process get all product promotions cause qixol do not provede all promotions for a day without requesting per product,
779
+ //maybe need to run once a 10 minutes
780
+ $this->addExportStatus("process", 'promotions' ,'',0);
781
+
782
+ $soapclient = new soapclient('http://evaluation.qixolpromo.com/ExportService.svc?singleWsdl', array('trace' => 1));
783
+ //$types_array = $soapclient->__getTypes();
784
+
785
+ //$functions_array = $soapclient->__getFunctions();
786
+
787
+ $products_list = Mage::getModel('catalog/product')->getCollection()
788
+ ->addAttributeToSelect('*')->addAttributeToFilter('visibility', array('neq'=>1))
789
+ ->addAttributeToSort('entity_id', 'desc');
790
+
791
+ foreach ($products_list as $product) {
792
+ $data .= '<product productcode="'.$product->getSku().'" variantcode="" barcode="" price="'.$product->getPrice().'"><description>'.$this->CDT($product->getName()).'</description><imageurl>'.$this->CDT($product->getImage() != 'no_selection' ? $product->getImageUrl() : '').'</imageurl>';
793
+ $products_data.='<product productcode="'.$product->getSku().'" variantcode="" />';
794
+ if ($product->isConfigurable()){ //with variations
795
+ //$associatedAttributes = $product->getTypeInstance()->getConfigurableAttributesAsArray($product);
796
+ $childs_products_list=$product->getTypeInstance()->getUsedProducts();
797
+ foreach ($childs_products_list as $childProduct_tmp) {
798
+ $childProduct = Mage::getModel('catalog/product')->load($childProduct_tmp->getId());
799
+ $products_data.='<product productcode="'.$product->getSku().'" variantcode="'.$childProduct->getSku().'" />';
800
+ }
801
+ }
802
+
803
+ }
804
+ if ($products_data!=''){
805
+
806
+ $promotions='<request companykey="'.Mage::getStoreConfig('qixol/integraion/companykey').
807
+ '" validationdate="'.date("Y-m-d",strtotime("+ 1 DAY")).'T00:00:00" channel="'.Mage::getStoreConfig('qixol/syhchronized/channel').
808
+ '" storegroup="'.Mage::getStoreConfig('qixol/syhchronized/storegroup').'" store="'.Mage::getStoreConfig('qixol/syhchronized/channel').
809
+ '" validatefortime="false"><products>'.$products_data.'</products></request>';
810
+
811
+ $soapclient = new soapclient('http://evaluation.qixolpromo.com/ExportService.svc?singleWsdl', array('trace' => 1));
812
+ //$types_array = $soapclient->__getTypes();
813
+ //$functions_array = $soapclient->__getFunctions();
814
+
815
+ try {
816
+ $result = $soapclient->__soapCall('RetrievePromotionsForProducts', array('RetrievePromotionsForProducts' => array('xmlExportRequest' => $promotions)));
817
+ $promotions_xml=$result->RetrievePromotionsForProductsResult;
818
+ //print_r($result->RetrievePromotionsForProductsResult);
819
+ if ($promotions_xml!=''){
820
+ $this->parsePromotions($promotions_xml);
821
+ $this->addExportStatus("success", 'promotions' , 'imported' ,1);
822
+ }
823
+ //store in database for promotions here
824
+ //$result->RetrievePromotionsForProductsResult
825
+
826
+
827
+ } catch (SoapFault $e) {
828
+ print_r($e->faultstring);
829
+ $this->addExportStatus("error", 'promotions' , addslashes($e->faultstring) ,1);
830
+ $this->pushLog("Finish import promotions error ".$e->faultstring);
831
+ }
832
+ }
833
+
834
+
835
+
836
+ return ;
837
+ }
838
+
839
+ function run_import_DayPromotions(){
840
+ //retrieve promotion for a day
841
+
842
+ $this->addExportStatus("process", 'backetpromotions' ,'',0);
843
+ $promotions='<request companykey="'.Mage::getStoreConfig('qixol/integraion/companykey').
844
+ '" validationdate="'.date("Y-m-d",strtotime("+ 1 DAY")).'T00:00:00" channel="'.Mage::getStoreConfig('qixol/syhchronized/channel').
845
+ '" storegroup="'.Mage::getStoreConfig('qixol/syhchronized/storegroup').'" store="'.Mage::getStoreConfig('qixol/syhchronized/channel').
846
+ '" validatefortime="false"></request>';
847
+
848
+ $soapclient = new soapclient('http://evaluation.qixolpromo.com/ExportService.svc?singleWsdl', array('trace' => 1));
849
+ //$types_array = $soapclient->__getTypes();
850
+ //$functions_array = $soapclient->__getFunctions();
851
+
852
+ try {
853
+ $result = $soapclient->__soapCall('RetrievePromotionsForBaskets', array('RetrievePromotionsForBaskets' => array('xmlExportRequest' => $promotions)));
854
+ $promotions_xml=$result->RetrievePromotionsForBasketsResult;
855
+
856
+ if ($promotions_xml!=''){
857
+ $this->parseDayPromotions($promotions_xml);
858
+ $this->addExportStatus("success", 'backetpromotions' , 'imported' ,1);
859
+ }
860
+
861
+
862
+ } catch (SoapFault $e) {
863
+ print_r($e->faultstring);
864
+ $this->addExportStatus("error", 'backetpromotions' , addslashes($e->faultstring) ,1);
865
+ $this->pushLog("Finish import promotions error ".$e->faultstring);
866
+ }
867
+ }
868
+
869
+
870
+ function run_export_qixolData(){
871
+
872
+ if (Mage::getStoreConfig('holbi/qixol/enabled')>0){
873
+ //customers groups attribute
874
+ //{{
875
+ if (Mage::getStoreConfig('qixol/syhchronized/synchcustomer')>0){
876
+ $curent_state=$this->getExportStatus('customers');
877
+ //do not run again if in process
878
+ if ($curent_state['id']==0||$curent_state['finished']==1||strtotime($curent_state['last_updated'])<strtotime("-1 hour")){
879
+
880
+
881
+ //get mapping
882
+ $list_map_names=Mage::getModel('qixol/Customergrouspmap')->getCollection();
883
+
884
+ $list_map_names_exists=array();
885
+
886
+ foreach ($list_map_names as $list_map){
887
+ $list_map_names_exists[$list_map->getCustomerGroupName()]=$list_map->getCustomerGroupNameMap();
888
+ }
889
+ // end mapping array
890
+
891
+ $this->addExportStatus("process", 'customers' ,'',0);
892
+ $customerGroupModel = new Mage_Customer_Model_Group();
893
+ $customerGroups = array();
894
+ $allCustomerGroups = $customerGroupModel->getCollection()->toOptionHash();
895
+ $selectedgroups=Mage::getStoreConfig('qixol/customers/list');
896
+ if(trim($selectedgroups)!='')
897
+ $selectedgroups_array=explode(",",$selectedgroups);
898
+
899
+ $group_to_send='';
900
+ foreach($allCustomerGroups as $key => $group){
901
+ if (trim($selectedgroups)==''||in_array($key,$selectedgroups_array)){
902
+ $group_to_send.='<item display="'.((isset($list_map_names_exists[$group])&&trim($list_map_names_exists[$group])!='')?$list_map_names_exists[$group]:$group).'">'.$group.'</item>';
903
+ }
904
+ }
905
+ if ($group_to_send!='')
906
+ {//entity="basket"
907
+ $data='<import companykey="'.Mage::getStoreConfig('qixol/integraion/companykey').'" attributetoken="customergroup"><items>'.$group_to_send.'</items></import>';
908
+ $soapclient = new soapclient('http://evaluation.qixolpromo.com/ImportService.svc?singleWsdl', array('trace' => 1));
909
+ $types_array = $soapclient->__getTypes();
910
+ $functions_array = $soapclient->__getFunctions();
911
+
912
+ try {
913
+ $result = $soapclient->__soapCall('ImportEntityAttributeValues', array('ImportEntityAttributeValues' => array('xmlToImport' => $data)));
914
+ $this->addExportStatus("success", 'customers' ,addslashes($result->ImportEntityAttributeValuesResult),1);
915
+ } catch (SoapFault $e) {
916
+ $this->addExportStatus("error", 'customers' , addslashes($e->faultstring) ,1);
917
+ }
918
+ }
919
+ }
920
+ }
921
+ //}}end customer groups send
922
+
923
+
924
+ //shippings attributes
925
+ //{{
926
+ if (Mage::getStoreConfig('qixol/syhchronized/synchship')>0){
927
+ $curent_state=$this->getExportStatus('delivery');
928
+ //do not run again if in process
929
+ if ($curent_state['id']==0||$curent_state['finished']==1||strtotime($curent_state['last_updated'])<strtotime("-1 hour")){
930
+ $this->addExportStatus("process", 'delivery' ,'',0);
931
+
932
+ //get mapping
933
+ $list_map_names=Mage::getModel('qixol/Shippingmap')->getCollection();
934
+
935
+ $list_map_names_exists=array();
936
+
937
+ foreach ($list_map_names as $list_map){
938
+ $list_map_names_exists[$list_map->getShippingName()]=$list_map->getShippingNameMap();
939
+ }
940
+ // end mapping array
941
+
942
+ //returns only active list
943
+ $only_active=Mage::getStoreConfig('qixol/shippings/onlyactive');
944
+ //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
945
+ // $only_active=1;
946
+ if ($only_active>0)
947
+ $methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
948
+ else
949
+ $methods = Mage::getSingleton('shipping/config')->getAllCarriers();
950
+
951
+ $selectedgroups=Mage::getStoreConfig('qixol/shippings/list');
952
+
953
+ unset($selectedgroups_array);
954
+ if(trim($selectedgroups)!='')
955
+ $selectedgroups_array=explode(",",$selectedgroups);
956
+ $shipping_to_send='';
957
+ foreach($methods as $_ccode => $_carrier)
958
+ {
959
+ $_methodOptions = array();
960
+ try{ //some methods not allowed getAllowedMethods
961
+ if($_methods = $_carrier->getAllowedMethods())
962
+ {
963
+ foreach($_methods as $_mcode => $_method)
964
+ {
965
+ $_code = $_ccode . '_' . $_mcode;
966
+ if (trim($selectedgroups)==''||in_array($_code,$selectedgroups_array)){
967
+ $shipping_to_send.='<item display="'.((isset($list_map_names_exists[$_code])&&trim($list_map_names_exists[$_code])!='')?$list_map_names_exists[$_code]:(trim($_method)==''?$_code:$_method)).'">'.$_code.'</item>';
968
+ }
969
+ }
970
+ }
971
+ }
972
+ catch(Exception $e) {
973
+ continue;
974
+ }
975
+ }
976
+
977
+ if ($shipping_to_send!='')
978
+ {//entity="basket"
979
+ $data='<import companykey="'.Mage::getStoreConfig('qixol/integraion/companykey').'" attributetoken="deliverymethod"><items>'.$shipping_to_send.'</items></import>';
980
+ $soapclient = new soapclient('http://evaluation.qixolpromo.com/ImportService.svc?singleWsdl', array('trace' => 1));
981
+ $types_array = $soapclient->__getTypes();
982
+ $functions_array = $soapclient->__getFunctions();
983
+ try {
984
+ $result = $soapclient->__soapCall('ImportEntityAttributeValues', array('ImportEntityAttributeValues' => array('xmlToImport' => $data)));
985
+ $this->addExportStatus("success", 'delivery' ,addslashes($result->ImportEntityAttributeValuesResult),1);
986
+ } catch (SoapFault $e) {
987
+ $this->addExportStatus("error", 'delivery', addslashes($e->faultstring) ,1);
988
+ }
989
+ }
990
+ }
991
+ }
992
+ //}}
993
+
994
+ //{{ currencies
995
+ if (Mage::getStoreConfig('qixol/syhchronized/synchcurrency')>0){
996
+ $curent_state=$this->getExportStatus('currency');
997
+ //do not run again if in process
998
+ if ($curent_state['id']==0||$curent_state['finished']==1||strtotime($curent_state['last_updated'])<strtotime("-1 hour")){
999
+ $this->addExportStatus("process", 'currency' ,'',0);
1000
+ $currency_to_send='';
1001
+ $only_active_currency=Mage::getStoreConfig('currency/options/allow');
1002
+ $currencies_array = explode(',',$only_active_currency);
1003
+ foreach($currencies_array as $code_curr)
1004
+ {
1005
+ $currency_to_send.='<item display="'.$code_curr.'">'. Mage::app()->getLocale()->currency( $code_curr )->getName().'</item>';
1006
+ }
1007
+
1008
+ if ($currency_to_send!='');
1009
+ {//entity="basket"
1010
+ $data='<import companykey="'.Mage::getStoreConfig('qixol/integraion/companykey').'" attributetoken="currencycode"><items>'.$currency_to_send.'</items></import>';
1011
+ $soapclient = new soapclient('http://evaluation.qixolpromo.com/ImportService.svc?singleWsdl', array('trace' => 1));
1012
+ $types_array = $soapclient->__getTypes();
1013
+ $functions_array = $soapclient->__getFunctions();
1014
+ try {
1015
+ $result = $soapclient->__soapCall('ImportEntityAttributeValues', array('ImportEntityAttributeValues' => array('xmlToImport' => $data)));
1016
+ $this->addExportStatus("success", 'currency' ,addslashes($result->ImportEntityAttributeValuesResult),1);
1017
+ } catch (SoapFault $e) {
1018
+ $this->addExportStatus("error", 'currency', addslashes($e->faultstring) ,1);
1019
+ }
1020
+ //temporary before fixed !!!!!!!!!!! (now not returns result)
1021
+ $this->addExportStatus("success", 'currency' ,addslashes($result->ImportEntityAttributeValuesResult),1);
1022
+ //000000000000000
1023
+ }
1024
+ }
1025
+ }
1026
+ //}} currencies
1027
+
1028
+ //{{ stores
1029
+ if (true/*Mage::getStoreConfig('qixol/syhchronized/synchstore')>0*/){
1030
+
1031
+ $curent_state=$this->getExportStatus('store');
1032
+ //do not run again if in process
1033
+ if ($curent_state['id']==0||$curent_state['finished']==1||strtotime($curent_state['last_updated'])<strtotime("-1 hour")){
1034
+ $this->addExportStatus("process", 'store' ,'',0);
1035
+ $store_to_send='';
1036
+
1037
+ //get mapping
1038
+ $list_store_map_names=Mage::getModel('qixol/Storesmap')->getCollection();
1039
+
1040
+ $list_store_map_names_exists=array();
1041
+
1042
+ foreach ($list_store_map_names as $list_map){
1043
+ $list_store_map_names_exists[$list_map->getCustomerGroupName()]=$list_map->getCustomerGroupNameMap();
1044
+ }
1045
+ // end mapping array
1046
+
1047
+ foreach (Mage::app()->getWebsites() as $website) {
1048
+ foreach ($website->getGroups() as $group) {
1049
+ $stores = $group->getStores();
1050
+ foreach ($stores as $store) {
1051
+ $store_to_send.='<item display="'.((isset($list_store_map_names_exists[$store->getName()])&&trim($list_store_map_names_exists[$store->getName()])!='')?$list_store_map_names_exists[$store->getName()]:$store->getName()).'">'. $store->getName().'</item>';
1052
+ //$store is a store object
1053
+ }
1054
+ }
1055
+ }
1056
+
1057
+ if ($store_to_send!='');
1058
+ {//entity="basket"
1059
+ $data='<import companykey="'.Mage::getStoreConfig('qixol/integraion/companykey').'" attributetoken="store"><items>'.$store_to_send.'</items></import>';
1060
+ $soapclient = new soapclient('http://evaluation.qixolpromo.com/ImportService.svc?singleWsdl', array('trace' => 1));
1061
+ $types_array = $soapclient->__getTypes();
1062
+ $functions_array = $soapclient->__getFunctions();
1063
+ try {
1064
+ $result = $soapclient->__soapCall('ImportEntityAttributeValues', array('ImportEntityAttributeValues' => array('xmlToImport' => $data)));
1065
+ $this->addExportStatus("success", 'store' ,addslashes($result->ImportEntityAttributeValuesResult),1);
1066
+ } catch (SoapFault $e) {
1067
+ $this->addExportStatus("error", 'store', addslashes($e->faultstring) ,1);
1068
+ }
1069
+ //temporary before fixed !!!!!!!!!!! (now not returns result)
1070
+ $this->addExportStatus("success", 'store' ,addslashes($result->ImportEntityAttributeValuesResult),1);
1071
+ //000000000000000
1072
+ }
1073
+ }
1074
+
1075
+
1076
+
1077
+ }
1078
+ //}} stores
1079
+
1080
+
1081
+
1082
+ //products
1083
+ if (Mage::getStoreConfig('qixol/syhchronized/synchproducts')>0){
1084
+ $curent_state=$this->getExportStatus('products');
1085
+ //prevent double run script
1086
+ if ($curent_state['id']==0||$curent_state['finished']==1||strtotime($curent_state['last_updated'])<strtotime("-1 hour")){
1087
+
1088
+ $write_data = Mage::getSingleton('core/resource')->getConnection('core_write');
1089
+ $write_data->query("
1090
+ delete from ".$this->process_export_status_table." where export_what='products'
1091
+ ");
1092
+
1093
+ //clear old data
1094
+ $write_data = Mage::getSingleton('core/resource')->getConnection('core_write');
1095
+ $write_data->query("delete from ".$this->export_poducts_statistic_table." where start_export<(now() - interval 1 month)");
1096
+
1097
+
1098
+ //process products here
1099
+ $number_products_exported=0;
1100
+ $this->addExportStatus("process", 'products' ,'',0);
1101
+
1102
+
1103
+ $products_list = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')->addAttributeToFilter('visibility', array('neq'=>1))->addAttributeToSort('entity_id', 'desc');
1104
+
1105
+ $products_deleted = Mage::getModel('qixol/Deletedproduct')->getCollection();
1106
+ $remove_deleted=array();
1107
+
1108
+ if (count($products_list)||count($products_deleted)){
1109
+ $data = '<import companykey="'.Mage::getStoreConfig('qixol/integraion/companykey').'"><products>';
1110
+ $attributes=Mage::getStoreConfig('qixol/productattrib/attributes');
1111
+
1112
+ //assign deleted product first
1113
+ if (count($products_deleted))
1114
+ foreach ($products_deleted as $products_deleted_data) {
1115
+ $data .= '<product productcode="'.$products_deleted_data->getData('product_sku').'" variantcode="'.$products_deleted_data->getData('child_sku').'" barcode="" deleted="true"></product>';
1116
+ $remove_deleted[]=$products_deleted_data->getData('entity_id');
1117
+ }
1118
+
1119
+ if (count($products_list))
1120
+ foreach ($products_list as $product) {
1121
+ $send_poduct=true;
1122
+ //for simple product checks is it as a child for configurable and do not send it if parent active
1123
+ if (!$product->isConfigurable()){
1124
+ $parentId = Mage::getResourceSingleton('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
1125
+ //sometimes could be grouped if such module installed
1126
+ /*try {
1127
+ if((!$parentId)||(!is_array($parentId)))
1128
+ $parentId = Mage::getResourceSingleton('catalog/product_type_grouped')->getParentIdsByChild($product->getId());
1129
+ }
1130
+ catch(Exception $e) {
1131
+ ; //if object not supported appears exception
1132
+ }*/
1133
+ if (is_array($parentId)&&count($parentId))
1134
+ foreach ($parentId as $parent_product_id){
1135
+ $prod_parent_obj = Mage::getModel('catalog/product')->load($parent_product_id);
1136
+ //do not send if this product exists as child in any active parent product
1137
+ if (strtolower($prod_parent_obj->getAttributeText('status'))=='enabled'&&$prod_parent_obj->getVisibility()>1){
1138
+ $send_poduct=false;
1139
+ break;
1140
+ }
1141
+ }
1142
+
1143
+ }
1144
+ if ($send_poduct){
1145
+ $data .= '<product productcode="'.$product->getSku().'" variantcode="" barcode="" price="'.$product->getPrice().'"><description>'.$this->CDT($product->getName()).'</description><imageurl>'.$this->CDT($product->getImage() != 'no_selection' ? $product->getImageUrl() : '').'</imageurl>';
1146
+ $attributes_arr=explode(",",$attributes);
1147
+ if (count($attributes_arr)){
1148
+ $data .= '<attributes>';
1149
+ foreach ($attributes_arr as $attribute_id){
1150
+ $is_attribute_text_value=$product->getResource()->getAttribute($attribute_id)->getFrontend()->getValue($product);
1151
+ $data .= '<attribute><name>'.$attribute_id.'</name><value>'.$this->CDT($is_attribute_text_value!=''?$is_attribute_text_value:$product->getData($attribute_id)).'</value></attribute>';
1152
+ }
1153
+ if (Mage::getStoreConfig('qixol/syhchronized/synchcatproducts')>0){
1154
+ foreach ($product->getCategoryIds() as $product_category_id){
1155
+ if ($product_category_id==0) continue;
1156
+ $current_ctaegory_id=$product_category_id;
1157
+ $category_name_push='';
1158
+ while($current_ctaegory_id != 0){
1159
+ $category = Mage::getModel('catalog/category')->load($current_ctaegory_id);
1160
+ $current_ctaegory_id=$category->getParentId();
1161
+ if (strtolower($category->getName())!='root catalog')
1162
+ $category_name_push=$category->getName().($category_name_push!=''?" / ".$category_name_push:"");
1163
+ }
1164
+ $data .= '<attribute><name>categorycode</name><value>'.$this->CDT($category_name_push).'</value></attribute>';
1165
+ }
1166
+ }
1167
+
1168
+ $data .= '</attributes>';
1169
+ }
1170
+ $data .= '</product>';
1171
+
1172
+ if ($product->isConfigurable()){ //with variations
1173
+ //$associatedAttributes = $product->getTypeInstance()->getConfigurableAttributesAsArray($product);
1174
+ $childs_products_list=$product->getTypeInstance()->getUsedProducts();
1175
+ foreach ($childs_products_list as $childProduct_tmp) {
1176
+ $childProduct = Mage::getModel('catalog/product')->load($childProduct_tmp->getId());
1177
+ $data .= '<product productcode="'.$product->getSku().'" variantcode="'.$childProduct->getSku().'" barcode="" price="'.$childProduct->getPrice().'"><description>'.$this->CDT($childProduct->getName()).'</description><imageurl>'.($childProduct->getImage() != 'no_selection' ? $childProduct->getImageUrl() : '').'</imageurl>';
1178
+ $attributes_arr=explode(",",$attributes);
1179
+ if (count($attributes_arr)){
1180
+ $data .= '<attributes>';
1181
+ foreach ($attributes_arr as $attribute_id){
1182
+ $is_attribute_text_value=$childProduct->getResource()->getAttribute($attribute_id)->getFrontend()->getValue($childProduct);
1183
+ $data .= '<attribute><name>'.$attribute_id.'</name><value>'.$this->CDT($is_attribute_text_value!=''?$is_attribute_text_value:$childProduct->getData($attribute_id)).'</value></attribute>';
1184
+ }
1185
+ $data .= '</attributes>';
1186
+ }
1187
+ $data .= '</product>';
1188
+
1189
+ $number_products_exported++;//clacualte also childs as in qixol it is separate products
1190
+ }
1191
+ }
1192
+ $number_products_exported++;
1193
+ }
1194
+ }
1195
+
1196
+ $data .= '</products></import>';
1197
+ if ($data!=''){
1198
+ $soapclient = new soapclient('http://evaluation.qixolpromo.com/ImportService.svc?singleWsdl', array('trace' => 1));
1199
+ $types_array = $soapclient->__getTypes();
1200
+ $functions_array = $soapclient->__getFunctions();
1201
+ try {
1202
+ $result = $soapclient->__soapCall('ImportProducts', array('ImportProducts' => array('xmlToImport' => $data)));
1203
+ if (is_array($remove_deleted)&&count($remove_deleted)>0){
1204
+ $write_data = Mage::getSingleton('core/resource')->getConnection('core_write');
1205
+ $write_data->query("delete from qixol_product_to_delete where entity_id in (".join(",",$remove_deleted).")");
1206
+ }
1207
+ $this->addExportStatus("success", 'products' ,addslashes($result->ImportProductsResult),1);
1208
+ } catch (SoapFault $e) {
1209
+ print_r($e->faultstring);
1210
+ $this->addExportStatus("error", 'products' ,addslashes($e->faultstring),1);
1211
+ }
1212
+ }
1213
+ }
1214
+ }
1215
+ }
1216
+ //end product sennd block
1217
+
1218
+ } //end config enabled
1219
+ return ;
1220
+ }
1221
+
1222
+ function CDT($in_str)
1223
+ {
1224
+ return "<![CDATA[".$in_str."]]>";
1225
+ }
1226
+
1227
+ function getExportStatus($for='products'){
1228
+ //should get ststus here
1229
+ //id ->database log, message=>last message in log, error - on error =1; finished->on script finished =1
1230
+ $query="SELECT
1231
+ *
1232
+ FROM ".$this->process_export_status_table."
1233
+ where
1234
+ export_what ='".$for."'
1235
+ ORDER BY id DESC LIMIT 1";
1236
+ // where export_what='".$for."' //for future should be spleted by each export type
1237
+ $read_data = Mage::getSingleton('core/resource')->getConnection('core_read');
1238
+
1239
+ if ($readresult=$read_data->query($query)){
1240
+ $_status = $readresult->fetch();
1241
+ }else {
1242
+ $_status=array();
1243
+ }
1244
+ if($_status['id']>0){
1245
+ //if finished<0 - error appeared
1246
+ $messages=array('id'=>$_status['id'],'message'=>$_status['last_message'],'extended_message'=>$_status['extended_message'], 'error'=>((int)$_status['is_finished']<0?1:0), 'finished'=>((int)$_status['is_finished']>0?1:0),'last_updated'=>$_status['exports_last_updated']);
1247
+ } else {
1248
+ $messages=array('id'=>'0','message'=>'inactive', 'error'=>0, 'finished'=>0);
1249
+ }
1250
+
1251
+
1252
+ return $messages;
1253
+
1254
+ }
1255
+
1256
+ function addExportStatus($message, $for ,$extended_message='',$finished=0){
1257
+ if (!isset($this->process_export_status_id[$for])||$this->process_export_status_id[$for]==0){
1258
+ $query="INSERT INTO ".$this->process_export_status_table."
1259
+ (last_message, export_what,exports_start,exports_last_updated,is_finished,extended_message)
1260
+ VALUES('".$message."','".$for."',now(),now(), '".(int)$finished."','".$extended_message."')";
1261
+
1262
+ $write_data = Mage::getSingleton('core/resource')->getConnection('core_write');
1263
+ $write_data->query($query);
1264
+ $this->process_export_status_id[$for]=$write_data->lastInsertId();
1265
+ } else {
1266
+ $query="update ".$this->process_export_status_table."
1267
+ set last_message='".$message."', exports_last_updated=now(), is_finished='".(int)$finished."', extended_message='".$extended_message."'
1268
+ where id=".(int)$this->process_export_status_id[$for]."";
1269
+ $write_data = Mage::getSingleton('core/resource')->getConnection('core_write');
1270
+ $write_data->query($query);
1271
+ }
1272
+
1273
+ //extended latst transactions stat table disabled as now it dublicate main status table function
1274
+ /* if ($this->export_poducts_statistic_id==0){
1275
+ $write_data = Mage::getSingleton('core/resource')->getConnection('core_write');
1276
+ $write_data->query("
1277
+ insert into ".$this->export_poducts_statistic_table."
1278
+ (start_export,number_of_items,status_export,export_by,status_export_message)
1279
+ values(now(),0,'process','".$this->export_by."','export start')
1280
+ ");
1281
+ $this->export_poducts_statistic_id=$write_data->lastInsertId();
1282
+ }
1283
+ if($finished==0){
1284
+ $query = "UPDATE ".$this->export_poducts_statistic_table."
1285
+ SET status_export='".$message."' ,
1286
+ status_export_message='".addslashes($extended_message)."'
1287
+ WHERE export_id=".$this->export_poducts_statistic_id;
1288
+ $write_data = Mage::getSingleton('core/resource')->getConnection('core_write');
1289
+ $write_data->query($query);
1290
+ } else {
1291
+ $query = "UPDATE ".$this->export_poducts_statistic_table."
1292
+ SET
1293
+ status_export='success',
1294
+ status_export_message='".addslashes($extended_message)."'
1295
+ finish_export=now()
1296
+ WHERE
1297
+ export_id=".$this->export_poducts_statistic_id;
1298
+ $write_data = Mage::getSingleton('core/resource')->getConnection('core_write');
1299
+ $write_data->query($query);
1300
+ }*/
1301
+ return ;
1302
+ }
1303
+ }
app/code/community/Holbi/Qixol/Model/Status.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Status extends Varien_Object {
3
+ const STATUS_ENABLED = 1;
4
+ const STATUS_DISABLED = 2;
5
+
6
+ static public function getOptionArray() {
7
+ return array(
8
+ self::STATUS_ENABLED => Mage::helper('qixol')->__('Enabled'),
9
+ self::STATUS_DISABLED => Mage::helper('qixol')->__('Disabled')
10
+ );
11
+ }
12
+
13
+ }
app/code/community/Holbi/Qixol/Model/Sticker.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Sticker extends Mage_Core_Model_Abstract {
3
+ private $default_stickers=array('BOGOF'=>'BOGOF.png',
4
+ 'BOGOR'=>'BOGOR.png',
5
+ 'BUNDLE'=>'BUNDLE.png',
6
+ 'DEAL'=>'DEAL.png',
7
+ 'DELIVERYREDUCTION'=>'DELIVERYREDUCTION.png',
8
+ 'FREEPRODUCT'=>'FREEPRODUCT.png',
9
+ 'ISSUECOUPON'=>'ISSUECOUPON.png',
10
+ 'ISSUEPOINTS'=>'ISSUEPOINTS.png',
11
+ 'BASKETREDUCTION'=>'BASKETREDUCTION.png',
12
+ 'PRODUCTSREDUCTION'=>'PRODUCTSREDUCTION.png',
13
+ );
14
+ protected static $defaultstickerDir = null;
15
+ protected static $defaultstickerURL = null;
16
+
17
+ private $default_sticker_folder='frontend/base/default/images/qixol';
18
+
19
+ public function _construct() {
20
+ self::$defaultstickerDir = Mage::getBaseDir('skin') . DS;
21
+ self::$defaultstickerURL = Mage::getBaseUrl('skin');
22
+ parent::_construct();
23
+ $this->_init('qixol/sticker');
24
+ }
25
+
26
+ public function getAllAvailStickerIds(){
27
+ $collection = Mage::getResourceModel('qixol/sticker_collection')
28
+ ->getAllIds();
29
+ return $collection;
30
+ }
31
+
32
+ public function getAllStickers() {
33
+ $collection = Mage::getResourceModel('qixol/sticker_collection');
34
+ $collection->getSelect()->where('status = ?', 1);
35
+ $data = array();
36
+ foreach ($collection as $record) {
37
+ $data[$record->getId()] = array('value' => $record->getId(), 'label' => $record->getfilename());
38
+ }
39
+ return $data;
40
+ }
41
+
42
+ public function getDataByStickerIds($bannerIds) {
43
+ $data = array();
44
+ if ($bannerIds != '') {
45
+ $collection = Mage::getResourceModel('qixol/sticker_collection');
46
+ $collection->getSelect()->where('sticker_id IN (' . $bannerIds . ')')->order('sort_order');
47
+ foreach ($collection as $record) {
48
+ $status = $record->getStatus();
49
+ if ($status == 1) {
50
+ $data[] = $record;
51
+ }
52
+ }
53
+ }
54
+ return $data;
55
+ }
56
+
57
+ public function getDefaultSticker($stickername) {
58
+ $data='';
59
+ if ($stickername!=''&&$this->default_stickers[$stickername]!=''){
60
+ if (file_exists(self::$defaultstickerDir."/".$this->default_sticker_folder."/".$this->default_stickers[$stickername])){
61
+ $data=self::$defaultstickerURL."/".$this->default_sticker_folder."/".$this->default_stickers[$stickername];
62
+ }
63
+ }
64
+ return $data;
65
+ }
66
+
67
+ }
app/code/community/Holbi/Qixol/Model/Storesmap.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_Storesmap extends Mage_Core_Model_Abstract {
3
+
4
+ public function _construct() {
5
+ parent::_construct();
6
+ $this->_init('qixol/storesmap', "store_name");
7
+ }
8
+
9
+ public function getOptionArray(){
10
+ $hlp = Mage::helper('qixol');
11
+ $collections=$this->getCollection();
12
+ $list_return=array();
13
+ foreach ($collections as $item){
14
+ $list_return[]=array(
15
+ 'value' => (string)$item->getStoreName(),
16
+ 'label' => $hlp->__((string)$item->getStoreName())
17
+ );
18
+ }
19
+ return $list_return;
20
+ }
21
+ }
app/code/community/Holbi/Qixol/Model/System/Config/Source/Attributes.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_System_Config_Source_Attributes
3
+ {
4
+
5
+ public function toOptionArray(){
6
+ $hlp = Mage::helper('qixol');
7
+ $attributes_return=array();
8
+
9
+ $attributes = Mage::getResourceModel('catalog/product_attribute_collection')
10
+ ->getItems();
11
+
12
+ foreach ($attributes as $attribute){
13
+ $attributes_return[]=array(
14
+ 'value' => (string)$attribute->getAttributecode(),
15
+ 'label' => $hlp->__($attribute->getFrontendLabel()!=''?$attribute->getFrontendLabel():$attribute->getAttributecode())
16
+ );
17
+ }
18
+
19
+ return $attributes_return;
20
+ }
21
+ }
app/code/community/Holbi/Qixol/Model/System/Config/Source/Cart/Settings.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_System_Config_Source_Cart_Settings
3
+ {
4
+
5
+ public function getAllOptions()
6
+ {
7
+ $hlp = Mage::helper('qixol');
8
+ return array(
9
+ array('label'=>$hlp->__('Show promotion end-user/customer description'), 'value'=>'displaytext'),
10
+ array('label'=>$hlp->__('Show promotion name'), 'value'=>'displayname'),
11
+ array('label'=>$hlp->__('Show promotion type'), 'value'=>'displaytype'),
12
+ array('label'=>$hlp->__("Don't display"), 'value'=>'dontdisplay'),
13
+ );
14
+ }
15
+
16
+ public function toOptionArray(){
17
+ $hlp = Mage::helper('qixol');
18
+
19
+ return array(
20
+ array(
21
+ 'value' => 'displaytext',
22
+ 'label' => $hlp->__('Show promotion end-user/customer description'),
23
+ ),
24
+ array(
25
+ 'value' => 'displayname',
26
+ 'label' => $hlp->__('Show promotion name'),
27
+ ),
28
+ array(
29
+ 'value' => 'displaytype',
30
+ 'label' => $hlp->__('Show promotion type'),
31
+ ),
32
+ array(
33
+ 'value' => 'dontdisplay',
34
+ 'label' => $hlp->__("Don't display"),
35
+ ),
36
+ );
37
+ }
38
+ }
app/code/community/Holbi/Qixol/Model/System/Config/Source/Customers/List.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_System_Config_Source_Customers_List
3
+ {
4
+
5
+ public function toOptionArray(){
6
+ $hlp = Mage::helper('qixol');
7
+ $customerGroups=array();
8
+
9
+ $customerGroupModel = new Mage_Customer_Model_Group();
10
+ $customerGroups = array();
11
+ $allCustomerGroups = $customerGroupModel->getCollection()->toOptionHash();
12
+ foreach($allCustomerGroups as $key => $group){
13
+ $customerGroups[] = array('value'=>$key,'label'=>$hlp->__($group));
14
+ }
15
+
16
+ return $customerGroups;
17
+ }
18
+
19
+ }
app/code/community/Holbi/Qixol/Model/System/Config/Source/Iservices/Values.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_System_Config_Source_Iservices_Values
3
+ {
4
+
5
+ public function getAllOptions()
6
+ {
7
+ $hlp = Mage::helper('qixol');
8
+ return array(
9
+ array('label'=>$hlp->__('evaluation services'), 'value'=>'evaluation'),
10
+ array('label'=>$hlp->__('live services'), 'value'=>'live'),
11
+
12
+ );
13
+ }
14
+
15
+ public function toOptionArray(){
16
+ $hlp = Mage::helper('qixol');
17
+
18
+ return array(
19
+ array(
20
+ 'value' => 'evaluation',
21
+ 'label' => $hlp->__('evaluation services'),
22
+ ),
23
+ array(
24
+ 'value' => 'live',
25
+ 'label' => $hlp->__('live services'),
26
+ ),
27
+ );
28
+ }
29
+ }
app/code/community/Holbi/Qixol/Model/System/Config/Source/Shippings/List.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_System_Config_Source_Shippings_List
3
+ {
4
+
5
+ public function toOptionArray(){
6
+ $hlp = Mage::helper('qixol');
7
+ //returns only active list
8
+ $only_active=Mage::getStoreConfig('qixol/shippings/onlyactive');
9
+ if ($only_active>0)
10
+ $methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
11
+ else
12
+ $methods = Mage::getSingleton('shipping/config')->getAllCarriers();
13
+
14
+ $options = array();
15
+
16
+ foreach($methods as $_ccode => $_carrier)
17
+ {
18
+ $_methodOptions = array();
19
+ try{ //some methods not allowed getAllowedMethods
20
+ if($_methods = $_carrier->getAllowedMethods())
21
+ {
22
+ foreach($_methods as $_mcode => $_method)
23
+ {
24
+ $_code = $_ccode . '_' . $_mcode;
25
+ $_methodOptions[] = array('value' => $_code, 'label' => $hlp->__(trim($_method)==''?$_code:$_method));
26
+ }
27
+
28
+ if(!$_title = Mage::getStoreConfig("carriers/$_ccode/title"))
29
+ $_title = $_ccode;
30
+
31
+ $options[] = array('value' => $_methodOptions, 'label' => $hlp->__($_title));
32
+ }
33
+ }
34
+ catch(Exception $e) {
35
+ continue;
36
+ }
37
+ }
38
+
39
+ return $options;
40
+ }
41
+
42
+ }
app/code/community/Holbi/Qixol/Model/System/Config/Source/Stores.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Model_System_Config_Source_Stores
3
+ {
4
+
5
+ public function toOptionArray(){
6
+ $hlp = Mage::helper('qixol');
7
+ $stores=array(
8
+ array(
9
+ 'value' => '0',
10
+ 'label' => $hlp->__('All stores'),
11
+ )
12
+ );
13
+ foreach (Mage::app()->getWebsites() as $website) {
14
+ foreach ($website->getGroups() as $group) {
15
+ $stores_list = $group->getStores();
16
+ foreach ($stores_list as $store) {
17
+ $stores[]=array('value' => (string)$store->getId(), 'label' => $hlp->__($store->getName()." - (".$store->getCode().")"));
18
+ }
19
+ }
20
+ }
21
+ return $stores;
22
+ }
23
+ }
app/code/community/Holbi/Qixol/Model/Wysiwyg/Config.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once 'Mage/Cms/Model/Wysiwyg/Config.php';
3
+ class Holbi_Qixol_Model_Wysiwyg_Config extends Mage_Cms_Model_Wysiwyg_Config
4
+ {
5
+ public function getConfig($data = array())
6
+ {
7
+ $config = new Varien_Object();
8
+
9
+ $config->setData(array(
10
+ 'enabled' => $this->isEnabled(),
11
+ 'hidden' => $this->isHidden(),
12
+ 'use_container' => false,
13
+ 'add_variables' => false,
14
+ 'add_widgets' => false,
15
+ 'no_display' => false,
16
+ 'translator' => Mage::helper('qixol'),
17
+ 'files_browser_window_url' => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index'),
18
+ 'files_browser_window_width' => (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_width'),
19
+ 'files_browser_window_height' => (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_height'),
20
+ 'encode_directives' => true,
21
+ 'directives_url' => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive'),
22
+ 'popup_css' => Mage::getBaseUrl('js').'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css',
23
+ 'content_css' => Mage::getBaseUrl('js').'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css',
24
+ 'width' => '100%',
25
+ 'plugins' => array()
26
+ ));
27
+
28
+ $config->setData('directives_url_quoted', preg_quote($config->getData('directives_url')));
29
+
30
+ if (is_array($data)) {
31
+ $config->addData($data);
32
+ }
33
+
34
+ Mage::dispatchEvent('cms_wysiwyg_config_prepare', array('config' => $config));
35
+
36
+ return $config;
37
+ }
38
+ }
app/code/community/Holbi/Qixol/Model/config.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ error_reporting(E_ALL);
4
+ ini_set('display_errors','On');
5
+ define("DIR_FS_CATALOG",dirname(__FILE__).((substr(dirname(__FILE__), -1)<>"/")? "/": ""));
6
+ define('TEMPORARY_DIRECTORY_FOR_FILES', Mage::getBaseDir()."var/");
7
+ define('LOG_PATH', TEMPORARY_DIRECTORY_FOR_FILES . 'logs_qixol/');
8
+ define('TMP_PATH', TEMPORARY_DIRECTORY_FOR_FILES . 'tmp/');
9
+ define('LOG_FILE', LOG_PATH.'product_export_'.date("_Y_m").'.log');
app/code/community/Holbi/Qixol/controllers/Adminhtml/BannerController.php ADDED
@@ -0,0 +1,248 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Adminhtml_BannerController extends Mage_Adminhtml_Controller_action {
3
+
4
+ protected function _initAction() {
5
+ $this->loadLayout()
6
+ ->_setActiveMenu('qixol/items')
7
+ ->_addBreadcrumb(Mage::helper('qixol')->__('Banner Manager'), Mage::helper('qixol')->__('Banner Manager'));
8
+
9
+ return $this;
10
+ }
11
+
12
+ public function indexAction() {
13
+ $this->_initAction()
14
+ ->renderLayout();
15
+ }
16
+
17
+ public function editAction() {
18
+ $id = $this->getRequest()->getParam('id');
19
+ $model = Mage::getModel('qixol/banner')->load($id);
20
+
21
+ //$BannerImages = Mage::getModel('qixol/banner')->getBannerImages($id);
22
+
23
+
24
+ if ($model->getId() || $id == 0) {
25
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
26
+ if (!empty($data)) {
27
+ $model->setData($data);
28
+ }
29
+
30
+
31
+ Mage::register('banner_data', $model);
32
+
33
+ $this->loadLayout();
34
+ $this->_setActiveMenu('qixol/items');
35
+
36
+ $this->_addBreadcrumb(Mage::helper('qixol')->__('Banner Manager'), Mage::helper('qixol')->__('Banner Manager'));
37
+ $this->_addBreadcrumb(Mage::helper('qixol')->__('Item Banner'), Mage::helper('qixol')->__('Item Banner'));
38
+
39
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
40
+
41
+ $this->_addContent($this->getLayout()->createBlock('qixol/adminhtml_banner_edit'))
42
+ ->_addLeft($this->getLayout()->createBlock('qixol/adminhtml_banner_edit_tabs'));
43
+ $version = substr(Mage::getVersion(), 0, 3);
44
+ if (($version=='1.4' || $version=='1.5') && Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
45
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
46
+ }
47
+ $this->renderLayout();
48
+ } else {
49
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('qixol')->__('Item does not exist'));
50
+ $this->_redirect('*/*/');
51
+ }
52
+ }
53
+
54
+ public function newAction() {
55
+ $this->_forward('edit');
56
+ }
57
+
58
+ public function saveAction() {
59
+ $imagedata = array();
60
+ if (!empty($_FILES['filename']['name'])) {
61
+ try {
62
+ $ext = substr($_FILES['filename']['name'], strrpos($_FILES['filename']['name'], '.') + 1);
63
+ $fname = 'File-' . time() . '.' . $ext;
64
+ $uploader = new Varien_File_Uploader('filename');
65
+ $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png')); // or pdf or anything
66
+
67
+ $uploader->setAllowRenameFiles(true);
68
+ $uploader->setFilesDispersion(false);
69
+
70
+ $path = Mage::getBaseDir('media').DS.'custom'.DS.'banners';
71
+
72
+ $uploader->save($path, $fname);
73
+
74
+ $imagedata['filename'] = 'custom/banners/'.$fname;
75
+ } catch (Exception $e) {
76
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
77
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
78
+ return;
79
+ }
80
+ }
81
+ if ($data = $this->getRequest()->getPost()) {
82
+ $image_saved=false;
83
+ if (is_array($data['banner_link_name'])){
84
+ $data['banner_link_name']=join(",",$data['banner_link_name']);
85
+ }
86
+
87
+ if (!empty($imagedata['filename'])) {
88
+ $modelimages = Mage::getModel('qixol/Bannerimages');
89
+ $imagesdata['filename']=$imagedata['filename'];
90
+ $modelimages->setData($imagesdata);
91
+ $modelimages->save();
92
+ $image_saved=true;
93
+ unset($imagedata['filename']);
94
+ } else {
95
+ /*if (isset($data['filename']['delete']) && $data['filename']['delete'] == 1) {
96
+ if ($data['filename']['value'] != '') {
97
+ $_helper = Mage::helper('qixol');
98
+ $this->removeFile(Mage::getBaseDir('media').DS.$_helper->updateDirSepereator($data['filename']['value']));
99
+ }
100
+ $data['filename'] = '';
101
+ } else {
102
+ unset($data['filename']);
103
+ }*/
104
+ }
105
+
106
+ $model = Mage::getModel('qixol/banner');
107
+ $model->setData($data)
108
+ ->setId($this->getRequest()->getParam('id'));
109
+
110
+ try {
111
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
112
+ $model->setCreatedTime(now())
113
+ ->setUpdateTime(now());
114
+ } else {
115
+ $model->setUpdateTime(now());
116
+ }
117
+
118
+ $model->save();
119
+
120
+
121
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('qixol')->__('Item was successfully saved'));
122
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
123
+
124
+ if ($this->getRequest()->getParam('back')||$image_saved) {
125
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
126
+ return;
127
+ }
128
+ $this->_redirect('*/*/');
129
+ return;
130
+ } catch (Exception $e) {
131
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
132
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
133
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
134
+ return;
135
+ }
136
+ }
137
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('qixol')->__('Unable to find item to save'));
138
+ $this->_redirect('*/*/');
139
+ }
140
+
141
+ public function deleteAction() {
142
+ if ($this->getRequest()->getParam('id') > 0) {
143
+ try {
144
+ $model = Mage::getModel('qixol/banner')->load($this->getRequest()->getParam('id'));
145
+ $_helper = Mage::helper('qixol');
146
+ //$filePath = Mage::getBaseDir('media').DS.$_helper->updateDirSepereator($model->getFilename());
147
+ $model->delete();
148
+ //$this->removeFile($filePath);
149
+
150
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('qixol')->__('Item was successfully deleted'));
151
+ $this->_redirect('*/*/');
152
+ } catch (Exception $e) {
153
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
154
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
155
+ }
156
+ }
157
+ $this->_redirect('*/*/');
158
+ }
159
+
160
+ public function massDeleteAction() {
161
+ $bannerIds = $this->getRequest()->getParam('banner');
162
+ if (!is_array($bannerIds)) {
163
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('qixol')->__('Please select item(s)'));
164
+ } else {
165
+ try {
166
+ foreach ($bannerIds as $bannerId) {
167
+ $model = Mage::getModel('qixol/banner')->load($bannerId);
168
+ $_helper = Mage::helper('qixol');
169
+ //$filePath = Mage::getBaseDir('media').DS.$_helper->updateDirSepereator($model->getFilename());
170
+ $model->delete();
171
+ //$this->removeFile($filePath);
172
+ }
173
+ Mage::getSingleton('adminhtml/session')->addSuccess(
174
+ Mage::helper('qixol')->__(
175
+ 'Total of %d record(s) were successfully deleted', count($bannerIds)
176
+ )
177
+ );
178
+ } catch (Exception $e) {
179
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
180
+ }
181
+ }
182
+ $this->_redirect('*/*/index');
183
+ }
184
+
185
+ public function massStatusAction() {
186
+ $bannerIds = $this->getRequest()->getParam('banner');
187
+ if (!is_array($bannerIds)) {
188
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
189
+ } else {
190
+ try {
191
+ foreach ($bannerIds as $bannerId) {
192
+ $banner = Mage::getSingleton('qixol/banner')
193
+ ->load($bannerId)
194
+ ->setStatus($this->getRequest()->getParam('status'))
195
+ ->setIsMassupdate(true)
196
+ ->save();
197
+ }
198
+ $this->_getSession()->addSuccess(
199
+ $this->__('Total of %d record(s) were successfully updated', count($bannerIds))
200
+ );
201
+ } catch (Exception $e) {
202
+ $this->_getSession()->addError($e->getMessage());
203
+ }
204
+ }
205
+ $this->_redirect('*/*/index');
206
+ }
207
+
208
+ public function exportCsvAction() {
209
+ $fileName = 'banner.csv';
210
+ $content = $this->getLayout()->createBlock('qixol/adminhtml_banner_grid')
211
+ ->getCsv();
212
+
213
+ $this->_sendUploadResponse($fileName, $content);
214
+ }
215
+
216
+ public function exportXmlAction() {
217
+ $fileName = 'banner.xml';
218
+ $content = $this->getLayout()->createBlock('qixol/adminhtml_banner_grid')
219
+ ->getXml();
220
+
221
+ $this->_sendUploadResponse($fileName, $content);
222
+ }
223
+
224
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream') {
225
+ $response = $this->getResponse();
226
+ $response->setHeader('HTTP/1.1 200 OK', '');
227
+ $response->setHeader('Pragma', 'public', true);
228
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
229
+ $response->setHeader('Content-Disposition', 'attachment; filename=' . $fileName);
230
+ $response->setHeader('Last-Modified', date('r'));
231
+ $response->setHeader('Accept-Ranges', 'bytes');
232
+ $response->setHeader('Content-Length', strlen($content));
233
+ $response->setHeader('Content-type', $contentType);
234
+ $response->setBody($content);
235
+ $response->sendResponse();
236
+ die;
237
+ }
238
+
239
+ protected function removeFile($file) {
240
+ try {
241
+ $io = new Varien_Io_File();
242
+ $result = $io->rmdir($file, true);
243
+ } catch (Exception $e) {
244
+
245
+ }
246
+ }
247
+
248
+ }
app/code/community/Holbi/Qixol/controllers/Adminhtml/BannerboxesController.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Adminhtml_BannerboxesController extends Mage_Adminhtml_Controller_action {
3
+
4
+ protected function _initAction() {
5
+ $this->loadLayout()
6
+ ->_setActiveMenu('qixol/bannerboxes')
7
+ ->_addBreadcrumb(Mage::helper('qixol')->__('Banner boxes Manager'), Mage::helper('qixol')->__('Banner boxes Manager'));
8
+
9
+ return $this;
10
+ }
11
+
12
+ public function indexAction() {
13
+ $this->_initAction()
14
+ ->renderLayout();
15
+ }
16
+
17
+ public function editAction() {
18
+ $id = $this->getRequest()->getParam('id');
19
+ $model = Mage::getModel('qixol/bannerboxes')->load($id);
20
+
21
+ if ($model->getBannerBoxType() || $id == '') {
22
+
23
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
24
+ if (!empty($data)) {
25
+ $model->setData($data);
26
+ }
27
+
28
+ Mage::register('bannerbox_data', $model);
29
+
30
+ $this->loadLayout();
31
+ $this->_setActiveMenu('qixol/bannerboxes');
32
+
33
+ $this->_addBreadcrumb(Mage::helper('qixol')->__('Box Manager'), Mage::helper('qixol')->__('Box Manager'));
34
+
35
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
36
+
37
+ $this->_addContent($this->getLayout()->createBlock('qixol/adminhtml_bannerboxes_edit'))
38
+ ->_addLeft($this->getLayout()->createBlock('qixol/adminhtml_bannerboxes_edit_tabs'));
39
+ $version = substr(Mage::getVersion(), 0, 3);
40
+ $this->renderLayout();
41
+ } else {
42
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('qixol')->__('Item does not exist'));
43
+ $this->_redirect('*/*/');
44
+ }
45
+ }
46
+
47
+ public function newAction() {
48
+ $this->_forward('edit');
49
+ }
50
+
51
+ public function saveAction() {
52
+ $imagedata = array();
53
+
54
+ if ($data = $this->getRequest()->getPost()) {
55
+ $model = Mage::getModel('qixol/bannerboxes');
56
+ $model->setData($data)
57
+ ->setId($this->getRequest()->getParam('banner_box_type'));
58
+
59
+ try {
60
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
61
+ $model->setCreatedTime(now())
62
+ ->setUpdateTime(now());
63
+ } else {
64
+ $model->setUpdateTime(now());
65
+ }
66
+
67
+ $model->save();
68
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('qixol')->__('Item was successfully saved'));
69
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
70
+
71
+ if ($this->getRequest()->getParam('back')) {
72
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
73
+ return;
74
+ }
75
+ $this->_redirect('*/*/');
76
+ return;
77
+ } catch (Exception $e) {
78
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
79
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
80
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
81
+ return;
82
+ }
83
+ }
84
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('qixol')->__('Unable to find item to save'));
85
+ $this->_redirect('*/*/');
86
+ }
87
+
88
+ public function deleteAction() {
89
+ if ($this->getRequest()->getParam('id') !='') {
90
+ try {
91
+ $model = Mage::getModel('qixol/bannerboxes')->load($this->getRequest()->getParam('id'));
92
+ $_helper = Mage::helper('qixol');
93
+ $model->delete();
94
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('qixol')->__('Item was successfully deleted'));
95
+ $this->_redirect('*/*/');
96
+ } catch (Exception $e) {
97
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
98
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
99
+ }
100
+ }
101
+ $this->_redirect('*/*/');
102
+ }
103
+
104
+
105
+ }
app/code/community/Holbi/Qixol/controllers/Adminhtml/CustomergrouspmapController.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Adminhtml_CustomergrouspmapController extends Mage_Adminhtml_Controller_action {
3
+
4
+ protected function _initAction() {
5
+ $this->loadLayout()
6
+ ->_setActiveMenu('qixol/customergrouspmap')
7
+ ->_addBreadcrumb(Mage::helper('qixol')->__('Customer Groups Map'), Mage::helper('qixol')->__('Customer Groups Map'));
8
+
9
+ return $this;
10
+ }
11
+
12
+ public function indexAction() {
13
+ $this->_initAction()
14
+ ->renderLayout();
15
+ }
16
+
17
+ public function editAction() {
18
+ $id = $this->getRequest()->getParam('id');
19
+ $model = Mage::getModel('qixol/customergrouspmap')->load($id);
20
+
21
+ if ($model->getCustomerGroupName() || $id == '') {
22
+
23
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
24
+ if (!empty($data)) {
25
+ $model->setData($data);
26
+ }
27
+
28
+ Mage::register('customergrouspmap_data', $model);
29
+
30
+ $this->loadLayout();
31
+ $this->_setActiveMenu('qixol/customergrouspmap');
32
+
33
+ $this->_addBreadcrumb(Mage::helper('qixol')->__('Customer Group Map'), Mage::helper('qixol')->__('Customer Group Map'));
34
+
35
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
36
+
37
+ $this->_addContent($this->getLayout()->createBlock('qixol/adminhtml_customergrouspmap_edit'))
38
+ ->_addLeft($this->getLayout()->createBlock('qixol/adminhtml_customergrouspmap_edit_tabs'));
39
+ $version = substr(Mage::getVersion(), 0, 3);
40
+ $this->renderLayout();
41
+ } else {
42
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('qixol')->__('Item does not exist'));
43
+ $this->_redirect('*/*/');
44
+ }
45
+ }
46
+
47
+ public function newAction() {
48
+ $this->_forward('edit');
49
+ }
50
+
51
+ public function saveAction() {
52
+ $imagedata = array();
53
+
54
+ if ($data = $this->getRequest()->getPost()) {
55
+ $model = Mage::getModel('qixol/customergrouspmap');
56
+ $model->setData($data)
57
+ ->setId($this->getRequest()->getParam('customer_group_name'));
58
+
59
+ try {
60
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
61
+ $model->setCreatedTime(now())
62
+ ->setUpdateTime(now());
63
+ } else {
64
+ $model->setUpdateTime(now());
65
+ }
66
+
67
+ $model->save();
68
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('qixol')->__('Item was successfully saved'));
69
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
70
+
71
+ if ($this->getRequest()->getParam('back')) {
72
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
73
+ return;
74
+ }
75
+ $this->_redirect('*/*/');
76
+ return;
77
+ } catch (Exception $e) {
78
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
79
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
80
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
81
+ return;
82
+ }
83
+ }
84
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('qixol')->__('Unable to find item to save'));
85
+ $this->_redirect('*/*/');
86
+ }
87
+
88
+ public function deleteAction() {
89
+ if ($this->getRequest()->getParam('id') !='') {
90
+ try {
91
+ $model = Mage::getModel('qixol/customergrouspmap')->load($this->getRequest()->getParam('id'));
92
+ $_helper = Mage::helper('qixol');
93
+ $model->delete();
94
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('qixol')->__('Item was successfully deleted'));
95
+ $this->_redirect('*/*/');
96
+ } catch (Exception $e) {
97
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
98
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
99
+ }
100
+ }
101
+ $this->_redirect('*/*/');
102
+ }
103
+
104
+
105
+ }
app/code/community/Holbi/Qixol/controllers/Adminhtml/QixolbackendController.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Adminhtml_QixolbackendController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->_setActiveMenu('qixol/items');
8
+ $this->_title($this->__("Qixol"));
9
+ $this->renderLayout();
10
+ }
11
+ }
app/code/community/Holbi/Qixol/controllers/Adminhtml/ShippingmapController.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Adminhtml_ShippingmapController extends Mage_Adminhtml_Controller_action {
3
+
4
+ protected function _initAction() {
5
+ $this->loadLayout()
6
+ ->_setActiveMenu('qixol/shippingmap')
7
+ ->_addBreadcrumb(Mage::helper('qixol')->__('Manage Shippings Map'), Mage::helper('qixol')->__('Manage Shippings Map'));
8
+
9
+ return $this;
10
+ }
11
+
12
+ public function indexAction() {
13
+ $this->_initAction()
14
+ ->renderLayout();
15
+ }
16
+
17
+ public function editAction() {
18
+ $id = $this->getRequest()->getParam('id');
19
+ $model = Mage::getModel('qixol/shippingmap')->load($id);
20
+
21
+ if ($model->getShippingName() || $id == '') {
22
+
23
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
24
+ if (!empty($data)) {
25
+ $model->setData($data);
26
+ }
27
+
28
+ Mage::register('shippingmap_data', $model);
29
+
30
+ $this->loadLayout();
31
+ $this->_setActiveMenu('qixol/shippingmap');
32
+
33
+ $this->_addBreadcrumb(Mage::helper('qixol')->__('Shippings Map'), Mage::helper('qixol')->__('Shippings Map'));
34
+
35
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
36
+
37
+ $this->_addContent($this->getLayout()->createBlock('qixol/adminhtml_shippingmap_edit'))
38
+ ->_addLeft($this->getLayout()->createBlock('qixol/adminhtml_shippingmap_edit_tabs'));
39
+ $version = substr(Mage::getVersion(), 0, 3);
40
+ $this->renderLayout();
41
+ } else {
42
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('qixol')->__('Item does not exist'));
43
+ $this->_redirect('*/*/');
44
+ }
45
+ }
46
+
47
+ public function newAction() {
48
+ $this->_forward('edit');
49
+ }
50
+
51
+ public function saveAction() {
52
+ $imagedata = array();
53
+
54
+ if ($data = $this->getRequest()->getPost()) {
55
+ $model = Mage::getModel('qixol/shippingmap');
56
+ $model->setData($data)
57
+ ->setId($this->getRequest()->getParam('shipping_name'));
58
+
59
+ try {
60
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
61
+ $model->setCreatedTime(now())
62
+ ->setUpdateTime(now());
63
+ } else {
64
+ $model->setUpdateTime(now());
65
+ }
66
+
67
+ $model->save();
68
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('qixol')->__('Item was successfully saved'));
69
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
70
+
71
+ if ($this->getRequest()->getParam('back')) {
72
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
73
+ return;
74
+ }
75
+ $this->_redirect('*/*/');
76
+ return;
77
+ } catch (Exception $e) {
78
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
79
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
80
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
81
+ return;
82
+ }
83
+ }
84
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('qixol')->__('Unable to find item to save'));
85
+ $this->_redirect('*/*/');
86
+ }
87
+
88
+ public function deleteAction() {
89
+ if ($this->getRequest()->getParam('id') !='') {
90
+ try {
91
+ $model = Mage::getModel('qixol/shippingmap')->load($this->getRequest()->getParam('id'));
92
+ $_helper = Mage::helper('qixol');
93
+ $model->delete();
94
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('qixol')->__('Item was successfully deleted'));
95
+ $this->_redirect('*/*/');
96
+ } catch (Exception $e) {
97
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
98
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
99
+ }
100
+ }
101
+ $this->_redirect('*/*/');
102
+ }
103
+
104
+
105
+ }
app/code/community/Holbi/Qixol/controllers/Adminhtml/StickerController.php ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Adminhtml_StickerController extends Mage_Adminhtml_Controller_action {
3
+
4
+ protected function _initAction() {
5
+ $this->loadLayout()
6
+ ->_setActiveMenu('qixol/items')
7
+ ->_addBreadcrumb(Mage::helper('qixol')->__('Sticker Manager'), Mage::helper('qixol')->__('Sticker Manager'));
8
+
9
+ return $this;
10
+ }
11
+
12
+ public function indexAction() {
13
+ $this->_initAction()
14
+ ->renderLayout();
15
+ }
16
+
17
+ public function editAction() {
18
+ $id = $this->getRequest()->getParam('id');
19
+ $model = Mage::getModel('qixol/sticker')->load($id);
20
+
21
+ if ($model->getId() || $id == 0) {
22
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
23
+ if (!empty($data)) {
24
+ $model->setData($data);
25
+ }
26
+
27
+ Mage::register('sticker_data', $model);
28
+
29
+ $this->loadLayout();
30
+ $this->_setActiveMenu('qixol/items');
31
+
32
+ $this->_addBreadcrumb(Mage::helper('qixol')->__('Sticker Manager'), Mage::helper('qixol')->__('Sticker Manager'));
33
+ $this->_addBreadcrumb(Mage::helper('qixol')->__('Item Sticker'), Mage::helper('qixol')->__('Item Sticker'));
34
+
35
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
36
+
37
+ $this->_addContent($this->getLayout()->createBlock('qixol/adminhtml_sticker_edit'))
38
+ ->_addLeft($this->getLayout()->createBlock('qixol/adminhtml_sticker_edit_tabs'));
39
+ $version = substr(Mage::getVersion(), 0, 3);
40
+ if (($version=='1.4' || $version=='1.5') && Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
41
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
42
+ }
43
+ $this->renderLayout();
44
+ } else {
45
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('qixol')->__('Sticker does not exist'));
46
+ $this->_redirect('*/*/');
47
+ }
48
+ }
49
+
50
+ public function newAction() {
51
+ $this->_forward('edit');
52
+ }
53
+
54
+ public function saveAction() {
55
+ $imagedata = array();
56
+ if (!empty($_FILES['filename']['name'])) {
57
+ try {
58
+ $ext = substr($_FILES['filename']['name'], strrpos($_FILES['filename']['name'], '.') + 1);
59
+ $fname = 'File-' . time() . '.' . $ext;
60
+ $uploader = new Varien_File_Uploader('filename');
61
+ $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png')); // or pdf or anything
62
+
63
+ $uploader->setAllowRenameFiles(true);
64
+ $uploader->setFilesDispersion(false);
65
+
66
+ $path = Mage::getBaseDir('media').DS.'custom'.DS.'stickers';
67
+
68
+ $uploader->save($path, $fname);
69
+
70
+ $imagedata['filename'] = 'custom/stickers/'.$fname;
71
+ } catch (Exception $e) {
72
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
73
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
74
+ return;
75
+ }
76
+ }
77
+ if ($data = $this->getRequest()->getPost()) {
78
+ if ($data['use_default_banner_group']=='1'){
79
+ $data['unique_banner_group']='';
80
+ }else {
81
+ $data['default_banner_group']='';
82
+ }
83
+
84
+ if (is_array($data['banner_link_name'])){
85
+ $data['banner_link_name']=join(",",$data['banner_link_name']);
86
+ }
87
+ if (!empty($imagedata['filename'])) {
88
+ $data['filename'] = $imagedata['filename'];
89
+ } else {
90
+ if (isset($data['filename']['delete']) && $data['filename']['delete'] == 1) {
91
+ if ($data['filename']['value'] != '') {
92
+ $_helper = Mage::helper('qixol');
93
+ $this->removeFile(Mage::getBaseDir('media').DS.'custom'.DS.'stickers'.DS.$_helper->updateDirSepereator($data['filename']['value']));
94
+ }
95
+ $data['filename'] = '';
96
+ } else {
97
+ unset($data['filename']);
98
+ }
99
+ }
100
+ $model = Mage::getModel('qixol/sticker');
101
+ $model->setData($data)
102
+ ->setId($this->getRequest()->getParam('id'));
103
+
104
+ try {
105
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
106
+ $model->setCreatedTime(now())
107
+ ->setUpdateTime(now());
108
+ } else {
109
+ $model->setUpdateTime(now());
110
+ }
111
+
112
+ $model->save();
113
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('qixol')->__('Item was successfully saved'));
114
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
115
+
116
+ if ($this->getRequest()->getParam('back')) {
117
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
118
+ return;
119
+ }
120
+ $this->_redirect('*/*/');
121
+ return;
122
+ } catch (Exception $e) {
123
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
124
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
125
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
126
+ return;
127
+ }
128
+ }
129
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('qixol')->__('Unable to find item to save'));
130
+ $this->_redirect('*/*/');
131
+ }
132
+
133
+ public function deleteAction() {
134
+ if ($this->getRequest()->getParam('id') > 0) {
135
+ try {
136
+ $model = Mage::getModel('qixol/sticker')->load($this->getRequest()->getParam('id'));
137
+ $_helper = Mage::helper('qixol');
138
+ $filePath = Mage::getBaseDir('media').DS.'custom'.DS.'stickers'.DS.$_helper->updateDirSepereator($model->getFilename());
139
+ $model->delete();
140
+ $this->removeFile($filePath);
141
+
142
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('qixol')->__('Item was successfully deleted'));
143
+ $this->_redirect('*/*/');
144
+ } catch (Exception $e) {
145
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
146
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
147
+ }
148
+ }
149
+ $this->_redirect('*/*/');
150
+ }
151
+
152
+ public function massDeleteAction() {
153
+ $bannerIds = $this->getRequest()->getParam('sticker');
154
+ if (!is_array($bannerIds)) {
155
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('qixol')->__('Please select item(s)'));
156
+ } else {
157
+ try {
158
+ foreach ($bannerIds as $bannerId) {
159
+ $model = Mage::getModel('qixol/sticker')->load($bannerId);
160
+ $_helper = Mage::helper('qixol');
161
+ $filePath = Mage::getBaseDir('media').DS.'custom'.DS.'stickers'.DS.$_helper->updateDirSepereator($model->getFilename());
162
+ $model->delete();
163
+ $this->removeFile($filePath);
164
+ }
165
+ Mage::getSingleton('adminhtml/session')->addSuccess(
166
+ Mage::helper('qixol')->__(
167
+ 'Total of %d record(s) were successfully deleted', count($bannerIds)
168
+ )
169
+ );
170
+ } catch (Exception $e) {
171
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
172
+ }
173
+ }
174
+ $this->_redirect('*/*/index');
175
+ }
176
+
177
+ public function massStatusAction() {
178
+ $bannerIds = $this->getRequest()->getParam('sticker');
179
+ if (!is_array($bannerIds)) {
180
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
181
+ } else {
182
+ try {
183
+ foreach ($bannerIds as $bannerId) {
184
+ $banner = Mage::getSingleton('qixol/sticker')
185
+ ->load($bannerId)
186
+ ->setStatus($this->getRequest()->getParam('status'))
187
+ ->setIsMassupdate(true)
188
+ ->save();
189
+ }
190
+ $this->_getSession()->addSuccess(
191
+ $this->__('Total of %d record(s) were successfully updated', count($bannerIds))
192
+ );
193
+ } catch (Exception $e) {
194
+ $this->_getSession()->addError($e->getMessage());
195
+ }
196
+ }
197
+ $this->_redirect('*/*/index');
198
+ }
199
+
200
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream') {
201
+ $response = $this->getResponse();
202
+ $response->setHeader('HTTP/1.1 200 OK', '');
203
+ $response->setHeader('Pragma', 'public', true);
204
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
205
+ $response->setHeader('Content-Disposition', 'attachment; filename=' . $fileName);
206
+ $response->setHeader('Last-Modified', date('r'));
207
+ $response->setHeader('Accept-Ranges', 'bytes');
208
+ $response->setHeader('Content-Length', strlen($content));
209
+ $response->setHeader('Content-type', $contentType);
210
+ $response->setBody($content);
211
+ $response->sendResponse();
212
+ die;
213
+ }
214
+
215
+ protected function removeFile($file) {
216
+ try {
217
+ $io = new Varien_Io_File();
218
+ $result = $io->rmdir($file, true);
219
+ } catch (Exception $e) {
220
+
221
+ }
222
+ }
223
+
224
+ }
app/code/community/Holbi/Qixol/controllers/Adminhtml/StoresmapController.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_Adminhtml_StoresmapController extends Mage_Adminhtml_Controller_action {
3
+
4
+ protected function _initAction() {
5
+ $this->loadLayout()
6
+ ->_setActiveMenu('qixol/storesmap')
7
+ ->_addBreadcrumb(Mage::helper('qixol')->__('Manage Stores Map'), Mage::helper('qixol')->__('Manage Stores Map'));
8
+
9
+ return $this;
10
+ }
11
+
12
+ public function indexAction() {
13
+ $this->_initAction()
14
+ ->renderLayout();
15
+ }
16
+
17
+ public function editAction() {
18
+ $id = $this->getRequest()->getParam('id');
19
+ $model = Mage::getModel('qixol/storesmap')->load($id);
20
+
21
+ if ($model->getStoreName() || $id == '') {
22
+
23
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
24
+ if (!empty($data)) {
25
+ $model->setData($data);
26
+ }
27
+
28
+ Mage::register('storesmap_data', $model);
29
+
30
+ $this->loadLayout();
31
+ $this->_setActiveMenu('qixol/storesmap');
32
+
33
+ $this->_addBreadcrumb(Mage::helper('qixol')->__('Stores Map'), Mage::helper('qixol')->__('Stores Map'));
34
+
35
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
36
+
37
+ $this->_addContent($this->getLayout()->createBlock('qixol/adminhtml_storesmap_edit'))
38
+ ->_addLeft($this->getLayout()->createBlock('qixol/adminhtml_storesmap_edit_tabs'));
39
+ $version = substr(Mage::getVersion(), 0, 3);
40
+ $this->renderLayout();
41
+ } else {
42
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('qixol')->__('Item does not exist'));
43
+ $this->_redirect('*/*/');
44
+ }
45
+ }
46
+
47
+ public function newAction() {
48
+ $this->_forward('edit');
49
+ }
50
+
51
+ public function saveAction() {
52
+ $imagedata = array();
53
+
54
+ if ($data = $this->getRequest()->getPost()) {
55
+ $model = Mage::getModel('qixol/storesmap');
56
+ $model->setData($data)
57
+ ->setId($this->getRequest()->getParam('store_name'));
58
+
59
+ try {
60
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
61
+ $model->setCreatedTime(now())
62
+ ->setUpdateTime(now());
63
+ } else {
64
+ $model->setUpdateTime(now());
65
+ }
66
+
67
+ $model->save();
68
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('qixol')->__('Item was successfully saved'));
69
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
70
+
71
+ if ($this->getRequest()->getParam('back')) {
72
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
73
+ return;
74
+ }
75
+ $this->_redirect('*/*/');
76
+ return;
77
+ } catch (Exception $e) {
78
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
79
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
80
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
81
+ return;
82
+ }
83
+ }
84
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('qixol')->__('Unable to find item to save'));
85
+ $this->_redirect('*/*/');
86
+ }
87
+
88
+ public function deleteAction() {
89
+ if ($this->getRequest()->getParam('id') !='') {
90
+ try {
91
+ $model = Mage::getModel('qixol/storesmap')->load($this->getRequest()->getParam('id'));
92
+ $_helper = Mage::helper('qixol');
93
+ $model->delete();
94
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('qixol')->__('Item was successfully deleted'));
95
+ $this->_redirect('*/*/');
96
+ } catch (Exception $e) {
97
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
98
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
99
+ }
100
+ }
101
+ $this->_redirect('*/*/');
102
+ }
103
+
104
+
105
+ }
app/code/community/Holbi/Qixol/controllers/AjaxController.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_AjaxController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ var $_logFile;
5
+
6
+ public function UpdateStatusAction() {
7
+ $_hlp=Mage::helper('qixol');
8
+ $export=Mage::getModel('qixol/sinch');
9
+ $message_output='';
10
+ $finished=1;
11
+
12
+ $tmp_data=$export->getExportStatus('customers');
13
+ if ($tmp_data['id']>0){
14
+ $message_output.='<strong>'.$_hlp->__('Customers').'</strong>:'.$_hlp->__($tmp_data['extended_message']!=''?$tmp_data['extended_message']:$tmp_data['last_message'])."<br><br><hr>";
15
+ $finished=$tmp_data['finished'];
16
+ } else $finished=0;
17
+
18
+ $tmp_data=$export->getExportStatus('delivery');
19
+ if ($tmp_data['id']>0){
20
+ $message_output.='<strong>'.$_hlp->__('Shippings').'</strong>:'.$_hlp->__($tmp_data['extended_message']!=''?$tmp_data['extended_message']:$tmp_data['last_message'])."<br><br><hr>";
21
+ $finished=$tmp_data['finished'];
22
+ } else $finished=0;
23
+
24
+ $tmp_data=$export->getExportStatus('products');
25
+ if ($tmp_data['id']>0){
26
+ $message_output.='<strong>'.$_hlp->__('Products').'</strong>:'.$_hlp->__($tmp_data['extended_message']!=''?$tmp_data['extended_message']:$tmp_data['last_message'])."<br><br><hr>";
27
+ $finished=$tmp_data['finished'];
28
+ } else $finished=0;
29
+
30
+ $tmp_data=$export->getExportStatus('currency');
31
+ if ($tmp_data['id']>0){
32
+ $message_output.='<strong>'.$_hlp->__('Currency').'</strong>:'.$_hlp->__($tmp_data['extended_message']!=''?$tmp_data['extended_message']:$tmp_data['last_message'])."<br><br><hr>";
33
+ $finished=$tmp_data['finished'];
34
+ } else $finished=0;
35
+
36
+ if ($message_output!='') {
37
+ // JSON
38
+ print '{ "message": "'.$_hlp->__((string)$message_arr['message']).'","extmessage": "'.addslashes(nl2br((string)$message_output)).'", "finished": "'.(int)$finished.'"}';
39
+ }
40
+ else{
41
+ print '{ "message": "", "finished": "0"}';
42
+ }
43
+
44
+ return;
45
+ }
46
+
47
+
48
+ public function UpdateImportStatusAction() {
49
+ $_hlp=Mage::helper('qixol');
50
+
51
+ $import=Mage::getModel('qixol/sinch');
52
+ $message_output='';
53
+ $finished=1;
54
+
55
+ $tmp_data=$import->getExportStatus('promotions');
56
+ if ($tmp_data['id']>0){
57
+ $message_output.="<strong>".$_hlp->__('Promotions')."</strong>".$_hlp->__(':Imported')."<br><br><hr>";
58
+ $finished=$tmp_data['finished'];
59
+ } else $finished=0;
60
+
61
+ if ($message_output!='') {
62
+ // JSON
63
+ print '{ "message": "'.$_hlp->__('Done').'","extmessage": "'.addslashes(nl2br((string)$message_output)).'", "finished": "'.(int)$finished.'"}';
64
+ }
65
+ else{
66
+ print '{ "message": "", "finished": "0"}';
67
+ }
68
+
69
+ return;
70
+ }
71
+
72
+ public function indexAction(){
73
+ $export=Mage::getModel('qixol/sinch');
74
+ //echo "Start export <br>";
75
+ //$dir = dirname(__FILE__);
76
+ $export->run_export();
77
+ //exec("nohup ".$sinch->php_run_string.$dir."/../sinch_import_start_ajax.php > /dev/null & echo $!");
78
+ //echo "Finish export<br>";
79
+
80
+ }
81
+
82
+ public function ExportProductAction(){
83
+ $export=Mage::getModel('qixol/sinch');
84
+ //echo "Start export <br>";
85
+ //$dir = dirname(__FILE__);
86
+ $export->run_export();
87
+ //exec("nohup ".$sinch->php_run_string.$dir."/../sinch_import_start_ajax.php > /dev/null & echo $!");
88
+ //echo "Finish export<br>";
89
+
90
+ }
91
+
92
+ public function ImportPromotionAction(){
93
+ $export=Mage::getModel('qixol/sinch');
94
+ //echo "Start export <br>";
95
+ //$dir = dirname(__FILE__);
96
+ $export->run_import();
97
+ //exec("nohup ".$sinch->php_run_string.$dir."/../sinch_import_start_ajax.php > /dev/null & echo $!");
98
+ //echo "Finish export<br>";
99
+
100
+ }
101
+
102
+ }
103
+ ?>
app/code/community/Holbi/Qixol/controllers/CartController.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once 'Mage/Checkout/controllers/CartController.php';
3
+ class Holbi_Qixol_CartController extends Mage_Checkout_CartController {
4
+
5
+ public function applypointsAction() {
6
+ global $_SESSION;
7
+ $_Cart=Mage::getModel('checkout/cart');
8
+ $session = Mage::getSingleton('checkout/session');
9
+ if (!$_Cart->getQuote()->getItemsCount()) {
10
+ $session->addError($this->__('Emopty shopping cart!.'));
11
+ $this->_redirect('checkout/cart');
12
+ return;
13
+ }
14
+ if ($this->getRequest()->getParam('removepoints') == 1) {
15
+ $points_amount='';
16
+ Mage::getSingleton('customer/session')->setPointsAmount($points_amount);
17
+ $session->addSuccess($this->__('Points was canceled.'));
18
+ }
19
+ else {
20
+ $points_amount = (string) $this->getRequest()->getParam('reward_points');
21
+ if ((int)Mage::getStoreConfig('qixol/issuedpoints/convertrate')>0)
22
+ $points_amount_money=$points_amount/(int)Mage::getStoreConfig('qixol/issuedpoints/convertrate');
23
+ $customerId = Mage::getSingleton('customer/session')->getCustomerId();
24
+ if ($customerId==0) {
25
+ $session->addError($this->__('Login First.'));
26
+ } else {
27
+
28
+ $validtotal = $_Cart->getQuote()->getSubtotal();
29
+ $bonuspoints = Mage::getModel('qixol/bonuspoints')->load($customerId);
30
+ $leftpoints = $bonuspoints->getCurrentPoints();
31
+
32
+ if (isset($_SESSION['qixol_quoted_items']['cart_data']['deliverytotaldiscount'])&&$_SESSION['qixol_quoted_items']['cart_data']['deliverytotaldiscount']>0){
33
+ $validtotal-=$_SESSION['qixol_quoted_items']['cart_data']['deliverytotaldiscount'];
34
+ }
35
+ if (isset($_SESSION['qixol_quoted_items']['cart_data']['totaldiscount'])&&$_SESSION['qixol_quoted_items']['cart_data']['totaldiscount']>0){
36
+ $validtotal-=$_SESSION['qixol_quoted_items']['cart_data']['totaldiscount'];
37
+ }
38
+ if ((double)$leftpoints>=(double)$points_amount_money&&(double)$points_amount_money<$validtotal){
39
+ Mage::getSingleton('customer/session')->setPointsAmount($points_amount);
40
+ $session->addSuccess(
41
+ $session->addSuccess('Reward Points "'.Mage::helper('core')->escapeHtml($points_amount).'" was applied.')
42
+ );
43
+
44
+
45
+ }elseif((int)$leftpoints<(int)$points_amount) {
46
+ $session->addError($this->__('Not enouhgt points!'));
47
+ }else{
48
+ $session->addError('reward Points "'.Mage::helper('core')->escapeHtml($points_amount).'" is not valid.');
49
+ }
50
+
51
+ }
52
+ }
53
+ $this->_redirect('checkout/cart');
54
+ return;
55
+ }
56
+
57
+ }
app/code/community/Holbi/Qixol/controllers/IndexController.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Holbi_Qixol_IndexController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ /*var $_logFile;
5
+
6
+ public function indexAction(){
7
+
8
+ echo "Start export <br>";
9
+
10
+ $export=Mage::getModel('qixol/sinch');
11
+
12
+ $export->run_export();
13
+
14
+ echo "Finish export<br>";
15
+
16
+ }*/
17
+ public function indexAction() {
18
+ $this->loadLayout();
19
+ $this->renderLayout();
20
+ }
21
+
22
+ }
app/code/community/Holbi/Qixol/controllers/IssuedcouponController.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Holbi_Qixol_IssuedcouponController extends Mage_Core_Controller_Front_Action {
4
+
5
+ public function indexAction() {
6
+ if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
7
+ $this->_redirect('customer/account/login');
8
+ return;
9
+ }
10
+ $this->loadLayout();
11
+ $this->_initLayoutMessages('customer/session');
12
+ $this->_initLayoutMessages('catalog/session');
13
+
14
+ $this->renderLayout();
15
+ }
16
+
17
+ }
app/code/community/Holbi/Qixol/etc/adminhtml.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <qixol>
12
+ <title>Qixol Setting</title>
13
+ </qixol>
14
+ </children>
15
+ </config>
16
+ </children>
17
+ </system>
18
+ </children>
19
+ </admin>
20
+ </resources>
21
+ </acl>
22
+ </config>
app/code/community/Holbi/Qixol/etc/config.xml ADDED
@@ -0,0 +1,396 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <default>
4
+ <qixol>
5
+ <integraion>
6
+ <dropdown>evaluation</dropdown>
7
+ </integraion>
8
+ </qixol>
9
+ </default>
10
+ <modules>
11
+ <Holbi_Qixol>
12
+ <version>0.1.0</version>
13
+ </Holbi_Qixol>
14
+ </modules>
15
+ <global>
16
+ <helpers>
17
+ <qixol>
18
+ <class>Holbi_Qixol_Helper</class>
19
+ </qixol>
20
+ </helpers>
21
+ <blocks>
22
+ <qixol>
23
+ <class>Holbi_Qixol_Block</class>
24
+ </qixol>
25
+ </blocks>
26
+ <fieldsets>
27
+ <sales_convert_quote_address>
28
+ <points_amount><to_order>*</to_order></points_amount>
29
+ <base_points_amount><to_order>*</to_order></base_points_amount>
30
+ </sales_convert_quote_address>
31
+ <sales_convert_order>
32
+ <points_amount><to_invoice>*</to_invoice></points_amount>
33
+ <base_points_amount><to_invoice>*</to_invoice></base_points_amount>
34
+ </sales_convert_order>
35
+ </fieldsets>
36
+ <pdf>
37
+ <totals>
38
+ <points translate="title">
39
+ <title>Rewards points discount</title>
40
+ <source_field>points_amount</source_field>
41
+ <font_size>7</font_size>
42
+ <display_zero>0</display_zero>
43
+ <sort_order>650</sort_order>
44
+ <amount_prefix>-</amount_prefix>
45
+ </points>
46
+ </totals>
47
+ </pdf>
48
+ <sales>
49
+ <quote>
50
+ <totals>
51
+ <points>
52
+ <class>Holbi_Qixol_Model_Ordertotalpoints</class>
53
+ <after>subtotal</after>
54
+ </points>
55
+ </totals>
56
+ </quote>
57
+ <order_invoice>
58
+ <totals>
59
+ <points>
60
+ <class>Holbi_Qixol__Model_Invoicepoints</class>
61
+ <after>subtotal</after>
62
+ </points>
63
+ </totals>
64
+ </order_invoice>
65
+ <order_creditmemo>
66
+ <totals>
67
+ <points>
68
+ <class>Holbi_Qixol_Model_Creditmemopoints</class>
69
+ <after>subtotal</after>
70
+ </points>
71
+ </totals>
72
+ </order_creditmemo>
73
+ </sales>
74
+ <models>
75
+ <qixol>
76
+ <class>Holbi_Qixol_Model</class>
77
+ <resourceModel>qixol_mysql4</resourceModel>
78
+ </qixol>
79
+ <qixol_mysql4>
80
+ <class>Holbi_Qixol_Model_Mysql4</class>
81
+ <entities>
82
+ <promotions>
83
+ <table>qixol_promotions_type</table>
84
+ </promotions>
85
+ <promotionhasproduct>
86
+ <table>qixol_promotion_has_product</table>
87
+ </promotionhasproduct>
88
+ <banner>
89
+ <table>qixol_banners</table>
90
+ </banner>
91
+ <bannerimages>
92
+ <table>qixol_banner_images</table>
93
+ </bannerimages>
94
+ <bannertoimage>
95
+ <table>qixol_banner_has_images</table>
96
+ </bannertoimage>
97
+ <sticker>
98
+ <table>qixol_stickers</table>
99
+ </sticker>
100
+ <bannerboxes>
101
+ <table>qixol_banner_box</table>
102
+ </bannerboxes>
103
+ <exprpocessstat>
104
+ <table>qixol_process_export_status_table</table>
105
+ </exprpocessstat>
106
+ <exportstat>
107
+ <table>qixol_product_export_stat</table>
108
+ </exportstat>
109
+ <deletedproduct>
110
+ <table>qixol_product_to_delete</table>
111
+ </deletedproduct>
112
+ <customergrouspmap>
113
+ <table>qixol_customers_groups_name_map</table>
114
+ </customergrouspmap>
115
+ <shippingmap>
116
+ <table>qixol_shipping_name_map</table>
117
+ </shippingmap>
118
+ <issuedcoupon>
119
+ <table>qixol_coupon_issued</table>
120
+ </issuedcoupon>
121
+ <storesmap>
122
+ <table>qixol_stores_name_map</table>
123
+ </storesmap>
124
+ <bonuspoints>
125
+ <table>qixol_cutomer_points</table>
126
+ </bonuspoints>
127
+ </entities>
128
+ </qixol_mysql4>
129
+ </models>
130
+ <resources>
131
+ <qixol_setup>
132
+ <setup>
133
+ <module>Holbi_Qixol</module>
134
+ </setup>
135
+ <connection>
136
+ <use>core_setup</use>
137
+ </connection>
138
+ </qixol_setup>
139
+ <qixol_write>
140
+ <connection>
141
+ <use>core_write</use>
142
+ </connection>
143
+ </qixol_write>
144
+ <qixol_read>
145
+ <connection>
146
+ <use>core_read</use>
147
+ </connection>
148
+ </qixol_read>
149
+ </resources>
150
+ <events>
151
+ <catalog_product_delete_before> <!-- identifier of the event we want to catch -->
152
+ <observers>
153
+ <catalog_product_delete_before_handler> <!-- identifier of the event handler -->
154
+ <type>model</type> <!-- class method call type; valid are model, object and singleton -->
155
+ <class>qixol/observer</class> <!-- observers class alias -->
156
+ <method>markDletedProduct</method> <!-- observer's method to be called -->
157
+ <args></args> <!-- additional arguments passed to observer -->
158
+ </catalog_product_delete_before_handler>
159
+ </observers>
160
+ </catalog_product_delete_before>
161
+ <checkout_cart_save_after> <!-- identifier of the event we want to catch -->
162
+ <observers>
163
+ <checkout_cart_save_after_handler> <!-- identifier of the event handler -->
164
+ <type>model</type> <!-- class method call type; valid are model, object and singleton -->
165
+ <class>qixol/observer</class> <!-- observers class alias -->
166
+ <method>processGetCartPromo</method> <!-- observer's method to be called -->
167
+ <args></args> <!-- additional arguments passed to observer -->
168
+ </checkout_cart_save_after_handler>
169
+ </observers>
170
+ </checkout_cart_save_after>
171
+
172
+ <checkout_controller_onepage_save_shipping_method> <!-- identifier of the event we want to catch -->
173
+ <observers>
174
+ <checkout_controller_onepage_save_shipping_method_handler> <!-- identifier of the event handler -->
175
+ <type>model</type> <!-- class method call type; valid are model, object and singleton -->
176
+ <class>qixol/observer</class> <!-- observers class alias -->
177
+ <method>processShippingUpdated</method> <!-- observer's method to be called -->
178
+ <args></args> <!-- additional arguments passed to observer -->
179
+ </checkout_controller_onepage_save_shipping_method_handler>
180
+ </observers>
181
+ </checkout_controller_onepage_save_shipping_method>
182
+
183
+ <sales_convert_quote_to_order> <!-- identifier of the event we want to catch -->
184
+ <observers>
185
+ <sales_convert_quote_to_order_handler> <!-- identifier of the event handler -->
186
+ <type>model</type> <!-- class method call type; valid are model, object and singleton -->
187
+ <class>qixol/observer</class> <!-- observers class alias -->
188
+ <method>processApplyCartPromo</method> <!-- observer's method to be called -->
189
+ <args></args> <!-- additional arguments passed to observer -->
190
+ </sales_convert_quote_to_order_handler>
191
+ </observers>
192
+ </sales_convert_quote_to_order>
193
+
194
+ <checkout_type_onepage_save_order_after>
195
+ <observers>
196
+ <checkout_type_onepage_save_order_after_handler>
197
+ <class>qixol/observer</class>
198
+ <method>processSavePromotionsToOrder</method>
199
+ </checkout_type_onepage_save_order_after_handler>
200
+ </observers>
201
+ </checkout_type_onepage_save_order_after>
202
+
203
+ <controller_action_predispatch_checkout_cart_couponPost>
204
+ <observers>
205
+ <controller_action_before>
206
+ <type>model</type>
207
+ <class>qixol/observer</class>
208
+ <method>checkQixolCoupon</method>
209
+ </controller_action_before>
210
+ </observers>
211
+ </controller_action_predispatch_checkout_cart_couponPost>
212
+ <controller_action_predispatch_checkout_cart_delete>
213
+ <observers>
214
+ <controller_action_before>
215
+ <type>model</type>
216
+ <class>qixol/observer</class>
217
+ <method>deleteCartAction</method>
218
+ </controller_action_before>
219
+ </observers>
220
+ </controller_action_predispatch_checkout_cart_delete>
221
+ <controller_action_predispatch_checkout_cart_updatePost>
222
+ <observers>
223
+ <controller_action_before>
224
+ <type>model</type>
225
+ <class>qixol/observer</class>
226
+ <method>updateCartPostAction</method>
227
+ </controller_action_before>
228
+ </observers>
229
+ </controller_action_predispatch_checkout_cart_updatePost>
230
+ <controller_action_predispatch_checkout_cart_ajaxUpdate>
231
+ <observers>
232
+ <controller_action_before>
233
+ <type>model</type>
234
+ <class>qixol/observer</class>
235
+ <method>updateCartAjaxUpdate</method>
236
+ </controller_action_before>
237
+ </observers>
238
+ </controller_action_predispatch_checkout_cart_ajaxUpdate>
239
+ <controller_action_predispatch_checkout_cart_ajaxDelete>
240
+ <observers>
241
+ <controller_action_before>
242
+ <type>model</type>
243
+ <class>qixol/observer</class>
244
+ <method>updateCartAjaxDelete</method>
245
+ </controller_action_before>
246
+ </observers>
247
+ </controller_action_predispatch_checkout_cart_ajaxDelete>
248
+ </events>
249
+ </global>
250
+ <admin>
251
+ <routers>
252
+ <qixol_admin>
253
+ <use>admin</use>
254
+ <args>
255
+ <module>Holbi_Qixol</module>
256
+ <frontName>qixol_admin</frontName>
257
+ </args>
258
+ </qixol_admin>
259
+ </routers>
260
+ </admin>
261
+ <adminhtml>
262
+ <menu>
263
+ <qixol module="qixol">
264
+ <title>Qixol</title>
265
+ <sort_order>100</sort_order>
266
+ <children>
267
+ <banner module="qixol">
268
+ <title>Manage Banners</title>
269
+ <sort_order>1</sort_order>
270
+ <action>qixol_admin/adminhtml_banner</action>
271
+ </banner>
272
+ <sticker module="qixol">
273
+ <title>Manage Stickers</title>
274
+ <sort_order>1</sort_order>
275
+ <action>qixol_admin/adminhtml_sticker</action>
276
+ </sticker>
277
+ <bannerboxes module="qixol">
278
+ <title>Manage Banner Position</title>
279
+ <sort_order>5</sort_order>
280
+ <action>qixol_admin/adminhtml_bannerboxes</action>
281
+ </bannerboxes>
282
+ <qixolbackend module="qixol">
283
+ <title>Qixol</title>
284
+ <sort_order>3</sort_order>
285
+ <action>qixol_admin/adminhtml_qixolbackend</action>
286
+ </qixolbackend>
287
+ <shippingmap module="qixol">
288
+ <title>Manage Shippings Map</title>
289
+ <sort_order>15</sort_order>
290
+ <action>qixol_admin/adminhtml_shippingmap</action>
291
+ </shippingmap>
292
+ <storesmap module="qixol">
293
+ <title>Manage Stores Map</title>
294
+ <sort_order>15</sort_order>
295
+ <action>qixol_admin/adminhtml_storesmap</action>
296
+ </storesmap>
297
+ <customergrouspmap module="qixol">
298
+ <title>Customer Groups Map</title>
299
+ <sort_order>25</sort_order>
300
+ <action>qixol_admin/adminhtml_customergrouspmap</action>
301
+ </customergrouspmap>
302
+ </children>
303
+ </qixol>
304
+
305
+ <promo>
306
+ <disabled>1</disabled>
307
+ <children>
308
+ <quote>
309
+ <disabled>1</disabled>
310
+ </quote>
311
+ <catalog>
312
+ <disabled>1</disabled>
313
+ </catalog>
314
+ </children>
315
+ </promo>
316
+
317
+ </menu>
318
+ <acl>
319
+ <resources>
320
+ <all>
321
+ <title>Allow Everything</title>
322
+ </all>
323
+ <admin>
324
+ <children>
325
+ <qixol translate="title" module="qixol">
326
+ <title>Qixol</title>
327
+ <sort_order>1000</sort_order>
328
+ <children>
329
+ <qixolbackend translate="title">
330
+ <title>Qixol</title>
331
+ </qixolbackend>
332
+ </children>
333
+ </qixol>
334
+ </children>
335
+ </admin>
336
+ </resources>
337
+ </acl>
338
+ <layout>
339
+ <updates>
340
+ <qixol>
341
+ <file>qixol.xml</file>
342
+ </qixol>
343
+ </updates>
344
+ </layout>
345
+ <translate>
346
+ <modules>
347
+ <Holbi_Qixol>
348
+ <files>
349
+ <default>Holbi_Qixol.csv</default>
350
+ </files>
351
+ </Holbi_Qixol>
352
+ </modules>
353
+ </translate>
354
+ </adminhtml>
355
+
356
+ <frontend>
357
+ <routers>
358
+ <qixol>
359
+ <use>standard</use>
360
+ <args>
361
+ <module>Holbi_Qixol</module>
362
+ <frontName>qixol</frontName>
363
+ </args>
364
+ </qixol>
365
+ </routers>
366
+ <layout>
367
+ <updates>
368
+ <qixol>
369
+ <file>qixol.xml</file>
370
+ </qixol>
371
+ </updates>
372
+ </layout>
373
+ <translate>
374
+ <modules>
375
+ <Holbi_Qixol>
376
+ <files>
377
+ <default>Holbi_Qixol.csv</default>
378
+ </files>
379
+ </Holbi_Qixol>
380
+ </modules>
381
+ </translate>
382
+ </frontend>
383
+
384
+ <crontab>
385
+ <jobs>
386
+ <qixol_runexportsynch>
387
+ <schedule><cron_expr>* */2 * * *</cron_expr></schedule>
388
+ <run><model>qixol/cron::runExportSynch</model></run>
389
+ </qixol_runexportsynch>
390
+ <qixol_runimportpromosynch>
391
+ <schedule><cron_expr>*/15 * * * *</cron_expr></schedule>
392
+ <run><model>qixol/cron::runImportProductPromotionSynch</model></run>
393
+ </qixol_runimportpromosynch>
394
+ </jobs>
395
+ </crontab>
396
+ </config>
app/code/community/Holbi/Qixol/etc/system.xml ADDED
@@ -0,0 +1,407 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <qixol translate="label" module="qixol">
5
+ <label>Qixol Extension</label>
6
+ <sort_order>333</sort_order>
7
+ </qixol>
8
+ </tabs>
9
+ <sections>
10
+ <qixol translate="label">
11
+ <label>Qixol Setting</label>
12
+ <tab>qixol</tab>
13
+ <sort_order>100</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
+ <integraion translate="label">
19
+ <label>General / Intagration</label>
20
+ <sort_order>50</sort_order>
21
+ <show_in_default>1</show_in_default>
22
+ <show_in_website>0</show_in_website>
23
+ <show_in_store>0</show_in_store>
24
+ <comment><![CDATA[The main configuration]]></comment>
25
+ <fields>
26
+ <enabled translate="label">
27
+ <label>Enabled</label>
28
+ <frontend_type>select</frontend_type>
29
+ <config_path>holbi/qixol/enabled</config_path>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>0</show_in_website>
34
+ <show_in_store>0</show_in_store>
35
+ </enabled>
36
+ <companykey translate="label">
37
+ <label>Company Key</label>
38
+ <frontend_type>text</frontend_type>
39
+ <comment><![CDATA[Company key assigned to you when you register in Qixol Promo <a href="http://www.qixolpromo.com">click</a>.]]></comment>
40
+ <sort_order>2</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>0</show_in_website>
43
+ <show_in_store>0</show_in_store>
44
+ </companykey>
45
+ <services translate="label comment">
46
+ <label>Integration Services</label>
47
+ <comment>Integration Services</comment>
48
+ <frontend_type>select</frontend_type>
49
+ <source_model>qixol/system_config_source_iservices_values</source_model>
50
+ <sort_order>30</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>0</show_in_website>
53
+ <show_in_store>0</show_in_store>
54
+ </services>
55
+ </fields>
56
+ </integraion>
57
+ <frontend translate="label">
58
+ <label>Front-End Settings</label>
59
+ <sort_order>60</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>0</show_in_website>
62
+ <show_in_store>0</show_in_store>
63
+ <fields>
64
+ <showpromocat translate="label">
65
+ <label>Show promotion sticker in cataloge</label>
66
+ <comment>Show promotion stickers on products on cataloge</comment>
67
+ <frontend_type>select</frontend_type>
68
+ <source_model>adminhtml/system_config_source_yesno</source_model>
69
+ <sort_order>10</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>1</show_in_store>
73
+ </showpromocat>
74
+ <showpromoprod translate="label">
75
+ <label>Show promotion sticker on product</label>
76
+ <comment>Show promotion stickers on the product page</comment>
77
+ <frontend_type>select</frontend_type>
78
+ <source_model>adminhtml/system_config_source_yesno</source_model>
79
+ <sort_order>10</sort_order>
80
+ <show_in_default>1</show_in_default>
81
+ <show_in_website>1</show_in_website>
82
+ <show_in_store>1</show_in_store>
83
+ </showpromoprod>
84
+ <showpromoboxes translate="label">
85
+ <label>Show promotion boxes</label>
86
+ <comment>Show promotion boxes on product page</comment>
87
+ <frontend_type>select</frontend_type>
88
+ <source_model>adminhtml/system_config_source_yesno</source_model>
89
+ <sort_order>10</sort_order>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>1</show_in_website>
92
+ <show_in_store>1</show_in_store>
93
+ </showpromoboxes>
94
+ <showcartpromobox translate="label">
95
+ <label>Show promotion box in cart</label>
96
+ <comment>Show cart related only promotion box</comment>
97
+ <frontend_type>select</frontend_type>
98
+ <source_model>adminhtml/system_config_source_yesno</source_model>
99
+ <sort_order>15</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>1</show_in_website>
102
+ <show_in_store>1</show_in_store>
103
+ </showcartpromobox>
104
+ <onepagejavascr translate="label">
105
+ <label>Use Javascript onepage update.</label>
106
+ <comment>One one page chackout use javascript cart update.</comment>
107
+ <frontend_type>select</frontend_type>
108
+ <source_model>adminhtml/system_config_source_yesno</source_model>
109
+ <sort_order>10</sort_order>
110
+ <show_in_default>1</show_in_default>
111
+ <show_in_website>1</show_in_website>
112
+ <show_in_store>1</show_in_store>
113
+ </onepagejavascr>
114
+ <cartjavascr translate="label">
115
+ <label>Use Javascript cart update.</label>
116
+ <comment>Cart confirmation use javascript replace.</comment>
117
+ <frontend_type>select</frontend_type>
118
+ <source_model>adminhtml/system_config_source_yesno</source_model>
119
+ <sort_order>20</sort_order>
120
+ <show_in_default>1</show_in_default>
121
+ <show_in_website>1</show_in_website>
122
+ <show_in_store>1</show_in_store>
123
+ </cartjavascr>
124
+ <mcartjavascr translate="label">
125
+ <label>Use Javascript topcart update.</label>
126
+ <comment>Top cart javascript replace.</comment>
127
+ <frontend_type>select</frontend_type>
128
+ <source_model>adminhtml/system_config_source_yesno</source_model>
129
+ <sort_order>20</sort_order>
130
+ <show_in_default>1</show_in_default>
131
+ <show_in_website>1</show_in_website>
132
+ <show_in_store>1</show_in_store>
133
+ </mcartjavascr>
134
+ <showallpromoprod translate="label">
135
+ <label>Show available promotions on product page</label>
136
+ <comment>Show product related promotions on product page</comment>
137
+ <frontend_type>select</frontend_type>
138
+ <source_model>adminhtml/system_config_source_yesno</source_model>
139
+ <sort_order>10</sort_order>
140
+ <show_in_default>1</show_in_default>
141
+ <show_in_website>1</show_in_website>
142
+ <show_in_store>1</show_in_store>
143
+ </showallpromoprod>
144
+ </fields>
145
+ </frontend>
146
+ <advanced translate="label">
147
+ <label>Advanced</label>
148
+ <sort_order>60</sort_order>
149
+ <show_in_default>1</show_in_default>
150
+ <show_in_website>0</show_in_website>
151
+ <show_in_store>0</show_in_store>
152
+ <fields>
153
+ <basketval translate="label">
154
+ <label>Basket Validation</label>
155
+ <comment>When submitting baskets used selected currency</comment>
156
+ <frontend_type>select</frontend_type>
157
+ <source_model>adminhtml/system_config_source_yesno</source_model>
158
+ <sort_order>1</sort_order>
159
+ <show_in_default>1</show_in_default>
160
+ <show_in_website>0</show_in_website>
161
+ <show_in_store>0</show_in_store>
162
+ </basketval>
163
+ <services translate="label comment">
164
+ <label>Shopping Cart Configuration</label>
165
+ <comment>Show promotional details</comment>
166
+ <frontend_type>select</frontend_type>
167
+ <source_model>qixol/system_config_source_cart_settings</source_model>
168
+ <sort_order>30</sort_order>
169
+ <show_in_default>1</show_in_default>
170
+ <show_in_website>0</show_in_website>
171
+ <show_in_store>0</show_in_store>
172
+ </services>
173
+ </fields>
174
+ </advanced>
175
+
176
+ <syhchronized translate="label">
177
+ <label>Synchronized Items</label>
178
+ <sort_order>61</sort_order>
179
+ <show_in_default>1</show_in_default>
180
+ <show_in_website>0</show_in_website>
181
+ <show_in_store>0</show_in_store>
182
+ <comment><![CDATA[Synchronization Config]]></comment>
183
+ <fields>
184
+ <synchproducts translate="label">
185
+ <label>Synchronise Products</label>
186
+ <frontend_type>select</frontend_type>
187
+ <source_model>adminhtml/system_config_source_yesno</source_model>
188
+ <sort_order>1</sort_order>
189
+ <show_in_default>1</show_in_default>
190
+ <show_in_website>0</show_in_website>
191
+ <show_in_store>0</show_in_store>
192
+ </synchproducts>
193
+ <synchcatproducts translate="label">
194
+ <label>Send real Category as categorycode</label>
195
+ <comment>Send product categories in attribute categorycode</comment>
196
+ <frontend_type>select</frontend_type>
197
+ <source_model>adminhtml/system_config_source_yesno</source_model>
198
+ <sort_order>2</sort_order>
199
+ <show_in_default>1</show_in_default>
200
+ <show_in_website>0</show_in_website>
201
+ <show_in_store>0</show_in_store>
202
+ </synchcatproducts>
203
+ <storeuse translate="label">
204
+ <label>Stores</label>
205
+ <comment>For stores</comment>
206
+ <frontend_type>select</frontend_type>
207
+ <source_model>qixol/system_config_source_stores</source_model>
208
+ <sort_order>3</sort_order>
209
+ <show_in_default>1</show_in_default>
210
+ <show_in_website>0</show_in_website>
211
+ <show_in_store>0</show_in_store>
212
+ </storeuse>
213
+ <synchcustomer translate="label">
214
+ <label>Synchronise Customer groups</label>
215
+ <frontend_type>select</frontend_type>
216
+ <source_model>adminhtml/system_config_source_yesno</source_model>
217
+ <sort_order>4</sort_order>
218
+ <show_in_default>1</show_in_default>
219
+ <show_in_website>0</show_in_website>
220
+ <show_in_store>0</show_in_store>
221
+ </synchcustomer>
222
+ <synchship translate="label">
223
+ <label>Synchronise Shipping Methods</label>
224
+ <frontend_type>select</frontend_type>
225
+ <source_model>adminhtml/system_config_source_yesno</source_model>
226
+ <sort_order>5</sort_order>
227
+ <show_in_default>1</show_in_default>
228
+ <show_in_website>0</show_in_website>
229
+ <show_in_store>0</show_in_store>
230
+ </synchship>
231
+ <synchcurrency translate="label">
232
+ <label>Synchronise Curency Sore List</label>
233
+ <frontend_type>select</frontend_type>
234
+ <source_model>adminhtml/system_config_source_yesno</source_model>
235
+ <sort_order>5</sort_order>
236
+ <show_in_default>1</show_in_default>
237
+ <show_in_website>0</show_in_website>
238
+ <show_in_store>0</show_in_store>
239
+ </synchcurrency>
240
+ <synchstores translate="label">
241
+ <label>Synchronise Stores</label>
242
+ <frontend_type>select</frontend_type>
243
+ <source_model>adminhtml/system_config_source_yesno</source_model>
244
+ <sort_order>6</sort_order>
245
+ <show_in_default>1</show_in_default>
246
+ <show_in_website>0</show_in_website>
247
+ <show_in_store>0</show_in_store>
248
+ </synchstores>
249
+ <channel translate="label">
250
+ <label>Channel</label>
251
+ <frontend_type>text</frontend_type>
252
+ <sort_order>7</sort_order>
253
+ <show_in_default>1</show_in_default>
254
+ <show_in_website>0</show_in_website>
255
+ <show_in_store>0</show_in_store>
256
+ </channel>
257
+ <storegroup translate="label">
258
+ <label>Store Group</label>
259
+ <frontend_type>text</frontend_type>
260
+ <comment><![CDATA[The channel and store group are used in the store hierarchy submited to Promo.]]></comment>
261
+ <sort_order>8</sort_order>
262
+ <show_in_default>1</show_in_default>
263
+ <show_in_website>0</show_in_website>
264
+ <show_in_store>0</show_in_store>
265
+ </storegroup>
266
+ <synchonsaving translate="label">
267
+ <label>Synchronise on Saving</label>
268
+ <frontend_type>select</frontend_type>
269
+ <source_model>adminhtml/system_config_source_yesno</source_model>
270
+ <sort_order>9</sort_order>
271
+ <show_in_default>1</show_in_default>
272
+ <show_in_website>0</show_in_website>
273
+ <show_in_store>0</show_in_store>
274
+ </synchonsaving>
275
+ </fields>
276
+ </syhchronized>
277
+
278
+ <customers translate="label">
279
+ <label>Customers</label>
280
+ <sort_order>77</sort_order>
281
+ <show_in_default>1</show_in_default>
282
+ <show_in_website>0</show_in_website>
283
+ <show_in_store>0</show_in_store>
284
+ <comment><![CDATA[Synchronization Config]]></comment>
285
+ <fields>
286
+ <list translate="label">
287
+ <label>Synch only this types:</label>
288
+ <frontend_type>Multiselect</frontend_type>
289
+ <source_model>qixol/system_config_source_customers_list</source_model>
290
+ <sort_order>14</sort_order>
291
+ <show_in_default>1</show_in_default>
292
+ <show_in_website>1</show_in_website>
293
+ <show_in_store>1</show_in_store>
294
+ </list>
295
+ </fields>
296
+ </customers>
297
+
298
+ <shippings translate="label">
299
+ <label>Shippings</label>
300
+ <sort_order>77</sort_order>
301
+ <show_in_default>1</show_in_default>
302
+ <show_in_website>0</show_in_website>
303
+ <show_in_store>0</show_in_store>
304
+ <comment><![CDATA[Synchronization Config]]></comment>
305
+ <fields>
306
+ <onlyactive translate="label">
307
+ <label>Only active</label>
308
+ <frontend_type>select</frontend_type>
309
+ <source_model>adminhtml/system_config_source_yesno</source_model>
310
+ <sort_order>1</sort_order>
311
+ <show_in_default>1</show_in_default>
312
+ <show_in_website>0</show_in_website>
313
+ <show_in_store>0</show_in_store>
314
+ </onlyactive>
315
+ <list translate="label">
316
+ <label>Synch only this types:</label>
317
+ <frontend_type>Multiselect</frontend_type>
318
+ <source_model>qixol/system_config_source_shippings_list</source_model>
319
+ <sort_order>14</sort_order>
320
+ <show_in_default>1</show_in_default>
321
+ <show_in_website>1</show_in_website>
322
+ <show_in_store>1</show_in_store>
323
+ </list>
324
+ </fields>
325
+ </shippings>
326
+
327
+ <productattrib translate="label">
328
+ <label>Products Attributes</label>
329
+ <sort_order>72</sort_order>
330
+ <show_in_default>1</show_in_default>
331
+ <show_in_website>0</show_in_website>
332
+ <show_in_store>0</show_in_store>
333
+ <comment><![CDATA[Synchronization Config]]></comment>
334
+ <fields>
335
+ <attributes translate="label">
336
+ <label>Include when synch product:</label>
337
+ <frontend_type>checkboxes</frontend_type>
338
+ <source_model>qixol/system_config_source_attributes</source_model>
339
+ <frontend_model>qixol/adminhtml_system_config_attributes</frontend_model>
340
+ <sort_order>14</sort_order>
341
+ <show_in_default>1</show_in_default>
342
+ <show_in_website>1</show_in_website>
343
+ <show_in_store>1</show_in_store>
344
+ </attributes>
345
+ </fields>
346
+ </productattrib>
347
+ <issuedpoints translate="label">
348
+ <label>Issued Points</label>
349
+ <sort_order>72</sort_order>
350
+ <show_in_default>1</show_in_default>
351
+ <show_in_website>0</show_in_website>
352
+ <show_in_store>0</show_in_store>
353
+ <comment><![CDATA[Bonus points Config]]></comment>
354
+ <fields>
355
+ <convertrate translate="label">
356
+ <label>Conversion rate</label>
357
+ <frontend_type>text</frontend_type>
358
+ <comment><![CDATA[will be divided on this value (1/x)]]></comment>
359
+ <sort_order>8</sort_order>
360
+ <show_in_default>1</show_in_default>
361
+ <show_in_website>0</show_in_website>
362
+ <show_in_store>0</show_in_store>
363
+ </convertrate>
364
+ </fields>
365
+ </issuedpoints>
366
+ <sinch_explort_products translate="label">
367
+ <label>Run export products</label>
368
+ <frontend_type>text</frontend_type>
369
+ <comment>Export products to qixol.</comment>
370
+ <sort_order>150</sort_order>
371
+ <show_in_default>1</show_in_default>
372
+ <show_in_website>1</show_in_website>
373
+ <show_in_store>1</show_in_store>
374
+ <fields>
375
+ <start_sinch_export translate="label">
376
+ <frontend_type>button</frontend_type>
377
+ <frontend_model>qixol/startexportbutton</frontend_model>
378
+ <sort_order>4</sort_order>
379
+ <show_in_default>1</show_in_default>
380
+ <show_in_website>0</show_in_website>
381
+ <show_in_store>0</show_in_store>
382
+ </start_sinch_export>
383
+ </fields>
384
+ </sinch_explort_products>
385
+ <sinch_import_promotion translate="label">
386
+ <label>Run import promotions</label>
387
+ <frontend_type>text</frontend_type>
388
+ <comment>Import promotions from qixol.</comment>
389
+ <sort_order>180</sort_order>
390
+ <show_in_default>1</show_in_default>
391
+ <show_in_website>1</show_in_website>
392
+ <show_in_store>1</show_in_store>
393
+ <fields>
394
+ <start_sinch_import translate="label">
395
+ <frontend_type>button</frontend_type>
396
+ <frontend_model>qixol/startimportbutton</frontend_model>
397
+ <sort_order>4</sort_order>
398
+ <show_in_default>1</show_in_default>
399
+ <show_in_website>0</show_in_website>
400
+ <show_in_store>0</show_in_store>
401
+ </start_sinch_import>
402
+ </fields>
403
+ </sinch_import_promotion>
404
+ </groups>
405
+ </qixol>
406
+ </sections>
407
+ </config>
app/code/community/Holbi/Qixol/sql/qixol_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+
6
+ $sql=<<<SQLTEXT
7
+ create table {$installer->getTable('qixol_product_to_delete')}(
8
+ entity_id int unsigned not null default 0,
9
+ product_sku varchar(128),
10
+ child_sku varchar(128),
11
+ deleted_time datetime,
12
+ primary key (entity_id)
13
+ );
14
+
15
+ SQLTEXT;
16
+
17
+ $installer->run($sql);
18
+
19
+
20
+ $sql=<<<SQLTEXT
21
+ create table {$installer->getTable('qixol_product_export_stat')}(
22
+ export_id int(11) NOT NULL auto_increment,
23
+ start_export timestamp NOT NULL default '0000-00-00 00:00:00',
24
+ finish_export timestamp NOT NULL default '0000-00-00 00:00:00',
25
+ number_of_products int(11) default '0',
26
+ status_export varchar(255) default '',
27
+ export_by ENUM ('MANUAL', 'CRON') DEFAULt NULL ,
28
+ status_export_message text,
29
+ primary key (export_id)
30
+ );
31
+ SQLTEXT;
32
+
33
+ $installer->run($sql);
34
+
35
+ $sql=<<<SQLTEXT
36
+ create table {$installer->getTable('qixol_process_export_status_table')}(
37
+ id int(11) NOT NULL auto_increment,
38
+ last_message varchar(255),
39
+ export_what varchar(32),
40
+ exports_start datetime,
41
+ exports_last_updated datetime,
42
+ is_finished int(1) default 0,
43
+ extended_message text,
44
+ PRIMARY KEY (id)
45
+ );
46
+ SQLTEXT;
47
+
48
+ $installer->run($sql);
49
+
50
+ $sql=<<<SQLTEXT
51
+ CREATE TABLE {$installer->getTable('qixol_banners')}(
52
+ `banner_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
53
+ `title` varchar(255) NOT NULL DEFAULT '',
54
+ `banner_link_name` varchar(255) NOT NULL DEFAULT '',
55
+ `status` smallint(6) NOT NULL DEFAULT '0',
56
+ `is_default` tinyint(6) NOT NULL DEFAULT '0',
57
+ `sort_order` int(11) NOT NULL DEFAULT '0',
58
+ `banner_group` varchar(32) NOT NULL DEFAULT '',
59
+ `banner_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0=>Image, 1=>HTML',
60
+ `url` varchar(255) NOT NULL DEFAULT '',
61
+ `created_time` datetime DEFAULT NULL,
62
+ `update_time` datetime DEFAULT NULL,
63
+ PRIMARY KEY (`banner_id`)
64
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8
65
+ SQLTEXT;
66
+
67
+ $installer->run($sql);
68
+
69
+ $sql=<<<SQLTEXT
70
+ CREATE TABLE {$installer->getTable('qixol_banner_images')}(
71
+ `banner_image_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
72
+ `filename` varchar(255) NOT NULL DEFAULT '',
73
+ PRIMARY KEY (`banner_image_id`)
74
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8
75
+ SQLTEXT;
76
+
77
+ $installer->run($sql);
78
+
79
+ $sql=<<<SQLTEXT
80
+ CREATE TABLE {$installer->getTable('qixol_banner_has_images')}(
81
+ `banner_image_id` int(11) unsigned NOT NULL default 0,
82
+ `banner_id` int(11) unsigned NOT NULL default 0,
83
+ PRIMARY KEY (`banner_image_id`,`banner_id`),
84
+ CONSTRAINT `FK_qixol_banner_has_images_banner_image_id` FOREIGN KEY (`banner_image_id`) REFERENCES `qixol_banner_images` (`banner_image_id`) ON DELETE CASCADE ON UPDATE CASCADE,
85
+ CONSTRAINT `FK_qixol_banner_has_images_banner_id` FOREIGN KEY (`banner_id`) REFERENCES `qixol_banners` (`banner_id`) ON DELETE CASCADE ON UPDATE CASCADE
86
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8
87
+ SQLTEXT;
88
+
89
+ $installer->run($sql);
90
+
91
+
92
+ $sql=<<<SQLTEXT
93
+ CREATE TABLE {$installer->getTable('qixol_promotions_type')}(
94
+ `promotion_id` int(11) unsigned NOT NULL default 0,
95
+ `promotion_type` varchar(255) NOT NULL DEFAULT '',
96
+ `promotion_name` varchar(255) NOT NULL DEFAULT '',
97
+ `promotion_text` text,
98
+ `yourref` varchar(255) NOT NULL DEFAULT '',
99
+ `bundleprice` decimal(12,2) NOT NULL DEFAULT '0.00',
100
+ `discountpercent` decimal(8,2) NOT NULL DEFAULT '0.00',
101
+ `discountamount` decimal(10,2) NOT NULL DEFAULT '0.00',
102
+ `hascouponrestrictions` tinyint not null default 0,
103
+ `is_everyday` tinyint not null default 0,
104
+ `till_date` datetime not null default '0000-00-00 00:00:00',
105
+ `from_date` datetime not null default '0000-00-00 00:00:00',
106
+ `created_time` datetime DEFAULT NULL,
107
+ `update_time` datetime DEFAULT NULL,
108
+ `is_for_product` tinyint not null default 0,
109
+ PRIMARY KEY (`promotion_id`)
110
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8
111
+ SQLTEXT;
112
+
113
+
114
+ $installer->run($sql);
115
+
116
+ $sql=<<<SQLTEXT
117
+ CREATE TABLE {$installer->getTable('qixol_promotion_has_product')}(
118
+ `product_id` int(11) unsigned NOT NULL default 0,
119
+ `parent_product_id` int(11) unsigned NOT NULL default 0,
120
+ `promotion_id` int(11) unsigned NOT NULL default 0,
121
+ `parentsku` varchar(255) NOT NULL DEFAULT '',
122
+ `sku` varchar(255) NOT NULL DEFAULT '',
123
+ `requiredqty` tinyint not null default 0,
124
+ `multipleproductrestrictions` tinyint not null default 0,
125
+ `created_time` datetime DEFAULT NULL,
126
+ `update_time` datetime DEFAULT NULL,
127
+ PRIMARY KEY (`product_id`,`parent_product_id`,`promotion_id`),
128
+ INDEX `idx_qixol_promotion_sku`(`sku`)
129
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8
130
+ SQLTEXT;
131
+
132
+
133
+ $installer->run($sql);
134
+
135
+ $sql=<<<SQLTEXT
136
+ CREATE TABLE {$installer->getTable('qixol_banner_box')}(
137
+ banner_box_type varchar(64) not null default '',
138
+ banner_box_is_active tinyint not null default 0,
139
+ banner_box_translation_type varchar(32) not null default '',
140
+ `created_time` datetime DEFAULT NULL,
141
+ `update_time` datetime DEFAULT NULL,
142
+ PRIMARY KEY (`banner_box_type`)
143
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8
144
+ SQLTEXT;
145
+
146
+
147
+ $installer->run($sql);
148
+
149
+ $sql=<<<SQLTEXT
150
+ CREATE TABLE {$installer->getTable('qixol_shipping_name_map')}(
151
+ shipping_name varchar(255) not null default '',
152
+ shipping_name_map varchar(255) not null default '',
153
+ `created_time` datetime DEFAULT NULL,
154
+ `update_time` datetime DEFAULT NULL,
155
+ PRIMARY KEY (`shipping_name`),
156
+ UNIQUE KEY `shipping_name_to_shipping_name_map` (`shipping_name`,`shipping_name_map`)
157
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
158
+ SQLTEXT;
159
+
160
+
161
+ $installer->run($sql);
162
+
163
+ $sql=<<<SQLTEXT
164
+ CREATE TABLE {$installer->getTable('qixol_coupon_issued')}(
165
+ entity_id int unsigned not null auto_increment,
166
+ customer_id int unsigned not null default 0,
167
+ coupon_code_value varchar(255) not null default '',
168
+ coupon_valid_till datetime,
169
+ is_used tinyint unsigned not null default 0,
170
+ coupon_description varchar(255) not null default '',
171
+ `created_time` datetime DEFAULT NULL,
172
+ PRIMARY KEY (`entity_id`),
173
+ KEY `IDX_qixol_coupon_issued_customer_id` (`entity_id`),
174
+ CONSTRAINT `FK_qixol_coupon_issued_customer_id_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
175
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
176
+ SQLTEXT;
177
+
178
+ /*$sql=<<<SQLTEXT
179
+ CREATE TABLE {$installer->getTable('qixol_flat_order_promotions')}(
180
+ `order_id` int(10) unsigned DEFAULT NULL COMMENT 'Order ID',
181
+ promotion_data_applied text,
182
+ UNIQUE (`order_id`),
183
+ CONSTRAINT `FK_qixol_flat_order_promotions_sales_flat_order_ENTITY_ID` FOREIGN KEY (`order_id`) REFERENCES `sales_flat_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
184
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
185
+ SQLTEXT;*/
186
+
187
+ $sql=<<<SQLTEXT
188
+ alter table {$installer->getTable('sales_flat_order')} add column promotion_data_applied text;
189
+ SQLTEXT;
190
+
191
+ $installer->run($sql);
192
+
193
+
194
+
195
+ $sql=<<<SQLTEXT
196
+ CREATE TABLE {$installer->getTable('qixol_customers_groups_name_map')}(
197
+ customer_group_name varchar(255) not null default '',
198
+ customer_group_name_map varchar(255) not null default '',
199
+ `created_time` datetime DEFAULT NULL,
200
+ `update_time` datetime DEFAULT NULL,
201
+ PRIMARY KEY (`customer_group_name`),
202
+ UNIQUE KEY `customer_group_name_to_customer_group_name_map` (`customer_group_name`,`customer_group_name_map`)
203
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
204
+ SQLTEXT;
205
+
206
+
207
+ $installer->run($sql);
208
+
209
+
210
+ $sql=<<<SQLTEXT
211
+ CREATE TABLE {$installer->getTable('qixol_stores_name_map')}(
212
+ store_name varchar(255) not null default '',
213
+ store_name_map varchar(255) not null default '',
214
+ `created_time` datetime DEFAULT NULL,
215
+ `update_time` datetime DEFAULT NULL,
216
+ PRIMARY KEY (`store_name`),
217
+ UNIQUE KEY `store_name_to_store_name_map` (`store_name`,`store_name_map`)
218
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
219
+ SQLTEXT;
220
+
221
+
222
+ $installer->run($sql);
223
+
224
+
225
+ $sql=<<<SQLTEXT
226
+ CREATE TABLE {$installer->getTable('qixol_stickers')}(
227
+ `sticker_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
228
+ `use_default_sticker` varchar(32) not null default '',
229
+ `filename` varchar(255) NOT NULL DEFAULT '',
230
+ `use_default_banner_group` tinyint(6) NOT NULL DEFAULT '0',
231
+ `default_banner_group` varchar(32) not null default '',
232
+ `unique_banner_group` varchar(32) not null default '',
233
+ `banner_link_name` varchar(255) NOT NULL DEFAULT '' COMMENT 'promotion reference',
234
+ `status` smallint(6) NOT NULL DEFAULT '0',
235
+ `sort_order` int(11) NOT NULL DEFAULT '0',
236
+ `created_time` datetime DEFAULT NULL,
237
+ `update_time` datetime DEFAULT NULL,
238
+ PRIMARY KEY (`sticker_id`)
239
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
240
+ SQLTEXT;
241
+
242
+ $installer->run($sql);
243
+
244
+
245
+ $sql=<<<SQLTEXT
246
+ CREATE TABLE {$installer->getTable('qixol_cutomer_points')}(
247
+ points_account_id int(11) unsigned NOT NULL AUTO_INCREMENT,
248
+ customer_id int unsigned not null default 0,
249
+ store_id smallint(5) unsigned NOT NULL DEFAULT '0',
250
+ current_points int(5) unsigned NOT NULL DEFAULT '0',
251
+ earned_points int unsigned not null default 0,
252
+ spent_points int unsigned not null default 0,
253
+ PRIMARY KEY (`points_account_id`),
254
+ KEY `FK_catalog_category_ENTITY_STORE` (`store_id`),
255
+ CONSTRAINT `FK_qixol_cutomer_points_customer_id_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
256
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
257
+ SQLTEXT;
258
+
259
+ $installer->run($sql);
260
+
261
+
262
+ $sql=<<<SQLTEXT
263
+ ALTER TABLE {$installer->getTable('sales/quote_address')} ADD `points_amount` DECIMAL( 10, 2 ) NOT NULL;
264
+ ALTER TABLE {$installer->getTable('sales/quote_address')} ADD `base_points_amount` DECIMAL( 10, 2 ) NOT NULL;
265
+
266
+ ALTER TABLE {$installer->getTable('sales/order')} ADD `points_amount` DECIMAL( 10, 2 ) NOT NULL;
267
+ ALTER TABLE {$installer->getTable('sales/order')} ADD `base_points_amount` DECIMAL( 10, 2 ) NOT NULL;
268
+
269
+ ALTER TABLE {$installer->getTable('sales/invoice')} ADD `points_amount` DECIMAL( 10, 2 ) NOT NULL;
270
+ ALTER TABLE {$installer->getTable('sales/invoice')} ADD `base_points_amount` DECIMAL( 10, 2 ) NOT NULL;
271
+ SQLTEXT;
272
+ $installer->run($sql);
273
+
274
+ //demo
275
+ //Mage::getModel('core/url_rewrite')->setId(null);
276
+ //demo
277
+ $installer->endSetup();
278
+
app/design/adminhtml/default/default/layout/qixol.xml ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <qixol_admin_adminhtml_qixolbackend_index>
4
+ <reference name="content">
5
+ <block type="qixol/adminhtml_qixolbackend" name="qixolbackend" template="qixol/qixolbackend.phtml"/>
6
+ </reference>
7
+ </qixol_admin_adminhtml_qixolbackend_index>
8
+ <qixol_admin_adminhtml_banner_edit>
9
+ <update handle="editor"/>
10
+ </qixol_admin_adminhtml_banner_edit>
11
+ <qixol_admin_adminhtml_banner_index>
12
+ <reference name="content">
13
+ <block type="qixol/adminhtml_banner" name="banner" />
14
+ </reference>
15
+ </qixol_admin_adminhtml_banner_index>
16
+
17
+ <qixol_admin_adminhtml_sticker_edit>
18
+ <!--reference name="head">
19
+ <action method="addJs"><script>lib/jquery/jquery-1.10.2.min.js</script></action>
20
+ </reference-->
21
+ <update handle="editor"/>
22
+ </qixol_admin_adminhtml_sticker_edit>
23
+ <qixol_admin_adminhtml_sticker_index>
24
+ <reference name="content">
25
+ <block type="qixol/adminhtml_sticker" name="sticker" />
26
+ </reference>
27
+ </qixol_admin_adminhtml_sticker_index>
28
+
29
+ <qixol_admin_adminhtml_bannerboxes_edit>
30
+ <update handle="editor"/>
31
+ </qixol_admin_adminhtml_bannerboxes_edit>
32
+ <qixol_admin_adminhtml_bannerboxes_index>
33
+ <reference name="content">
34
+ <block type="qixol/adminhtml_bannerboxes" name="bannerboxes" />
35
+ </reference>
36
+ </qixol_admin_adminhtml_bannerboxes_index>
37
+
38
+ <qixol_admin_adminhtml_shippingmap_edit>
39
+ <update handle="editor"/>
40
+ </qixol_admin_adminhtml_shippingmap_edit>
41
+
42
+ <qixol_admin_adminhtml_shippingmap_index>
43
+ <reference name="content">
44
+ <block type="qixol/adminhtml_shippingmap" name="shippingmap" />
45
+ </reference>
46
+ </qixol_admin_adminhtml_shippingmap_index>
47
+
48
+
49
+ <qixol_admin_adminhtml_customergrouspmap_edit>
50
+ <update handle="editor"/>
51
+ </qixol_admin_adminhtml_customergrouspmap_edit>
52
+
53
+ <qixol_admin_adminhtml_customergrouspmap_index>
54
+ <reference name="content">
55
+ <block type="qixol/adminhtml_customergrouspmap" name="customergrouspmap" />
56
+ </reference>
57
+ </qixol_admin_adminhtml_customergrouspmap_index>
58
+
59
+ <qixol_admin_adminhtml_storesmap_edit>
60
+ <update handle="editor"/>
61
+ </qixol_admin_adminhtml_storesmap_edit>
62
+
63
+ <qixol_admin_adminhtml_storesmap_index>
64
+ <reference name="content">
65
+ <block type="qixol/adminhtml_storesmap" name="storesmap" />
66
+ </reference>
67
+ </qixol_admin_adminhtml_storesmap_index>
68
+
69
+ <adminhtml_sales_order_view>
70
+ <reference name="left">
71
+ <block type="adminhtml/sales_order_view_items" name="qixolorderitemswrap" as="qixolorderitemswrap" template="qixol/order/advert.phtml"/>
72
+ </reference>
73
+ <reference name="order_totals">
74
+ <block type="qixol/adminhtml_sales_order_total" name="qixol.sales.order.total" />
75
+ </reference>
76
+ </adminhtml_sales_order_view>
77
+
78
+ <!--adminhtml_sales_order_invoice_new>
79
+ <reference name="invoice_totals">
80
+ <block type="qixol/adminhtml_sales_order_total" name="qixol.sales.order.total" />
81
+ </reference>
82
+ </adminhtml_sales_order_invoice_new>
83
+
84
+ <adminhtml_sales_order_invoice_updateqty>
85
+ <reference name="invoice_totals">
86
+ <block type="qixol/adminhtml_sales_order_total" name="qixol.sales.order.total" />
87
+ </reference>
88
+ </adminhtml_sales_order_invoice_updateqty-->
89
+
90
+ <adminhtml_sales_order_invoice_view>
91
+ <reference name="invoice_totals">
92
+ <block type="qixol/adminhtml_sales_order_total" name="qixol.sales.order.total" />
93
+ </reference>
94
+ </adminhtml_sales_order_invoice_view>
95
+
96
+ <adminhtml_sales_order_creditmemo_view>
97
+ <reference name="creditmemo_totals">
98
+ <block type="qixol/adminhtml_sales_order_total" name="qixol.sales.order.total" />
99
+ </reference>
100
+ </adminhtml_sales_order_creditmemo_view>
101
+
102
+ </layout>
app/design/adminhtml/default/default/template/qixol/bannerboxes.phtml ADDED
@@ -0,0 +1 @@
 
1
+ <?php echo $this->getTabsHtml() ?>
app/design/adminhtml/default/default/template/qixol/banners.phtml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php echo $this->getTabsHtml() ?>
2
+ <script type="text/javascript">
3
+ //<![CDATA[
4
+ function load_banner_funcs(){
5
+ <?php if (($block = $this->getLayout()->getBlock('bannergroup.grid.banner')) && ($_gridJsObject = $block->getJsObjectName())): ?>
6
+ if(!$('in_bannergroup_banners')){
7
+ setTimeout('load_banner_funcs()',500);
8
+ return false;
9
+ }
10
+ var selectedBanners=$H(<?php echo $this->getBannersJson(); ?>);
11
+ $('in_bannergroup_banners').value = selectedBanners.toQueryString();
12
+
13
+ function registerSelectedBanner(grid, element, checked){
14
+ if(checked){
15
+ selectedBanners.set(element.value, element.value);
16
+ }
17
+ else{
18
+ selectedBanners.unset(element.value);
19
+ }
20
+ $('in_bannergroup_banners').value = selectedBanners.toQueryString();
21
+ grid.reloadParams = {'selected_banners[]':selectedBanners.keys()};
22
+ }
23
+ function selectedBannerRowClick(grid, event){
24
+ var trElement = Event.findElement(event, 'tr');
25
+ var isInput = Event.element(event).tagName == 'INPUT';
26
+ if(trElement){
27
+ var checkbox = Element.getElementsBySelector(trElement, 'input');
28
+ if(checkbox[0]){
29
+ var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
30
+ <?php echo $_gridJsObject ?>.setCheckboxChecked(checkbox[0], checked);
31
+ }
32
+ }
33
+ }
34
+
35
+ var tabIndex = 1000;
36
+ function selectedBannerRowInit(grid, row){
37
+ var checkbox = $(row).getElementsByClassName('checkbox')[0];
38
+ }
39
+
40
+
41
+ <?php echo $_gridJsObject ?>.rowClickCallback = selectedBannerRowClick;
42
+ <?php echo $_gridJsObject ?>.initRowCallback = selectedBannerRowInit;
43
+ <?php echo $_gridJsObject ?>.checkboxCheckCallback = registerSelectedBanner;
44
+ <?php echo $_gridJsObject ?>.rows.each(function(row){selectedBannerRowInit(<?php echo $_gridJsObject ?>, row)});
45
+
46
+ <?php endif; ?>
47
+ }
48
+ load_banner_funcs();
49
+ //]]>
50
+ </script>
app/design/adminhtml/default/default/template/qixol/customergrouspmap.phtml ADDED
@@ -0,0 +1 @@
 
1
+ <?php echo $this->getTabsHtml() ?>
app/design/adminhtml/default/default/template/qixol/order/advert.phtml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $order = $this->getOrder();
3
+ $promotions_raw=$order->getPromotionDataApplied();
4
+ $inline_item_advert='';
5
+ if(strlen($promotions_raw)>3){
6
+ $promotions_data_array=unserialize($promotions_raw);
7
+ if (is_array($promotions_data_array['items'])&&count($promotions_data_array['items'])>0){
8
+
9
+ foreach ($order->getAllItems() as $item) {
10
+ if (isset($promotions_data_array['items'][$item->getQuoteItemId()]['promotions'])){
11
+ foreach ($promotions_data_array['items'][$item->getQuoteItemId()]['promotions'] as $promotion_data){
12
+ if ($promotion_data['description']!=''){
13
+ $inline_item_advert.="$('<div class=\"order_inline_item_advert\" style=\"font-weight:bold;color:#6666FF\">".$promotion_data['description']."</div>').appendTo($('#order_item_".$item->getId()."'));";
14
+ }
15
+ }
16
+ }
17
+ ;
18
+ }
19
+
20
+ if (isset($promotions_data_array['promotion_summary'])){
21
+ foreach ($promotions_data_array['promotion_summary'] as $inline_cart_promotion)
22
+ if($inline_cart_promotion['data']['basketlevel']>0){
23
+ switch ($inline_cart_promotion['data']['type']){
24
+ case 'ISSUEPOINTS';
25
+ $inline_item_advert.="$('<div class=\"order_total_advert\" style=\"font-weight:bold;color:#6666FF\">".$inline_cart_promotion['data']['issuedpoints']."&nbsp;pt."."</div>').appendTo($('#order-totals'));";
26
+ break;
27
+ }
28
+ }
29
+ }
30
+
31
+
32
+ ?><script type="text/javascript" src="http://qixol.holbidev.co.uk/js/lib/jquery/jquery-1.10.2.min.js"></script><script type="text/javascript">$.noConflict();jQuery( document ).ready(function( $ ) { <?php
33
+ echo $inline_item_advert;
34
+ ?>});</script><?php
35
+
36
+ }
37
+ }
38
+ ?>
app/design/adminhtml/default/default/template/qixol/qixolbackend.phtml ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $run_pic=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/_run.gif";
4
+ $post_url=$this->getUrl('qixol_admin/ajax');
5
+ $post_url_upd=$this->getUrl('qixol_admin/ajax/UpdateStatus');
6
+
7
+ ?><div id="qixolexport_status_template" name="qixolexpor_status_template" style="display:none">
8
+ <ul>
9
+ <li>
10
+ Start export
11
+ &nbsp
12
+ <span id='qixolexport_process'>
13
+ <img src='<?php echo $run_pic?>'
14
+ alt='product export run' />
15
+ </span>
16
+ </li>
17
+ <!--li>
18
+ Export finished
19
+ &nbsp
20
+ <span id='qixolexport_export_done'>
21
+ <img src='<?php echo $run_pic?>'
22
+ alt='Export finished' />
23
+ </span>
24
+ </li-->
25
+ </ul>
26
+ </div>
27
+ <?php
28
+ $start_import_button = $this->getLayout()->createBlock('adminhtml/widget_button')
29
+ ->setType('button')
30
+ ->setClass('scalable')
31
+ ->setLabel('Export now')
32
+ ->setOnClick("start_product_export()")
33
+ ->toHtml();
34
+ $safe_mode_set = ini_get('safe_mode');
35
+ if($safe_mode_set){
36
+ $html .="<p class='sinch-error'><b>You can't start export (safe_mode is 'On'. set safe_mode = Off in php.ini )<b></p>";
37
+ } else {
38
+ $html .= $start_import_button;
39
+ }
40
+
41
+ $export=Mage::getModel('qixol/sinch');
42
+ $last_export=$export->getDataOfLatestExportProduct();
43
+ $last_exp_status=$last_import['status_export'];
44
+ if($last_exp_status=='error'){
45
+ $html.='<div id="export_current_status_message" name="export_current_status_message" style="display:true"><br><br><hr/><p class="sinch-error">The export has failed.<br> Error reporting : "'.$last_import['status_export_message'].'"</p></div>';
46
+ }elseif($last_imp_status=='success'){
47
+ $html.='<div id="export_current_status_message" name="export_current_status_message" style="display:true"><br><br><hr/><p class="sinch-success">'.$last_import['number_of_products'].' products imported succesfully!</p></div>';
48
+ }elseif($last_imp_status=='process'){
49
+ $html.='<div id="export_current_status_message" name="export_current_status_message" style="display:true"><br><br><hr/><p>Export is running now</p></div>';
50
+ }else{
51
+ $html.='<div id="export_current_status_message" name="export_current_status_message" style="display:true"></div>';
52
+ }
53
+
54
+ echo $html;
55
+
56
+ ?>
57
+ <script>
58
+ function start_product_export(){
59
+ set_run_icon();
60
+ status_data=document.getElementById('qixolexport_status_template');
61
+ curr_status_data=document.getElementById('export_current_status_message');
62
+ curr_status_data.style.display='none';
63
+ status_data.style.display='';
64
+ // status_data.innerHTML='';
65
+ sinch = new Sinch('<?php echo $post_url?>','<?php echo $post_url_upd?>');
66
+ sinch.startProductExport();
67
+
68
+ //
69
+ }
70
+ function set_run_icon(){
71
+ run_pic='<img src=\"<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/_run.gif"; ?>"/>';
72
+ document.getElementById('qixolexport_process').innerHTML=run_pic;
73
+ //document.getElementById('qixolexport_export_done').innerHTML=run_pic;
74
+
75
+
76
+
77
+ }
78
+
79
+ var Sinch = Class.create();
80
+ Sinch.prototype = {
81
+
82
+ initialize: function(postUrl, postUrlUpd) {
83
+ this.postUrl = postUrl;
84
+ this.postUrlUpd = postUrlUpd;
85
+ this.failureUrl = document.URL;
86
+ // unique user session ID
87
+ this.SID = null;
88
+ // object with event message data
89
+ this.objectMsg = null;
90
+ this.prevMsg = '';
91
+ // interval object
92
+ this.updateTimer = null;
93
+ // default shipping code. Display on errors
94
+
95
+ elem = 'checkoutSteps';
96
+ clickableEntity = '.head';
97
+
98
+ // overwrite Accordion class method
99
+ var headers = $$('#' + elem + ' .section ' + clickableEntity);
100
+ headers.each(function(header) {
101
+ Event.observe(header,'click',this.sectionClicked.bindAsEventListener(this));
102
+ }.bind(this));
103
+ },
104
+ startProductExport: function () {
105
+ _this = this;
106
+ new Ajax.Request(this.postUrl,
107
+ {
108
+ method:'post',
109
+ parameters: '',
110
+ requestTimeout: 10,
111
+ /*
112
+ onLoading:function(){
113
+ alert('onLoading');
114
+ },
115
+ onLoaded:function(){
116
+ alert('onLoaded');
117
+ },
118
+ */
119
+ onSuccess: function(transport) {
120
+ var response = transport.responseText || null;
121
+ _this.SID = response;
122
+ if (_this.SID) {
123
+ _this.updateTimer = setInterval(function(){_this.updateEvent();},7000);
124
+ $('session_id').value = _this.SID;
125
+ } else {
126
+ alert('Can not get your session ID. Please reload the page!');
127
+ }
128
+ },
129
+ onTimeout: function() { alert('Can not get your session ID. Timeout!'); },
130
+ onFailure: function() { alert('Something went wrong...') }
131
+ });
132
+
133
+ },
134
+
135
+ updateEvent: function () {
136
+ _this = this;
137
+ new Ajax.Request(this.postUrlUpd,
138
+ {
139
+ method: 'post',
140
+ parameters: {session_id: this.SID},
141
+ onSuccess: function(transport) {
142
+ _this.objectMsg = transport.responseText.evalJSON();
143
+ _this.prevMsg = _this.objectMsg.message;
144
+ if(_this.prevMsg!=''){
145
+ _this.updateStatusHtml();
146
+ }
147
+
148
+ if (_this.objectMsg.error == 1) {
149
+ // Do something on error
150
+ _this.clearUpdateInterval();
151
+ }
152
+
153
+ if (_this.objectMsg.finished == 1) {
154
+ _this.objectMsg.message='Import finished';
155
+ _this.updateStatusHtml();
156
+ _this.clearUpdateInterval();
157
+
158
+ }
159
+
160
+ },
161
+ onFailure: this.ajaxFailure.bind(),
162
+ });
163
+ },
164
+
165
+ updateStatusHtml: function(){
166
+ message=this.objectMsg.message.toLowerCase();
167
+ extendedmessage=this.objectMsg.extmessage.toLowerCase();
168
+ mess_id='qixolexport_'+message.replace(/\s+/g, '_');
169
+ if(!document.getElementById(mess_id)){
170
+ // alert(mess_id+' - not exist');
171
+ }
172
+ else{
173
+ //alert (mess_id+' - exist');
174
+ $(mess_id).innerHTML='<img src=\"".Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/_yes.gif"."\"/>'
175
+ if (mess_id=='qixolexport_export_done'){//if processed quicker
176
+ $('qixolexport_process').innerHTML='<img src=\"".Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/_yes.gif"."\"/>'
177
+ }
178
+ }
179
+ if (extendedmessage!='')
180
+ $('qixolexport_status_template').innerHTML=extendedmessage;
181
+ //$('qixolexport_status_template').innerHTML=htm+'<br>'+this.objectMsg.message;
182
+ },
183
+
184
+ ajaxFailure: function(){
185
+ this.clearUpdateInterval();
186
+ location.href = this.failureUrl;
187
+ },
188
+
189
+ clearUpdateInterval: function () {
190
+ clearInterval(this.updateTimer);
191
+ },
192
+
193
+
194
+ }
195
+ </script>
196
+
app/design/adminhtml/default/default/template/qixol/shippingmap.phtml ADDED
@@ -0,0 +1 @@
 
1
+ <?php echo $this->getTabsHtml() ?>
app/design/adminhtml/default/default/template/qixol/stickers.phtml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php echo $this->getTabsHtml() ?>
2
+ <script type="text/javascript">
3
+ //<![CDATA[
4
+ function load_banner_funcs(){
5
+ <?php if (($block = $this->getLayout()->getBlock('bannergroup.grid.banner')) && ($_gridJsObject = $block->getJsObjectName())): ?>
6
+ if(!$('in_bannergroup_banners')){
7
+ setTimeout('load_banner_funcs()',500);
8
+ return false;
9
+ }
10
+ var selectedBanners=$H(<?php echo $this->getBannersJson(); ?>);
11
+ $('in_bannergroup_banners').value = selectedBanners.toQueryString();
12
+
13
+ function registerSelectedBanner(grid, element, checked){
14
+ if(checked){
15
+ selectedBanners.set(element.value, element.value);
16
+ }
17
+ else{
18
+ selectedBanners.unset(element.value);
19
+ }
20
+ $('in_bannergroup_banners').value = selectedBanners.toQueryString();
21
+ grid.reloadParams = {'selected_banners[]':selectedBanners.keys()};
22
+ }
23
+ function selectedBannerRowClick(grid, event){
24
+ var trElement = Event.findElement(event, 'tr');
25
+ var isInput = Event.element(event).tagName == 'INPUT';
26
+ if(trElement){
27
+ var checkbox = Element.getElementsBySelector(trElement, 'input');
28
+ if(checkbox[0]){
29
+ var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
30
+ <?php echo $_gridJsObject ?>.setCheckboxChecked(checkbox[0], checked);
31
+ }
32
+ }
33
+ }
34
+
35
+ var tabIndex = 1000;
36
+ function selectedBannerRowInit(grid, row){
37
+ var checkbox = $(row).getElementsByClassName('checkbox')[0];
38
+ }
39
+
40
+
41
+ <?php echo $_gridJsObject ?>.rowClickCallback = selectedBannerRowClick;
42
+ <?php echo $_gridJsObject ?>.initRowCallback = selectedBannerRowInit;
43
+ <?php echo $_gridJsObject ?>.checkboxCheckCallback = registerSelectedBanner;
44
+ <?php echo $_gridJsObject ?>.rows.each(function(row){selectedBannerRowInit(<?php echo $_gridJsObject ?>, row)});
45
+
46
+ <?php endif; ?>
47
+ }
48
+ load_banner_funcs();
49
+ //]]>
50
+ </script>
app/design/adminhtml/default/default/template/qixol/storesmap.phtml ADDED
@@ -0,0 +1 @@
 
1
+ <?php echo $this->getTabsHtml() ?>
app/design/adminhtml/default/default/template/qixol/system/config/attributes.phtml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <input type="hidden" name="<?php echo $this->getNamePrefix() ?>" value="" /><!-- this is send if nothing is checked -->
2
+ <ul class="checkboxes">
3
+ <?php foreach ($this->getValues() as $name => $label): ?>
4
+ <li>
5
+ <input type="checkbox" value="<?php echo $name?>" name="<?php echo $this->getNamePrefix() ?>[]" id="<?php echo $this->getHtmlId() . '_' . $name ?>"<?php echo ($this->getIsChecked($name) ? ' checked="checked"' : '') ?>/><label for="<?php echo $this->getHtmlId() . '_' . $name ?>">
6
+ <?php echo $label ?>
7
+ </label>
8
+ </li>
9
+ <?php endforeach;?>
10
+ </ul>
app/design/frontend/base/default/layout/qixol.xml ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addItem"><type>skin_css</type><name>css/qixol.css</name></action>
6
+ </reference>
7
+ <reference name="minicart_content">
8
+ <action method="setTemplate"><template>qixol/minicart/mincart.phtml</template></action>
9
+ <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>qixol/minicart/default.phtml</template></action>
10
+ <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>qixol/minicart/default.phtml</template></action>
11
+ <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>qixol/minicart/default.phtml</template></action>
12
+ <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>qixol/minicart/default.phtml</template></action>
13
+ <block type="checkout/onepage_link" name="qixolmincartwrap" as="qixolmincartwrap" template="qixol/minicart/advert.phtml"/>
14
+ </reference>
15
+ </default>
16
+
17
+ <catalog_product_view>
18
+ <reference name="content">
19
+ <block type="catalog/product_view" after='-' name="qixol-promo-wrap-data" template="qixol/product/qixol_product_info.phtml"/>
20
+ </reference>
21
+ <reference name="product.info.addtocart">
22
+ <block type="catalog/product_view" name="qixol-promo-details" template="qixol/product/qixol_info_details.phtml"/>
23
+ </reference>
24
+ </catalog_product_view>
25
+ <catalog_category_default>
26
+ <reference name="content">
27
+ <block type="catalog/product_list" name="qixol-wrap-text" after="category.products" template="qixol/product/qixol_adv.phtml"/>
28
+ </reference>
29
+ </catalog_category_default>
30
+
31
+ <checkout_cart_index>
32
+ <reference name="checkout.cart">
33
+ <action method="setTemplate"><template>qixol/cart/cart.phtml</template></action>
34
+ <action method="addItemRender">
35
+ <type>simple</type><block>checkout/cart_item_renderer</block><template>qixol/cart/item/default.phtml</template>
36
+ </action>
37
+ <action method="addItemRender">
38
+ <type>grouped</type><block>checkout/cart_item_renderer</block><template>qixol/cart/item/default.phtml</template>
39
+ </action>
40
+ <action method="addItemRender">
41
+ <type>configurable</type><block>checkout/cart_item_renderer</block><template>qixol/cart/item/default.phtml</template>
42
+ </action>
43
+ </reference>
44
+ <reference name="checkout.cart.extra">
45
+ <block type="core/template" name="bonuspointsbox" as="bonuspointsbox" template="qixol/cart/bonuspointbox.phtml" />
46
+ </reference>
47
+ <reference name="content">
48
+ <block type="checkout/onepage_link" name="qixolcartwrap" as="qixolcartwrap" template="qixol/cart/advert.phtml"/>
49
+ </reference>
50
+ </checkout_cart_index>
51
+
52
+
53
+ <checkout_onepage_review>
54
+ <reference name="root">
55
+ <action method="setTemplate"><template>qixol/onepage/review.phtml</template></action>
56
+ <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>qixol/onepage/item.phtml</template></action>
57
+ <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>qixol/onepage/item.phtml</template></action>
58
+ <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>qixol/onepage/item.phtml</template></action>
59
+ </reference>
60
+ <reference name="checkout.onepage.review.info.items.after">
61
+ <block type="checkout/onepage_link" name="qixolreviewwrap" as="qixolreviewwrap" template="qixol/onepage/advert.phtml"/>
62
+ </reference>
63
+ </checkout_onepage_review>
64
+
65
+ <customer_account>
66
+ <!-- Qixol issued coupons -->
67
+ <reference name="customer_account_navigation">
68
+ <action method="addLink" translate="label" module="qixol"><name>issuedcoupon</name><path>qixol/issuedcoupon</path><label>Issued Coupons</label></action>
69
+ </reference>
70
+ </customer_account>
71
+
72
+ <customer_account_index>
73
+ <!-- Qixol issued points -->
74
+ <reference name="customer_account_dashboard_top">
75
+ <action method="setTemplate"><template>qixol/issuedpoints/box.phtml</template></action>
76
+ <block type="core/template" name="customer_account_points" as="points" template="qixol/issuedpoints/dashboard_points.phtml"/>
77
+ </reference>
78
+ </customer_account_index>
79
+
80
+ <qixol_issuedcoupon_index translate="label">
81
+ <label>Customer Qixol Issued Coupons</label>
82
+ <update handle="customer_account"/>
83
+ <reference name="my.account.wrapper">
84
+ <block type="qixol/issuedcoupon" name="qixol-issuedcoupon" template="qixol/issuedcoupon/list.phtml"/>
85
+ </reference>
86
+ </qixol_issuedcoupon_index>
87
+
88
+ <sales_order_view>
89
+ <reference name="order_items">
90
+ <action method="setTemplate"><template>qixol/myaccount/order/items/items.phtml</template></action>
91
+ <action method="addItemRender"><type>default</type><block>sales/order_item_renderer_default</block><template>qixol/myaccount/order/items/default.phtml</template></action>
92
+ <action method="addItemRender"><type>grouped</type><block>sales/order_item_renderer_grouped</block><template>qixol/myaccount/order/items/default.phtml</template></action>
93
+ </reference>
94
+ <reference name="order_totals">
95
+ <block type="qixol/sales_order_total" name="qixol.sales.order.total" />
96
+ </reference>
97
+ </sales_order_view>
98
+
99
+ <sales_order_print>
100
+ <reference name="sales.order.print">
101
+ <action method="setTemplate"><template>qixol/myaccount/order/print/print.phtml</template></action>
102
+ <action method="addItemRender"><type>default</type><block>sales/order_item_renderer_default</block><template>qixol/myaccount/order/print/default.phtml</template></action>
103
+ <action method="addItemRender"><type>grouped</type><block>sales/order_item_renderer_grouped</block><template>qixol/myaccount/order/print/default.phtml</template></action>
104
+ </reference>
105
+ <reference name="order_totals">
106
+ <block type="qixol/sales_order_total" name="qixol.sales.order.total" />
107
+ </reference>
108
+ </sales_order_print>
109
+
110
+ <sales_email_order_items>
111
+ <reference name="items">
112
+ <action method="setTemplate"><template>qixol/myaccount/order/email/items.phtml</template></action>
113
+ <action method="addItemRender"><type>default</type><block>sales/order_email_items_order_default</block><template>qixol/myaccount/order/email/default.phtml</template></action>
114
+ <action method="addItemRender"><type>grouped</type><block>sales/order_email_items_order_grouped</block><template>qixol/myaccount/order/email/default.phtml</template></action>
115
+ </reference>
116
+ <reference name="order_totals">
117
+ <block type="qixol/sales_order_total" name="qixol.sales.order.total" />
118
+ </reference>
119
+ </sales_email_order_items>
120
+
121
+ <sales_email_order_invoice_items>
122
+ <reference name="invoice_totals">
123
+ <block type="qixol/sales_order_total" name="qixol.sales.order.total" />
124
+ </reference>
125
+ </sales_email_order_invoice_items>
126
+
127
+ <sales_order_invoice>
128
+ <reference name="invoice_totals">
129
+ <block type="qixol/sales_order_total" name="qixol.sales.order.total" />
130
+ </reference>
131
+ </sales_order_invoice>
132
+
133
+ <sales_order_printinvoice>
134
+ <reference name="invoice_totals">
135
+ <block type="qixol/sales_order_total" name="qixol.sales.order.total" />
136
+ </reference>
137
+ </sales_order_printinvoice>
138
+ <sales_order_creditmemo>
139
+ <reference name="creditmemo_totals">
140
+ <block type="qixol/sales_order_total" name="qixol.sales.order.total" />
141
+ </reference>
142
+ </sales_order_creditmemo>
143
+ <sales_order_printcreditmemo>
144
+ <reference name="creditmemo_totals">
145
+ <block type="qixol/sales_order_total" name="qixol.sales.order.total" />
146
+ </reference>
147
+ </sales_order_printcreditmemo>
148
+ <sales_email_order_creditmemo_items>
149
+ <reference name="creditmemo_totals">
150
+ <block type="qixol/sales_order_total" name="qixol.sales.order.total" />
151
+ </reference>
152
+ </sales_email_order_creditmemo_items>
153
+ </layout>
154
+
app/design/frontend/base/default/template/qixol/cart/advert.phtml ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //$place_box_in_design_after_pattern=Mage::getStoreConfig('qixol/integraion/boxcartpromotion')
3
+ $place_box_in_design_after_pattern='.cart';
4
+
5
+
6
+ $cart_advertisment_=Mage::getModel('qixol/advert');
7
+ $text_to_show_cart_adv='';
8
+ if ((int)Mage::getStoreConfig('qixol/frontend/showcartpromobox')>0)
9
+ $text_to_show_cart_adv=$cart_advertisment_->getCartInlineAdv();
10
+
11
+ $inline_cart_advert='';
12
+ $total_discount_amount=0;
13
+ $delivery_discount_amount=0;
14
+ //for cart items
15
+ $cart = Mage::getModel('checkout/cart')->getQuote();
16
+ foreach ($cart->getAllItems() as $item) {
17
+ if (isset($_SESSION['qixol_quoted_items'])&&isset($_SESSION['qixol_quoted_items']['items'][$item->getId()])){
18
+ if ((int)Mage::getStoreConfig('qixol/frontend/cartjavascr')>0 && Mage::getStoreConfig('qixol/advanced/services')!='dontdisplay' &&
19
+ isset($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions']))
20
+ foreach ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions'] as $promotion){
21
+ //inline level promotion
22
+ if ((int)$promotion['basketlevel']==0&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displaytext'){
23
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_promo\">".addslashes($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display_text'])."</div>').appendTo($('#qixol_idx_cart_item_name_".$item->getId()."'));";
24
+ } elseif((int)$promotion['basketlevel']==0&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displayname') {
25
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_promo\">".addslashes($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['name'])."</div>').appendTo($('#qixol_idx_cart_item_name_".$item->getId()."'));";
26
+
27
+ } elseif((int)$promotion['basketlevel']==0&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displaytype') {
28
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_promo\">".addslashes($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display'])."</div>').appendTo($('#qixol_idx_cart_item_name_".$item->getId()."'));";
29
+
30
+ }
31
+
32
+ //basket level promotion
33
+ if ((int)$promotion['basketlevel']==1&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]))
34
+ $text_to_show_cart_adv.='';//should be also added??? $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['display_text'];
35
+ }
36
+
37
+ //if quantity changed (get one + one free so will be splited to 2 products with 1 free)
38
+ if ((int)Mage::getStoreConfig('qixol/frontend/cartjavascr')>0 &&$_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_qty']>0)
39
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_new_qty\">For&nbsp;promo&nbsp;".addslashes($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['quantity'])."&nbsp;Qty</div>').appendTo($('#qixol_idx_cart_item_qty_".$item->getId()."'));";
40
+
41
+ if ((int)Mage::getStoreConfig('qixol/frontend/cartjavascr')>0 &&$_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_price']>0)
42
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_new_price\">Only for ".addslashes($this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['lineamount']))."</div>').appendTo($('#qixol_idx_cart_item_price_".$item->getId()."'));";
43
+
44
+ }
45
+ }
46
+
47
+ if (isset($_SESSION['qixol_quoted_items']['items'])){
48
+ foreach ($_SESSION['qixol_quoted_items']['items'] as $cart_item_process){
49
+ if ($cart_item_process['data']['totaldiscount']>0&&$cart_item_process['new']==0&&((int)Mage::getStoreConfig('qixol/advanced/separateitem')>0||$cart_item_process['data']['generated']==false)){
50
+ $total_discount_amount+=$cart_item_process['data']['totaldiscount'];
51
+ }/*elseif($cart_item_process['data']['totaldiscount']>0&&$cart_item_process['new']==0&&((int)Mage::getStoreConfig('qixol/advanced/separateitem')==0&&$cart_item_process['data']['generated']==true)){
52
+ $total_discount_amount-=$cart_item_process['data']['totaldiscount'];
53
+ }*/
54
+ /*elseif($cart_item_process['data']['isdelivery']){
55
+ foreach ($cart_item_process['promotions'] as $delivery_promotion){
56
+ if ($delivery_promotion['discountamount']>0){
57
+ $delivery_discount_amount+=$delivery_promotion['discountamount'];
58
+ }
59
+ }
60
+ }*/
61
+ }
62
+ if (isset($_SESSION['qixol_quoted_items']['cart_data']['deliverytotaldiscount'])){
63
+ $delivery_discount_amount=$_SESSION['qixol_quoted_items']['cart_data']['deliverytotaldiscount'];
64
+ }
65
+ }
66
+
67
+ if (isset($_SESSION['qixol_quoted_items']['summary'])){
68
+ foreach ($_SESSION['qixol_quoted_items']['summary'] as $cart_total_process){
69
+ if ($cart_total_process['data']['discountamount']>0&&$cart_total_process['data']['type']=='BASKETREDUCTION'){
70
+ $total_discount_amount+=$cart_total_process['data']['discountamount'];
71
+ }
72
+ }
73
+ }
74
+ if ($text_to_show_cart_adv!==false&&strlen($text_to_show_cart_adv)>5||$inline_cart_advert!=''||$total_discount_amount>0){
75
+ ?><script type="text/javascript" src="<?php echo Mage::getBaseUrl('js'); ?>/lib/jquery/jquery-1.10.2.min.js"></script><script type="text/javascript">$.noConflict();jQuery( document ).ready(function( $ ) { <?php
76
+ if ($text_to_show_cart_adv!==false&&strlen($text_to_show_cart_adv)>5)
77
+ echo '$("'.$place_box_in_design_after_pattern.'").after("<div class=\'qixolcartpromo\'>'.$text_to_show_cart_adv.'</div>");';
78
+ if ($inline_cart_advert!='')
79
+ echo preg_replace("/[\n\r]+/","",$inline_cart_advert);
80
+ if ($total_discount_amount>0||$delivery_discount_amount>0){
81
+ if ($delivery_discount_amount>0){
82
+ ?>$('<tr class="qixol_discount"><td class="a-right" colspan="1" ><?php echo Mage::helper('qixol')->__("Delivery Discount");?></td><td class="a-right" ><span class="qixol_total_price"><?php echo $this->helper('checkout')->formatPrice($delivery_discount_amount); ?></span></td></tr>').appendTo($('#shopping-cart-totals-table tbody'));<?php
83
+ }
84
+ if ($total_discount_amount>0){
85
+ ?>$('<tr class="qixol_discount"><td class="a-right" colspan="1" ><?php echo Mage::helper('qixol')->__("Products Discount");?></td><td class="a-right" ><span class="qixol_total_price"><?php echo $this->helper('checkout')->formatPrice($total_discount_amount); ?></span></td></tr>').appendTo($('#shopping-cart-totals-table tbody'));<?php
86
+ }
87
+ ?>$('#shopping-cart-totals-table tfoot .price').addClass('qixol_price_cross');$('<span class="qixol_grand_total_price"><?php echo $this->helper('checkout')->formatPrice($cart->getGrandTotal()-$total_discount_amount-$delivery_discount_amount); ?></span>').appendTo($('#shopping-cart-totals-table tfoot .price').parent());<?php
88
+ }
89
+ ?>});</script><?php
90
+ }
91
+ ?>
app/design/frontend/base/default/template/qixol/cart/bonuspointbox.phtml ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style>
2
+ #bonuspoints .input-text{
3
+ float:left;
4
+ border-radius: 0;
5
+ height: 30px;
6
+ margin: 4px 10px 0 0;
7
+ width: 100px;
8
+ }
9
+
10
+ #bonuspoints .button-wrapper{
11
+ float: left;
12
+ }
13
+
14
+ #bonuspoints label{
15
+ float:left;
16
+ font-family: "Raleway", "Helvetica Neue", Verdana, Arial, sans-serif;
17
+ font-size: 12px;
18
+ font-weight: 400;
19
+ text-align: left;
20
+ text-transform: uppercase;
21
+ min-width: 90px;
22
+ display: inline-block;
23
+ margin-right: 10px;
24
+ line-height:32px;
25
+ }
26
+ .discount h2{
27
+ font-weight:bold;
28
+ font-size:12px;
29
+ }
30
+ </style>
31
+ <?php
32
+ $customerId = Mage::getModel('customer/session')->getCustomerId();
33
+ $customerPoints = Mage::getModel('qixol/Bonuspoints')->load($customerId);
34
+ ?>
35
+ <div class="discount">
36
+ <h2>Reward Points</h2>
37
+ <?php $r_disc = Mage::getSingleton('customer/session')->getPointsAmount(); ?>
38
+ <form action="<?php echo Mage::getUrl('qixol/cart/applypoints') ?>" id="bonuspoints" method="post">
39
+
40
+ <div class="discount-form">
41
+ <label for="coupon_code"><?php echo $this->__('Points') ?></label>
42
+ <input type="hidden" name="removepoints" id="remove-points" value="0" />
43
+ <div class="field-wrapper">
44
+ <input class="input-text" type="text" id="reward_points" name="reward_points" value="<?php echo $r_disc; ?>" />
45
+ <div class="button-wrapper">
46
+ <button type="button" title="<?php echo $this->__('Apply') ?>" class="button2" onclick="rewardForm.submit(false)" value="<?php echo $this->__('Apply') ?>"><span><span><?php echo $this->__('Apply') ?></span></span></button>
47
+
48
+ <?php if(strlen($r_disc > 0)): ?>
49
+ <button type="button" title="<?php echo $this->__('Cancel') ?>" class="button2 cancel-coupon" onclick="rewardForm.submit(true)" value="<?php echo $this->__('Cancel') ?>"><span><span><?php echo $this->__('Cancel') ?></span></span>
50
+ </button>
51
+ <?php endif;?>
52
+
53
+ </div>
54
+ </div><br>
55
+ <div style="padding-top:20px;"><?php echo $this->__('Balance Available') ?> : <?= sprintf('%d',$customerPoints->getCurrentPoints()); ?> </div>
56
+ </div>
57
+ </form>
58
+
59
+ </div>
60
+
61
+ <script type="text/javascript">
62
+ //<![CDATA[
63
+ var rewardForm = new VarienForm('bonuspoints');
64
+ rewardForm.submit = function (isRemove) {
65
+ if (isRemove) {
66
+ $('reward_points').removeClassName('required-entry');
67
+ $('remove-points').value = "1";
68
+ } else {
69
+ $('reward_points').addClassName('required-entry');
70
+ $('remove-points').value = "0";
71
+ }
72
+ return VarienForm.prototype.submit.bind(rewardForm)();
73
+ }
74
+ //]]>
75
+ </script>
app/design/frontend/base/default/template/qixol/cart/cart.phtml ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Shopping cart template
30
+ *
31
+ * @var $this Mage_Checkout_Block_Cart
32
+ */
33
+ ?>
34
+ <?php $_priceDisplay = ($this->helper('tax')->displayCartBothPrices()) ? 'display-both-prices' : 'display-single-price'; ?>
35
+ <div class="cart <?php echo $_priceDisplay; ?>">
36
+ <div class="page-title title-buttons">
37
+ <h1><?php echo $this->__('Shopping Cart') ?></h1>
38
+ <?php if(!$this->hasError()): ?>
39
+ <ul class="checkout-types top">
40
+ <?php foreach ($this->getMethods('top_methods') as $method): ?>
41
+ <?php if ($methodHtml = $this->getMethodHtml($method)): ?>
42
+ <li><?php echo $methodHtml; ?></li>
43
+ <?php endif; ?>
44
+ <?php endforeach; ?>
45
+ </ul>
46
+ <?php endif; ?>
47
+ </div>
48
+ <?php echo $this->getMessagesBlock()->toHtml() ?>
49
+ <?php echo $this->getChildHtml('form_before') ?>
50
+ <form action="<?php echo $this->getFormActionUrl() ?>" method="post">
51
+ <?php echo $this->getBlockHtml('formkey'); ?>
52
+ <table id="shopping-cart-table" class="cart-table data-table">
53
+ <col width="1" />
54
+ <col width="1" />
55
+ <col width="1" />
56
+ <col width="1" />
57
+ <col width="1" />
58
+ <col width="1" />
59
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
60
+ <col width="1" />
61
+ <col width="1" />
62
+ <?php endif; ?>
63
+
64
+ <?php $mergedCells = ($this->helper('tax')->displayCartBothPrices() ? 2 : 1); ?>
65
+ <thead>
66
+ <tr>
67
+ <th rowspan="<?php echo $mergedCells; ?>"><span class="nobr"><?php echo $this->__('Product') ?></span></th>
68
+
69
+ <th rowspan="<?php echo $mergedCells; ?>">&nbsp;</th>
70
+
71
+ <th class="a-center cart-price-head" colspan="<?php echo $mergedCells; ?>">
72
+ <!-- <div class="cart-price-placeholder">-->
73
+ <span class="nobr"><?php echo $this->__('Price') ?></span>
74
+ <!-- </div>-->
75
+ </th>
76
+
77
+ <th rowspan="<?php echo $mergedCells; ?>" class="a-center">
78
+ <?php echo $this->__('Qty') ?>
79
+
80
+ <?php /*if ($this->helper('wishlist')->isAllowInCart()) : ?>
81
+ <span class="nobr"><?php echo $this->__('Move to Wishlist') ?></span>
82
+ <?php endif*/ ?>
83
+
84
+ </th>
85
+
86
+ <th class="a-center cart-total-head" colspan="<?php echo $mergedCells; ?>">
87
+ <!-- <div class="cart-total-placeholder">-->
88
+ <?php echo $this->__('Subtotal') ?>
89
+ <!-- </div>-->
90
+ </th>
91
+
92
+ <th class="a-center" rowspan="<?php echo $mergedCells; ?>">&nbsp;</th>
93
+
94
+ </tr>
95
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
96
+ <tr>
97
+ <th class="a-center cart-price-head"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
98
+ <th class="a-center cart-price-head"><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
99
+ <th class="a-center cart-total-head"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
100
+ <th class="a-center cart-total-head"><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
101
+ </tr>
102
+ <?php endif; ?>
103
+ </thead>
104
+ <tfoot>
105
+ <tr>
106
+ <td colspan="50" class="a-right cart-footer-actions">
107
+
108
+ <!-- Make this button the first responder rather than empty cart -->
109
+ <button type="submit" style="visibility:hidden;" data-cart-item-update name="update_cart_action" value="update_qty" title="<?php echo $this->quoteEscape($this->__('Update Shopping Cart')); ?>" class="button2 btn-update"><span><span><?php echo $this->__('Update Shopping Cart'); ?></span></span></button>
110
+
111
+ <button type="submit" name="update_cart_action" data-cart-empty value="empty_cart" title="<?php echo $this->quoteEscape($this->__('Empty Cart')); ?>" class="button2 btn-empty" id="empty_cart_button"><span><span><?php echo $this->__('Empty Cart'); ?></span></span></button>
112
+
113
+ <button type="submit" name="update_cart_action" data-cart-item-update value="update_qty" title="<?php echo $this->quoteEscape($this->__('Update Shopping Cart')); ?>" class="button2 btn-update"><span><span><?php echo $this->__('Update Shopping Cart'); ?></span></span></button>
114
+
115
+ <span class="or">-<?php echo $this->__('or'); ?>-</span>
116
+
117
+ <?php if($this->getContinueShoppingUrl()): ?>
118
+ <button type="button" title="<?php echo $this->quoteEscape($this->__('Continue Shopping')) ?>" class="button2 btn-continue" onclick="setLocation('<?php echo Mage::helper('core')->quoteEscape($this->getContinueShoppingUrl()) ?>')"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
119
+ <?php endif; ?>
120
+ <!--[if lt IE 8]>
121
+ <input type="hidden" id="update_cart_action_container" data-cart-item-update />
122
+ <script type="text/javascript">
123
+ //<![CDATA[
124
+ Event.observe(window, 'load', function()
125
+ {
126
+ // Internet Explorer (lt 8) does not support value attribute in button elements
127
+ $emptyCartButton = $('empty_cart_button');
128
+ $cartActionContainer = $('update_cart_action_container');
129
+ if ($emptyCartButton && $cartActionContainer) {
130
+ Event.observe($emptyCartButton, 'click', function()
131
+ {
132
+ $emptyCartButton.setAttribute('name', 'update_cart_action_temp');
133
+ $cartActionContainer.setAttribute('name', 'update_cart_action');
134
+ $cartActionContainer.setValue('empty_cart');
135
+ });
136
+ }
137
+
138
+ });
139
+ //]]>
140
+ </script>
141
+ <![endif]-->
142
+ </td>
143
+ </tr>
144
+ </tfoot>
145
+ <tbody>
146
+ <?php foreach($this->getItems() as $_item): ?>
147
+ <?php
148
+ //{{qixol start wrap block
149
+ if ((int)Mage::getStoreConfig('qixol/frontend/cartjavascr')==0&&($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']>0)){
150
+ $multiple_coeff=((float)$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['quantity']/(float)$_item->getQty());
151
+ $_item->setQty((string)$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['quantity']);
152
+ //$_item->setPrice($_item->getPrice()*$multiple_coeff);
153
+ //$_item->setBasePrice($_item->getBasePrice()*$multiple_coeff);
154
+ //$_item->setPriceInclTax($_item->getPriceInclTax()*$multiple_coeff);
155
+ //$_item->setBasePriceInclTax($_item->getBasePriceInclTax()*$multiple_coeff);
156
+ //$_item->setBasePriceInclTax($_item->getBasePriceInclTax()*$multiple_coeff);
157
+ $_item->setRowTotal($_item->getRowTotal()*$multiple_coeff);
158
+ $_item->setBaseRowTotal($_item->getBaseRowTotal()*$multiple_coeff);
159
+ $_item->setRowTotalInclTax($_item->getRowTotalInclTax()*$multiple_coeff);
160
+ $_item->setBaseRowTotalInclTax($_item->getBaseRowTotalInclTax()*$multiple_coeff);
161
+
162
+
163
+ unset($multiple_coeff);
164
+ }
165
+ // }} qixol
166
+ ?>
167
+ <?php echo $this->getItemHtml($_item) ?>
168
+ <?php endforeach ?>
169
+ <?php
170
+ //{{qixol start wrap block
171
+
172
+ if (isset($_SESSION['qixol_quoted_items'])){
173
+ foreach ($_SESSION['qixol_quoted_items']['items'] as $idx_cart=>$item_to_show){
174
+ if ($item_to_show['new']>0&&(int)$item_to_show['data']['isdelivery']==0&&(int)$item_to_show['data']['splitfromlineid']==0){
175
+ if ($productId=Mage::getModel('catalog/product')->getIdBySku((string)$item_to_show['data']['variantcode']!=''?(string)$item_to_show['data']['variantcode']:(string)$item_to_show['data']['productcode'])){
176
+
177
+ $productObj = Mage::getModel('catalog/product')->load($productId);
178
+ $quoteItem = Mage::getModel('sales/quote_item')->setStoreId(Mage::app()->getStore()->getId())->setProduct($productObj);
179
+ $quoteItem->setConvertedPrice((string)$item_to_show['data']['price']);
180
+ $quoteItem->setRowTotal((string)$item_to_show['data']['price']);
181
+ $quoteItem->setBaseRowTotal((string)$item_to_show['data']['price']);
182
+ $quoteItem->setQty((string)$item_to_show['data']['quantity']);
183
+ $quoteItem->setFreeProduct((int)$item_to_show['free_added']);
184
+ $quoteItem->setQuote($this);
185
+ $quoteItem->setId($idx_cart);
186
+ echo $this->getItemHtml($quoteItem);
187
+ }
188
+ }
189
+ }
190
+
191
+ if (isset($_SESSION['qixol_quoted_items']['summary'])){
192
+ foreach ($_SESSION['qixol_quoted_items']['summary'] as $inline_cart_promotion)
193
+ if($inline_cart_promotion['data']['basketlevel']>0){
194
+ ?>
195
+ <tr class='promotion_cart_inline_box'>
196
+ <td class="product-cart-image">&nbsp;</td>
197
+ <td class="product-cart-info" colspan='3'><?php echo $inline_cart_promotion['data']['display_text']; ?></td>
198
+ <td class="product-cart-total" colspan='2'><?php
199
+ switch ($inline_cart_promotion['data']['type']){
200
+ case 'ISSUEPOINTS';
201
+ echo $inline_cart_promotion['data']['issuedpoints']."&nbsp;pt.";
202
+ break;
203
+ case 'DELIVERYREDUCTION';
204
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
205
+ break;
206
+ case 'BASKETREDUCTION';
207
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
208
+ break;
209
+ }
210
+ ?></td>
211
+ </tr>
212
+ <?
213
+ }
214
+ }
215
+ }
216
+ //}} qixol end wrap block
217
+ ?>
218
+ </tbody>
219
+ </table>
220
+ <script type="text/javascript">decorateTable('shopping-cart-table')</script>
221
+ </form>
222
+
223
+ <?php echo $this->getChildHtml('shopping.cart.table.after'); ?>
224
+ <div class="cart-forms">
225
+ <?php /* Extensions placeholder */ ?>
226
+ <?php echo $this->getChildHtml('checkout_cart_widget') ?>
227
+ <?php echo $this->getChildHtml('coupon') ?>
228
+ <?php echo $this->getChildHtml('checkout.cart.extra') ?>
229
+ <?php if (!$this->getIsVirtual()): echo $this->getChildHtml('shipping'); endif; ?>
230
+ </div>
231
+ <div class="cart-totals-wrapper">
232
+ <div class="cart-totals">
233
+ <?php echo $this->getChildHtml('totals'); ?>
234
+ <?php if(!$this->hasError()): ?>
235
+ <ul class="checkout-types bottom">
236
+ <?php foreach ($this->getMethods('methods') as $method): ?>
237
+ <?php if ($methodHtml = $this->getMethodHtml($method)): ?>
238
+ <li class="method-<?php echo preg_replace("/[^_a-zA-Z0-9-]/", '-', $method); ?>"><?php echo $methodHtml; ?></li>
239
+ <?php endif; ?>
240
+ <?php endforeach; ?>
241
+ </ul>
242
+ <?php endif; ?>
243
+ </div>
244
+ </div>
245
+ <?php echo $this->getChildHtml('crosssell') ?>
246
+ </div>
app/design/frontend/base/default/template/qixol/cart/item/default.phtml ADDED
@@ -0,0 +1,386 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ $_item = $this->getItem();
29
+ $isVisibleProduct = $_item->getProduct()?$_item->getProduct()->isVisibleInSiteVisibility():0;
30
+ $canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_BEFORE_ORDER_CONFIRM);
31
+ ?>
32
+ <?php /* {{ qixol should be added id */ ?>
33
+ <tr id='qixol_idx_cart_item_<?php echo $_item->getId(); ?>'>
34
+ <?php /* }} qixol end should be added id */ ?>
35
+ <td class="product-cart-image">
36
+ <?php if ($this->hasProductUrl()):?>
37
+ <a href="<?php echo $this->getProductUrl() ?>" title="<?php echo $this->escapeHtml($this->getProductName()) ?>" class="product-image">
38
+ <?php endif;?>
39
+ <img src="<?php echo $this->getProductThumbnail()->resize(180); ?>" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" />
40
+ <?php if ($this->hasProductUrl()):?>
41
+ </a>
42
+ <?php endif;?>
43
+
44
+ <ul class="cart-links">
45
+ <?php if ($isVisibleProduct): ?>
46
+ <li>
47
+ <a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Edit item parameters')) ?>"><?php echo $this->__('Edit') ?></a>
48
+ </li>
49
+ <?php endif ?>
50
+
51
+ <?php if ($this->helper('wishlist')->isAllowInCart() && $isVisibleProduct) : ?>
52
+ <li>
53
+ <a href="<?php echo $this->helper('wishlist')->getMoveFromCartUrl($_item->getId()); ?>" class="link-wishlist use-ajax"><?php echo $this->__('Move to wishlist'); ?></a>
54
+ </li>
55
+ <?php endif ?>
56
+ </ul>
57
+ </td>
58
+
59
+ <?php /* {{ qixol should be added id */ ?>
60
+ <td class="product-cart-info" id='qixol_idx_cart_item_name_<?php echo $_item->getId(); ?>'>
61
+ <?php /* }} qixol end should be added id */ ?>
62
+
63
+ <a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove Item')) ?>" class="btn-remove btn-remove2"><?php echo $this->__('Remove Item') ?></a>
64
+
65
+ <h2 class="product-name">
66
+ <?php if ($this->hasProductUrl()):?>
67
+ <a href="<?php echo $this->getProductUrl() ?>"><?php echo $this->escapeHtml($this->getProductName()) ?></a>
68
+ <?php else: ?>
69
+ <?php echo $this->escapeHtml($this->getProductName()) ?>
70
+ <?php endif; ?>
71
+ </h2>
72
+
73
+ <div class="product-cart-sku">
74
+ <span class="label"><?php echo $this->__('SKU'); ?>:</span> <?php echo $this->escapeHtml($_item->getSku()); ?>
75
+ </div>
76
+
77
+ <?php if ($_options = $this->getOptionList()):?>
78
+ <dl class="item-options">
79
+ <?php foreach ($_options as $_option) : ?>
80
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
81
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
82
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
83
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
84
+ <div class="truncated_full_value">
85
+ <dl class="item-options">
86
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
87
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
88
+ </dl>
89
+ </div>
90
+ <?php endif; ?>
91
+ </dd>
92
+ <?php endforeach; ?>
93
+ </dl>
94
+ <?php endif;?>
95
+
96
+ <?php if ($messages = $this->getMessages()): ?>
97
+ <?php foreach ($messages as $message): ?>
98
+ <p class="item-msg <?php echo $message['type'] ?>">
99
+ * <?php echo $this->escapeHtml($message['text']) ?>
100
+ </p>
101
+ <?php endforeach; ?>
102
+ <?php endif; ?>
103
+
104
+ <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
105
+ <?php if ($addInfoBlock): ?>
106
+ <?php echo $addInfoBlock->setItem($_item)->toHtml() ?>
107
+ <?php endif;
108
+ /* qixol {{ */
109
+ if ((int)Mage::getStoreConfig('qixol/frontend/cartjavascr')==0&&Mage::getStoreConfig('qixol/advanced/services')!='dontdisplay'):
110
+ foreach ($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['promotions'] as $promotion){
111
+ //inline level promotion
112
+ $is_generated=($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['generated']>0?$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['generated']:$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']);
113
+ if (((int)$promotion['basketlevel']==0||$is_generated>0)&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displaytext'){
114
+ ?><div class="cart_inline_item_promo"><?php echo $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display_text']; ?></div><?php
115
+ }elseif(((int)$promotion['basketlevel']==0||$is_generated>0)&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displayname'){
116
+ ?><div class="cart_inline_item_promo"><?php echo $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['name']; ?></div><?php
117
+ }elseif(((int)$promotion['basketlevel']==0||$is_generated>0)&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displaytype'){
118
+ ?><div class="cart_inline_item_promo"><?php echo $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display']; ?></div><?php
119
+ }
120
+
121
+ }
122
+ endif;
123
+ /* }} end qixol */ ?>
124
+
125
+ </td>
126
+
127
+ <?php if ($canApplyMsrp): ?>
128
+ <td class="a-center product-cart-price"<?php if ($this->helper('tax')->displayCartBothPrices()): ?> colspan="2"<?php endif; ?>>
129
+ <span class="cart-price">
130
+ <span class="cart-msrp-unit"><?php echo $this->__('See price before order confirmation.'); ?></span>
131
+ <?php $helpLinkId = 'cart-msrp-help-' . $_item->getId(); ?>
132
+ <a id="<?php echo $helpLinkId ?>" href="#" class="map-help-link"><?php echo $this->__("What's this?"); ?></a>
133
+
134
+ <script type="text/javascript">
135
+ Catalog.Map.addHelpLink($('<?php echo $helpLinkId ?>'), "<?php echo $this->__("What&#39;s this?") ?>");
136
+ </script>
137
+
138
+ </span>
139
+ </td>
140
+ <?php else: ?>
141
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
142
+ <td class="product-cart-price" data-rwd-label="<?php echo $this->__('Price'); ?>" data-rwd-tax-label="<?php echo $this->__('Excl. Tax'); ?>" >
143
+
144
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
145
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
146
+ <?php else: ?>
147
+ <span class="cart-price">
148
+ <?php endif; ?>
149
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
150
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
151
+ <?php else: ?>
152
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
153
+ <?php endif; ?>
154
+
155
+ </span>
156
+
157
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
158
+
159
+ <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
160
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
161
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
162
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
163
+ <?php endforeach; ?>
164
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
165
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
166
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
167
+ <?php endforeach; ?>
168
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
169
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
170
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
171
+ <?php endforeach; ?>
172
+ <?php endif; ?>
173
+ </div>
174
+
175
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
176
+ <div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
177
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total'); ?>: <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
178
+ </div>
179
+ <?php endif; ?>
180
+ <?php endif; ?>
181
+ </td>
182
+ <?php endif; ?><!-- inclusive price starts here -->
183
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
184
+ <td class="product-cart-price" data-rwd-label="<?php echo $this->__('Price'); ?>" data-rwd-tax-label="<?php echo $this->__('Incl. Tax'); ?>">
185
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
186
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
187
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
188
+ <?php else: ?>
189
+ <span class="cart-price">
190
+ <?php endif; ?>
191
+
192
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
193
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
194
+ <?php else: ?>
195
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
196
+ <?php endif; ?>
197
+
198
+ </span>
199
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
200
+
201
+ <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
202
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
203
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
204
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
205
+ <?php endforeach; ?>
206
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
207
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
208
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
209
+ <?php endforeach; ?>
210
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
211
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
212
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
213
+ <?php endforeach; ?>
214
+ <?php endif; ?>
215
+ </div>
216
+
217
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
218
+ <div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
219
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>: <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
220
+ </div>
221
+ <?php endif; ?>
222
+ <?php endif; ?>
223
+ </td>
224
+ <?php endif; ?>
225
+ <?php endif; ?>
226
+ <?php /* qixol should be added id */ ?>
227
+ <td class="product-cart-actions" data-rwd-label="<?php echo $this->__('Qty'); ?>" id='qixol_idx_cart_item_qty_<?php echo $_item->getId(); ?>'>
228
+ <?php /* qixol add */ ?>
229
+ <?php /*if ($_item->getFreeProduct()>0): ?>
230
+ <div class="cart_inline_item_promo"><?php echo $this->__('free '.$_item->getFreeProduct().' item'); ?><br>
231
+ <button title="<?php echo Mage::helper('qixol')->quoteEscape($this->__('Add More')) ?>" class="button btn-cart" style="display:inline-block !important" onclick="setLocation('<?php echo $this->helper('checkout/cart')->getAddUrl($_item->getProduct())/*$_item->getProduct()->getProductUrl()*//*; ?>')"><span><span><?php echo $this->__('Add More') ?></span></span></button>
232
+ </div>
233
+ <?php else :*/ ?>
234
+ <?php /* end qixol add */ ?>
235
+ <input type="text" pattern="\d*" name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4"
236
+ data-cart-item-id="<?php echo $this->jsQuoteEscape($_item->getSku()) ?>"
237
+ title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" maxlength="12" />
238
+
239
+ <button type="submit" name="update_cart_action" data-cart-item-update value="update_qty" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Update')); ?>" class="button btn-update"><span><span><?php echo $this->__('Update'); ?></span></span>
240
+ </button>
241
+
242
+ <ul class="cart-links">
243
+ <?php if ($isVisibleProduct): ?>
244
+ <li>
245
+ <a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Edit item parameters')) ?>"><?php echo $this->__('Edit') ?></a>
246
+ </li>
247
+ <?php endif ?>
248
+
249
+ <?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
250
+ <li>
251
+ <?php if ($isVisibleProduct): ?>
252
+ <a href="<?php echo $this->helper('wishlist')->getMoveFromCartUrl($_item->getId()); ?>" class="link-wishlist use-ajax"><?php echo $this->__('Move to wishlist'); ?></a>
253
+ <?php endif ?>
254
+ </li>
255
+ <?php endif ?>
256
+ </ul>
257
+ <?php /* qixol add */ ?>
258
+ <?php //endif ?>
259
+ <?php /* end qixol add */ ?>
260
+ <?php
261
+ //{{qixol
262
+ /*if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')==0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['updated_qty']>0){
263
+ ?><div class="cart_inline_item_new_qty">For&nbsp;<?php echo $_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['quantity']; ?>&nbsp;Qty</div><?php
264
+ }*/
265
+ //}}qixol end
266
+ ?>
267
+ </td>
268
+
269
+ <!--Sub total starts here -->
270
+ <?php if (($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?>
271
+ <?php /* qixol should be added id */ ?>
272
+ <td class="product-cart-total" data-rwd-label="<?php echo $this->__('Subtotal'); ?>" id='qixol_idx_cart_item_price_<?php echo $_item->getId(); ?>'>
273
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
274
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
275
+ <?php else: ?>
276
+ <span class="cart-price">
277
+ <?php endif; ?>
278
+
279
+ <?php if ($canApplyMsrp): ?>
280
+ <span class="cart-msrp-subtotal">--</span>
281
+ <?php else: ?>
282
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
283
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
284
+ <?php else: ?>
285
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()) ?>
286
+ <?php endif; ?>
287
+ <?php endif; ?>
288
+
289
+ </span>
290
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
291
+
292
+ <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
293
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
294
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
295
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
296
+ <?php endforeach; ?>
297
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
298
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
299
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
300
+ <?php endforeach; ?>
301
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
302
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
303
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
304
+ <?php endforeach; ?>
305
+ <?php endif; ?>
306
+ </div>
307
+
308
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
309
+ <div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
310
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total'); ?>: <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
311
+ </div>
312
+ <?php endif; ?>
313
+ <?php endif; ?>
314
+ <?php
315
+ //{{qixol
316
+ if ((int)Mage::getStoreConfig('qixol/frontend/cartjavascr')==0&&($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['updated_price']>0)){
317
+ ?><div class="cart_inline_item_new_price">Only for <?php echo $this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalamount']-$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['totaldiscount']); ?></div><?php
318
+ }
319
+ if ((int)Mage::getStoreConfig('qixol/frontend/cartjavascr')==0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['new']>0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['generated']>0){
320
+ ?><div class="cart_inline_item_new_price"><?php echo $this->__('Discount: -').$this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalprice']); ?></div><?php
321
+ }else if ((int)Mage::getStoreConfig('qixol/frontend/cartjavascr')==0&&($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']>0)){
322
+ ?><div class="cart_inline_item_new_price"><?php echo $this->__('Discount: -').$this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalprice']*$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']); ?></div><?php
323
+ }
324
+ //}}qixol end
325
+ ?>
326
+ </td>
327
+ <?php endif; ?>
328
+ <?php if (($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?>
329
+ <?php /* qixol should be added id */ ?>
330
+ <td class="product-cart-total" data-rwd-label="<?php echo $this->__('Subtotal'); ?>" id='qixol_idx_cart_item_price_<?php echo $_item->getId(); ?>'>
331
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
332
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
333
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
334
+ <?php else: ?>
335
+ <span class="cart-price">
336
+ <?php endif; ?>
337
+
338
+ <?php if ($canApplyMsrp): ?>
339
+ <span class="cart-msrp-subtotal">--</span>
340
+ <?php else: ?>
341
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
342
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
343
+ <?php else: ?>
344
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
345
+ <?php endif; ?>
346
+ <?php endif; ?>
347
+
348
+ </span>
349
+
350
+
351
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
352
+
353
+ <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
354
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
355
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
356
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
357
+ <?php endforeach; ?>
358
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
359
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
360
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
361
+ <?php endforeach; ?>
362
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
363
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
364
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
365
+ <?php endforeach; ?>
366
+ <?php endif; ?>
367
+ </div>
368
+
369
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
370
+ <div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
371
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>: <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
372
+ </div>
373
+ <?php endif; ?>
374
+ <?php endif; ?>
375
+ </td>
376
+ <?php endif; ?>
377
+ <td class="a-center product-cart-remove">
378
+ <?php /* qixol */ ?>
379
+ <?php if ($_item->getFreeProduct()==0): ?>
380
+ <?php /* qixol end */ ?>
381
+ <a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove Item')) ?>" class="btn-remove btn-remove2"><?php echo $this->__('Remove Item') ?></a>
382
+ <?php /* qixol */ ?>
383
+ <?php endif; ?>
384
+ <?php /* qixol end */ ?>
385
+ </td>
386
+ </tr>
app/design/frontend/base/default/template/qixol/cart/totals.phtml ADDED
@@ -0,0 +1 @@
 
1
+ totals
app/design/frontend/base/default/template/qixol/issuedcoupon/list.phtml ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(Mage::getSingleton('customer/session')->isLoggedIn()) {
4
+ $customerData = Mage::getSingleton('customer/session')->getCustomer();
5
+ $list_coupons_collection=Mage::getModel('qixol/issuedcoupon')->getCustomerIssuedcoupons($customerData->getId());
6
+
7
+ ?>
8
+ <div class="page-title">
9
+ <h1><?php echo $this->__('Issued Coupons') ?></h1>
10
+ </div>
11
+ <?php if($list_coupons_collection->getSize()): ?>
12
+
13
+
14
+ <table class="data-table">
15
+ <col width="60" />
16
+ <col width="60" />
17
+ <col width="160" />
18
+ <col />
19
+ <thead>
20
+ <tr>
21
+ <th><?php echo $this->__('Code') ?></th>
22
+ <th><?php echo $this->__('Status') ?></th>
23
+ <th><?php echo $this->__('Valid To') ?></th>
24
+ <th><?php echo $this->__('Description') ?></th>
25
+ </tr>
26
+ </thead>
27
+ <tbody>
28
+ <?php foreach($list_coupons_collection as $item): ?>
29
+ <?php
30
+
31
+ $soapclient_coupon = new soapclient('http://evaluation.qixolpromo.com/BasketService.svc?singleWsdl', array('trace' => 1));
32
+ try {
33
+ $update_item=false;
34
+ $result_coupon = $soapclient_coupon->__soapCall('ValidateCouponCode', array('ValidateCouponCode' => array('companyKey' => Mage::getStoreConfig('qixol/integraion/companykey'),'couponCode' => $item->getCouponCodeValue())));
35
+ $xml_coupon_code_validated=$result_coupon->ValidateCouponCodeResult;
36
+ if (strlen($xml_coupon_code_validated)>10){
37
+ $xml_coupon_object = simplexml_load_string($xml_coupon_code_validated);
38
+ foreach ($xml_coupon_object as $xml_coupon_object_root_key=>$xml_coupon_object_object_sub){
39
+ if ($xml_coupon_object_root_key=='summary'){
40
+ $xml_coupon_object_object_coupon_summary=$xml_coupon_object_object_sub->attributes();
41
+ if ($xml_coupon_object_object_coupon_summary['result']=='false'){
42
+ $item->setIsUsed(1);
43
+ $update_item=true;
44
+ }
45
+ }
46
+ else if ($xml_coupon_object_root_key=='coupon'){
47
+ foreach ($xml_coupon_object_object_sub as $xml_coupon_object_coupon_key=>$xml_coupon_object_object_coupon){
48
+ if ($xml_coupon_object_coupon_key=='codes'){
49
+ foreach ($xml_coupon_object_object_coupon as $xml_coupon_object_object_coupon_obj){
50
+ $xml_coupon_object_object_coupon_attributes=$xml_coupon_object_object_coupon_obj->attributes();
51
+ if ((string)$xml_coupon_object_object_coupon_attributes['isredeemable']!='true'){
52
+ $item->setIsUsed(1);
53
+ $update_item=true;
54
+ }
55
+ if (date("Y-m-d H:i:s",strtotime((string)$xml_coupon_object_object_coupon_attributes['validto']))!=$item->getCouponValidTill()){
56
+ $item->setCouponValidTill(date("Y-m-d H:i:s",strtotime((string)$xml_coupon_object_object_coupon_attributes['validto'])));
57
+ $update_item=true;
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+
65
+ }
66
+ } catch (SoapFault $e) {
67
+
68
+ }
69
+
70
+ ?>
71
+ <tr>
72
+ <td><?php echo $item->getCouponCodeValue() ?></td>
73
+ <td><?php echo (((int)$item->getIsUsed()>0)?($this->__('Inactive')):(($item->getCouponValidTill()!=''&&$item->getCouponValidTill()!='0000-00-00 00:00:00'&&$item->getCouponValidTill()!='1970-01-01 00:00:00'&&strtotime($item->getCouponValidTill())<time())?$this->__('Expired'):$this->__('Active'))) ?></td>
74
+ <td><?php echo (($item->getCouponValidTill()!='0000-00-00 00:00:00'&&$item->getCouponValidTill()!='1970-01-01 00:00:00')?$item->getCouponValidTill():"Unlimited"); ?></td>
75
+ <td><?php echo $item->getCouponDescription(); ?></td>
76
+ </tr>
77
+ <?php
78
+ if ($update_item){
79
+ $item->save();
80
+ }
81
+ ?>
82
+ <?php endforeach ?>
83
+ </tbody>
84
+ </table>
85
+
86
+
87
+ <?php else: ?>
88
+ <p><?php echo $this->__('You are having no issued coupons yet.'); ?></p>
89
+ <div class="buttons-set">
90
+ <p class="back-link"><a href="<?php echo $this->getUrl('customer/account') ?>"><small>&laquo; </small><?php echo $this->__('Back - link to the previously viewed page'); ?></a></p>
91
+ </div>
92
+ <?php endif ?>
93
+ <?php
94
+ }
95
+ ?>
app/design/frontend/base/default/template/qixol/issuedpoints/box.phtml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <div class="account-box ad-account-info">
2
+ <div class="box-head">
3
+ <h4><?php echo $this->__('Points') ?></h4>
4
+ </div>
5
+ <?php echo $this->getChildHtml('points'); ?>
6
+ </div>
app/design/frontend/base/default/template/qixol/issuedpoints/dashboard_points.phtml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $customerId = Mage::getModel('customer/session')->getCustomerId();
3
+ $customerPoints = Mage::getModel('qixol/Bonuspoints')->load($customerId);
4
+ ?>
5
+ Your Points: <?= sprintf('%d',$customerPoints->getCurrentPoints()); ?>
6
+ <br/>
7
+ Total Points Accumulated: <?= sprintf('%d',$customerPoints->getEarnedPoints()); ?>
8
+ <br/>
9
+ Total Points Spent: <?= sprintf('%d',$customerPoints->getSpentPoints()); ?>
10
+ <br/>
app/design/frontend/base/default/template/qixol/minicart/advert.phtml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ moved to mincart
4
+ //$place_box_in_design_after_pattern=Mage::getStoreConfig('qixol/integraion/boxcartpromotion')
5
+ $place_box_in_design_after_pattern='.cart';
6
+
7
+
8
+ /* $cart_advertisment_=Mage::getModel('qixol/advert');
9
+ $text_to_show_cart_adv=$cart_advertisment_->getCartInlineAdv();*/
10
+ /*
11
+ $inline_cart_advert='';
12
+
13
+ //for cart items
14
+ $cart = Mage::getModel('checkout/cart')->getQuote();
15
+ foreach ($cart->getAllItems() as $item) {
16
+ if (isset($_SESSION['qixol_quoted_items'])&&isset($_SESSION['qixol_quoted_items']['items'][$item->getId()])){
17
+ if (isset($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions']))
18
+ foreach ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions'] as $promotion){
19
+ //inline level promotion
20
+ if ((int)$promotion['basketlevel']==0&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]))
21
+ $inline_cart_advert.="
22
+ $('<div class=\"cart_inline_item_promo\">".addslashes($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display_text'])."</div>').appendTo($('#qixol_idx_mcart_item_name_".$item->getId()."'));
23
+ ";
24
+ //basket level promotion
25
+ if ((int)$promotion['basketlevel']==1&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]))
26
+ $text_to_show_cart_adv.='';//should be also added??? $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['display_text'];
27
+
28
+ }
29
+
30
+ //if quantity changed (get one + one free so will be splited to 2 products with 1 free)
31
+ if ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_qty']>0)
32
+ $inline_cart_advert.="
33
+ $('<div class=\"cart_inline_item_new_qty\">For&nbsp;promo&nbsp;".addslashes($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['quantity'])."&nbsp;Qty</div>').appendTo($('#qixol_idx_mcart_item_qty_".$item->getId()."'));
34
+ ";
35
+
36
+ if ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_price']>0)
37
+ $inline_cart_advert.="
38
+ $('<div class=\"cart_inline_item_new_price\">Only for ".addslashes($this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['lineamount']))."</div>').appendTo($('#qixol_idx_mcart_item_price_".$item->getId()."'));
39
+ ";
40
+
41
+ }
42
+ }
43
+ $total_discount_amount=0;
44
+ if (isset($_SESSION['qixol_quoted_items']['items'])){
45
+ foreach ($_SESSION['qixol_quoted_items']['items'] as $cart_item_process){
46
+ if ($cart_item_process['data']['totaldiscount']>0&&(int)$cart_item_process['new']==0){
47
+ $total_discount_amount+=$cart_item_process['data']['totaldiscount'];
48
+ }
49
+ }
50
+ }
51
+
52
+ if ($text_to_show_cart_adv!==false&&strlen($text_to_show_cart_adv)>5||$inline_cart_advert!=''){
53
+ ?><script type="text/javascript" src="http://qixol.holbidev.co.uk/js/lib/jquery/jquery-1.10.2.min.js"></script><script type="text/javascript">$.noConflict();jQuery( document ).ready(function( $ ) { <?php
54
+ /*if ($text_to_show_cart_adv!==false&&strlen($text_to_show_cart_adv)>5)
55
+ echo '$("'.$place_box_in_design_after_pattern.'").after("<div class=\'qixolcartpromo\'>'.$text_to_show_cart_adv.'</div>");';*//*
56
+ if ($inline_cart_advert!='')
57
+ echo preg_replace("/[\n\r]+/","",$inline_cart_advert);
58
+ if ($total_discount_amount>0){
59
+ /*?>$('<tr class="qixol_discount"><td class="a-right" colspan="1" > Discount</td><td class="a-right" ><span class="qixol_total_price"><?php echo $this->helper('checkout')->formatPrice($total_discount_amount);; ?></span></td></tr>').appendTo($('#shopping-cart-totals-table tbody'));<?php*//*
60
+ ?>$('#header-cart .subtotal .price').addClass('qixol_price_cross');$('<?php echo $this->helper('checkout')->formatPrice($cart->getGrandTotal()-$total_discount_amount); ?>').appendTo($('#header-cart .subtotal .price').parent());<?php
61
+ }
62
+ ?>});</script><?php
63
+ }*/
64
+ ?>
app/design/frontend/base/default/template/qixol/minicart/default.phtml ADDED
@@ -0,0 +1,238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ $_item = $this->getItem();
29
+ $isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();
30
+ $canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_BEFORE_ORDER_CONFIRM);
31
+ ?>
32
+ <?php /* {{ qixol should be added id */ ?>
33
+ <li class="item" xmlns="http://www.w3.org/1999/html" id='qixol_idx_mcart_item_<?php echo $_item->getId(); ?>'>
34
+ <?php if ($this->hasProductUrl()): ?>
35
+ <a href="<?php echo $this->getProductUrl()?>" title="<?php echo $this->escapeHtml($this->getProductName()) ?>" class="product-image"><img src="<?php echo $this->getProductThumbnail()->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" /></a>
36
+ <?php else: ?>
37
+ <span class="product-image"><img src="<?php echo $this->getProductThumbnail()->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" /></span>
38
+ <?php endif; ?>
39
+ <div class="product-details">
40
+ <?php /* qixol should be added id */ ?>
41
+ <p class="product-name" id='qixol_idx_mcart_item_name_<?php echo $_item->getId(); ?>'><?php if ($this->hasProductUrl()): ?><a href="<?php echo $this->getProductUrl() ?>"><?php endif; ?><?php echo $this->escapeHtml($this->getProductName()) ?><?php if ($this->hasProductUrl()): ?></a><?php endif;
42
+ /* qixol {{ */
43
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')==0&&Mage::getStoreConfig('qixol/advanced/services')!='dontdisplay'):
44
+ foreach ($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['promotions'] as $promotion){
45
+ //inline level promotion
46
+ $is_generated=($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['generated']>0?$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['generated']:$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']);
47
+ if (((int)$promotion['basketlevel']==0||$is_generated>0)&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displaytext'){
48
+ ?><div class="cart_inline_item_promo"><?php echo $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display_text']; ?></div><?php
49
+ }elseif(((int)$promotion['basketlevel']==0||$is_generated>0)&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displayname'){
50
+ ?><div class="cart_inline_item_promo"><?php echo $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['name']; ?></div><?php
51
+ }elseif(((int)$promotion['basketlevel']==0||$is_generated>0)&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displaytype'){
52
+ ?><div class="cart_inline_item_promo"><?php echo $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display']; ?></div><?php
53
+ }
54
+
55
+ }
56
+ endif;
57
+ /* }} end qixol */ ?></p>
58
+
59
+
60
+ <table class="info-wrapper">
61
+ <tbody>
62
+ <tr>
63
+ <th><?php echo $this->__('Price'); ?></th>
64
+ <td id='qixol_idx_mcart_item_price_<?php echo $_item->getId(); ?>'>
65
+ <?php if ($canApplyMsrp): ?>
66
+
67
+ <span class="map-cart-sidebar-item"><?php echo $this->__('See price before order confirmation.'); ?></span>
68
+
69
+ <?php else: ?>
70
+
71
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
72
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
73
+ <?php echo $this->__('Excl. Tax'); ?>:
74
+ <?php endif; ?>
75
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
76
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
77
+ <?php else: ?>
78
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
79
+ <?php endif; ?>
80
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
81
+ <br />
82
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
83
+ <small>
84
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
85
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
86
+ <?php endforeach; ?>
87
+ </small>
88
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
89
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
90
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
91
+ <?php endforeach; ?>
92
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
93
+ <small>
94
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
95
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
96
+ <?php endforeach; ?>
97
+ </small>
98
+ <?php endif; ?>
99
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
100
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
101
+ <?php endif; ?>
102
+ <?php endif; ?>
103
+ <?php endif; ?>
104
+
105
+
106
+
107
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
108
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
109
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
110
+ <br /><?php echo $this->__('Incl. Tax'); ?>:
111
+ <?php endif; ?>
112
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
113
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
114
+ <?php else: ?>
115
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
116
+ <?php endif; ?>
117
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
118
+ <br />
119
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
120
+ <small>
121
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
122
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
123
+ <?php endforeach; ?>
124
+ </small>
125
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
126
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
127
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span>
128
+ <?php endforeach; ?>
129
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
130
+ <small>
131
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
132
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
133
+ <?php endforeach; ?>
134
+ </small>
135
+ <?php endif; ?>
136
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
137
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
138
+ <?php endif; ?>
139
+ <?php endif; ?>
140
+ <?php endif; ?>
141
+
142
+ <?php endif; //Can apply MSRP ?>
143
+ <?php
144
+ //{{qixol
145
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')==0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['updated_price']>0){
146
+ ?><div class="cart_inline_item_new_price">Only for <?php echo $this->helper('checkout')->formatPrice(($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalamount']-$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['totaldiscount'])/$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalquantity']);?></div><?php
147
+ }
148
+ //}}qixol end
149
+ ?>
150
+ </td>
151
+ </tr>
152
+ <tr class="qty-wrapper">
153
+ <th><?php echo $this->__('Qty'); ?></th>
154
+
155
+ <?php /* qixol should be added id */ ?>
156
+ <td id='qixol_idx_mcart_item_qty_<?php echo $_item->getId(); ?>'>
157
+ <?php /*if ($_item->getFreeProduct()>0): ?>
158
+ <div class="cart_inline_item_promo"><?php echo $this->__('free item'); ?></div>
159
+ <?php else :*/ ?>
160
+ <?php /* end qixol add */ ?>
161
+ <input
162
+ id="qinput-<?php echo $_item->getId(); ?>"
163
+ data-link="<?php echo $this->getAjaxUpdateUrl() ?>"
164
+ data-item-id="<?php echo $_item->getId(); ?>"
165
+ data-cart-item-id="<?php echo $_item->getSku(); ?>"
166
+ class="qty cart-item-quantity input-text" name=""
167
+ value="<?php echo $this->getQty()?>"
168
+ <?php if ($this->isOnCheckoutPage()) echo 'disabled'; ?>
169
+ />
170
+
171
+ <button id="qbutton-<?php echo $_item->getId(); ?>"
172
+ data-item-id="<?php echo $_item->getId(); ?>"
173
+ disabled="disabled"
174
+ data-update
175
+ data-cart-item-update
176
+ class="button quantity-button">
177
+ <?php echo $this->__('ok'); ?>
178
+ </button>
179
+ <?php
180
+ //{{qixol
181
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')==0&&($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['updated_price']>0)){
182
+ ?><div class="cart_inline_item_new_price">Only for <?php echo $this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalamount']-$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['totaldiscount']); ?></div><?php
183
+ }
184
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')==0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['new']>0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['generated']>0){
185
+ ?><div class="cart_inline_item_new_price"><?php echo $this->__('Discount: -').$this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalprice']); ?></div><?php
186
+ }else if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')==0&&($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']>0)){
187
+ ?><div class="cart_inline_item_new_price"><?php echo $this->__('Discount: -').$this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalprice']*$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']); ?></div><?php
188
+ }
189
+ //}}qixol end
190
+ ?>
191
+ <?php /* qixol add */ ?>
192
+ <?php //endif ?>
193
+ <?php /* end qixol add */ ?>
194
+ </td>
195
+ </tr>
196
+ </tbody>
197
+ </table>
198
+
199
+ <?php if ($isVisibleProduct&&($_item->getFreeProduct()==0)): ?>
200
+ <a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Edit item')) ?>" class="btn-edit">
201
+ <?php echo $this->__('Edit item')?>
202
+ </a>
203
+ |
204
+ <?php if (!$this->isOnCheckoutPage()): ?>
205
+ <a href="<?php echo $this->getAjaxDeleteUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove This Item')) ?>"
206
+ data-confirm="<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>"
207
+ class="remove">
208
+ <?php echo $this->__('Remove Item') ?>
209
+ </a>
210
+ <?php else: ?>
211
+ <span><?php echo $this->__('Remove Item') ?></span>
212
+ <?php endif; ?>
213
+ <?php endif ?>
214
+
215
+
216
+
217
+ <?php if ($_options = $this->getOptionList()):?>
218
+ <div class="truncated">
219
+ <div class="truncated_full_value">
220
+ <dl class="item-options">
221
+ <?php foreach ($_options as $_option) : ?>
222
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
223
+ <dd>
224
+ <?php if (is_array($_option['value'])): ?>
225
+ <?php echo nl2br(implode("\n", $_option['value'])) ?>
226
+ <?php else: ?>
227
+ <?php echo $_option['value'] ?>
228
+ <?php endif; ?>
229
+ </dd>
230
+ <?php endforeach; ?>
231
+ </dl>
232
+ </div>
233
+ <a href="#" onclick="return false;" class="details"><?php echo $this->__('Details') ?></a>
234
+ </div>
235
+ <?php endif; ?>
236
+
237
+ </div>
238
+ </li>
app/design/frontend/base/default/template/qixol/minicart/mincart.phtml ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Shoping cart sidebar
29
+ *
30
+ * @var Mage_Checkout_Block_Cart_Minicart $this
31
+ */
32
+ ?>
33
+ <?php
34
+ $_cartQty = $this->getSummaryCount();
35
+ if(empty($_cartQty)) {
36
+ $_cartQty = 0;
37
+ }
38
+ ?>
39
+ <div id="minicart-error-message" class="minicart-message"></div>
40
+ <div id="minicart-success-message" class="minicart-message"></div>
41
+
42
+ <div class="minicart-wrapper">
43
+
44
+ <p class="block-subtitle">
45
+ <?php echo $this->__('Recently added item(s)') ?>
46
+ <a class="close skip-link-close" href="#" title="<?php echo $this->quoteEscape($this->__('Close')); ?>">&times;</a>
47
+ </p>
48
+
49
+ <?php $_items = $this->getRecentItems() ?>
50
+ <?php $countItems = count($_items); ?>
51
+ <?php if($countItems): ?>
52
+ <div>
53
+ <ul id="cart-sidebar" class="mini-products-list">
54
+ <?php foreach($_items as $_item): ?>
55
+ <?php
56
+ //{{qixol start wrap block
57
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')==0&&($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']>0)){
58
+ $multiple_coeff=((float)$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['quantity']/(float)$_item->getQty());
59
+ $_item->setQty((string)$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['quantity']);
60
+ //$_item->setPrice($_item->getPrice()*$multiple_coeff);
61
+ //$_item->setBasePrice($_item->getBasePrice()*$multiple_coeff);
62
+ //$_item->setPriceInclTax($_item->getPriceInclTax()*$multiple_coeff);
63
+ //$_item->setBasePriceInclTax($_item->getBasePriceInclTax()*$multiple_coeff);
64
+ //$_item->setBasePriceInclTax($_item->getBasePriceInclTax()*$multiple_coeff);
65
+ $_item->setRowTotal($_item->getRowTotal()*$multiple_coeff);
66
+ $_item->setBaseRowTotal($_item->getBaseRowTotal()*$multiple_coeff);
67
+ $_item->setRowTotalInclTax($_item->getRowTotalInclTax()*$multiple_coeff);
68
+ $_item->setBaseRowTotalInclTax($_item->getBaseRowTotalInclTax()*$multiple_coeff);
69
+
70
+
71
+ unset($multiple_coeff);
72
+ }
73
+ // }} qixol
74
+ ?>
75
+ <?php echo $this->getItemHtml($_item) ?>
76
+ <?php endforeach; ?>
77
+ <?php
78
+ //{{qixol start wrap block
79
+
80
+ if (isset($_SESSION['qixol_quoted_items'])){
81
+ foreach ($_SESSION['qixol_quoted_items']['items'] as $idx_cart=>$item_to_show){
82
+ if ($item_to_show['new']>0&&(int)$item_to_show['data']['isdelivery']==0&&(int)$item_to_show['data']['splitfromlineid']==0){
83
+ if ($productId=Mage::getModel('catalog/product')->getIdBySku((string)$item_to_show['data']['variantcode']!=''?(string)$item_to_show['data']['variantcode']:(string)$item_to_show['data']['productcode'])){
84
+ $productObj = Mage::getModel('catalog/product')->load($productId);
85
+ $quoteItem = Mage::getModel('sales/quote_item')->setStoreId(Mage::app()->getStore()->getId())->setProduct($productObj);
86
+ $quoteItem->setConvertedPrice((string)$item_to_show['data']['price']);
87
+ $quoteItem->setQty((string)$item_to_show['data']['quantity']);
88
+ $quoteItem->setFreeProduct((int)$item_to_show['free_added']);
89
+ $quoteItem->setQuote($this);
90
+ $quoteItem->setId($idx_cart);
91
+ echo $this->getItemHtml($quoteItem);
92
+ }
93
+ }
94
+ }
95
+ if (isset($_SESSION['qixol_quoted_items']['summary'])){
96
+ foreach ($_SESSION['qixol_quoted_items']['summary'] as $inline_cart_promotion)
97
+ if($inline_cart_promotion['data']['basketlevel']>0){
98
+ ?>
99
+ <li class="item odd" xmlns="http://www.w3.org/1999/html">
100
+ <div class="promotion_cart_inline_box" ><?php echo $inline_cart_promotion['data']['display_text'] ?>&nbsp;&nbsp;:&nbsp;&nbsp;<?php
101
+ switch ($inline_cart_promotion['data']['type']){
102
+ case 'DELIVERYREDUCTION';
103
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
104
+ break;
105
+ case 'ISSUEPOINTS';
106
+ echo $inline_cart_promotion['data']['issuedpoints']."&nbsp;pt.";
107
+ break;
108
+ case 'BASKETREDUCTION';
109
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
110
+ break;
111
+ }
112
+ ?></div>
113
+ </li>
114
+ <?
115
+ }
116
+ }
117
+ }
118
+ //}} qixol end wrap block
119
+ ?>
120
+ </ul>
121
+ </div>
122
+ <script type="text/javascript">
123
+ truncateOptions();
124
+ decorateList('cart-sidebar', 'none-recursive');
125
+ $j('document').ready(function() {
126
+ var minicartOptions = {
127
+ formKey: "<?php echo $this->getFormKey();?>"
128
+ }
129
+ var Mini = new Minicart(minicartOptions);
130
+ Mini.init();
131
+ });
132
+ </script>
133
+
134
+ <div id="minicart-widgets">
135
+ <?php echo $this->getChildHtml('cart_promotion') ?>
136
+ </div>
137
+ <div class="block-content">
138
+ <p class="subtotal">
139
+ <?php if ($this->canApplyMsrp()): ?>
140
+ <span class="map-cart-sidebar-total"><?php echo $this->__('ORDER TOTAL WILL BE DISPLAYED BEFORE YOU SUBMIT THE ORDER'); ?></span>
141
+ <?php else: ?>
142
+ <span class="label"><?php echo $this->__('Cart Subtotal:') ?></span> <?php echo Mage::helper('checkout')->formatPrice($this->getSubtotal()) ?>
143
+ <?php if ($_subtotalInclTax = $this->getSubtotalInclTax()): ?>
144
+ <br />(<?php echo Mage::helper('checkout')->formatPrice($_subtotalInclTax) ?> <?php echo Mage::helper('tax')->getIncExcText(true) ?>)
145
+ <?php endif; ?>
146
+ <?php endif; ?>
147
+ </p>
148
+ </div>
149
+
150
+
151
+ <div class="minicart-actions">
152
+ <?php if($_cartQty && $this->isPossibleOnepageCheckout()): ?>
153
+ <ul class="checkout-types minicart">
154
+ <?php echo $this->getChildHtml('extra_actions') ?>
155
+ <li>
156
+ <a title="<?php echo $this->quoteEscape($this->__('Checkout')) ?>" class="button checkout-button" href="<?php echo $this->getCheckoutUrl() ?>">
157
+ <?php echo $this->__('Checkout') ?>
158
+ </a>
159
+ </li>
160
+ </ul>
161
+ <?php endif ?>
162
+ <a class="cart-link" href="<?php echo $this->getUrl('checkout/cart'); ?>">
163
+ <?php echo $this->__('View Shopping Cart'); ?>
164
+ </a>
165
+ </div>
166
+
167
+ <?php else: ?>
168
+ <p class="empty"><?php echo $this->__('You have no items in your shopping cart.') ?></p>
169
+
170
+ <?php endif ?>
171
+ </div>
172
+ <!-- // qixol //-->
173
+ <?php
174
+ //$place_box_in_design_after_pattern=Mage::getStoreConfig('qixol/integraion/boxcartpromotion')
175
+ $place_box_in_design_after_pattern='.cart';
176
+
177
+
178
+ $cart_advertisment_=Mage::getModel('qixol/advert');
179
+ $text_to_show_cart_adv=$cart_advertisment_->getCartInlineAdv();
180
+
181
+ $inline_cart_advert='';
182
+
183
+ //for cart items
184
+ $cart = Mage::getModel('checkout/cart')->getQuote();
185
+ foreach ($cart->getAllItems() as $item) {
186
+ if (isset($_SESSION['qixol_quoted_items'])&&isset($_SESSION['qixol_quoted_items']['items'][$item->getId()])){
187
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')>0 && Mage::getStoreConfig('qixol/advanced/services')!='dontdisplay' &&
188
+ isset($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions']))
189
+ foreach ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions'] as $promotion){
190
+
191
+ //inline level promotion
192
+ if ((int)$promotion['basketlevel']==0&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displayname'){
193
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_promo\">".addslashes($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display_text'])."</div>').appendTo($('#qixol_idx_cart_item_name_".$item->getId()."'));";
194
+ } elseif((int)$promotion['basketlevel']==0&&(Mage::getStoreConfig('qixol/advanced/services')=='displaytext'||Mage::getStoreConfig('qixol/advanced/services')=='displaytype')) {
195
+ if ($cart_promotion_data=Mage::getModel('qixol/promotions')->load($promotion['id'])){
196
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_promo\">".addslashes(Mage::getStoreConfig('qixol/advanced/services')=='displaytype'?$cart_promotion_data->getPromotionType():$cart_promotion_data->getPromotionText())."</div>').appendTo($('#qixol_idx_cart_item_name_".$item->getId()."'));";
197
+ }
198
+ }
199
+
200
+ //basket level promotion
201
+ if ((int)$promotion['basketlevel']==1&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]))
202
+ $text_to_show_cart_adv.='';//should be also added??? $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['display_text'];
203
+
204
+ }
205
+
206
+ //if quantity changed (get one + one free so will be splited to 2 products with 1 free)
207
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')>0&&$_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_qty']>0)
208
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_new_qty\">For&nbsp;promo&nbsp;".addslashes($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['quantity'])."&nbsp;Qty</div>').appendTo($('#qixol_idx_mcart_item_qty_".$item->getId()."'));";
209
+
210
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')>0&&$_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_price']>0)
211
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_new_price\">Only for ".addslashes($this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['lineamount']))."</div>').appendTo($('#qixol_idx_mcart_item_price_".$item->getId()."'));";
212
+
213
+ }
214
+ }
215
+ $total_discount_amount=0;
216
+ if (isset($_SESSION['qixol_quoted_items']['items'])){
217
+ foreach ($_SESSION['qixol_quoted_items']['items'] as $cart_item_process){
218
+ if ($cart_item_process['data']['totaldiscount']>0&&$cart_item_process['new']==0&&((int)Mage::getStoreConfig('qixol/advanced/separateitem')>0||$cart_item_process['data']['generated']==false)){
219
+ $total_discount_amount+=$cart_item_process['data']['totaldiscount'];
220
+ }
221
+ //subtotal are not including delivery
222
+ /*elseif($cart_item_process['data']['totaldiscount']>0&&$cart_item_process['data']['type']=='DELIVERYREDUCTION'){
223
+ $total_discount_amount+=$cart_item_process['data']['totaldiscount'];
224
+ }*/
225
+ }
226
+
227
+ }
228
+
229
+ if (isset($_SESSION['qixol_quoted_items']['summary'])){
230
+ foreach ($_SESSION['qixol_quoted_items']['summary'] as $cart_total_process){
231
+ if ($cart_total_process['data']['discountamount']>0&&$cart_total_process['data']['type']=='BASKETREDUCTION'){
232
+ $total_discount_amount+=$cart_total_process['data']['discountamount'];
233
+ }
234
+ }
235
+ }
236
+
237
+ if ($text_to_show_cart_adv!==false&&strlen($text_to_show_cart_adv)>5||$inline_cart_advert!=''){
238
+ ?><script type="text/javascript" src="http://qixol.holbidev.co.uk/js/lib/jquery/jquery-1.10.2.min.js"></script><script type="text/javascript">$.noConflict();jQuery( document ).ready(function( $ ) { <?php
239
+ //commented -show only on base cart
240
+ /*if ($text_to_show_cart_adv!==false&&strlen($text_to_show_cart_adv)>5)
241
+ echo '$("'.$place_box_in_design_after_pattern.'").after("<div class=\'qixolcartpromo\'>'.$text_to_show_cart_adv.'</div>");';*/
242
+ if ($inline_cart_advert!='')
243
+ echo preg_replace("/[\n\r]+/","",$inline_cart_advert);
244
+ if ($total_discount_amount>0){
245
+ /*?>$('<tr class="qixol_discount"><td class="a-right" colspan="1" > Discount</td><td class="a-right" ><span class="qixol_total_price"><?php echo $this->helper('checkout')->formatPrice($total_discount_amount);; ?></span></td></tr>').appendTo($('#shopping-cart-totals-table tbody'));<?php*/
246
+ ?>$('#header-cart .subtotal .price').addClass('qixol_price_cross');$('<?php echo $this->helper('checkout')->formatPrice($cart->getSubtotal()-$total_discount_amount); ?>').appendTo($('#header-cart .subtotal .price').parent());<?php
247
+ }
248
+ ?>});</script><?php
249
+ }
250
+ ?>
app/design/frontend/base/default/template/qixol/myaccount/order/email/default.phtml ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $_order = $this->getItem()->getOrder() ?>
29
+ <?php
30
+ $promotions_raw=$_order->getPromotionDataApplied();
31
+ if(strlen($promotions_raw)>3){
32
+ $promotions_data_array=unserialize($promotions_raw);
33
+ }
34
+ ?>
35
+ <tbody>
36
+ <tr>
37
+ <td class="cell-content product-info">
38
+ <p class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></p>
39
+ <p class="sku"><?php echo $this->__('SKU'); ?>: <?php echo $this->escapeHtml($this->getSku($_item)) ?></p>
40
+ <?php if ($this->getItemOptions()): ?>
41
+ <dl style="margin:0; padding:0;">
42
+ <?php foreach ($this->getItemOptions() as $option): ?>
43
+ <dt><strong><em><?php echo $option['label'] ?></em></strong></dt>
44
+ <dd style="margin:0; padding:0 0 0 9px;">
45
+ <?php echo nl2br($option['value']) ?>
46
+ </dd>
47
+ <?php endforeach; ?>
48
+ </dl>
49
+ <?php endif; ?>
50
+ <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
51
+ <?php if ($addInfoBlock) :?>
52
+ <?php echo $addInfoBlock->setItem($_item)->toHtml(); ?>
53
+ <?php endif; ?>
54
+ <?php
55
+ //{ qixol
56
+ //maybe should be redeveloped as additional.product.info template block
57
+ if (isset($promotions_data_array['items'][$_item->getQuoteItemId()]['promotions'])){
58
+ foreach ($promotions_data_array['items'][$_item->getQuoteItemId()]['promotions'] as $promotion_data){
59
+ if ($promotion_data['description']!=''){
60
+ echo "<br><span class='cart_inline_item_new_price'>".$this->escapeHtml($promotion_data['description'])."</span><br>";
61
+ }
62
+ }
63
+
64
+ }
65
+ // } end qixol
66
+ ?>
67
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
68
+ </td>
69
+ <td class="cell-content align-center"><?php echo $_item->getQtyOrdered()*1 ?></td>
70
+ <td class="cell-content align-right">
71
+ <?php if ($this->helper('tax')->displaySalesPriceExclTax($_order->getStore()) || $this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
72
+ <?php if ($this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
73
+ <span class="label"><?php echo Mage::helper('tax')->__('Excl. Tax'); ?>:</span>
74
+ <?php endif; ?>
75
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?>
76
+ <?php echo $_order->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
77
+ <?php else: ?>
78
+ <?php echo $_order->formatPrice($_item->getRowTotal()) ?>
79
+ <?php endif; ?>
80
+
81
+
82
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
83
+ <br />
84
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?>
85
+ <small>
86
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
87
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br />
88
+ <?php endforeach; ?>
89
+ </small>
90
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
91
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
92
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></small></span><br />
93
+ <?php endforeach; ?>
94
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?>
95
+ <small>
96
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
97
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount'],true,true); ?></span><br />
98
+ <?php endforeach; ?>
99
+ </small>
100
+ <?php endif; ?>
101
+
102
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
103
+ <br />
104
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $_order->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
105
+ <?php endif; ?>
106
+ <?php endif; ?>
107
+ <?php endif; ?>
108
+
109
+
110
+ <?php if ($this->helper('tax')->displaySalesPriceInclTax($_order->getStore()) || $this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
111
+ <?php if ($this->helper('tax')->displaySalesBothPrices($_order->getStore())): ?>
112
+ <br /><span class="label"><?php echo Mage::helper('tax')->__('Incl. Tax'); ?>:</span>
113
+ <?php endif; ?>
114
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
115
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_order->getStore())): ?>
116
+ <?php echo $_order->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
117
+ <?php else: ?>
118
+ <?php echo $_order->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
119
+ <?php endif; ?>
120
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
121
+ <br />
122
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'email', $_order->getStore())): ?>
123
+ <small>
124
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
125
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
126
+ <?php endforeach; ?>
127
+ </small>
128
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
129
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
130
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
131
+ <?php endforeach; ?>
132
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'email', $_order->getStore())): ?>
133
+ <small>
134
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
135
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $_order->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
136
+ <?php endforeach; ?>
137
+ </small>
138
+ <?php endif; ?>
139
+
140
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_order->getStore())): ?>
141
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $_order->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
142
+ <?php endif; ?>
143
+ <?php endif; ?>
144
+ <?php endif; ?>
145
+ <?php
146
+ if (isset($promotions_data_array['items'][$_item->getQuoteItemId()])&&(int)$promotions_data_array['items'][$_item->getQuoteItemId()]['basketlevel']==0&&(float)$promotions_data_array['items'][$_item->getQuoteItemId()]['discount']>0){
147
+ echo '<div class="cart_inline_item_new_price">'.Mage::helper('qixol')->__("Discount:-").$this->getOrder()->formatPrice($promotions_data_array['items'][$_item->getQuoteItemId()]['discount'])."<div>";
148
+ }
149
+ ?>
150
+
151
+ </td>
152
+ </tr>
153
+ <?php if ($_item->getGiftMessageId() && $_giftMessage = $this->helper('giftmessage/message')->getGiftMessage($_item->getGiftMessageId())): ?>
154
+ <tr>
155
+ <td colspan="4" style=" border-bottom:2px solid #CCCCCC; padding:3px 9px;">
156
+ <strong style="color:#444444; font-size:11px;"><?php echo $this->__('Gift Message') ?></strong>
157
+ <?php echo $this->__('From:'); ?> <?php echo $this->escapeHtml($_giftMessage->getSender()) ?><br />
158
+ <?php echo $this->__('To:'); ?> <?php echo $this->escapeHtml($_giftMessage->getRecipient()) ?><br />
159
+ <strong><?php echo $this->__('Message:'); ?></strong><br /><?php echo $this->escapeHtml($_giftMessage->getMessage()) ?>
160
+ </td>
161
+ </tr>
162
+ <?php endif; ?>
163
+ </tbody>
app/design/frontend/base/default/template/qixol/myaccount/order/email/items.phtml ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php $_order = $this->getOrder(); ?>
29
+
30
+ <?php if ($_order): ?>
31
+ <?php
32
+ $promotions_raw=$_order->getPromotionDataApplied();
33
+ if(strlen($promotions_raw)>3){
34
+ $promotions_data_array=unserialize($promotions_raw);
35
+ }
36
+ ?>
37
+ <?php $_items = $_order->getAllItems(); ?>
38
+ <?php $_itemCount = count($_items); ?>
39
+ <tr>
40
+ <td>
41
+ <table class="items" cellpadding="0" cellspacing="0" border="0">
42
+ <thead>
43
+ <tr>
44
+ <th class="cell-name">
45
+ <?php if($_itemCount > 1): ?>
46
+ <?php echo $this->__('Items in your order'); ?>
47
+ <?php else: ?>
48
+ <?php echo $this->__('Item in your order'); ?>
49
+ <?php endif; ?>
50
+ </th>
51
+ <th class="cell-name align-center">
52
+ <?php echo $this->__('Qty'); ?>
53
+ </th>
54
+ <th class="cell-name align-right">
55
+ <?php echo $this->__('Price'); ?>
56
+ </th>
57
+ </tr>
58
+ </thead>
59
+ <?php $i=0; foreach ($_order->getAllItems() as $_item): ?>
60
+ <?php if($_item->getParentItem()) continue; else $i++; ?>
61
+ <?php echo $this->getItemHtml($_item) ?>
62
+ <?php endforeach; ?>
63
+ <?php
64
+ if (is_array($promotions_data_array['promotion_summary'])&&count($promotions_data_array['promotion_summary'])>0){
65
+ foreach ($promotions_data_array['promotion_summary'] as $inline_cart_promotion){
66
+ if($inline_cart_promotion['data']['basketlevel']>0||$inline_cart_promotion['data']['type']=='ISSUEPOINTS'){
67
+ ?>
68
+ <tbody>
69
+ <tr class='promotion_cart_inline_box'>
70
+ <td class="product-cart-info" colspan='1'><?php echo $inline_cart_promotion['data']['display_text']; ?></td>
71
+ <td class="product-cart-total" colspan='2' style="text-align:right;"><?php
72
+ switch ($inline_cart_promotion['data']['type']){
73
+ case 'DELIVERYREDUCTION';
74
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
75
+ break;
76
+ case 'ISSUEPOINTS';
77
+ echo $inline_cart_promotion['data']['issuedpoints']."&nbsp;pt.";
78
+ break;
79
+ case 'BASKETREDUCTION';
80
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
81
+ break;
82
+ }
83
+ ?></td>
84
+ </tr>
85
+ </tbody>
86
+ <?
87
+ }
88
+ }
89
+ }
90
+ ?>
91
+ </table>
92
+ </td>
93
+ </tr>
94
+ <tr>
95
+ <td>
96
+ <?php echo $this->getChildHtml('order_totals') ?>
97
+ </td>
98
+ </tr>
99
+ <?php if ($this->helper('giftmessage/message')->isMessagesAvailable('order', $_order, $_order->getStore()) && $_order->getGiftMessageId()): ?>
100
+ <?php $_giftMessage = $this->helper('giftmessage/message')->getGiftMessage($_order->getGiftMessageId()); ?>
101
+ <?php if ($_giftMessage): ?>
102
+ <br />
103
+ <table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #EAEAEA;">
104
+ <thead>
105
+ <tr>
106
+ <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><strong><?php echo $this->__('Gift Message for this Order') ?></strong></th>
107
+ </tr>
108
+ </thead>
109
+
110
+ <tbody>
111
+
112
+ <tr>
113
+ <td colspan="4" align="left" style="padding:3px 9px">
114
+ <strong><?php echo $this->__('From:'); ?></strong> <?php echo $this->escapeHtml($_giftMessage->getSender()) ?>
115
+ <br /><strong><?php echo $this->__('To:'); ?></strong> <?php echo $this->escapeHtml($_giftMessage->getRecipient()) ?>
116
+ <br /><strong><?php echo $this->__('Message:'); ?></strong><br /> <?php echo $this->escapeHtml($_giftMessage->getMessage()) ?>
117
+ </td>
118
+ </tr>
119
+ </tbody>
120
+ </table>
121
+ <?php endif; ?>
122
+ <?php endif; ?>
123
+ <?php $_history = $_order->getVisibleStatusHistory() ?>
124
+ <?php if (count($_history)): ?>
125
+ <tr>
126
+ <td>
127
+ <div class="order-additional order-comments">
128
+ <dl class="order-about">
129
+ <?php foreach ($_history as $_historyItem): ?>
130
+ <dt><?php echo $this->formatDate($_historyItem->getCreatedAtStoreDate(), 'medium', true) ?></dt>
131
+ <dd><?php echo $this->escapeHtml($_historyItem->getComment()) ?></dd>
132
+ <?php endforeach; ?>
133
+ </dl>
134
+ </div>
135
+ </td>
136
+ </tr>
137
+ <?php endif; ?>
138
+ <?php endif; ?>
app/design/frontend/base/default/template/qixol/myaccount/order/invoice/default.phtml ADDED
@@ -0,0 +1,328 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php $_order = $this->getItem()->getOrderItem()->getOrder() ?>
29
+ <tr class="border" id="order-item-row-<?php echo $_item->getId() ?>">
30
+ <td><h4 class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></h4>
31
+ <?php if ($_options = $this->getItemOptions()): ?>
32
+ <dl class="item-options">
33
+ <?php foreach ($_options as $_option) : ?>
34
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
35
+ <?php if (!$this->getPrintStatus()): ?>
36
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
37
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>>
38
+ <?php echo $_formatedOptionValue['value'] ?>
39
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
40
+ <div class="truncated_full_value">
41
+ <dl class="item-options">
42
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
43
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
44
+ </dl>
45
+ </div>
46
+ <?php endif; ?>
47
+ </dd>
48
+ <?php else: ?>
49
+ <dd><?php echo $this->escapeHtml((isset($_option['print_value']) ? $_option['print_value'] : $_option['value'])) ?></dd>
50
+ <?php endif; ?>
51
+ <?php endforeach; ?>
52
+ </dl>
53
+ <?php endif; ?>
54
+ <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
55
+ <?php if ($addInfoBlock) : ?>
56
+ <?php echo $addInfoBlock->setItem($_item->getOrderItem())->toHtml(); ?>
57
+ <?php endif; ?>
58
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
59
+ <?php if ($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item->getOrderItem()) && $_item->getGiftMessageId()): ?>
60
+ <a href="#" id="order-item-gift-message-link-<?php echo $_item->getId() ?>" class="gift-message-link"
61
+ onclick="return giftMessageToogle('<?php echo $_item->getId() ?>')"><?php echo $this->__('Gift Message') ?></a>
62
+ <?php endif; ?>
63
+ </td>
64
+ <td><?php echo $this->escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
65
+ <td class="a-right">
66
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
67
+ <span class="price-excl-tax">
68
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
69
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
70
+ <span class="cart-price">
71
+ <?php endif; ?>
72
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
73
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
74
+ </span>
75
+ <?php endif; ?>
76
+ <?php endif; ?>
77
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
78
+ <span class="cart-tax-total"
79
+ onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
80
+ <?php else: ?>
81
+ <span class="cart-price">
82
+ <?php endif; ?>
83
+
84
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
85
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice() + $this->getItem()->getWeeeTaxAppliedAmount() + $this->getItem()->getWeeeTaxDisposition()); ?>
86
+ <?php else: ?>
87
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?>
88
+ <?php endif; ?>
89
+
90
+ </span>
91
+
92
+
93
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
94
+
95
+ <span class="cart-tax-info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>"
96
+ style="display:none;">
97
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
98
+ <small>
99
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
100
+ <span class="nobr"><?php echo $tax['title']; ?>
101
+ : <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
102
+ <?php endforeach; ?>
103
+ </small>
104
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
105
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
106
+ <span class="nobr"><small><?php echo $tax['title']; ?>
107
+ : <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></small></span>
108
+ <?php endforeach; ?>
109
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
110
+ <small>
111
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
112
+ <span class="nobr"><?php echo $tax['title']; ?>
113
+ : <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
114
+ <?php endforeach; ?>
115
+ </small>
116
+ <?php endif; ?>
117
+ </span>
118
+
119
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
120
+ <span class="cart-tax-total"
121
+ onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
122
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>
123
+ :<br/> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice() + $this->getItem()->getWeeeTaxAppliedAmount() + $this->getItem()->getWeeeTaxDisposition()); ?></span>
124
+ </span>
125
+ <?php endif; ?>
126
+ <?php endif; ?>
127
+ </span>
128
+ <br/>
129
+ <?php endif; ?>
130
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
131
+ <span class="price-incl-tax">
132
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
133
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
134
+ <span class="cart-price">
135
+ <?php endif; ?>
136
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
137
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
138
+ </span>
139
+ <?php endif; ?>
140
+ <?php endif; ?>
141
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($this->getItem()); ?>
142
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
143
+ <span class="cart-tax-total"
144
+ onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
145
+ <?php else: ?>
146
+ <span class="cart-price">
147
+ <?php endif; ?>
148
+
149
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
150
+ <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
151
+ <?php else: ?>
152
+ <?php echo $this->getOrder()->formatPrice($_incl - $this->getItem()->getWeeeTaxDisposition()) ?>
153
+ <?php endif; ?>
154
+
155
+ </span>
156
+
157
+
158
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
159
+
160
+ <span class="cart-tax-info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>"
161
+ style="display:none;">
162
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
163
+ <small>
164
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
165
+ <span class="nobr"><?php echo $tax['title']; ?>
166
+ : <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
167
+ <?php endforeach; ?>
168
+ </small>
169
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
170
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
171
+ <span class="nobr"><small><?php echo $tax['title']; ?>
172
+ : <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
173
+ <?php endforeach; ?>
174
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
175
+ <small>
176
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
177
+ <span class="nobr"><?php echo $tax['title']; ?>
178
+ : <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
179
+ <?php endforeach; ?>
180
+ </small>
181
+ <?php endif; ?>
182
+ </span>
183
+
184
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
185
+ <span class="cart-tax-total"
186
+ onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
187
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>
188
+ :<br/> <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
189
+ </span>
190
+ <?php endif; ?>
191
+ <?php endif; ?>
192
+ </span>
193
+ <?php endif; ?>
194
+ </td>
195
+ <td class="a-center"><?php echo $_item->getQty() * 1 ?> </td>
196
+ <td class="a-right">
197
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
198
+ <span class="price-excl-tax">
199
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
200
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
201
+ <span class="cart-price">
202
+ <?php endif; ?>
203
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
204
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
205
+ </span>
206
+ <?php endif; ?>
207
+ <?php endif; ?>
208
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
209
+ <span class="cart-tax-total"
210
+ onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
211
+ <?php else: ?>
212
+ <span class="cart-price">
213
+ <?php endif; ?>
214
+
215
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
216
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal() + $this->getItem()->getWeeeTaxAppliedRowAmount() + $this->getItem()->getWeeeTaxRowDisposition()); ?>
217
+ <?php else: ?>
218
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?>
219
+ <?php endif; ?>
220
+
221
+ </span>
222
+
223
+
224
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
225
+
226
+ <span class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"
227
+ style="display:none;">
228
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
229
+ <small>
230
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
231
+ <span class="nobr"><?php echo $tax['title']; ?>
232
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
233
+ <?php endforeach; ?>
234
+ </small>
235
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
236
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
237
+ <span class="nobr"><small><?php echo $tax['title']; ?>
238
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></small></span>
239
+ <?php endforeach; ?>
240
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
241
+ <small>
242
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
243
+ <span class="nobr"><?php echo $tax['title']; ?>
244
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
245
+ <?php endforeach; ?>
246
+ </small>
247
+ <?php endif; ?>
248
+ </span>
249
+
250
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
251
+ <span class="cart-tax-total"
252
+ onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
253
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>
254
+ :<br/> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal() + $this->getItem()->getWeeeTaxAppliedRowAmount() + $this->getItem()->getWeeeTaxRowDisposition()); ?></span>
255
+ </span>
256
+ <?php endif; ?>
257
+ <?php endif; ?>
258
+ </span>
259
+ <br/>
260
+ <?php endif; ?>
261
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
262
+ <span class="price-incl-tax">
263
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
264
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
265
+ <span class="cart-price">
266
+ <?php endif; ?>
267
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
268
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
269
+ </span>
270
+ <?php endif; ?>
271
+ <?php endif; ?>
272
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($this->getItem()); ?>
273
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
274
+ <span class="cart-tax-total"
275
+ onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
276
+ <?php else: ?>
277
+ <span class="cart-price">
278
+ <?php endif; ?>
279
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
280
+ <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
281
+ <?php else: ?>
282
+ <?php echo $this->getOrder()->formatPrice($_incl - $this->getItem()->getWeeeTaxRowDisposition()) ?>
283
+ <?php endif; ?>
284
+
285
+ </span>
286
+
287
+
288
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
289
+
290
+ <span class="cart-tax-info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>"
291
+ style="display:none;">
292
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
293
+ <small>
294
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
295
+ <span class="nobr"><?php echo $tax['title']; ?>
296
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
297
+ <?php endforeach; ?>
298
+ </small>
299
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
300
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
301
+ <span class="nobr"><small><?php echo $tax['title']; ?>
302
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
303
+ <?php endforeach; ?>
304
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
305
+ <small>
306
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
307
+ <span class="nobr"><?php echo $tax['title']; ?>
308
+ : <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
309
+ <?php endforeach; ?>
310
+ </small>
311
+ <?php endif; ?>
312
+ </span>
313
+
314
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
315
+ <span class="cart-tax-total"
316
+ onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
317
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>
318
+ :<br/> <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
319
+ </span>
320
+ <?php endif; ?>
321
+ <?php endif; ?>
322
+
323
+
324
+
325
+ </span>
326
+ <?php endif; ?>
327
+ </td>
328
+ </tr>
app/design/frontend/base/default/template/qixol/myaccount/order/invoice/invoice.phtml ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_order = $this->getOrder() ?>
28
+ <?php
29
+ $promotions_raw=$_order->getPromotionDataApplied();
30
+ if(strlen($promotions_raw)>3){
31
+ $promotions_data_array=unserialize($promotions_raw);
32
+ }
33
+ ?>
34
+ <h1><?php echo $this->__('Order #%s', $_order->getRealOrderId()) ?></h1>
35
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
36
+ <?php $_invoice = $this->getInvoice() ?>
37
+ <?php if($_invoice): ?>
38
+ <?php $_invoices = array($_invoice); ?>
39
+ <?php else: ?>
40
+ <?php $_invoices = $_order->getInvoiceCollection() ?>
41
+ <?php endif; ?>
42
+ <?php foreach ($_invoices as $_invoice): ?>
43
+ <h2 class="h2"><?php echo $this->__('Invoice #%s', $_invoice->getIncrementId()) ?></h2>
44
+ <div class="col2-set">
45
+ <div class="col-1">
46
+ <?php if (!$_order->getIsVirtual()): ?>
47
+ <h3><?php echo $this->__('Shipping Address') ?></h3>
48
+ <?php $_shipping = $_invoice->getShippingAddress() ?>
49
+ <address><?php echo $_shipping->format('html') ?></address>
50
+ </div>
51
+ <div class="col-2">
52
+ <?php endif; ?>
53
+ <h3><?php echo $this->__('Billing Address') ?></h3>
54
+ <?php $_billing = $_invoice->getbillingAddress() ?>
55
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
56
+ </div>
57
+ <?php if (!$_order->getIsVirtual()): ?>
58
+ </div>
59
+ <div class="col2-set">
60
+ <div class="col-1">
61
+ <h3><?php echo $this->__('Shipping Method') ?></h3>
62
+ <?php echo $this->escapeHtml($_order->getShippingDescription()) ?>
63
+ </div>
64
+ <?php endif; ?>
65
+ <div class="col-2">
66
+ <h3><?php echo $this->__('Payment Method') ?></h3>
67
+ <?php echo $this->getPaymentInfoHtml() ?>
68
+ </div>
69
+ </div>
70
+ <h3><?php echo $this->__('Items Invoiced') ?></h3>
71
+ <table class="data-table" id="my-invoice-table-<?php echo $_invoice->getId(); ?>">
72
+ <col />
73
+ <col width="1" />
74
+ <col width="1" />
75
+ <col width="1" />
76
+ <col width="1" />
77
+ <thead>
78
+ <tr>
79
+ <th><?php echo $this->__('Product Name') ?></th>
80
+ <th><?php echo $this->__('SKU') ?></th>
81
+ <th class="a-right"><?php echo $this->__('Price') ?></th>
82
+ <th class="a-center"><span class="nobr"><?php echo $this->__('Qty Invoiced') ?></span></th>
83
+ <th class="a-right"><?php echo $this->__('Subtotal') ?></th>
84
+ </tr>
85
+ </thead>
86
+ <tfoot>
87
+ <?php echo $this->getInvoiceTotalsHtml($_invoice)?>
88
+ </tfoot>
89
+ <?php $_items = $_invoice->getItemsCollection(); ?>
90
+ <?php $_count = $_items->count(); ?>
91
+ <?php foreach ($_items as $_item): ?>
92
+ <?php if ($_item->getOrderItem()->getParentItem()) continue; ?>
93
+ <tbody>
94
+ <?php echo $this->getItemHtml($_item) ?>
95
+ </tbody>
96
+ <?php endforeach; ?>
97
+ <?php
98
+ if (is_array($promotions_data_array['promotion_summary'])&&count($promotions_data_array['promotion_summary'])>0){
99
+ foreach ($promotions_data_array['promotion_summary'] as $inline_cart_promotion){
100
+ if($inline_cart_promotion['data']['basketlevel']>0||$inline_cart_promotion['data']['type']=='ISSUEPOINTS'){
101
+ ?>
102
+ <tbody>
103
+ <tr class='promotion_cart_inline_box'>
104
+ <td class="product-cart-info" colspan='1'><?php echo $inline_cart_promotion['data']['display_text']; ?></td>
105
+ <td class="product-cart-total" colspan='2' style="text-align:right;"><?php
106
+ switch ($inline_cart_promotion['data']['type']){
107
+ case 'DELIVERYREDUCTION';
108
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
109
+ break;
110
+ case 'ISSUEPOINTS';
111
+ echo $inline_cart_promotion['data']['issuedpoints']."&nbsp;pt.";
112
+ break;
113
+ case 'BASKETREDUCTION';
114
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
115
+ break;
116
+ }
117
+ ?></td>
118
+ </tr>
119
+ </tbody>
120
+ <?
121
+ }
122
+ }
123
+ }
124
+ ?>
125
+ </table>
126
+ <script type="text/javascript">decorateTable('my-invoice-table-<?php echo $_invoice->getId(); ?>', {'tbody' : ['odd', 'even'], 'tbody tr' : ['first', 'last']})</script>
127
+ <?php endforeach; ?>
128
+ <script type="text/javascript">window.print();</script>
app/design/frontend/base/default/template/qixol/myaccount/order/items/default.phtml ADDED
@@ -0,0 +1,347 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php
29
+ $promotions_raw=$_item->getOrder()->getPromotionDataApplied();
30
+ if(strlen($promotions_raw)>3){
31
+ $promotions_data_array=unserialize($promotions_raw);
32
+ }
33
+ ?>
34
+ <tr class="border" id="order-item-row-<?php echo $_item->getId() ?>">
35
+ <td><h3 class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></h3>
36
+ <?php if($_options = $this->getItemOptions()): ?>
37
+ <dl class="item-options">
38
+ <?php foreach ($_options as $_option) : ?>
39
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
40
+ <?php if (!$this->getPrintStatus()): ?>
41
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
42
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>>
43
+ <?php echo $_formatedOptionValue['value'] ?>
44
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
45
+ <div class="truncated_full_value">
46
+ <dl class="item-options">
47
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
48
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
49
+ </dl>
50
+ </div>
51
+ <?php endif; ?>
52
+ </dd>
53
+ <?php else: ?>
54
+ <dd>
55
+ <?php echo nl2br($this->escapeHtml( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) )) ?>
56
+ </dd>
57
+ <?php endif; ?>
58
+ <?php endforeach; ?>
59
+ </dl>
60
+ <?php endif; ?>
61
+ <?php
62
+ //{ qixol
63
+ //maybe should be redeveloped as additional.product.info template block
64
+ if (isset($promotions_data_array['items'][$_item->getQuoteItemId()]['promotions'])){
65
+ foreach ($promotions_data_array['items'][$_item->getQuoteItemId()]['promotions'] as $promotion_data){
66
+ if ($promotion_data['description']!=''){
67
+ echo "<span class='cart_inline_item_new_price'>".$this->escapeHtml($promotion_data['description'])."</span><br>";
68
+ }
69
+ }
70
+
71
+ }
72
+ // } end qixol
73
+ ?>
74
+ <?php $addtInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
75
+ <?php if ($addtInfoBlock) :?>
76
+ <?php echo $addtInfoBlock->setItem($_item)->toHtml(); ?>
77
+ <?php endif; ?>
78
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
79
+ <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?>
80
+ <a href="#" id="order-item-gift-message-link-<?php echo $_item->getId() ?>" class="gift-message-link" onclick="return giftMessageToogle('<?php echo $_item->getId() ?>')"><?php echo $this->__('Gift Message') ?></a>
81
+ <?php endif; ?>
82
+ </td>
83
+ <td><?php echo $this->escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
84
+ <td class="a-right">
85
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
86
+ <span class="price-excl-tax">
87
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
88
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
89
+ <span class="cart-price">
90
+ <?php endif; ?>
91
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
92
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
93
+ </span>
94
+ <?php endif; ?>
95
+ <?php endif; ?>
96
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
97
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
98
+ <?php else: ?>
99
+ <span class="cart-price">
100
+ <?php endif; ?>
101
+
102
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
103
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice() + $this->getItem()->getWeeeTaxAppliedAmount() + $this->getItem()->getWeeeTaxDisposition()); ?>
104
+ <?php else: ?>
105
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?>
106
+ <?php endif; ?>
107
+
108
+ </span>
109
+
110
+
111
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
112
+
113
+ <span class="cart-tax-info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
114
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
115
+ <small>
116
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
117
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
118
+ <?php endforeach; ?>
119
+ </small>
120
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
121
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
122
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></small></span>
123
+ <?php endforeach; ?>
124
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
125
+ <small>
126
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
127
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
128
+ <?php endforeach; ?>
129
+ </small>
130
+ <?php endif; ?>
131
+ </span>
132
+
133
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
134
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
135
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?></span>
136
+ </span>
137
+ <?php endif; ?>
138
+ <?php endif; ?>
139
+ </span>
140
+ <br />
141
+ <?php endif; ?>
142
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
143
+ <span class="price-incl-tax">
144
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
145
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
146
+ <span class="cart-price">
147
+ <?php endif; ?>
148
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
149
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
150
+ </span>
151
+ <?php endif; ?>
152
+ <?php endif; ?>
153
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($this->getItem()); ?>
154
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
155
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
156
+ <?php else: ?>
157
+ <span class="cart-price">
158
+ <?php endif; ?>
159
+
160
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
161
+ <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
162
+ <?php else: ?>
163
+ <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?>
164
+ <?php endif; ?>
165
+
166
+ </span>
167
+
168
+
169
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
170
+
171
+ <span class="cart-tax-info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
172
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
173
+ <small>
174
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
175
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
176
+ <?php endforeach; ?>
177
+ </small>
178
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
179
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
180
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
181
+ <?php endforeach; ?>
182
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
183
+ <small>
184
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
185
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
186
+ <?php endforeach; ?>
187
+ </small>
188
+ <?php endif; ?>
189
+ </span>
190
+
191
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
192
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
193
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
194
+ </span>
195
+ <?php endif; ?>
196
+ <?php endif; ?>
197
+ </span>
198
+ <?php endif; ?>
199
+ </td>
200
+ <td class="a-right">
201
+ <span class="nobr">
202
+ <?php if ($this->getItem()->getQtyOrdered() > 0): ?>
203
+ <?php echo $this->__('Ordered'); ?>: <strong><?php echo $this->getItem()->getQtyOrdered()*1 ?></strong><br />
204
+ <?php endif; ?>
205
+ <?php if ($this->getItem()->getQtyShipped() > 0): ?>
206
+ <?php echo $this->__('Shipped'); ?>: <strong><?php echo $this->getItem()->getQtyShipped()*1 ?></strong><br />
207
+ <?php endif; ?>
208
+ <?php if ($this->getItem()->getQtyCanceled() > 0): ?>
209
+ <?php echo $this->__('Canceled'); ?>: <strong><?php echo $this->getItem()->getQtyCanceled()*1 ?></strong><br />
210
+ <?php endif; ?>
211
+ <?php if ($this->getItem()->getQtyRefunded() > 0): ?>
212
+ <?php echo $this->__('Refunded'); ?>: <strong><?php echo $this->getItem()->getQtyRefunded()*1 ?></strong><br />
213
+ <?php endif; ?>
214
+ </span>
215
+ </td>
216
+ <td class="a-right">
217
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
218
+ <span class="price-excl-tax">
219
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
220
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
221
+ <span class="cart-price">
222
+ <?php endif; ?>
223
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
224
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
225
+ </span>
226
+ <?php endif; ?>
227
+ <?php endif; ?>
228
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
229
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
230
+ <?php else: ?>
231
+ <span class="cart-price">
232
+ <?php endif; ?>
233
+
234
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
235
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?>
236
+ <?php else: ?>
237
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?>
238
+ <?php endif; ?>
239
+
240
+ </span>
241
+
242
+
243
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
244
+
245
+ <span class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
246
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
247
+ <small>
248
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
249
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
250
+ <?php endforeach; ?>
251
+ </small>
252
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
253
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
254
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></small></span>
255
+ <?php endforeach; ?>
256
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
257
+ <small>
258
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
259
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
260
+ <?php endforeach; ?>
261
+ </small>
262
+ <?php endif; ?>
263
+ </span>
264
+
265
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
266
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
267
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?></span>
268
+ </span>
269
+ <?php endif; ?>
270
+ <?php endif; ?>
271
+ </span>
272
+ <br />
273
+ <?php endif; ?>
274
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
275
+ <span class="price-incl-tax">
276
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
277
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
278
+ <span class="cart-price">
279
+ <?php endif; ?>
280
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
281
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
282
+ </span>
283
+ <?php endif; ?>
284
+ <?php endif; ?>
285
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($this->getItem()); ?>
286
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
287
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
288
+ <?php else: ?>
289
+ <span class="cart-price">
290
+ <?php endif; ?>
291
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
292
+ <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
293
+ <?php else: ?>
294
+ <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?>
295
+ <?php endif; ?>
296
+
297
+ </span>
298
+
299
+
300
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
301
+
302
+ <span class="cart-tax-info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
303
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
304
+ <small>
305
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
306
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
307
+ <?php endforeach; ?>
308
+ </small>
309
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
310
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
311
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
312
+ <?php endforeach; ?>
313
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
314
+ <small>
315
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
316
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
317
+ <?php endforeach; ?>
318
+ </small>
319
+ <?php endif; ?>
320
+ </span>
321
+
322
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
323
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
324
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
325
+ </span>
326
+ <?php endif; ?>
327
+ <?php endif; ?>
328
+
329
+
330
+
331
+ </span>
332
+ <?php endif; ?>
333
+ <?php
334
+ if (isset($promotions_data_array['items'][$_item->getQuoteItemId()])&&(int)$promotions_data_array['items'][$_item->getQuoteItemId()]['basketlevel']==0&&(float)$promotions_data_array['items'][$_item->getQuoteItemId()]['discount']>0){
335
+ echo '<div class="cart_inline_item_new_price">'.Mage::helper('qixol')->__("Discount:-").$this->getOrder()->formatPrice($promotions_data_array['items'][$_item->getQuoteItemId()]['discount'])."<div>";
336
+ }
337
+ ?>
338
+ </td>
339
+ <!--
340
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
341
+ <th class="a-right"><?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?></th>
342
+ <?php endif; ?>
343
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
344
+ <th class="a-right"><?php echo $this->getOrder()->formatPrice($this->helper('checkout')->getSubtotalInclTax($this->getItem())); ?></th>
345
+ <?php endif; ?>
346
+ -->
347
+ </tr>
app/design/frontend/base/default/template/qixol/myaccount/order/items/items.phtml ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_order = $this->getOrder(); ?>
28
+ <?php
29
+ $promotions_raw=$_order->getPromotionDataApplied();
30
+ if(strlen($promotions_raw)>3){
31
+ $promotions_data_array=unserialize($promotions_raw);
32
+ }
33
+ ?>
34
+ <table class="data-table" id="my-orders-table" summary="<?php echo Mage::helper('core')->quoteEscape($this->__('Items Ordered')) ?>">
35
+ <col />
36
+ <col width="1" />
37
+ <col width="1" />
38
+ <col width="1" />
39
+ <col width="1" />
40
+ <thead>
41
+ <tr>
42
+ <th><?php echo $this->__('Product Name') ?></th>
43
+ <th><?php echo $this->__('SKU') ?></th>
44
+ <th class="a-right"><?php echo $this->__('Price') ?></th>
45
+ <th class="a-center"><?php echo $this->__('Qty') ?></th>
46
+ <th class="a-right"><?php echo $this->__('Subtotal') ?></th>
47
+ </tr>
48
+ </thead>
49
+ <tfoot>
50
+ <?php echo $this->getChildHtml('order_totals') ?>
51
+ </tfoot>
52
+ <?php $_items = $_order->getItemsCollection(); ?>
53
+ <?php $_index = 0; ?>
54
+ <?php $_count = $_items->count(); ?>
55
+ <?php foreach ($_items as $_item): ?>
56
+ <?php if ($_item->getParentItem()) continue; ?>
57
+ <tbody>
58
+ <?php echo $this->getItemHtml($_item) ?>
59
+ <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?>
60
+ <tr class="border<?php echo ($_index++ > $_count ?' last':'') ?>" id="order-item-gift-message-<?php echo $_item->getId() ?>" style="display:none;">
61
+ <?php $_giftMessage=$this->helper('giftmessage/message')->getGiftMessageForEntity($_item); ?>
62
+ <td class="gift-message-row" colspan="7">
63
+ <a href="#" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Close')) ?>" onclick="return giftMessageToogle('<?php echo $_item->getId() ?>');" class="btn-close"><?php echo $this->__('Close') ?></a>
64
+ <dl class="gift-message">
65
+ <dt><strong><?php echo $this->__('From:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getRecipient()) ?></dt>
66
+ <dt><strong><?php echo $this->__('To:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getSender()) ?></dt>
67
+ <dd><?php echo $this->helper('giftmessage/message')->getEscapedGiftMessage($_item) ?></dd>
68
+ </dl>
69
+ </td>
70
+ </tr>
71
+ <?php endif ?>
72
+ </tbody>
73
+ <?php endforeach; ?>
74
+ <?php
75
+
76
+
77
+
78
+
79
+ if (is_array($promotions_data_array['promotion_summary'])&&count($promotions_data_array['promotion_summary'])>0){
80
+ foreach ($promotions_data_array['promotion_summary'] as $inline_cart_promotion){
81
+ if($inline_cart_promotion['data']['basketlevel']>0||$inline_cart_promotion['data']['type']=='ISSUEPOINTS'){
82
+ ?>
83
+ <tbody>
84
+ <tr class='promotion_cart_inline_box'>
85
+ <td class="product-cart-info" colspan='3'><?php echo $inline_cart_promotion['data']['display_text']; ?></td>
86
+ <td class="product-cart-total" colspan='2' style="text-align:right;"><?php
87
+ switch ($inline_cart_promotion['data']['type']){
88
+ case 'DELIVERYREDUCTION';
89
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
90
+ break;
91
+ case 'ISSUEPOINTS';
92
+ echo $inline_cart_promotion['data']['issuedpoints']."&nbsp;pt.";
93
+ break;
94
+ case 'BASKETREDUCTION';
95
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
96
+ break;
97
+ }
98
+ ?></td>
99
+ </tr>
100
+ </tbody>
101
+ <?
102
+ }
103
+ }
104
+ }
105
+
106
+ ?>
107
+
108
+ </table>
109
+ <script type="text/javascript">decorateTable('my-orders-table', {'tbody' : ['odd', 'even'], 'tbody tr' : ['first', 'last']})</script>
app/design/frontend/base/default/template/qixol/myaccount/order/print/default.phtml ADDED
@@ -0,0 +1,347 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem() ?>
28
+ <?php
29
+ $promotions_raw=$_item->getOrder()->getPromotionDataApplied();
30
+ if(strlen($promotions_raw)>3){
31
+ $promotions_data_array=unserialize($promotions_raw);
32
+ }
33
+ ?>
34
+ <tr class="border" id="order-item-row-<?php echo $_item->getId() ?>">
35
+ <td><h3 class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></h3>
36
+ <?php if($_options = $this->getItemOptions()): ?>
37
+ <dl class="item-options">
38
+ <?php foreach ($_options as $_option) : ?>
39
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
40
+ <?php if (!$this->getPrintStatus()): ?>
41
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
42
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>>
43
+ <?php echo $_formatedOptionValue['value'] ?>
44
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
45
+ <div class="truncated_full_value">
46
+ <dl class="item-options">
47
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
48
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
49
+ </dl>
50
+ </div>
51
+ <?php endif; ?>
52
+ </dd>
53
+ <?php else: ?>
54
+ <dd>
55
+ <?php echo nl2br($this->escapeHtml( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) )) ?>
56
+ </dd>
57
+ <?php endif; ?>
58
+ <?php endforeach; ?>
59
+ </dl>
60
+ <?php endif; ?>
61
+ <?php $addtInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
62
+ <?php
63
+ //{ qixol
64
+ //maybe should be redeveloped as additional.product.info template block
65
+ if (isset($promotions_data_array['items'][$_item->getQuoteItemId()]['promotions'])){
66
+ foreach ($promotions_data_array['items'][$_item->getQuoteItemId()]['promotions'] as $promotion_data){
67
+ if ($promotion_data['description']!=''){
68
+ echo "<span class='cart_inline_item_new_price'><b>".$this->escapeHtml($promotion_data['description'])."</b></span><br>";
69
+ }
70
+ }
71
+
72
+ }
73
+ // } end qixol
74
+ ?>
75
+ <?php if ($addtInfoBlock) :?>
76
+ <?php echo $addtInfoBlock->setItem($_item)->toHtml(); ?>
77
+ <?php endif; ?>
78
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
79
+ <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?>
80
+ <a href="#" id="order-item-gift-message-link-<?php echo $_item->getId() ?>" class="gift-message-link" onclick="return giftMessageToogle('<?php echo $_item->getId() ?>')"><?php echo $this->__('Gift Message') ?></a>
81
+ <?php endif; ?>
82
+ </td>
83
+ <td><?php echo $this->escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
84
+ <td class="a-right">
85
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
86
+ <span class="price-excl-tax">
87
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
88
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
89
+ <span class="cart-price">
90
+ <?php endif; ?>
91
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
92
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
93
+ </span>
94
+ <?php endif; ?>
95
+ <?php endif; ?>
96
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
97
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
98
+ <?php else: ?>
99
+ <span class="cart-price">
100
+ <?php endif; ?>
101
+
102
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
103
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice() + $this->getItem()->getWeeeTaxAppliedAmount() + $this->getItem()->getWeeeTaxDisposition()); ?>
104
+ <?php else: ?>
105
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?>
106
+ <?php endif; ?>
107
+
108
+ </span>
109
+
110
+
111
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
112
+
113
+ <span class="cart-tax-info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
114
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
115
+ <small>
116
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
117
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
118
+ <?php endforeach; ?>
119
+ </small>
120
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
121
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
122
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></small></span>
123
+ <?php endforeach; ?>
124
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
125
+ <small>
126
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
127
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
128
+ <?php endforeach; ?>
129
+ </small>
130
+ <?php endif; ?>
131
+ </span>
132
+
133
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
134
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
135
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?></span>
136
+ </span>
137
+ <?php endif; ?>
138
+ <?php endif; ?>
139
+ </span>
140
+ <br />
141
+ <?php endif; ?>
142
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
143
+ <span class="price-incl-tax">
144
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
145
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
146
+ <span class="cart-price">
147
+ <?php endif; ?>
148
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
149
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
150
+ </span>
151
+ <?php endif; ?>
152
+ <?php endif; ?>
153
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($this->getItem()); ?>
154
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
155
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
156
+ <?php else: ?>
157
+ <span class="cart-price">
158
+ <?php endif; ?>
159
+
160
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
161
+ <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
162
+ <?php else: ?>
163
+ <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?>
164
+ <?php endif; ?>
165
+
166
+ </span>
167
+
168
+
169
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
170
+
171
+ <span class="cart-tax-info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
172
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
173
+ <small>
174
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
175
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
176
+ <?php endforeach; ?>
177
+ </small>
178
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
179
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
180
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
181
+ <?php endforeach; ?>
182
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
183
+ <small>
184
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
185
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
186
+ <?php endforeach; ?>
187
+ </small>
188
+ <?php endif; ?>
189
+ </span>
190
+
191
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
192
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
193
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
194
+ </span>
195
+ <?php endif; ?>
196
+ <?php endif; ?>
197
+ </span>
198
+ <?php endif; ?>
199
+ </td>
200
+ <td class="a-right">
201
+ <span class="nobr">
202
+ <?php if ($this->getItem()->getQtyOrdered() > 0): ?>
203
+ <?php echo $this->__('Ordered'); ?>: <strong><?php echo $this->getItem()->getQtyOrdered()*1 ?></strong><br />
204
+ <?php endif; ?>
205
+ <?php if ($this->getItem()->getQtyShipped() > 0): ?>
206
+ <?php echo $this->__('Shipped'); ?>: <strong><?php echo $this->getItem()->getQtyShipped()*1 ?></strong><br />
207
+ <?php endif; ?>
208
+ <?php if ($this->getItem()->getQtyCanceled() > 0): ?>
209
+ <?php echo $this->__('Canceled'); ?>: <strong><?php echo $this->getItem()->getQtyCanceled()*1 ?></strong><br />
210
+ <?php endif; ?>
211
+ <?php if ($this->getItem()->getQtyRefunded() > 0): ?>
212
+ <?php echo $this->__('Refunded'); ?>: <strong><?php echo $this->getItem()->getQtyRefunded()*1 ?></strong><br />
213
+ <?php endif; ?>
214
+ </span>
215
+ </td>
216
+ <td class="a-right">
217
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
218
+ <span class="price-excl-tax">
219
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
220
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
221
+ <span class="cart-price">
222
+ <?php endif; ?>
223
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
224
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
225
+ </span>
226
+ <?php endif; ?>
227
+ <?php endif; ?>
228
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
229
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
230
+ <?php else: ?>
231
+ <span class="cart-price">
232
+ <?php endif; ?>
233
+
234
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
235
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?>
236
+ <?php else: ?>
237
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?>
238
+ <?php endif; ?>
239
+
240
+ </span>
241
+
242
+
243
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
244
+
245
+ <span class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
246
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
247
+ <small>
248
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
249
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
250
+ <?php endforeach; ?>
251
+ </small>
252
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
253
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
254
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></small></span>
255
+ <?php endforeach; ?>
256
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
257
+ <small>
258
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
259
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
260
+ <?php endforeach; ?>
261
+ </small>
262
+ <?php endif; ?>
263
+ </span>
264
+
265
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
266
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
267
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?></span>
268
+ </span>
269
+ <?php endif; ?>
270
+ <?php endif; ?>
271
+ </span>
272
+ <br />
273
+ <?php endif; ?>
274
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
275
+ <span class="price-incl-tax">
276
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
277
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
278
+ <span class="cart-price">
279
+ <?php endif; ?>
280
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
281
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
282
+ </span>
283
+ <?php endif; ?>
284
+ <?php endif; ?>
285
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($this->getItem()); ?>
286
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
287
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
288
+ <?php else: ?>
289
+ <span class="cart-price">
290
+ <?php endif; ?>
291
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
292
+ <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
293
+ <?php else: ?>
294
+ <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?>
295
+ <?php endif; ?>
296
+
297
+ </span>
298
+
299
+
300
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
301
+
302
+ <span class="cart-tax-info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
303
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
304
+ <small>
305
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
306
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
307
+ <?php endforeach; ?>
308
+ </small>
309
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
310
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
311
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
312
+ <?php endforeach; ?>
313
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
314
+ <small>
315
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
316
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
317
+ <?php endforeach; ?>
318
+ </small>
319
+ <?php endif; ?>
320
+ </span>
321
+
322
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
323
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
324
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
325
+ </span>
326
+ <?php endif; ?>
327
+ <?php endif; ?>
328
+
329
+
330
+
331
+ </span>
332
+ <?php endif; ?>
333
+ <?php
334
+ if (isset($promotions_data_array['items'][$_item->getQuoteItemId()])&&(int)$promotions_data_array['items'][$_item->getQuoteItemId()]['basketlevel']==0&&(float)$promotions_data_array['items'][$_item->getQuoteItemId()]['discount']>0){
335
+ echo '<div class="cart_inline_item_new_price"><b>'.Mage::helper('qixol')->__("Discount:-").$this->getOrder()->formatPrice($promotions_data_array['items'][$_item->getQuoteItemId()]['discount'])."</b><div>";
336
+ }
337
+ ?>
338
+ </td>
339
+ <!--
340
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
341
+ <th class="a-right"><?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?></th>
342
+ <?php endif; ?>
343
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
344
+ <th class="a-right"><?php echo $this->getOrder()->formatPrice($this->helper('checkout')->getSubtotalInclTax($this->getItem())); ?></th>
345
+ <?php endif; ?>
346
+ -->
347
+ </tr>
app/design/frontend/base/default/template/qixol/myaccount/order/print/messages.phtml ADDED
@@ -0,0 +1 @@
 
1
+ !!!!!
app/design/frontend/base/default/template/qixol/myaccount/order/print/print.phtml ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_order = $this->getOrder() ?>
28
+ <?php
29
+ $promotions_raw=$_order->getPromotionDataApplied();
30
+ if(strlen($promotions_raw)>3){
31
+ $promotions_data_array=unserialize($promotions_raw);
32
+ }
33
+ ?>
34
+ <h1><?php echo $this->__('Order #%s', $_order->getRealOrderId()) ?></h1>
35
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
36
+ <div class="col2-set">
37
+ <?php if (!$_order->getIsVirtual()): ?>
38
+ <div class="col-1">
39
+ <h2><?php echo $this->__('Shipping Address') ?></h2>
40
+ <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
41
+ </div>
42
+ <div class="col-2">
43
+ <?php else: ?>
44
+ <div class="col-1">
45
+ <?php endif; ?>
46
+ <h2><?php echo $this->__('Billing Address') ?></h2>
47
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
48
+ </div>
49
+ <?php if (!$_order->getIsVirtual()): ?>
50
+ </div>
51
+ <div class="col2-set">
52
+ <div class="col-1">
53
+ <h2><?php echo $this->__('Shipping Method') ?></h2>
54
+ <?php echo $this->escapeHtml($_order->getShippingDescription()) ?>
55
+ </div>
56
+ <?php endif; ?>
57
+ <div class="col-2">
58
+ <h2><?php echo $this->__('Payment Method') ?></h2>
59
+ <?php echo $this->getPaymentInfoHtml() ?>
60
+ </div>
61
+ </div>
62
+ <h2><?php echo $this->__('Items Ordered') ?></h2>
63
+ <table class="data-table" id="my-orders-table">
64
+ <col />
65
+ <col width="1" />
66
+ <col width="1" />
67
+ <col width="1" />
68
+ <col width="1" />
69
+ <thead>
70
+ <tr>
71
+ <th><?php echo $this->__('Product Name') ?></th>
72
+ <th><?php echo $this->__('SKU') ?></th>
73
+ <th class="a-right"><?php echo $this->__('Price') ?></th>
74
+ <th class="a-center"><?php echo $this->__('Qty') ?></th>
75
+ <th class="a-right"><?php echo $this->__('Subtotal') ?></th>
76
+ </tr>
77
+ </thead>
78
+ <tfoot>
79
+ <?php echo $this->getChildHtml('order_totals') ?>
80
+ </tfoot>
81
+ <?php $_items = $_order->getItemsCollection(); ?>
82
+ <?php $_count = $_items->count(); ?>
83
+ <?php foreach ($_items as $_item): ?>
84
+ <?php if ($_item->getParentItem()) continue; ?>
85
+ <tbody>
86
+ <?php echo $this->getItemHtml($_item) ?>
87
+ </tbody>
88
+ <?php endforeach; ?>
89
+ <?php
90
+
91
+ if (is_array($promotions_data_array['promotion_summary'])&&count($promotions_data_array['promotion_summary'])>0){
92
+ foreach ($promotions_data_array['promotion_summary'] as $inline_cart_promotion){
93
+ if($inline_cart_promotion['data']['basketlevel']>0||$inline_cart_promotion['data']['type']=='ISSUEPOINTS'){
94
+ ?>
95
+ <tbody>
96
+ <tr class='promotion_cart_inline_box'>
97
+ <td class="product-cart-info" colspan='3'><?php echo $inline_cart_promotion['data']['display_text']; ?></td>
98
+ <td class="product-cart-total" colspan='2' style="text-align:right;"><?php
99
+ switch ($inline_cart_promotion['data']['type']){
100
+ case 'DELIVERYREDUCTION';
101
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
102
+ break;
103
+ case 'ISSUEPOINTS';
104
+ echo $inline_cart_promotion['data']['issuedpoints']."&nbsp;pt.";
105
+ break;
106
+ case 'BASKETREDUCTION';
107
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
108
+ break;
109
+ }
110
+ ?></td>
111
+ </tr>
112
+ </tbody>
113
+ <?
114
+ }
115
+ }
116
+ }
117
+
118
+ ?>
119
+ </table>
120
+ <script type="text/javascript">decorateTable('my-orders-table', {'tbody' : ['odd', 'even'], 'tbody tr' : ['first', 'last']})</script>
121
+ <script type="text/javascript">window.print();</script>
122
+ <?php $_history = $this->getOrder()->getVisibleStatusHistory() ?>
123
+ <?php if (count($_history)): ?>
124
+ <div class="order-additional order-comments">
125
+ <dl class="order-about">
126
+ <?php foreach ($_history as $_historyItem): ?>
127
+ <dt><?php echo $this->formatDate($_historyItem->getCreatedAtStoreDate(), 'medium', true) ?></dt>
128
+ <dd><?php echo $this->escapeHtml($_historyItem->getComment()) ?></dd>
129
+ <?php endforeach; ?>
130
+ </dl>
131
+ </div>
132
+ <?php endif; ?>
app/design/frontend/base/default/template/qixol/onepage/advert.phtml ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //$place_box_in_design_after_pattern=Mage::getStoreConfig('qixol/integraion/boxcartpromotion')
3
+ $place_box_in_design_after_pattern='.cart';
4
+
5
+
6
+ $cart_advertisment_=Mage::getModel('qixol/advert');
7
+ $text_to_show_cart_adv=$cart_advertisment_->getCartInlineAdv();
8
+
9
+ $inline_cart_advert='';
10
+ $total_discount_amount=0;
11
+ $delivery_discount_amount=0;
12
+ //for cart items
13
+ $cart = Mage::getModel('checkout/cart')->getQuote();
14
+ foreach ($cart->getAllItems() as $item) {
15
+ if (isset($_SESSION['qixol_quoted_items'])&&isset($_SESSION['qixol_quoted_items']['items'][$item->getId()])){
16
+ if ((int)Mage::getStoreConfig('qixol/frontend/onepagejavascr')>0 && Mage::getStoreConfig('qixol/advanced/services')!='dontdisplay' &&
17
+ isset($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions']))
18
+ foreach ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions'] as $promotion){
19
+ //inline level promotion
20
+ if ((int)$promotion['basketlevel']==0&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displaytext'){
21
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_promo\">".addslashes($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display_text'])."</div>').appendTo($('#qixol_idx_cart_item_name_".$item->getId()."'));";
22
+ } elseif((int)$promotion['basketlevel']==0&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displayname') {
23
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_promo\">".addslashes($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['name'])."</div>').appendTo($('#qixol_idx_cart_item_name_".$item->getId()."'));";
24
+
25
+ } elseif((int)$promotion['basketlevel']==0&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displaytype') {
26
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_promo\">".addslashes($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display'])."</div>').appendTo($('#qixol_idx_cart_item_name_".$item->getId()."'));";
27
+
28
+ }
29
+
30
+ //basket level promotion
31
+ if ((int)$promotion['basketlevel']==1&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]))
32
+ $text_to_show_cart_adv.='';//should be also added??? $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['display_text'];
33
+
34
+ }
35
+
36
+ //if quantity changed (get one + one free so will be splited to 2 products with 1 free)
37
+ if ((int)Mage::getStoreConfig('qixol/frontend/onepagejavascr')>0 && $_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_qty']>0)
38
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_new_qty\">For&nbsp;promo&nbsp;".addslashes($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['quantity'])."&nbsp;Qty</div>').appendTo($('#qixol_idx_cart_item_qty_".$item->getId()."'));";
39
+
40
+ if ((int)Mage::getStoreConfig('qixol/frontend/onepagejavascr')>0 && $_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_price']>0)
41
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_new_price\">Only for ".addslashes($this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['lineamount']))."</div>').appendTo($('#qixol_idx_cart_item_price_".$item->getId()."'));";
42
+ }
43
+ }
44
+
45
+ if (isset($_SESSION['qixol_quoted_items']['items'])){
46
+ foreach ($_SESSION['qixol_quoted_items']['items'] as $cart_item_process){
47
+ if ($cart_item_process['data']['totaldiscount']>0&&$cart_item_process['new']==0&&((int)Mage::getStoreConfig('qixol/advanced/separateitem')>0||$cart_item_process['data']['generated']==false)){
48
+ $total_discount_amount+=$cart_item_process['data']['totaldiscount'];
49
+ }/*elseif($cart_item_process['data']['isdelivery']){
50
+ foreach ($cart_item_process['promotions'] as $delivery_promotion){
51
+ if ($delivery_promotion['discountamount']>0){
52
+ $delivery_discount_amount+=$delivery_promotion['discountamount'];
53
+ }
54
+ }
55
+ }*/
56
+ }
57
+ }
58
+ if (isset($_SESSION['qixol_quoted_items']['cart_data']['deliverytotaldiscount'])){
59
+ $delivery_discount_amount=$_SESSION['qixol_quoted_items']['cart_data']['deliverytotaldiscount'];
60
+ }
61
+
62
+ if (isset($_SESSION['qixol_quoted_items']['summary'])){
63
+ foreach ($_SESSION['qixol_quoted_items']['summary'] as $cart_total_process){
64
+ if ($cart_total_process['data']['discountamount']>0&&$cart_total_process['data']['type']=='BASKETREDUCTION'){
65
+ $total_discount_amount+=$cart_total_process['data']['discountamount'];
66
+ }
67
+ }
68
+ }
69
+
70
+
71
+ if ($text_to_show_cart_adv!==false&&strlen($text_to_show_cart_adv)>5||$inline_cart_advert!=''||$total_discount_amount>0){
72
+ ?><script type="text/javascript" src="<?php echo Mage::getBaseUrl('js'); ?>/lib/jquery/jquery-1.10.2.min.js"></script><script type="text/javascript">jQuery( document ).ready(function( $ ) {<?php
73
+ if ($text_to_show_cart_adv!==false&&strlen($text_to_show_cart_adv)>5)
74
+ echo '$("'.$place_box_in_design_after_pattern.'").after("<div class=\'qixolcartpromo\'>'.$text_to_show_cart_adv.'</div>");';
75
+ if ($inline_cart_advert!='')
76
+ echo preg_replace("/[\n\r]+/","",$inline_cart_advert);
77
+ if ($total_discount_amount>0||$delivery_discount_amount>0){
78
+ if ($delivery_discount_amount>0){
79
+ ?>$('<tr class="qixol_review_discount"><td class="a-right" colspan="3" ><?php echo Mage::helper('qixol')->__("Delivery Discount");?></td><td class="a-right" ><span class="qixol_review_total_price"><?php echo $this->helper('checkout')->formatPrice($delivery_discount_amount);; ?></span></td></tr>').insertBefore($('#checkout-review-table tfoot tr:last'));<?php
80
+ }
81
+ if ($total_discount_amount>0){
82
+ ?>$('<tr class="qixol_review_discount"><td class="a-right" colspan="3" ><?php echo Mage::helper('qixol')->__("Products Discount");?></td><td class="a-right" ><span class="qixol_review_total_price"><?php echo $this->helper('checkout')->formatPrice($total_discount_amount);; ?></span></td></tr>').insertBefore($('#checkout-review-table tfoot tr:last'));<?php
83
+ }
84
+ ?>$('#checkout-review-table tfoot strong .price').addClass('qixol_price_cross');$('<span class="qixol_grand_total_price"><?php echo $this->helper('checkout')->formatPrice($cart->getGrandTotal()-$total_discount_amount-$delivery_discount_amount); ?></span>').appendTo($('#checkout-review-table tfoot strong .price').parent());<?php
85
+ }
86
+ ?>});</script><?php
87
+ }
88
+ ?>
app/design/frontend/base/default/template/qixol/onepage/item.phtml ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php $_item = $this->getItem()?>
28
+ <?php /* {{ qixol should be added id */ ?>
29
+ <tr id='qixol_idx_cart_item_<?php echo $_item->getId(); ?>'>
30
+ <?php /* }} qixol end should be added id */ ?>
31
+ <?php /* {{ qixol should be added id */ ?>
32
+ <td id='qixol_idx_cart_item_name_<?php echo $_item->getId(); ?>'><h3 class="product-name"><?php echo $this->escapeHtml($this->getProductName()) ?></h3>
33
+ <?php if ($_options = $this->getOptionList()):?>
34
+ <dl class="item-options">
35
+ <?php foreach ($_options as $_option) : ?>
36
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
37
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
38
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
39
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
40
+ <div class="truncated_full_value">
41
+ <dl class="item-options">
42
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
43
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
44
+ </dl>
45
+ </div>
46
+ <?php endif; ?>
47
+ </dd>
48
+ <?php endforeach; ?>
49
+ </dl>
50
+ <?php endif;?>
51
+ <?php if ($addtInfoBlock = $this->getProductAdditionalInformationBlock()):?>
52
+ <?php echo $addtInfoBlock->setItem($_item)->toHtml() ?>
53
+ <?php endif; /* qixol {{ */
54
+ if ((int)Mage::getStoreConfig('qixol/frontend/onepagejavascr')==0&&Mage::getStoreConfig('qixol/advanced/services')!='dontdisplay'):
55
+ foreach ($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['promotions'] as $promotion){
56
+ //inline level promotion
57
+ $is_generated=($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['generated']>0?$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['generated']:$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']);
58
+ if (((int)$promotion['basketlevel']==0||$is_generated>0)&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displaytext'){
59
+ ?><div class="cart_inline_item_promo"><?php echo $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display_text']; ?></div><?php
60
+ }elseif(((int)$promotion['basketlevel']==0||$is_generated>0)&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displayname'){
61
+ ?><div class="cart_inline_item_promo"><?php echo $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['name']; ?></div><?php
62
+ }elseif(((int)$promotion['basketlevel']==0||$is_generated>0)&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displaytype'){
63
+ ?><div class="cart_inline_item_promo"><?php echo $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display']; ?></div><?php
64
+ }
65
+
66
+ }
67
+ endif;
68
+ /* }} end qixol */ ?>
69
+ </td>
70
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
71
+ <td class="a-right">
72
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
73
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
74
+ <?php else: ?>
75
+ <span class="cart-price">
76
+ <?php endif; ?>
77
+
78
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
79
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
80
+ <?php else: ?>
81
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
82
+ <?php endif; ?>
83
+
84
+ </span>
85
+
86
+
87
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
88
+
89
+ <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
90
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
91
+ <small>
92
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
93
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
94
+ <?php endforeach; ?>
95
+ </small>
96
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
97
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
98
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></small></span><br />
99
+ <?php endforeach; ?>
100
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
101
+ <small>
102
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
103
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
104
+ <?php endforeach; ?>
105
+ </small>
106
+ <?php endif; ?>
107
+ </div>
108
+
109
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
110
+ <div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
111
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
112
+ </div>
113
+ <?php endif; ?>
114
+ <?php endif; ?>
115
+ </td>
116
+ <?php endif; ?>
117
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
118
+ <td>
119
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
120
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
121
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
122
+ <?php else: ?>
123
+ <span class="cart-price">
124
+ <?php endif; ?>
125
+
126
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
127
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
128
+ <?php else: ?>
129
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
130
+ <?php endif; ?>
131
+
132
+ </span>
133
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
134
+
135
+ <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
136
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
137
+ <small>
138
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
139
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
140
+ <?php endforeach; ?>
141
+ </small>
142
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
143
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
144
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
145
+ <?php endforeach; ?>
146
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
147
+ <small>
148
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
149
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
150
+ <?php endforeach; ?>
151
+ </small>
152
+ <?php endif; ?>
153
+ </div>
154
+
155
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
156
+ <div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
157
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
158
+ </div>
159
+ <?php endif; ?>
160
+ <?php endif; ?>
161
+ </td>
162
+ <?php endif; ?>
163
+ <?php /* qixol should be added id */ ?>
164
+ <td class="a-center" id='qixol_idx_cart_item_qty_<?php echo $_item->getId(); ?>'><?php echo $_item->getQty();
165
+ //{{qixol
166
+ /*if ((int)Mage::getStoreConfig('qixol/frontend/onepagejavascr')==0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['updated_qty']>0){
167
+ ?><div class="cart_inline_item_new_qty">For&nbsp;promo&nbsp;<?php echo $_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['quantity'];?>&nbsp;Qty</div><?php
168
+ }
169
+ if ((int)Mage::getStoreConfig('qixol/frontend/onepagejavascr')==0&&($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']>0)){
170
+ ?><div class="cart_inline_item_new_price">+ <?php echo $_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']; ?> free</div><?php
171
+ }*/
172
+ //}}qixol end
173
+ ?></td>
174
+ <!-- sub total starts here -->
175
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
176
+ <?php /* qixol should be added id */ ?>
177
+ <td class="a-right" id='qixol_idx_cart_item_price_<?php echo $_item->getId(); ?>'>
178
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
179
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
180
+ <?php else: ?>
181
+ <span class="cart-price">
182
+ <?php endif; ?>
183
+
184
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
185
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
186
+ <?php else: ?>
187
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()) ?>
188
+ <?php endif; ?>
189
+
190
+ </span>
191
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
192
+
193
+ <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
194
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
195
+ <small>
196
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
197
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span><br />
198
+ <?php endforeach; ?>
199
+ </small>
200
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
201
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
202
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></small></span><br />
203
+ <?php endforeach; ?>
204
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
205
+ <small>
206
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
207
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span><br />
208
+ <?php endforeach; ?>
209
+ </small>
210
+ <?php endif; ?>
211
+ </div>
212
+
213
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
214
+ <div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
215
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
216
+ </div>
217
+ <?php endif; ?>
218
+ <?php endif; ?>
219
+ <?php
220
+ //{{qixol
221
+ if ((int)Mage::getStoreConfig('qixol/frontend/onepagejavascr')==0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['updated_price']>0){
222
+ ?><div class="cart_inline_item_new_price">Only for <?php echo $this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalamount']-$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['totaldiscount']); ?></div><?php
223
+ }
224
+ if ((int)Mage::getStoreConfig('qixol/frontend/onepagejavascr')==0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['new']>0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['generated']>0){
225
+ ?><div class="cart_inline_item_new_price"><?php echo $this->__('Discount: -').$this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalprice']); ?></div><?php
226
+ }else if ((int)Mage::getStoreConfig('qixol/frontend/onepagejavascr')==0&&($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']>0)){
227
+ ?><div class="cart_inline_item_new_price"><?php echo $this->__('Discount: -').$this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalprice']*$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']); ?></div><?php
228
+ }
229
+ //}}qixol end
230
+ ?>
231
+ </td>
232
+ <?php endif; ?>
233
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
234
+ <td id='qixol_idx_cart_item_price_<?php echo $_item->getId(); ?>'>
235
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
236
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
237
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
238
+ <?php else: ?>
239
+ <span class="cart-price">
240
+ <?php endif; ?>
241
+
242
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
243
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?>
244
+ <?php else: ?>
245
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
246
+ <?php endif; ?>
247
+
248
+ </span>
249
+
250
+
251
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
252
+
253
+ <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
254
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
255
+ <small>
256
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
257
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
258
+ <?php endforeach; ?>
259
+ </small>
260
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
261
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
262
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
263
+ <?php endforeach; ?>
264
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
265
+ <small>
266
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
267
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
268
+ <?php endforeach; ?>
269
+ </small>
270
+ <?php endif; ?>
271
+ </div>
272
+
273
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
274
+ <div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
275
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getRowWeeeTaxInclTax($_item)); ?></span>
276
+ </div>
277
+ <?php endif; ?>
278
+ <?php endif; ?>
279
+ <?php
280
+ //{{qixol
281
+ if ((int)Mage::getStoreConfig('qixol/frontend/onepagejavascr')==0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['updated_price']>0){
282
+ ?><div class="cart_inline_item_new_price">Only for <?php echo $this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['lineamount']); ?></div><?php
283
+ }
284
+ //}}qixol end
285
+ ?>
286
+ </td>
287
+ <?php endif; ?>
288
+ </tr>
app/design/frontend/base/default/template/qixol/onepage/review.phtml ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php echo $this->getChildHtml('items_before'); ?>
28
+ <div id="checkout-review-table-wrapper">
29
+ <table class="data-table" id="checkout-review-table">
30
+ <?php if ($this->helper('tax')->displayCartBothPrices()): $colspan = $rowspan = 2; else: $colspan = $rowspan = 1; endif; ?>
31
+ <col />
32
+ <col width="1" />
33
+ <col width="1" />
34
+ <col width="1" />
35
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
36
+ <col width="1" />
37
+ <col width="1" />
38
+ <?php endif; ?>
39
+ <thead>
40
+ <tr>
41
+ <th rowspan="<?php echo $rowspan ?>"><?php echo $this->__('Product Name') ?></th>
42
+ <th colspan="<?php echo $colspan ?>" class="a-center"><?php echo $this->__('Price') ?></th>
43
+ <th rowspan="<?php echo $rowspan ?>" class="a-center"><?php echo $this->__('Qty') ?></th>
44
+ <th colspan="<?php echo $colspan ?>" class="a-center"><?php echo $this->__('Subtotal') ?></th>
45
+ </tr>
46
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
47
+ <tr>
48
+ <th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
49
+ <th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
50
+ <th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
51
+ <th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
52
+ </tr>
53
+ <?php endif; ?>
54
+ </thead>
55
+ <?php echo $this->getChildHtml('totals'); ?>
56
+ <tbody>
57
+ <?php foreach($this->getItems() as $_item): ?>
58
+ <?php
59
+ //{{qixol start wrap block
60
+ if ((int)Mage::getStoreConfig('qixol/frontend/onepagejavascr')==0&&($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']>0)){
61
+ $multiple_coeff=((float)$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['quantity']/(float)$_item->getQty());
62
+ $_item->setQty((string)$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['quantity']);
63
+ //$_item->setPrice($_item->getPrice()*$multiple_coeff);
64
+ //$_item->setBasePrice($_item->getBasePrice()*$multiple_coeff);
65
+ //$_item->setPriceInclTax($_item->getPriceInclTax()*$multiple_coeff);
66
+ //$_item->setBasePriceInclTax($_item->getBasePriceInclTax()*$multiple_coeff);
67
+ //$_item->setBasePriceInclTax($_item->getBasePriceInclTax()*$multiple_coeff);
68
+ $_item->setRowTotal($_item->getRowTotal()*$multiple_coeff);
69
+ $_item->setBaseRowTotal($_item->getBaseRowTotal()*$multiple_coeff);
70
+ $_item->setRowTotalInclTax($_item->getRowTotalInclTax()*$multiple_coeff);
71
+ $_item->setBaseRowTotalInclTax($_item->getBaseRowTotalInclTax()*$multiple_coeff);
72
+
73
+
74
+ unset($multiple_coeff);
75
+ }
76
+ //}} qixol
77
+ ?>
78
+ <?php echo $this->getItemHtml($_item)?>
79
+ <?php endforeach ?>
80
+ <?php
81
+ //{{qixol start wrap block
82
+
83
+ if (isset($_SESSION['qixol_quoted_items'])){
84
+ foreach ($_SESSION['qixol_quoted_items']['items'] as $idx_cart=>$item_to_show){
85
+ if ($item_to_show['new']>0&&(int)$item_to_show['data']['isdelivery']==0&&(int)$item_to_show['data']['splitfromlineid']==0){
86
+ if ($productId=Mage::getModel('catalog/product')->getIdBySku((string)$item_to_show['data']['variantcode']!=''?(string)$item_to_show['data']['variantcode']:(string)$item_to_show['data']['productcode'])){
87
+ $productObj = Mage::getModel('catalog/product')->load($productId);
88
+ $quoteItem = Mage::getModel('sales/quote_item')->setStoreId(Mage::app()->getStore()->getId())->setProduct($productObj);
89
+ $quoteItem->setConvertedPrice((string)$item_to_show['data']['price']);
90
+ $quoteItem->setQty((string)$item_to_show['data']['quantity']);
91
+ $quoteItem->setFreeProduct((int)$item_to_show['free_added']);
92
+ $quoteItem->setQuote($this);
93
+ $quoteItem->setId($idx_cart);
94
+ echo $this->getItemHtml($quoteItem);
95
+ }
96
+ }
97
+ }
98
+ if (isset($_SESSION['qixol_quoted_items']['summary'])){
99
+ foreach ($_SESSION['qixol_quoted_items']['summary'] as $inline_cart_promotion)
100
+ if($inline_cart_promotion['data']['basketlevel']>0){
101
+ ?>
102
+ <tr class='promotion_review_inline_box'>
103
+ <td class="product-cart-info" colspan='2'><?php echo $inline_cart_promotion['data']['display_text']."&nbsp;"; ?></td>
104
+ <td class="product-cart-total" colspan='2' style="text-align:right;"><?php
105
+ switch ($inline_cart_promotion['data']['type']){
106
+ case 'DELIVERYREDUCTION';
107
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
108
+ break;
109
+ case 'ISSUEPOINTS';
110
+ echo $inline_cart_promotion['data']['issuedpoints']."&nbsp;pt.";
111
+ break;
112
+ case 'BASKETREDUCTION';
113
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
114
+ break;
115
+ }
116
+ ?></td>
117
+ </tr>
118
+ <?
119
+ }
120
+ }
121
+ }
122
+ //}} qixol end wrap block
123
+ ?>
124
+ </tbody>
125
+ </table>
126
+ </div>
127
+ <?php echo $this->getChildHtml('items_after'); ?>
128
+ <script type="text/javascript">
129
+ //<![CDATA[
130
+ decorateTable('checkout-review-table');
131
+ truncateOptions();
132
+ //]]>
133
+ </script>
134
+ <div id="checkout-review-submit">
135
+ <?php echo $this->getChildHtml('agreements') ?>
136
+ <div class="buttons-set" id="review-buttons-container">
137
+ <p class="f-left"><?php echo $this->__('Forgot an Item?') ?> <a href="<?php echo $this->getUrl('checkout/cart') ?>"><?php echo $this->__('Edit Your Cart') ?></a></p>
138
+ <?php echo $this->getChildHtml('button') ?>
139
+ <span class="please-wait" id="review-please-wait" style="display:none;">
140
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo Mage::helper('core')->quoteEscape($this->__('Submitting order information...')) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Submitting order information...')) ?>" class="v-middle" /> <?php echo $this->__('Submitting order information...') ?>
141
+ </span>
142
+ </div>
143
+ <script type="text/javascript">
144
+ //<![CDATA[
145
+ review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder', array('form_key' => Mage::getSingleton('core/session')->getFormKey())) ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements'));
146
+ //]]>
147
+ </script>
148
+ </div>
app/design/frontend/base/default/template/qixol/product/qixol_adv.phtml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (Mage::getStoreConfig('holbi/qixol/enabled')>0&&Mage::getStoreConfig('qixol/frontend/showpromocat')>0){
3
+ $_productCollection=$this->getLoadedProductCollection();
4
+ $qixol_bannerbox_category_top=Mage::getModel('qixol/bannerboxes')->load('CATEGORY_TOP');
5
+ if ($qixol_bannerbox_category_top->getBannerBoxIsActive()>0){
6
+ $qixol_advertisment=Mage::getModel('qixol/advert');
7
+ $qixol_top_advertisment_text=$qixol_advertisment->getCategoryTopAdv($_productCollection);
8
+ $qixol_catalog_all_scripts_inside='';
9
+ if (trim($qixol_top_advertisment_text)!=''){
10
+ $qixol_catalog_all_scripts_inside.='$(".category-title").after("<div id=category_top_ class=\'cycle-slideshow\' data-cycle-fx=\''.$qixol_bannerbox_category_top->getBannerBoxTranslationType().'\' data-cycle-timeout=\'1500\' data-cycle-slides=\'> div\'>'.addslashes(preg_replace("/[\n\r]+/","",$qixol_top_advertisment_text)).'</div>");$(\'#category_top_\').cycle();';
11
+ ?>
12
+ <?php
13
+ }
14
+ }
15
+
16
+ $qixol_bannerbox_category_stickers=Mage::getModel('qixol/bannerboxes')->load('CATEGORY_STICKERS');
17
+ if ($qixol_bannerbox_category_stickers->getBannerBoxIsActive()>0){
18
+
19
+ $_helper = $this->helper('catalog/output');
20
+ foreach ($_productCollection as $_product){
21
+ if ($is_sticker_image=$qixol_advertisment->isSticked($_product,'category')){
22
+ if ($is_sticker_image!==false){
23
+ if (is_array($is_sticker_image)){
24
+ $images_list='';
25
+ foreach ($is_sticker_image as $image_add){
26
+ $images_list.='<div style=\'width: 44px; height: 44px; display: block; z-index: 2; background:url(\"'.$image_add.'\") 0 0 no-repeat;background-size:contain;\'></div>';
27
+ }
28
+ if ($images_list!='')
29
+ $qixol_catalog_all_scripts_inside.='$("#product-collection-image-'.$_product->getId().'").after("<div style=\'position: absolute; right: 65; top: 0; width: 44px; height: 44px; display: block; z-index: 2;\' id=stickers_'.$_product->getId().' class=\'cycle-slideshow\' data-cycle-fx=\''.$qixol_bannerbox_category_stickers->getBannerBoxTranslationType().'\' data-cycle-timeout=\'555\' data-cycle-slides=\'> div\'>'.$images_list.'</div>");$(\'#stickers_'.$_product->getId().'\').cycle();';
30
+ }else {
31
+ //$qixol_catalog_all_scripts_inside.='$("#product-collection-image-'.$_product->getId().'").after("<div class=\'background_promotion_sale\'></div>");';
32
+ $qixol_catalog_all_scripts_inside.='$("#product-collection-image-'.$_product->getId().'").after("<div style=\'position: absolute; right: 65; top: 0; width: 44px; height: 44px; display: block; z-index: 2; background:url(\"'.$is_sticker_image.'\") 0 0 no-repeat;background-size:contain;\'></div>");';
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
38
+ if ($qixol_catalog_all_scripts_inside!=''){
39
+ ?><script type="text/javascript" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>lib/jquery/jquery-1.10.2.min.js"></script><script type="text/javascript" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>/skin/frontend/base/default/js/lib/jquery.cycle2.min.js"></script><script type="text/javascript">$.noConflict();jQuery( document ).ready(function( $ ) { <?php echo $qixol_catalog_all_scripts_inside;?>});</script><?php
40
+ }
41
+
42
+ }
43
+ ?>
44
+
app/design/frontend/base/default/template/qixol/product/qixol_info_details.phtml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (Mage::getStoreConfig('holbi/qixol/enabled')>0&&Mage::getStoreConfig('qixol/frontend/showpromoboxes')>0){
3
+ ?>
4
+ <?php $_helper = $this->helper('catalog/output'); ?>
5
+ <?php $_product = $this->getProduct(); ?>
6
+ <?php
7
+
8
+ $qixol_product_bottom_box=Mage::getModel('qixol/bannerboxes')->load('PRODUCT_BOTTOM');
9
+ if ($qixol_product_bottom_box->getBannerBoxIsActive()>0){
10
+
11
+ $bottom_advertisment_=Mage::getModel('qixol/advert');
12
+ $bottom_advertisment_text=$bottom_advertisment_->getProductBottmAdv($_product);
13
+
14
+ }
15
+
16
+ if ($bottom_advertisment_text!=''){
17
+ $bottom_advertisment_text='<div style="display:block;"><div id=product_bottom_ class="cycle-slideshow" data-cycle-fx="'.$qixol_product_bottom_box->getBannerBoxTranslationType().'" data-cycle-timeout="1500" data-cycle-slides="> div">'.preg_replace("/[\n\r]+/","",$bottom_advertisment_text).'</div></div>';
18
+ //echo $bottom_advertisment_text;
19
+ ?><script type="text/javascript" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>lib/jquery/jquery-1.10.2.min.js"></script><script type="text/javascript" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>/skin/frontend/base/default/js/lib/jquery.cycle2.min.js"></script><script type="text/javascript">$.noConflict();jQuery( document ).ready(function( $ ) { $(".add-to-cart").after('<?php echo addslashes($bottom_advertisment_text)?>'); $('#product_bottom_').cycle();});</script><?php
20
+ }
21
+
22
+ }
23
+ ?>
app/design/frontend/base/default/template/qixol/product/qixol_product_info.phtml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (Mage::getStoreConfig('holbi/qixol/enabled')>0){
3
+ ?>
4
+ <?php $_helper = $this->helper('catalog/output'); ?>
5
+ <?php $_product = $this->getProduct(); ?>
6
+ <?php
7
+ $qixol_advertisment=Mage::getModel('qixol/advert');
8
+ $qixol_product_all_scripts_inside='';
9
+
10
+ if (Mage::getStoreConfig('qixol/frontend/showpromoboxes')>0){
11
+ $qixol_all_promotions_text=$qixol_advertisment->getAllProductAdv($_product);
12
+
13
+ if ($qixol_all_promotions_text!=''){
14
+ // $qixol_product_all_scripts_inside .= '$(".add-to-box").after("<div id=product_advertisment_ class=\'cycle-slideshow\' data-cycle-fx=\'scrollHorz\' data-cycle-timeout=\'1500\' data-cycle-slides=\'> div\'>'.preg_replace("/[\n\r]+/","",$qixol_all_promotions_text).'</div>"); $(\'#product_advertisment_\').cycle();';
15
+ $qixol_product_all_scripts_inside .= '$(".add-to-box").after("<div class=\'product_all_promotions\'><table style=\'width:100%\'><th>Offers</th><th style=\'width:100px;\'>You Save</th>'.preg_replace("/[\n\r]+/","",$qixol_all_promotions_text).'</div></table>");';
16
+ }
17
+ }
18
+ if (Mage::getStoreConfig('qixol/frontend/showpromoboxes')>0){
19
+
20
+
21
+ $qixol_product_top_box=Mage::getModel('qixol/bannerboxes')->load('PRODUCT_TOP');
22
+ if ($qixol_product_top_box->getBannerBoxIsActive()>0){
23
+ $qixol_top_advertisment_text=$qixol_advertisment->getProductInfoTopAdv($_product);
24
+
25
+ if ($qixol_top_advertisment_text!=''){
26
+ $qixol_product_all_scripts_inside .= '$("#messages_product_view").after("<div id=product_top_ class=\'cycle-slideshow\' data-cycle-fx=\''.$qixol_product_top_box->getBannerBoxTranslationType().'\' data-cycle-timeout=\'1500\' data-cycle-slides=\'> div\'>'.preg_replace("/[\n\r]+/","",$qixol_top_advertisment_text).'</div>"); $(\'#product_top_\').cycle();';
27
+ }
28
+ }
29
+
30
+ $qixol_product_inline_box=Mage::getModel('qixol/bannerboxes')->load('PRODUCT_INLINE');
31
+
32
+ if ($qixol_product_inline_box->getBannerBoxIsActive()>0){
33
+ $qixol_inline_advertisment_text=$qixol_advertisment->getProductInlineAdv($_product);
34
+
35
+ if ($qixol_inline_advertisment_text!=''){
36
+ $qixol_product_all_scripts_inside .= '$(".extra-info").after("<div=\'product_inline\' style=\'float: left;width: 100%;\' id=product_inline_ class=\'cycle-slideshow\' data-cycle-fx=\''.$qixol_product_inline_box->getBannerBoxTranslationType().'\' data-cycle-timeout=\'1500\' data-cycle-slides=\'> div\'>'.addslashes($qixol_inline_advertisment_text).'</div>");$(\'#product_inline_\').cycle();';
37
+ }
38
+ }
39
+ }
40
+ if (Mage::getStoreConfig('qixol/frontend/showpromoprod')>0&&$is_sticker_image=$qixol_advertisment->isSticked($_product,'product')){
41
+ $qixol_bannerbox_product_stickers=Mage::getModel('qixol/bannerboxes')->load('PRODUCT_INFO_STICKERS');
42
+ if ($qixol_bannerbox_product_stickers->getBannerBoxIsActive()>0){
43
+ if ($is_sticker_image!==false){
44
+ if (is_array($is_sticker_image)){
45
+ $images_list='';
46
+ foreach ($is_sticker_image as $image_add){
47
+ $images_list.='<div style=\'position: absolute; right: 65; top: 0; width: 200px; height: 200px; display: block; z-index: 2; background:url(\"'.$image_add.'\") 0 0 no-repeat;background-size:contain;\'></div>';
48
+ }
49
+ if ($images_list!='')
50
+ $qixol_product_all_scripts_inside.='$(".product-image-gallery").after("<div style=\'position: absolute; right: 65; top: 0; width: 200px; height: 200px; display: block; z-index: 2;\' id=stickers_ class=\'cycle-slideshow\' data-cycle-fx=\''.$qixol_bannerbox_product_stickers->getBannerBoxTranslationType().'\' data-cycle-timeout=\'555\' data-cycle-slides=\'> div\'>'.$images_list.'</div>");$(\'#stickers_\').cycle();';
51
+
52
+ } else {
53
+ $qixol_product_all_scripts_inside.='$(".product-image-gallery").after("<div style=\'position: absolute; right: 65; top: 0; width: 200px; height: 200px; display: block; z-index: 2; background:url(\"'.$is_sticker_image.'\") 0 0 no-repeat;\'></div>");';
54
+ }
55
+
56
+ }
57
+ }
58
+ }
59
+
60
+ if ($qixol_product_all_scripts_inside!=''){
61
+ ?><script type="text/javascript" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>lib/jquery/jquery-1.10.2.min.js"></script><script type="text/javascript" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>/skin/frontend/base/default/js/lib/jquery.cycle2.min.js"></script><script type="text/javascript">$.noConflict();jQuery( document ).ready(function( $ ) { <?php echo $qixol_product_all_scripts_inside;?>});</script><?php
62
+ }
63
+ }
app/design/frontend/base/default/template/qixol/sidebar/advert.phtml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //$place_box_in_design_after_pattern=Mage::getStoreConfig('qixol/integraion/boxcartpromotion')
3
+ $place_box_in_design_after_pattern='.cart';
4
+
5
+
6
+ $cart_advertisment_=Mage::getModel('qixol/advert');
7
+ $text_to_show_cart_adv=$cart_advertisment_->getCartInlineAdv();
8
+
9
+ $inline_cart_advert='';
10
+
11
+ //for cart items
12
+ $cart = Mage::getModel('checkout/cart')->getQuote();
13
+ foreach ($cart->getAllItems() as $item) {
14
+ if (isset($_SESSION['qixol_quoted_items'])&&isset($_SESSION['qixol_quoted_items']['items'][$item->getId()])){
15
+ if (isset($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions']))
16
+ foreach ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions'] as $promotion){
17
+ //inline level promotion
18
+ if ((int)$promotion['basketlevel']==0&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]))
19
+ $inline_cart_advert.="
20
+ $('<div class=\"cart_inline_item_promo\">".addslashes($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display_text'])."</div>').appendTo($('#qixol_idx_cart_item_name_".$item->getId()."'));
21
+ ";
22
+ //basket level promotion
23
+ if ((int)$promotion['basketlevel']==1&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]))
24
+ $text_to_show_cart_adv.='';//should be also added??? $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['display_text'];
25
+
26
+ }
27
+
28
+ //if quantity changed (get one + one free so will be splited to 2 products with 1 free)
29
+ if ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_qty']>0)
30
+ $inline_cart_advert.="
31
+ $('<div class=\"cart_inline_item_new_qty\">For&nbsp;promo&nbsp;".addslashes($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['quantity'])."&nbsp;Qty</div>').appendTo($('#qixol_idx_cart_item_qty_".$item->getId()."'));
32
+ ";
33
+
34
+ if ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_price']>0)
35
+ $inline_cart_advert.="
36
+ $('<div class=\"cart_inline_item_new_price\">Only for ".addslashes($this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['lineamount']))."</div>').appendTo($('#qixol_idx_cart_item_price_".$item->getId()."'));
37
+ ";
38
+
39
+ }
40
+ }
41
+ $total_discount_amount=0;
42
+ if (isset($_SESSION['qixol_quoted_items']['items'])){
43
+ foreach ($_SESSION['qixol_quoted_items']['items'] as $cart_item_process){
44
+ if ($cart_item_process['data']['totaldiscount']>0){
45
+ $total_discount_amount+=$cart_item_process['data']['totaldiscount'];
46
+ }
47
+ }
48
+ }
49
+
50
+ if ($text_to_show_cart_adv!==false&&strlen($text_to_show_cart_adv)>5||$inline_cart_advert!=''){
51
+ ?><script type="text/javascript" src="<?php echo Mage::getBaseUrl('js'); ?>/lib/jquery/jquery-1.10.2.min.js"></script><script type="text/javascript">$.noConflict();jQuery( document ).ready(function( $ ) { <?php
52
+ if ($text_to_show_cart_adv!==false&&strlen($text_to_show_cart_adv)>5)
53
+ echo '$("'.$place_box_in_design_after_pattern.'").after("<div class=\'qixolcartpromo\'>'.$text_to_show_cart_adv.'</div>");';
54
+ if ($inline_cart_advert!='')
55
+ echo preg_replace("/[\n\r]+/","",$inline_cart_advert);
56
+ if ($total_discount_amount>0){
57
+ ?>$('<tr class="qixol_discount"><td class="a-right" colspan="1" > Discount</td><td class="a-right" ><span class="qixol_total_price"><?php echo $this->helper('checkout')->formatPrice($total_discount_amount);; ?></span></td></tr>').appendTo($('#shopping-cart-totals-table tbody'));<?php
58
+ ?>$('#shopping-cart-totals-table tfoot .price').addClass('qixol_price_cross');$('<span class="qixol_grand_total_price"><?php echo $this->helper('checkout')->formatPrice($cart->getGrandTotal()-$total_discount_amount); ?></span>').appendTo($('#shopping-cart-totals-table tfoot .price').parent());<?php
59
+ }
60
+ ?>});</script><?php
61
+ }
62
+ ?>
app/design/frontend/base/default/template/qixol/sidebar/default.phtml ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ $_item = $this->getItem();
29
+ $isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();
30
+ $canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_BEFORE_ORDER_CONFIRM);
31
+ ?>
32
+ <li class="item">
33
+ <?php if ($this->hasProductUrl()): ?>
34
+ <a href="<?php echo $this->getProductUrl()?>" title="<?php echo $this->escapeHtml($this->getProductName()) ?>" class="product-image"><img src="<?php echo $this->getProductThumbnail()->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" /></a>
35
+ <?php else: ?>
36
+ <span class="product-image"><img src="<?php echo $this->getProductThumbnail()->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" /></span>
37
+ <?php endif; ?>
38
+ <div class="product-details">
39
+ <a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove This Item')) ?>" onclick="return confirm('<?php echo Mage::helper('core')->quoteEscape($this->__('Are you sure you would like to remove this item from the shopping cart?'), true) ?>');" class="btn-remove"><?php echo $this->__('Remove This Item') ?></a>
40
+ <?php if ($isVisibleProduct): ?>
41
+ <a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Edit item')) ?>" class="btn-edit"><?php echo $this->__('Edit item')?></a>
42
+ <?php endif ?>
43
+ <p class="product-name"><?php if ($this->hasProductUrl()): ?><a href="<?php echo $this->getProductUrl() ?>"><?php endif; ?><?php echo $this->escapeHtml($this->getProductName()) ?><?php if ($this->hasProductUrl()): ?></a><?php endif; ?></p>
44
+ <strong><?php echo $this->getQty() ?></strong> x
45
+
46
+ <?php if ($canApplyMsrp): ?>
47
+
48
+ <span class="map-cart-sidebar-item"><?php echo $this->__('See price before order confirmation.'); ?></span>
49
+
50
+ <?php else: ?>
51
+
52
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
53
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
54
+ <?php echo $this->__('Excl. Tax'); ?>:
55
+ <?php endif; ?>
56
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
57
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
58
+ <?php else: ?>
59
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
60
+ <?php endif; ?>
61
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
62
+ <br />
63
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
64
+ <small>
65
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
66
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
67
+ <?php endforeach; ?>
68
+ </small>
69
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
70
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
71
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
72
+ <?php endforeach; ?>
73
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
74
+ <small>
75
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
76
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
77
+ <?php endforeach; ?>
78
+ </small>
79
+ <?php endif; ?>
80
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
81
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
82
+ <?php endif; ?>
83
+ <?php endif; ?>
84
+ <?php endif; ?>
85
+
86
+
87
+
88
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
89
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
90
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
91
+ <br /><?php echo $this->__('Incl. Tax'); ?>:
92
+ <?php endif; ?>
93
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
94
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
95
+ <?php else: ?>
96
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
97
+ <?php endif; ?>
98
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
99
+ <br />
100
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
101
+ <small>
102
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
103
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
104
+ <?php endforeach; ?>
105
+ </small>
106
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
107
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
108
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
109
+ <?php endforeach; ?>
110
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
111
+ <small>
112
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
113
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
114
+ <?php endforeach; ?>
115
+ </small>
116
+ <?php endif; ?>
117
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
118
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
119
+ <?php endif; ?>
120
+ <?php endif; ?>
121
+ <?php endif; ?>
122
+
123
+ <?php endif; //Can apply MSRP ?>
124
+
125
+ <?php if ($_options = $this->getOptionList()):?>
126
+ <div class="truncated">
127
+ <div class="truncated_full_value">
128
+ <dl class="item-options">
129
+ <?php foreach ($_options as $_option) : ?>
130
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
131
+ <dd>
132
+ <?php if (is_array($_option['value'])): ?>
133
+ <?php echo nl2br(implode("\n", $_option['value'])) ?>
134
+ <?php else: ?>
135
+ <?php echo $_option['value'] ?>
136
+ <?php endif; ?>
137
+ </dd>
138
+ <?php endforeach; ?>
139
+ </dl>
140
+ </div>
141
+ <a href="#" onclick="return false;" class="details"><?php echo $this->__('Details') ?></a>
142
+ </div>
143
+ <?php endif; ?>
144
+ </div>
145
+ </li>
app/design/frontend/base/default/template/qixol/sidebar/sidebar.phtml ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Shoping cart sidebar
29
+ *
30
+ * @see Mage_Checkout_Block_Cart_Sidebar
31
+ */
32
+
33
+ ?>
34
+ <?php if ($this->getIsNeedToDisplaySideBar()):?>
35
+ <div class="block block-cart">
36
+ <?php $_cartQty = $this->getSummaryCount() ?>
37
+ <div class="block-title">
38
+ <strong><span><?php echo $this->__('My Cart') ?></span></strong>
39
+ </div>
40
+ <div class="block-content">
41
+ <?php if ($_cartQty>0): ?>
42
+ <div class="summary">
43
+ <?php if ($_cartQty==1): ?>
44
+ <p class="amount"><?php echo $this->__('There is <a href="%s">1 item</a> in your cart.', $this->getUrl('checkout/cart')) ?></p>
45
+ <?php else: ?>
46
+ <p class="amount"><?php echo $this->__('There are <a href="%s">%s items</a> in your cart.', $this->getUrl('checkout/cart'), $_cartQty) ?></p>
47
+ <?php endif ?>
48
+ <p class="subtotal">
49
+ <?php if ($this->canApplyMsrp()): ?>
50
+ <span class="map-cart-sidebar-total"><?php echo $this->__('ORDER TOTAL WILL BE DISPLAYED BEFORE YOU SUBMIT THE ORDER'); ?></span>
51
+ <?php else: ?>
52
+ <span class="label"><?php echo $this->__('Cart Subtotal:') ?></span> <?php echo Mage::helper('checkout')->formatPrice($this->getSubtotal()) ?>
53
+ <?php if ($_subtotalInclTax = $this->getSubtotalInclTax()): ?>
54
+ <br />(<?php echo Mage::helper('checkout')->formatPrice($_subtotalInclTax) ?> <?php echo Mage::helper('tax')->getIncExcText(true) ?>)
55
+ <?php endif; ?>
56
+ <?php endif; ?>
57
+ </p>
58
+ </div>
59
+ <?php endif ?>
60
+ <?php if($_cartQty && $this->isPossibleOnepageCheckout()): ?>
61
+ <div class="actions">
62
+ <?php echo $this->getChildHtml('extra_actions') ?>
63
+ <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Checkout')) ?>" class="button" onclick="setLocation('<?php echo $this->getCheckoutUrl() ?>')"><span><span><?php echo $this->__('Checkout') ?></span></span></button>
64
+ </div>
65
+ <?php endif ?>
66
+ <?php $_items = $this->getRecentItems() ?>
67
+ <?php if(count($_items)): ?>
68
+ <p class="block-subtitle"><?php echo $this->__('Recently added item(s)') ?></p>
69
+ <ol id="cart-sidebar" class="mini-products-list">
70
+ <?php foreach($_items as $_item): ?>
71
+ <?php echo $this->getItemHtml($_item) ?>
72
+ <?php endforeach; ?>
73
+ </ol>
74
+ <script type="text/javascript">decorateList('cart-sidebar', 'none-recursive')</script>
75
+ <?php else: ?>
76
+ <p class="empty"><?php echo $this->__('You have no items in your shopping cart.') ?></p>
77
+ <?php endif ?>
78
+ </div>
79
+ </div>
80
+ <?php endif;?>
app/design/frontend/rwd/default/template/qixol/minicart/advert.phtml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ moved to mincart
4
+ //$place_box_in_design_after_pattern=Mage::getStoreConfig('qixol/integraion/boxcartpromotion')
5
+ $place_box_in_design_after_pattern='.cart';
6
+
7
+
8
+ /* $cart_advertisment_=Mage::getModel('qixol/advert');
9
+ $text_to_show_cart_adv=$cart_advertisment_->getCartInlineAdv();*/
10
+ /*
11
+ $inline_cart_advert='';
12
+
13
+ //for cart items
14
+ $cart = Mage::getModel('checkout/cart')->getQuote();
15
+ foreach ($cart->getAllItems() as $item) {
16
+ if (isset($_SESSION['qixol_quoted_items'])&&isset($_SESSION['qixol_quoted_items']['items'][$item->getId()])){
17
+ if (isset($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions']))
18
+ foreach ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions'] as $promotion){
19
+ //inline level promotion
20
+ if ((int)$promotion['basketlevel']==0&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]))
21
+ $inline_cart_advert.="
22
+ $('<div class=\"cart_inline_item_promo\">".addslashes($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display_text'])."</div>').appendTo($('#qixol_idx_mcart_item_name_".$item->getId()."'));
23
+ ";
24
+ //basket level promotion
25
+ if ((int)$promotion['basketlevel']==1&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]))
26
+ $text_to_show_cart_adv.='';//should be also added??? $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['display_text'];
27
+
28
+ }
29
+
30
+ //if quantity changed (get one + one free so will be splited to 2 products with 1 free)
31
+ if ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_qty']>0)
32
+ $inline_cart_advert.="
33
+ $('<div class=\"cart_inline_item_new_qty\">For&nbsp;promo&nbsp;".addslashes($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['quantity'])."&nbsp;Qty</div>').appendTo($('#qixol_idx_mcart_item_qty_".$item->getId()."'));
34
+ ";
35
+
36
+ if ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_price']>0)
37
+ $inline_cart_advert.="
38
+ $('<div class=\"cart_inline_item_new_price\">Only for ".addslashes($this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['lineamount']))."</div>').appendTo($('#qixol_idx_mcart_item_price_".$item->getId()."'));
39
+ ";
40
+
41
+ }
42
+ }
43
+ $total_discount_amount=0;
44
+ if (isset($_SESSION['qixol_quoted_items']['items'])){
45
+ foreach ($_SESSION['qixol_quoted_items']['items'] as $cart_item_process){
46
+ if ($cart_item_process['data']['totaldiscount']>0&&(int)$cart_item_process['new']==0){
47
+ $total_discount_amount+=$cart_item_process['data']['totaldiscount'];
48
+ }
49
+ }
50
+ }
51
+
52
+ if ($text_to_show_cart_adv!==false&&strlen($text_to_show_cart_adv)>5||$inline_cart_advert!=''){
53
+ ?><script type="text/javascript" src="http://qixol.holbidev.co.uk/js/lib/jquery/jquery-1.10.2.min.js"></script><script type="text/javascript">$.noConflict();jQuery( document ).ready(function( $ ) { <?php
54
+ /*if ($text_to_show_cart_adv!==false&&strlen($text_to_show_cart_adv)>5)
55
+ echo '$("'.$place_box_in_design_after_pattern.'").after("<div class=\'qixolcartpromo\'>'.$text_to_show_cart_adv.'</div>");';*//*
56
+ if ($inline_cart_advert!='')
57
+ echo preg_replace("/[\n\r]+/","",$inline_cart_advert);
58
+ if ($total_discount_amount>0){
59
+ /*?>$('<tr class="qixol_discount"><td class="a-right" colspan="1" > Discount</td><td class="a-right" ><span class="qixol_total_price"><?php echo $this->helper('checkout')->formatPrice($total_discount_amount);; ?></span></td></tr>').appendTo($('#shopping-cart-totals-table tbody'));<?php*//*
60
+ ?>$('#header-cart .subtotal .price').addClass('qixol_price_cross');$('<?php echo $this->helper('checkout')->formatPrice($cart->getGrandTotal()-$total_discount_amount); ?>').appendTo($('#header-cart .subtotal .price').parent());<?php
61
+ }
62
+ ?>});</script><?php
63
+ }*/
64
+ ?>
app/design/frontend/rwd/default/template/qixol/minicart/default.phtml ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ $_item = $this->getItem();
29
+ $isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();
30
+ $canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_BEFORE_ORDER_CONFIRM);
31
+ ?>
32
+ <?php /* {{ qixol should be added id */ ?>
33
+ <li class="item" xmlns="http://www.w3.org/1999/html" id='qixol_idx_mcart_item_<?php echo $_item->getId(); ?>'>
34
+ <?php if ($this->hasProductUrl()): ?>
35
+ <a href="<?php echo $this->getProductUrl()?>" title="<?php echo $this->escapeHtml($this->getProductName()) ?>" class="product-image"><img src="<?php echo $this->getProductThumbnail()->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" /></a>
36
+ <?php else: ?>
37
+ <span class="product-image"><img src="<?php echo $this->getProductThumbnail()->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" /></span>
38
+ <?php endif; ?>
39
+ <div class="product-details">
40
+ <?php /* qixol should be added id */ ?>
41
+ <p class="product-name" id='qixol_idx_mcart_item_name_<?php echo $_item->getId(); ?>'><?php if ($this->hasProductUrl()): ?><a href="<?php echo $this->getProductUrl() ?>"><?php endif; ?><?php echo $this->escapeHtml($this->getProductName()) ?><?php if ($this->hasProductUrl()): ?></a><?php endif;
42
+ /* qixol {{ */
43
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')==0&&Mage::getStoreConfig('qixol/advanced/services')!='dontdisplay'):
44
+ foreach ($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['promotions'] as $promotion){
45
+ //inline level promotion
46
+ $is_generated=($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['generated']>0?$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['generated']:$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']);
47
+ if (((int)$promotion['basketlevel']==0||$is_generated>0)&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displaytext'){
48
+ ?><div class="cart_inline_item_promo"><?php echo $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display_text']; ?></div><?php
49
+ }elseif(((int)$promotion['basketlevel']==0||$is_generated>0)&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displayname'){
50
+ ?><div class="cart_inline_item_promo"><?php echo $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['name']; ?></div><?php
51
+ }elseif(((int)$promotion['basketlevel']==0||$is_generated>0)&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displaytype'){
52
+ ?><div class="cart_inline_item_promo"><?php echo $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display']; ?></div><?php
53
+ }
54
+
55
+ }
56
+ endif;
57
+ /* }} end qixol */ ?></p>
58
+
59
+
60
+ <table class="info-wrapper">
61
+ <tbody>
62
+ <tr>
63
+ <th><?php echo $this->__('Price'); ?></th>
64
+ <td id='qixol_idx_mcart_item_price_<?php echo $_item->getId(); ?>'>
65
+ <?php if ($canApplyMsrp): ?>
66
+
67
+ <span class="map-cart-sidebar-item"><?php echo $this->__('See price before order confirmation.'); ?></span>
68
+
69
+ <?php else: ?>
70
+
71
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
72
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
73
+ <?php echo $this->__('Excl. Tax'); ?>:
74
+ <?php endif; ?>
75
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
76
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
77
+ <?php else: ?>
78
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
79
+ <?php endif; ?>
80
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
81
+ <br />
82
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
83
+ <small>
84
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
85
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
86
+ <?php endforeach; ?>
87
+ </small>
88
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
89
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
90
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
91
+ <?php endforeach; ?>
92
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
93
+ <small>
94
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
95
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
96
+ <?php endforeach; ?>
97
+ </small>
98
+ <?php endif; ?>
99
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
100
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
101
+ <?php endif; ?>
102
+ <?php endif; ?>
103
+ <?php endif; ?>
104
+
105
+
106
+
107
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
108
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
109
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
110
+ <br /><?php echo $this->__('Incl. Tax'); ?>:
111
+ <?php endif; ?>
112
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales')): ?>
113
+ <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?>
114
+ <?php else: ?>
115
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
116
+ <?php endif; ?>
117
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
118
+ <br />
119
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales')): ?>
120
+ <small>
121
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
122
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
123
+ <?php endforeach; ?>
124
+ </small>
125
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
126
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
127
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span>
128
+ <?php endforeach; ?>
129
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales')): ?>
130
+ <small>
131
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
132
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
133
+ <?php endforeach; ?>
134
+ </small>
135
+ <?php endif; ?>
136
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales')): ?>
137
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl + Mage::helper('weee')->getWeeeTaxInclTax($_item)); ?></span>
138
+ <?php endif; ?>
139
+ <?php endif; ?>
140
+ <?php endif; ?>
141
+
142
+ <?php endif; //Can apply MSRP ?>
143
+ <?php
144
+ //{{qixol
145
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')==0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['updated_price']>0){
146
+ ?><div class="cart_inline_item_new_price">Only for <?php echo $this->helper('checkout')->formatPrice(($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalamount']-$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['totaldiscount'])/$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalquantity']);?></div><?php
147
+ }
148
+ //}}qixol end
149
+ ?>
150
+ </td>
151
+ </tr>
152
+ <tr class="qty-wrapper">
153
+ <th><?php echo $this->__('Qty'); ?></th>
154
+
155
+ <?php /* qixol should be added id */ ?>
156
+ <td id='qixol_idx_mcart_item_qty_<?php echo $_item->getId(); ?>'>
157
+ <?php /*if ($_item->getFreeProduct()>0): ?>
158
+ <div class="cart_inline_item_promo"><?php echo $this->__('free item'); ?></div>
159
+ <?php else :*/ ?>
160
+ <?php /* end qixol add */ ?>
161
+ <input
162
+ id="qinput-<?php echo $_item->getId(); ?>"
163
+ data-link="<?php echo $this->getAjaxUpdateUrl() ?>"
164
+ data-item-id="<?php echo $_item->getId(); ?>"
165
+ data-cart-item-id="<?php echo $_item->getSku(); ?>"
166
+ class="qty cart-item-quantity input-text" name=""
167
+ value="<?php echo $this->getQty()?>"
168
+ <?php if ($this->isOnCheckoutPage()) echo 'disabled'; ?>
169
+ />
170
+
171
+ <button id="qbutton-<?php echo $_item->getId(); ?>"
172
+ data-item-id="<?php echo $_item->getId(); ?>"
173
+ disabled="disabled"
174
+ data-update
175
+ data-cart-item-update
176
+ class="button quantity-button">
177
+ <?php echo $this->__('ok'); ?>
178
+ </button>
179
+ <?php
180
+ //{{qixol
181
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')==0&&($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['updated_price']>0)){
182
+ ?><div class="cart_inline_item_new_price">Only for <?php echo $this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalamount']-$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['totaldiscount']); ?></div><?php
183
+ }
184
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')==0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['new']>0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['generated']>0){
185
+ ?><div class="cart_inline_item_new_price"><?php echo $this->__('Discount: -').$this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalprice']); ?></div><?php
186
+ }else if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')==0&&($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']>0)){
187
+ ?><div class="cart_inline_item_new_price"><?php echo $this->__('Discount: -').$this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalprice']*$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']); ?></div><?php
188
+ }
189
+ //}}qixol end
190
+ ?>
191
+ <?php /* qixol add */ ?>
192
+ <?php //endif ?>
193
+ <?php /* end qixol add */ ?>
194
+ </td>
195
+ </tr>
196
+ </tbody>
197
+ </table>
198
+
199
+ <?php if ($isVisibleProduct&&($_item->getFreeProduct()==0)): ?>
200
+ <?php
201
+ //{{qixol
202
+ if ($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']==0&&$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['generated']==0):
203
+ //}}qixol
204
+ ?>
205
+ <a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Edit item')) ?>" class="btn-edit">
206
+ <?php echo $this->__('Edit item')?>
207
+ </a>
208
+ |
209
+ <?php
210
+ //{{qixol
211
+ endif;
212
+ //}}qixol
213
+ ?>
214
+ <?php
215
+ //{{qixol
216
+ if ($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['generated']==0||$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['originalquantity']!=$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['quantity']):
217
+ //}}qixol
218
+ ?>
219
+ <?php if (!$this->isOnCheckoutPage()): ?>
220
+ <a href="<?php echo $this->getAjaxDeleteUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Remove This Item')) ?>"
221
+ data-confirm="<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>"
222
+ class="remove">
223
+ <?php echo $this->__('Remove Item') ?>
224
+ </a>
225
+ <?php else: ?>
226
+ <span><?php echo $this->__('Remove Item') ?></span>
227
+ <?php endif; ?>
228
+ <?php
229
+ //{{qixol
230
+ endif;
231
+ //}}qixol
232
+ ?>
233
+ <?php endif ?>
234
+
235
+
236
+
237
+ <?php if ($_options = $this->getOptionList()):?>
238
+ <div class="truncated">
239
+ <div class="truncated_full_value">
240
+ <dl class="item-options">
241
+ <?php foreach ($_options as $_option) : ?>
242
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
243
+ <dd>
244
+ <?php if (is_array($_option['value'])): ?>
245
+ <?php echo nl2br(implode("\n", $_option['value'])) ?>
246
+ <?php else: ?>
247
+ <?php echo $_option['value'] ?>
248
+ <?php endif; ?>
249
+ </dd>
250
+ <?php endforeach; ?>
251
+ </dl>
252
+ </div>
253
+ <a href="#" onclick="return false;" class="details"><?php echo $this->__('Details') ?></a>
254
+ </div>
255
+ <?php endif; ?>
256
+
257
+ </div>
258
+ </li>
app/design/frontend/rwd/default/template/qixol/minicart/mincart.phtml ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Shoping cart sidebar
29
+ *
30
+ * @var Mage_Checkout_Block_Cart_Minicart $this
31
+ */
32
+ ?>
33
+ <?php
34
+ $_cartQty = $this->getSummaryCount();
35
+ if(empty($_cartQty)) {
36
+ $_cartQty = 0;
37
+ }
38
+ ?>
39
+ <div id="minicart-error-message" class="minicart-message"></div>
40
+ <div id="minicart-success-message" class="minicart-message"></div>
41
+
42
+ <div class="minicart-wrapper">
43
+
44
+ <p class="block-subtitle">
45
+ <?php echo $this->__('Recently added item(s)') ?>
46
+ <a class="close skip-link-close" href="#" title="<?php echo $this->quoteEscape($this->__('Close')); ?>">&times;</a>
47
+ </p>
48
+
49
+ <?php $_items = $this->getRecentItems() ?>
50
+ <?php $countItems = count($_items); ?>
51
+ <?php if($countItems): ?>
52
+ <div>
53
+ <ul id="cart-sidebar" class="mini-products-list">
54
+ <?php foreach($_items as $_item): ?>
55
+ <?php
56
+ //{{qixol start wrap block
57
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')==0&&($_SESSION['qixol_quoted_items']['items'][$_item->getId()]['free_added']>0)){
58
+ $multiple_coeff=((float)$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['quantity']/(float)$_item->getQty());
59
+ $_item->setQty((string)$_SESSION['qixol_quoted_items']['items'][$_item->getId()]['data']['quantity']);
60
+ //$_item->setPrice($_item->getPrice()*$multiple_coeff);
61
+ //$_item->setBasePrice($_item->getBasePrice()*$multiple_coeff);
62
+ //$_item->setPriceInclTax($_item->getPriceInclTax()*$multiple_coeff);
63
+ //$_item->setBasePriceInclTax($_item->getBasePriceInclTax()*$multiple_coeff);
64
+ //$_item->setBasePriceInclTax($_item->getBasePriceInclTax()*$multiple_coeff);
65
+ $_item->setRowTotal($_item->getRowTotal()*$multiple_coeff);
66
+ $_item->setBaseRowTotal($_item->getBaseRowTotal()*$multiple_coeff);
67
+ $_item->setRowTotalInclTax($_item->getRowTotalInclTax()*$multiple_coeff);
68
+ $_item->setBaseRowTotalInclTax($_item->getBaseRowTotalInclTax()*$multiple_coeff);
69
+
70
+
71
+ unset($multiple_coeff);
72
+ }
73
+ // }} qixol
74
+ ?>
75
+ <?php echo $this->getItemHtml($_item) ?>
76
+ <?php endforeach; ?>
77
+ <?php
78
+ //{{qixol start wrap block
79
+
80
+ if (isset($_SESSION['qixol_quoted_items'])){
81
+ foreach ($_SESSION['qixol_quoted_items']['items'] as $idx_cart=>$item_to_show){
82
+ if ($item_to_show['new']>0&&(int)$item_to_show['data']['isdelivery']==0&&(int)$item_to_show['data']['splitfromlineid']==0){
83
+ if ($productId=Mage::getModel('catalog/product')->getIdBySku((string)$item_to_show['data']['variantcode']!=''?(string)$item_to_show['data']['variantcode']:(string)$item_to_show['data']['productcode'])){
84
+ $productObj = Mage::getModel('catalog/product')->load($productId);
85
+ $quoteItem = Mage::getModel('sales/quote_item')->setStoreId(Mage::app()->getStore()->getId())->setProduct($productObj);
86
+ $quoteItem->setConvertedPrice((string)$item_to_show['data']['price']);
87
+ $quoteItem->setQty((string)$item_to_show['data']['quantity']);
88
+ $quoteItem->setFreeProduct((int)$item_to_show['free_added']);
89
+ $quoteItem->setQuote($this);
90
+ $quoteItem->setId($idx_cart);
91
+ echo $this->getItemHtml($quoteItem);
92
+ }
93
+ }
94
+ }
95
+ if (isset($_SESSION['qixol_quoted_items']['summary'])){
96
+ foreach ($_SESSION['qixol_quoted_items']['summary'] as $inline_cart_promotion)
97
+ if($inline_cart_promotion['data']['basketlevel']>0){
98
+ ?>
99
+ <li class="item odd" xmlns="http://www.w3.org/1999/html">
100
+ <div class="promotion_cart_inline_box" ><?php echo $inline_cart_promotion['data']['display_text'] ?>&nbsp;&nbsp;:&nbsp;&nbsp;<?php
101
+ switch ($inline_cart_promotion['data']['type']){
102
+ case 'DELIVERYREDUCTION';
103
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
104
+ break;
105
+ case 'ISSUEPOINTS';
106
+ echo $inline_cart_promotion['data']['issuedpoints']."&nbsp;pt.";
107
+ break;
108
+ case 'BASKETREDUCTION';
109
+ echo $this->helper('checkout')->formatPrice($inline_cart_promotion['data']['discountamount']);
110
+ break;
111
+ }
112
+ ?></div>
113
+ </li>
114
+ <?
115
+ }
116
+ }
117
+ }
118
+ //}} qixol end wrap block
119
+ ?>
120
+ </ul>
121
+ </div>
122
+ <script type="text/javascript">
123
+ truncateOptions();
124
+ decorateList('cart-sidebar', 'none-recursive');
125
+ $j('document').ready(function() {
126
+ var minicartOptions = {
127
+ formKey: "<?php echo $this->getFormKey();?>"
128
+ }
129
+ var Mini = new Minicart(minicartOptions);
130
+ Mini.init();
131
+ });
132
+ </script>
133
+
134
+ <div id="minicart-widgets">
135
+ <?php echo $this->getChildHtml('cart_promotion') ?>
136
+ </div>
137
+ <div class="block-content">
138
+ <p class="subtotal">
139
+ <?php if ($this->canApplyMsrp()): ?>
140
+ <span class="map-cart-sidebar-total"><?php echo $this->__('ORDER TOTAL WILL BE DISPLAYED BEFORE YOU SUBMIT THE ORDER'); ?></span>
141
+ <?php else: ?>
142
+ <span class="label"><?php echo $this->__('Cart Subtotal:') ?></span> <?php echo Mage::helper('checkout')->formatPrice($this->getSubtotal()) ?>
143
+ <?php if ($_subtotalInclTax = $this->getSubtotalInclTax()): ?>
144
+ <br />(<?php echo Mage::helper('checkout')->formatPrice($_subtotalInclTax) ?> <?php echo Mage::helper('tax')->getIncExcText(true) ?>)
145
+ <?php endif; ?>
146
+ <?php endif; ?>
147
+ </p>
148
+ </div>
149
+
150
+
151
+ <div class="minicart-actions">
152
+ <?php if($_cartQty && $this->isPossibleOnepageCheckout()): ?>
153
+ <ul class="checkout-types minicart">
154
+ <?php echo $this->getChildHtml('extra_actions') ?>
155
+ <li>
156
+ <a title="<?php echo $this->quoteEscape($this->__('Checkout')) ?>" class="button checkout-button" href="<?php echo $this->getCheckoutUrl() ?>">
157
+ <?php echo $this->__('Checkout') ?>
158
+ </a>
159
+ </li>
160
+ </ul>
161
+ <?php endif ?>
162
+ <a class="cart-link" href="<?php echo $this->getUrl('checkout/cart'); ?>">
163
+ <?php echo $this->__('View Shopping Cart'); ?>
164
+ </a>
165
+ </div>
166
+
167
+ <?php else: ?>
168
+ <p class="empty"><?php echo $this->__('You have no items in your shopping cart.') ?></p>
169
+
170
+ <?php endif ?>
171
+ </div>
172
+ <!-- // qixol //-->
173
+ <?php
174
+ //$place_box_in_design_after_pattern=Mage::getStoreConfig('qixol/integraion/boxcartpromotion')
175
+ $place_box_in_design_after_pattern='.cart';
176
+
177
+
178
+ $cart_advertisment_=Mage::getModel('qixol/advert');
179
+ $text_to_show_cart_adv=$cart_advertisment_->getCartInlineAdv();
180
+
181
+ $inline_cart_advert='';
182
+
183
+ //for cart items
184
+ $cart = Mage::getModel('checkout/cart')->getQuote();
185
+ foreach ($cart->getAllItems() as $item) {
186
+ if (isset($_SESSION['qixol_quoted_items'])&&isset($_SESSION['qixol_quoted_items']['items'][$item->getId()])){
187
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')>0 && Mage::getStoreConfig('qixol/advanced/services')!='dontdisplay' &&
188
+ isset($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions']))
189
+ foreach ($_SESSION['qixol_quoted_items']['items'][$item->getId()]['promotions'] as $promotion){
190
+
191
+ //inline level promotion
192
+ if ((int)$promotion['basketlevel']==0&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']])&&Mage::getStoreConfig('qixol/advanced/services')=='displayname'){
193
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_promo\">".addslashes($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['data']['display_text'])."</div>').appendTo($('#qixol_idx_cart_item_name_".$item->getId()."'));";
194
+ } elseif((int)$promotion['basketlevel']==0&&(Mage::getStoreConfig('qixol/advanced/services')=='displaytext'||Mage::getStoreConfig('qixol/advanced/services')=='displaytype')) {
195
+ if ($cart_promotion_data=Mage::getModel('qixol/promotions')->load($promotion['id'])){
196
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_promo\">".addslashes(Mage::getStoreConfig('qixol/advanced/services')=='displaytype'?$cart_promotion_data->getPromotionType():$cart_promotion_data->getPromotionText())."</div>').appendTo($('#qixol_idx_cart_item_name_".$item->getId()."'));";
197
+ }
198
+ }
199
+
200
+ //basket level promotion
201
+ if ((int)$promotion['basketlevel']==1&&isset($_SESSION['qixol_quoted_items']['summary'][$promotion['id']]))
202
+ $text_to_show_cart_adv.='';//should be also added??? $_SESSION['qixol_quoted_items']['summary'][$promotion['id']]['display_text'];
203
+
204
+ }
205
+
206
+ //if quantity changed (get one + one free so will be splited to 2 products with 1 free)
207
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')>0&&$_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_qty']>0)
208
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_new_qty\">For&nbsp;promo&nbsp;".addslashes($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['quantity'])."&nbsp;Qty</div>').appendTo($('#qixol_idx_mcart_item_qty_".$item->getId()."'));";
209
+
210
+ if ((int)Mage::getStoreConfig('qixol/frontend/mcartjavascr')>0&&$_SESSION['qixol_quoted_items']['items'][$item->getId()]['updated_price']>0)
211
+ $inline_cart_advert.="$('<div class=\"cart_inline_item_new_price\">Only for ".addslashes($this->helper('checkout')->formatPrice($_SESSION['qixol_quoted_items']['items'][$item->getId()]['data']['lineamount']))."</div>').appendTo($('#qixol_idx_mcart_item_price_".$item->getId()."'));";
212
+
213
+ }
214
+ }
215
+ $total_discount_amount=0;
216
+ if (isset($_SESSION['qixol_quoted_items']['items'])){
217
+ foreach ($_SESSION['qixol_quoted_items']['items'] as $cart_item_process){
218
+ if ($cart_item_process['data']['totaldiscount']>0&&$cart_item_process['new']==0&&((int)Mage::getStoreConfig('qixol/advanced/separateitem')>0||$cart_item_process['data']['generated']==false)){
219
+ $total_discount_amount+=$cart_item_process['data']['totaldiscount'];
220
+ }
221
+ //subtotal are not including delivery
222
+ /*elseif($cart_item_process['data']['totaldiscount']>0&&$cart_item_process['data']['type']=='DELIVERYREDUCTION'){
223
+ $total_discount_amount+=$cart_item_process['data']['totaldiscount'];
224
+ }*/
225
+ }
226
+
227
+ }
228
+
229
+ if (isset($_SESSION['qixol_quoted_items']['summary'])){
230
+ foreach ($_SESSION['qixol_quoted_items']['summary'] as $cart_total_process){
231
+ if ($cart_total_process['data']['discountamount']>0&&$cart_total_process['data']['type']=='BASKETREDUCTION'){
232
+ $total_discount_amount+=$cart_total_process['data']['discountamount'];
233
+ }
234
+ }
235
+ }
236
+
237
+ if ($text_to_show_cart_adv!==false&&strlen($text_to_show_cart_adv)>5||$inline_cart_advert!=''){
238
+ ?><script type="text/javascript" src="http://qixol.holbidev.co.uk/js/lib/jquery/jquery-1.10.2.min.js"></script><script type="text/javascript">$.noConflict();jQuery( document ).ready(function( $ ) { <?php
239
+ //commented -show only on base cart
240
+ /*if ($text_to_show_cart_adv!==false&&strlen($text_to_show_cart_adv)>5)
241
+ echo '$("'.$place_box_in_design_after_pattern.'").after("<div class=\'qixolcartpromo\'>'.$text_to_show_cart_adv.'</div>");';*/
242
+ if ($inline_cart_advert!='')
243
+ echo preg_replace("/[\n\r]+/","",$inline_cart_advert);
244
+ if ($total_discount_amount>0){
245
+ /*?>$('<tr class="qixol_discount"><td class="a-right" colspan="1" > Discount</td><td class="a-right" ><span class="qixol_total_price"><?php echo $this->helper('checkout')->formatPrice($total_discount_amount);; ?></span></td></tr>').appendTo($('#shopping-cart-totals-table tbody'));<?php*/
246
+ ?>$('#header-cart .subtotal .price').addClass('qixol_price_cross');$('<?php echo $this->helper('checkout')->formatPrice($cart->getSubtotal()-$total_discount_amount); ?>').appendTo($('#header-cart .subtotal .price').parent());<?php
247
+ }
248
+ ?>});</script><?php
249
+ }
250
+ ?>
app/etc/modules/Holbi_Qixol.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Holbi_Qixol>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <version>0.1.0</version>
8
+ </Holbi_Qixol>
9
+ </modules>
10
+ </config>
app/locale/en_US/Holbi_Qixol.csv ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "%s","%s"
2
+ "Banner Box Manager","Banner Box Manager"
3
+ "Add Banner box","Add Banner box"
4
+ "Banner Manager","Banner Manager"
5
+ "Add Banner Item","Add Banner Item"
6
+ "Add Shipping Map","Add Shipping Map"
7
+ "Wrong column format","Wrong column format"
8
+ "Shipping Name Magento:","Shipping Name Magento:"
9
+ "Shipping Name To","Shipping Name To"
10
+ "Edit","Edit"
11
+ "Delete","Delete"
12
+ "Shipping Map Information","Shipping Map Information"
13
+ "Item information","Item information"
14
+ "Name to be send to quxiol.","Name to be send to quxiol."
15
+ "Save Item","Save Item"
16
+ "Delete Item","Delete Item"
17
+ "Save And Continue Edit","Save And Continue Edit"
18
+ "Add Item","Add Item"
19
+ "Edit Item '%s'","Edit Item '%s'"
20
+ "Banner Box Type","Banner Box Type"
21
+ "Enabled?","Enabled?"
22
+ "Translate Type","Translate Type"
23
+ "Action","Action"
24
+ "ID","ID"
25
+ "Image","Image"
26
+ "Link Name","Link Name"
27
+ "Title","Title"
28
+ "Banner Group","Banner Group"
29
+ "Not defined","Not defined"
30
+ "Buy one get one free","Buy one get one free"
31
+ "Buy one get one reduced","Buy one get one reduced"
32
+ "Bundle","Bundle"
33
+ "Deal","Deal"
34
+ "Free product","Free product"
35
+ "Issue points","Issue points"
36
+ "Basket reduction","Basket reduction"
37
+ "Delivery coupon","Delivery coupon"
38
+ "Product reduction","Product reduction"
39
+ "Status","Status"
40
+ "Sort Order","Sort Order"
41
+ "Default?","Default?"
42
+ "Are you sure?","Are you sure?"
43
+ "Change status","Change status"
44
+ "Qixol","Qixol"
45
+ "Manage Banners","Manage Banners"
46
+ "Manage Banner Position","Manage Banner Position"
47
+ "Manage Shippings Map","Manage Shippings Map"
48
+ "Qixol Extension","Qixol Extension"
49
+ "Qixol Setting","Qixol Setting"
50
+ "General / Intagration","General / Intagration"
51
+ "Qixol Setting","Qixol Setting"
52
+ "Enabled","Enabled"
53
+ "Company Key","Company Key"
54
+ "Company key assigned to you when you register in Qixol Promo <a href=\"http://www.qixolpromo.com\">click</a>.","Company key assigned to you when you register in Qixol Promo <a href=\"http://www.qixolpromo.com\">click</a>."
55
+ "Integration Services","Integration Services"
56
+ "Front-End Settings","Front-End Settings"
57
+ "Show promotion sticker in cataloge","Show promotion sticker in cataloge"
58
+ "Show promotion stickers on products on cataloge","Show promotion stickers on products on cataloge"
59
+ "Show promotion sticker on product","Show promotion sticker on product"
60
+ "Show promotion stickers on the product page","Show promotion stickers on the product page"
61
+ "Show promotion boxes","Show promotion boxes"
62
+ "Show promotion box in cart","Show promotion box in cart"
63
+ "Show cart related only promotion box","Show cart related only promotion box"
64
+ "Use Javascript onepage update.","Use Javascript onepage update."
65
+ "One one page chackout use javascript cart update.","One one page chackout use javascript cart update."
66
+ "Use Javascript cart update.","Use Javascript cart update."
67
+ "Cart confirmation use javascript replace.","Cart confirmation use javascript replace."
68
+ "Use Javascript topcart update.","Use Javascript topcart update."
69
+ "Top cart javascript replace.","Top cart javascript replace."
70
+ "Advanced","Advanced"
71
+ "Basket Validation","Basket Validation"
72
+ "Shopping Cart Configuration","Shopping Cart Configuration"
73
+ "Show promotional details","Show promotional details"
74
+ "Synchronized Items","Synchronized Items"
75
+ "Synchronization Config","Synchronization Config"
76
+ "Send real Category as categorycode","Send real Category as categorycode"
77
+ "Send product categories in attribute categorycode","Send product categories in attribute categorycode"
78
+ "Stores","For stores"
79
+ "Synchronise Customer groups","Synchronise Customer groups"
80
+ "Synchronise Customer groups","Synchronise Customer groups"
81
+ "Synchronise Shipping Methods","Synchronise Shipping Methods"
82
+ "Synchronise Curency Sore List","Synchronise Curency Sore List"
83
+ "Synchronise Stores","Synchronise Stores"
84
+ "Channel","Channel"
85
+ "Store Group","Store Group"
86
+ "The channel and store group are used in the store hierarchy submited to Promo.","The channel and store group are used in the store hierarchy submited to Promo."
87
+ "Synchronise on Saving","Synchronise on Saving"
88
+ "Customers","Customers"
89
+ "Synchronization Config","Synchronization Config"
90
+ "Synch only this types:","Synch only this types:"
91
+ "Shippings","Shippings"
92
+ "Only active","Only active"
93
+ "Synch only this types:","Synch only this types:"
94
+ "Products Attributes","Products Attributes"
95
+ "Include when synch product:",""
96
+ "Run export products","Run export products"
97
+ "Export products to qixol.","Export products to qixol."
98
+ "Run import promotions","Run import promotions"
99
+ "Import promotions from qixol.","Import promotions from qixol."
100
+ "Synchronise Products","Synchronise Products"
101
+ "product export run","product export run"
102
+ "Export finished","Export finished"
103
+ "promotion import run","promotion import run"
104
+ "Import finished","Import finished"
105
+ "Stickers Manager","Stickers Manager"
106
+ "Add Sticker","Add Sticker"
107
+ "Store Name Magento:","Store Name Magento:"
108
+ "Store Name To","Store Name To"
109
+ "Store Map Information","Store Map Information"
110
+ "Use Dafault Banner Promotion?","Use Dafault Banner Promotion?"
111
+ "Default Banner Promotion name","Default Banner Promotion name"
112
+ "Unique Banner Promotion refference","Unique Banner Promotion refference"
113
+ "Products","Products"
114
+ "Currency","Currency"
115
+ "Promotions","Promotions"
116
+ "Imported","Imported"
117
+ "Manage Stores Map","Manage Stores Map"
118
+ "Banner boxes Manager","Banner boxes Manager"
119
+ "Box Manager","Box Manager"
120
+ "Unable to find item to save","Unable to find item to save"
121
+ "Item was successfully deleted","Item was successfully deleted"
122
+ "Please select item(s)","Please select item(s)"
123
+ "Total of %d record(s) were successfully deleted","Total of %d record(s) were successfully deleted"
124
+ "Total of %d record(s) were successfully updated","Total of %d record(s) were successfully updated"
125
+ "Customer Group Map","Customer Group Map"
126
+ "Customer Groups Map","Customer Groups Map"
127
+ "Shippings Map","Shippings Map"
128
+ "Sticker Manager","Sticker Manager"
129
+ "Item Sticker","Item Sticker"
130
+ "Stores Map","Stores Map"
131
+ "Qixol coupon '%s' was applied to your order.","Qixol coupon '%s' was applied to your order."
132
+ "Qixol coupon '%s' not applicable.","Qixol coupon '%s' not applicable."
media/custom/banners/File-1459507414.jpg ADDED
Binary file
media/custom/banners/resize/File-1459507414.jpg ADDED
Binary file
media/custom/stickers/File-1460972848.png ADDED
Binary file
media/custom/stickers/resize/File-1460972848.png ADDED
Binary file
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Holbi_Qixol</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license>GNU General Public License (GPL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Qixol Promo</summary>
10
+ <description>Qixol Promo</description>
11
+ <notes>The first stable version</notes>
12
+ <authors><author><name>Sergey</name><user>Sergey_Holbi</user><email>sbukovetsky@holbi.co.uk</email></author></authors>
13
+ <date>2016-05-26</date>
14
+ <time>16:01:47</time>
15
+ <contents><target name="magecommunity"><dir name="Holbi"><dir name="Qixol"><dir name="Block"><dir name="Adminhtml"><dir name="Banner"><dir name="Edit"><file name="Form.php" hash="d71914390aab1875d9fb2413f4d04613"/><dir name="Tab"><file name="Form.php" hash="6e65041a8706b168f9a4eb4962a586a8"/></dir><file name="Tabs.php" hash="a5fd5d419c05984afde1327e9786c5ef"/></dir><file name="Edit.php" hash="ebe0882eb9fecd3f3d0d8087f0924ae6"/><file name="Grid.php" hash="a2ad1c0c3070bd8972029be05b7146b0"/></dir><file name="Banner.php" hash="e7803ebe90ef08deebbd2cbf9abb0c6b"/><dir name="Bannerboxes"><dir name="Edit"><file name="Form.php" hash="d6c3af85c039ed10bd4b5298e5a8fdf7"/><dir name="Tab"><file name="Form.php" hash="4283e54a04538c7f41e90cd3d1b179d6"/></dir><file name="Tabs.php" hash="6816f2f18877aec8ffb85a367437894a"/></dir><file name="Edit.php" hash="dba2ea53db50ed2b4bf74c3140354999"/><file name="Grid.php" hash="783889924b3df86b383ea1e6c3332f55"/></dir><file name="Bannerboxes.php" hash="d5cf8e6e5aff896fc223ae0865ace01f"/><dir name="Customergrouspmap"><dir name="Edit"><file name="Form.php" hash="c1b3cc172df6031509a311cb86117432"/><dir name="Tab"><file name="Form.php" hash="51c06cf0172fcfd588c7a478112cda4e"/></dir><file name="Tabs.php" hash="e2e12aae00892771e646299d780b86fb"/></dir><file name="Edit.php" hash="9c34b4674745e4e7d2338ded7fa5fffb"/><file name="Grid.php" hash="ca515bbc1cfa5b08e880446ce2fc7a57"/></dir><file name="Customergrouspmap.php" hash="396275064dd3113b1eb77e047b8da3e4"/><file name="Qixolbackend.php" hash="4d0e68d1a93e34828845546f73632da3"/><dir name="Sales"><dir name="Order"><file name="Total.php" hash="130b2e3ac9addf6c549ca28f4f7601be"/></dir></dir><dir name="Shippingmap"><dir name="Edit"><file name="Form.php" hash="b97943e0a024201b7dce5f87a466386f"/><dir name="Tab"><file name="Form.php" hash="42d23355f861bb11478d819aac4cd272"/></dir><file name="Tabs.php" hash="43cc0071d7150372f405c90e2aeff8d3"/></dir><file name="Edit.php" hash="632f884ff1f13c8783fac29fa159d68d"/><file name="Grid.php" hash="65263b3b765ea6fe178b25b79457f06d"/></dir><file name="Shippingmap.php" hash="12bbf577948da9ed308c35c23c6a9557"/><dir name="Sticker"><dir name="Edit"><file name="Form.php" hash="5c9cfe98d9f675c2d80659bd5d102480"/><dir name="Tab"><file name="Form.php" hash="657537928a3a9abd32f0043a44441257"/></dir><file name="Tabs.php" hash="c5030382b2dce637cb01876ba3516cec"/></dir><file name="Edit.php" hash="28df2c2abab10786fc402dc7707705a0"/><file name="Grid.php" hash="b9e23d604679448bf17995c6f6f6585c"/></dir><file name="Sticker.php" hash="bfd8e13b42c6d87e70ac897e11077592"/><dir name="Storesmap"><dir name="Edit"><file name="Form.php" hash="49d409972ca75ba6376df6aae3070311"/><dir name="Tab"><file name="Form.php" hash="928d701c1cf95861eda1a0bef9bd7176"/></dir><file name="Tabs.php" hash="204a1c126c905dfe1e31cfffa846d2e9"/></dir><file name="Edit.php" hash="f43946f32e4c3d0494c048ea6cf00803"/><file name="Grid.php" hash="6e773cc5594269e3fa0b6b7990df1d0b"/></dir><file name="Storesmap.php" hash="2842e7961008c9e239ee1173335a5f7d"/><dir name="System"><dir name="Config"><file name="Attributes.php" hash="77e2e0b38c4e66e3777fc9650513cf43"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Filter"><file name="Banner.php" hash="c2acfb4db1186c499558ca567eb48ff6"/></dir><dir name="Renderer"><file name="Banner.php" hash="296d1e458e6e9c7ef7f6a61f15a88006"/><file name="Sticker.php" hash="2d46519cc50d358210763f6bcbb53cf6"/></dir></dir><file name="Column.php" hash="24649c123824e02fc5bc0065a2e10b9f"/></dir><file name="Grid.php" hash="67c71f7b791a9ddc3920acc817460842"/></dir></dir><file name="Banner.php" hash="62bca7639d22f76f6133e02c9fed05b7"/><file name="Bannerboxes.php" hash="93d126ad3d9245c31eec24c7840bc6df"/><file name="Customergrouspmap.php" hash="7c332c2486315898244effc7376e31f4"/><file name="Issuedcoupon.php" hash="9d55be59c65290b8e59a718f3b401f48"/><dir name="Sales"><file name="Creditmemo.php" hash="92cda7a592b436d3c041f901537b0e29"/><file name="Invoice.php" hash="74fbc325806674d1efd40c58eb8ed24b"/><dir name="Order"><file name="Total.php" hash="1fee6af13f937861c6515ffb05b875c9"/></dir><file name="Order.php" hash="e347cf1a2dd983f1bad98e001cc97f09"/></dir><file name="Shippingmap.php" hash="152317fea90f4a8245a990b6a21d3886"/><file name="Startexportbutton.php" hash="484b3948e3c3aea48e2d2cc6844c5dac"/><file name="Startimportbutton.php" hash="6bdcd1e205b4d88fdf2202c789f4a2bc"/><file name="Sticker.php" hash="9b6c1dddb45b4cacda8d57b02412d84d"/><file name="Storesmap.php" hash="65d09ba7ed0481da9259dcec979f3fd9"/></dir><dir name="Helper"><file name="Data.php" hash="98c158b7a0bb71b0a6d1f59a4862691d"/></dir><dir name="Model"><file name="Advert.php" hash="e58c3ad343d964711f1e54859563725b"/><file name="Banner.php" hash="212456b3d92ff0e757a50ed5606146fb"/><file name="Bannerboxes.php" hash="bb4acb463a52a89d0063b8e949db5c46"/><file name="Bannerimages.php" hash="a760b4a6181afa849a5aec18cdec5d5a"/><file name="Bannerresize.php" hash="0c6f139d85181eb5f87b25acc4466688"/><file name="Bonuspoints.php" hash="69473842674ac8e73f62cd3576a8fde8"/><file name="Creditmemopoints.php" hash="8f358656a81dbecbe6e52838ad3c7250"/><file name="Cron.php" hash="e06f60c416737838485c484b8495760b"/><file name="Customergrouspmap.php" hash="18a434ca18a3fcff2fcc4ca9d00546ee"/><file name="Deletedproduct.php" hash="5094bd3b2fc5d4351090274a9aeaac58"/><file name="Exportstat.php" hash="25f805f0b75e288f7028368be3c8ef97"/><file name="Exprpocessstat.php" hash="cbf898eae206c986208df350ca99daa8"/><file name="Invoicepoints.php" hash="cc5323b8a47f52ea997f75d6955ece54"/><file name="Issuedcoupon.php" hash="d58a9cb376c05b6bab2d752294e09240"/><dir name="Mysql4"><dir name="Banner"><file name="Collection.php" hash="a6e42a9870849271c905c9afd5797146"/></dir><file name="Banner.php" hash="82a41ee8e5bf97bd496daf2d5722a61f"/><dir name="Bannerboxes"><file name="Collection.php" hash="660b47e973bccd7476f417a1180047c0"/></dir><file name="Bannerboxes.php" hash="619c0bbebe9998c4f4a08e64c6981433"/><dir name="Bannerimages"><file name="Collection.php" hash="fc19451f38ea15d2dedba512a30e7d3a"/></dir><file name="Bannerimages.php" hash="5eafd1b353d0837cccfb5bd81467ae0d"/><dir name="Bonuspoints"><file name="Collection.php" hash="ecb2d5983d7a6427095c3d19fe669c96"/></dir><file name="Bonuspoints.php" hash="884d4799506f9756f782c18afa348b19"/><dir name="Customergrouspmap"><file name="Collection.php" hash="ad86722b8b7df02099df0303cec67741"/></dir><file name="Customergrouspmap.php" hash="2d6d2d92fbfd3abdb89d165f9f85ed3a"/><dir name="Deletedproduct"><file name="Collection.php" hash="2c684f9f6bc07a2c2d628273792ea944"/></dir><file name="Deletedproduct.php" hash="82b3f14c209563687ab8f46326cba1b5"/><dir name="Exportstat"><file name="Collection.php" hash="652408a7900b75b6d6ff12fccabeac62"/></dir><file name="Exportstat.php" hash="42bbc370d24ea0378615154e3f0609cc"/><dir name="Exprpocessstat"><file name="Collection.php" hash="3276373ca5eac84f0c02f61ecd7b4bb7"/></dir><file name="Exprpocessstat.php" hash="9d21536935477e42e007a583ef01f702"/><dir name="Issuedcoupon"><file name="Collection.php" hash="d6777620dec2ee1576b3a6bf348ae471"/></dir><file name="Issuedcoupon.php" hash="8e833c092f6a233ae4f90844a670cc20"/><dir name="Promotions"><file name="Collection.php" hash="cb03ee5a074e2b33d262f6791ec8546e"/></dir><file name="Promotions.php" hash="0ec34451a06f915011e6748b79119a43"/><dir name="Shippingmap"><file name="Collection.php" hash="fcd435cf002813799807b7162d3d3ed6"/></dir><file name="Shippingmap.php" hash="f0a339441e70f7b0a9c93b4e51e9ddba"/><dir name="Sticker"><file name="Collection.php" hash="e053aa1e885d6e088a42b9422a34b2d4"/></dir><file name="Sticker.php" hash="267d84eace8e01df78757d52d293ffc0"/><dir name="Storesmap"><file name="Collection.php" hash="6522df844fb0a112f7a2fc5fc2231b0f"/></dir><file name="Storesmap.php" hash="ed88a28b499ada6c9caec701a578252b"/></dir><file name="Observer.php" hash="64257a56611bf2b9cd916894be6b92d5"/><file name="Ordertotalpoints.php" hash="b130e1dda5d8dce5ea1326fe1a6938f0"/><file name="Promotions.php" hash="3f27c9cf03e1313173d80114f86f0ea7"/><file name="Shippingmap.php" hash="5934ad1ce43f54fe471f6b28eb4bf40d"/><file name="Sinch.php" hash="b9b40dee529aa13e6790c9805d2e300f"/><file name="Status.php" hash="1af6751454ee49a639ee4a1a80d4e1eb"/><file name="Sticker.php" hash="18d49365d84cf60d0a63145b69fe85b0"/><file name="Storesmap.php" hash="334e0504f520bb8d83c34880d16875ac"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Attributes.php" hash="d784f4eded271f604e5dca79f0241463"/><dir name="Cart"><file name="Settings.php" hash="046910c563a1db3dc0c254b5c432ba79"/></dir><dir name="Customers"><file name="List.php" hash="616d7245643beb825c6707416f5f8a27"/></dir><dir name="Iservices"><file name="Values.php" hash="dae568b7699e00ec52ab4a89ba4fa672"/></dir><dir name="Shippings"><file name="List.php" hash="f018937ee8c0f629b1ac5bbc0b7a1a1d"/></dir><file name="Stores.php" hash="c6bda52815c10d26191c6b76b739e8b0"/></dir></dir></dir><dir name="Wysiwyg"><file name="Config.php" hash="90f8c29f21e08ba904372d442a3763d0"/></dir><file name="config.php" hash="791d755b14b819157cc5fca81852be40"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BannerController.php" hash="c1afb0ed57c19a39e70f75566866c8be"/><file name="BannerboxesController.php" hash="18bcc6a4174715ba3b09ba41002a5f74"/><file name="CustomergrouspmapController.php" hash="e76d0ce7609541ed3d410515b58cf920"/><file name="QixolbackendController.php" hash="ac6b9e50ee761186e7057f8a4d49ca14"/><file name="ShippingmapController.php" hash="6a669e3830ffec4b767c6c4d69c6b9f0"/><file name="StickerController.php" hash="470d66f98789030a7c85d62c8782986f"/><file name="StoresmapController.php" hash="c43892e5d05980d15ae4ac64a4bd50ca"/></dir><file name="AjaxController.php" hash="34da1d4782504ad8eb61ad615e650526"/><file name="CartController.php" hash="8d1081bb9a993c8c2a00162b6c815b37"/><file name="IndexController.php" hash="402d66f4fc4b61d7b68d633dde27c482"/><file name="IssuedcouponController.php" hash="f979cc85991b4c512762812f0b5b6ff6"/></dir><dir name="etc"><file name="adminhtml.xml" hash="9f4fe1ad17beda87ffb36f9185352da5"/><file name="config.xml" hash="4e4a1351686522f604e29dad71055f48"/><file name="system.xml" hash="dbc99cf01d73353b4339211e11ce5302"/></dir><dir name="sql"><dir name="qixol_setup"><file name="mysql4-install-0.1.0.php" hash="26e3086b2acedb2a05b4f4dd5883cb03"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="qixol.xml" hash="9c29c3af1f828ce9409e19dd2c4997bf"/></dir><dir name="template"><dir name="qixol"><dir name="cart"><file name="advert.phtml" hash="b0edba9e87f90ed3936b4543078dd4bf"/><file name="bonuspointbox.phtml" hash="558a50838ea7148dd106850850497231"/><file name="cart.phtml" hash="6b3f6b3911446fbf32b93e1ac7887272"/><dir name="item"><file name="default.phtml" hash="aea076b7e11eec60a5679bec0afe0160"/></dir><file name="totals.phtml" hash="32fa9abb563b44dc2d47434c709f8ae2"/></dir><dir name="issuedcoupon"><file name="list.phtml" hash="cefe204c4b02ab55ef1a291fedd6e09a"/></dir><dir name="issuedpoints"><file name="box.phtml" hash="2d534d83303b774cc4b254d1612771b7"/><file name="dashboard_points.phtml" hash="aafc7550392e7d335b5275317fc8adfb"/></dir><dir name="minicart"><file name="advert.phtml" hash="ba608046e14a5256aa7aa4de00a5b4c8"/><file name="default.phtml" hash="1558c016fb475639bef78c86a98fca65"/><file name="mincart.phtml" hash="1a8aa6db499d9a896e2768b4c4206af6"/></dir><dir name="myaccount"><dir name="order"><dir name="email"><file name="default.phtml" hash="85f8299e6bf0a7d8a2e0760bfe247fe8"/><file name="items.phtml" hash="b644e367111d6da7eb3f7d38e25e10d4"/></dir><dir name="invoice"><file name="default.phtml" hash="8d3f98f1b23f4d336b24b1f2082cfa11"/><file name="invoice.phtml" hash="07a7eeb965726d75509efd39ba065ccd"/></dir><dir name="items"><file name="default.phtml" hash="273be10efd43ed4fa15d7b0617be54a6"/><file name="items.phtml" hash="aa9fc3723982ecc1c46c3bc9c752ecbc"/></dir><dir name="print"><file name="default.phtml" hash="df6637723ed3614b4ef55716d2ec6b4a"/><file name="messages.phtml" hash="952bccf9afe8e4c04306f70f7bed6610"/><file name="print.phtml" hash="79d9b8e56c74d3e8c9d1b239440f611d"/></dir></dir></dir><dir name="onepage"><file name="advert.phtml" hash="a62651791334d131ed6cc01638b2488a"/><file name="item.phtml" hash="e1cb72018ef4c415c7ec1ae3194a0681"/><file name="review.phtml" hash="2676aaaea6b2f041d3166084f1f5b87d"/></dir><dir name="product"><file name="qixol_adv.phtml" hash="303b6597fcde958595a8fdc82f62c43c"/><file name="qixol_info_details.phtml" hash="f3977e56147100a3cf13f67fd76d792e"/><file name="qixol_product_info.phtml" hash="39f0565311a2c7ada4df7ea43c1f926f"/></dir><dir name="sidebar"><file name="advert.phtml" hash="b7ecad79b3f7e2de4690c0245c380f82"/><file name="default.phtml" hash="317f41c1259a37e576827ead92683945"/><file name="sidebar.phtml" hash="1324c07adc3ceb719e910add0e613e18"/></dir></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="template"><dir name="qixol"><dir name="minicart"><file name="advert.phtml" hash="ba608046e14a5256aa7aa4de00a5b4c8"/><file name="default.phtml" hash="e59d0727333f190f5e4ca17d903cf233"/><file name="mincart.phtml" hash="1a8aa6db499d9a896e2768b4c4206af6"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="qixol.xml" hash="91d82605756c495c2fc4002642b48f36"/></dir><dir name="template"><dir name="qixol"><file name="bannerboxes.phtml" hash="947eb49c5f7420e1442141024ae80e92"/><file name="banners.phtml" hash="188b11b26646abbed6f0c6c9e68cc1f7"/><file name="customergrouspmap.phtml" hash="947eb49c5f7420e1442141024ae80e92"/><dir name="order"><file name="advert.phtml" hash="0456514c76c469e25b64ca9152480838"/></dir><file name="qixolbackend.phtml" hash="3012313aed77e18b6294c7fc4f4bb8ec"/><file name="shippingmap.phtml" hash="947eb49c5f7420e1442141024ae80e92"/><file name="stickers.phtml" hash="188b11b26646abbed6f0c6c9e68cc1f7"/><file name="storesmap.phtml" hash="947eb49c5f7420e1442141024ae80e92"/><dir name="system"><dir name="config"><file name="attributes.phtml" hash="a8aa43dd93f3e775cd9c3b8a236ab318"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Holbi_Qixol.csv" hash="23218037ec52ca71df65dac18a5771a4"/></dir></target><target name="mageetc"><dir name="modules"><file name="Holbi_Qixol.xml" hash="59d6337543a22d444bfe06576926a63f"/></dir></target><target name="magemedia"><dir name="custom"><dir name="banners"><file name="File-1459507414.jpg" hash="26b1b67be785a51f43505b629d31837a"/><dir name="resize"><file name="File-1459507414.jpg" hash="26b1b67be785a51f43505b629d31837a"/></dir></dir><dir name="stickers"><file name="File-1460972848.png" hash="15e3e653f3efd82a4f619cc253813038"/><dir name="resize"><file name="File-1460972848.png" hash="15e3e653f3efd82a4f619cc253813038"/></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="_run.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/><file name="_yes.gif" hash="0afb20898a704a106cb4c598868abf32"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="qixol.css" hash="e69d3270a5014f45c607a1d335b687ef"/></dir><dir name="images"><dir name="qixol"><file name="BASKETREDUCTION.png" hash="f192b6bf609a7db2857e923b8b36ab08"/><file name="BOGOF.png" hash="f192b6bf609a7db2857e923b8b36ab08"/><file name="BOGOR.png" hash="f192b6bf609a7db2857e923b8b36ab08"/><file name="BUNDLE.png" hash="f192b6bf609a7db2857e923b8b36ab08"/><file name="DEAL.png" hash="f192b6bf609a7db2857e923b8b36ab08"/><file name="DELIVERYREDUCTION.png" hash="f192b6bf609a7db2857e923b8b36ab08"/><file name="FREEPRODUCT.png" hash="f192b6bf609a7db2857e923b8b36ab08"/><file name="ISSUECOUPON.png" hash="f192b6bf609a7db2857e923b8b36ab08"/><file name="ISSUEPOINTS.png" hash="f192b6bf609a7db2857e923b8b36ab08"/><file name="PRODUCTSREDUCTION.png" hash="f192b6bf609a7db2857e923b8b36ab08"/><file name="red_sales_sticker_pv.png" hash="f192b6bf609a7db2857e923b8b36ab08"/></dir></dir><dir name="js"><dir name="lib"><file name="jquery.cycle2.min.js" hash="24f809434b3e494cc7b98c6c08404b33"/><file name="jquery.cycle2.swipe.min.js" hash="15747fbd45dd1adcaf8f04a2d8a71d68"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="var"><dir name="logs_qixol"><file name="logs_here.txt" hash="68b329da9893e34099c7d8ad5cb9c940"/></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/adminhtml/default/default/images/_run.gif ADDED
Binary file
skin/adminhtml/default/default/images/_yes.gif ADDED
Binary file
skin/frontend/base/default/css/qixol.css ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .background_promotion_sale{
2
+ position: absolute;
3
+ right: 0;
4
+ top: 0;
5
+ width: 65px;
6
+ height: 66px;
7
+ display: block;
8
+ z-index: 2;
9
+ background:url(../images/qixol/red_sales_sticker_pv.png) 0 0 no-repeat;
10
+ }
11
+ .promotion_cart_inline_box {
12
+ font-weight:bold;
13
+ color:#00A;
14
+ }
15
+ .promotion_cart_inline_box {
16
+ font-weight:bold;
17
+ color:#00A;
18
+ }
19
+ .cart_inline_item_promo {
20
+ font-weight:bold;
21
+ color:#00A;
22
+ }
23
+ .cart_inline_item_new_qty {
24
+ font-weight:bold;
25
+ color:#00A;
26
+ }
27
+ .cart_inline_item_new_price {
28
+ font-weight:bold;
29
+ color:#00A;
30
+ }
31
+
32
+ .qixol_review_discount{
33
+ font-weight:bold;
34
+ color:#00A;
35
+ }
36
+
37
+ .qixol_review_total_price {
38
+ font-weight:bold;
39
+ color:#00A;
40
+ }
41
+
42
+ .qixol_total_price{
43
+ font-weight:bold;
44
+ color:#00A;
45
+ font-family: "Helvetica Neue",Verdana,Arial,sans-serif;
46
+ }
47
+
48
+ .qixol_discount{
49
+ font-weight:bold;
50
+ color:#00A;
51
+ }
52
+
53
+ .qixol_grand_total_price{
54
+ font-weight:bold;
55
+ color:#00A;
56
+ display:block;
57
+ }
58
+
59
+
60
+ .qixol_price_cross{
61
+ font-size: -4pt;
62
+ text-decoration: line-through;
63
+ }
64
+
65
+ .promotion_review_inline_box{
66
+ font-weight:bold;
67
+ color:#00A;
68
+ }
69
+
70
+
71
+
72
+ /*
73
+ * iMedia Inc.
74
+ */
75
+
76
+ #bonuspoints .input-text{
77
+ float:left;
78
+ border-radius: 0;
79
+ height: 30px;
80
+ margin: 4px 10px 0 0;
81
+ width: 100px;
82
+ }
83
+
84
+ #bonuspoints .button-wrapper{
85
+ float: left;
86
+ }
87
+
88
+ #bonuspoints label{
89
+ float:left;
90
+ font-size: 12px;
91
+ font-weight: 400;
92
+ text-align: left;
93
+ text-transform: uppercase;
94
+ min-width: 90px;
95
+ display: inline-block;
96
+ margin-right: 10px;
97
+ line-height:32px;
98
+ }
99
+ .cycle-slideshow{
100
+ height:100px;
101
+ }
102
+ .product_all_promotions{
103
+ width:100%;
104
+ }
105
+ .product_all_promotions table{
106
+ border:1px solid;
107
+ }
108
+ .product_all_promotions th{
109
+ background-color:#DDDDEE;
110
+ }
skin/frontend/base/default/images/qixol/BASKETREDUCTION.png ADDED
Binary file
skin/frontend/base/default/images/qixol/BOGOF.png ADDED
Binary file
skin/frontend/base/default/images/qixol/BOGOR.png ADDED
Binary file
skin/frontend/base/default/images/qixol/BUNDLE.png ADDED
Binary file
skin/frontend/base/default/images/qixol/DEAL.png ADDED
Binary file
skin/frontend/base/default/images/qixol/DELIVERYREDUCTION.png ADDED
Binary file
skin/frontend/base/default/images/qixol/FREEPRODUCT.png ADDED
Binary file
skin/frontend/base/default/images/qixol/ISSUECOUPON.png ADDED
Binary file
skin/frontend/base/default/images/qixol/ISSUEPOINTS.png ADDED
Binary file
skin/frontend/base/default/images/qixol/PRODUCTSREDUCTION.png ADDED
Binary file
skin/frontend/base/default/images/qixol/red_sales_sticker_pv.png ADDED
Binary file
skin/frontend/base/default/js/lib/jquery.cycle2.min.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Cycle2; build: v20131022
3
+ * http://jquery.malsup.com/cycle2/
4
+ * Copyright (c) 2013 M. Alsup; Dual licensed: MIT/GPL
5
+ */
6
+ /*! core engine; version: 20131003 */
7
+ (function(e){"use strict";function t(e){return(e||"").toLowerCase()}var i="20131003";e.fn.cycle=function(i){var n;return 0!==this.length||e.isReady?this.each(function(){var n,s,o,c,r=e(this),l=e.fn.cycle.log;if(!r.data("cycle.opts")){(r.data("cycle-log")===!1||i&&i.log===!1||s&&s.log===!1)&&(l=e.noop),l("--c2 init--"),n=r.data();for(var a in n)n.hasOwnProperty(a)&&/^cycle[A-Z]+/.test(a)&&(c=n[a],o=a.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t),l(o+":",c,"("+typeof c+")"),n[o]=c);s=e.extend({},e.fn.cycle.defaults,n,i||{}),s.timeoutId=0,s.paused=s.paused||!1,s.container=r,s._maxZ=s.maxZ,s.API=e.extend({_container:r},e.fn.cycle.API),s.API.log=l,s.API.trigger=function(e,t){return s.container.trigger(e,t),s.API},r.data("cycle.opts",s),r.data("cycle.API",s.API),s.API.trigger("cycle-bootstrap",[s,s.API]),s.API.addInitialSlides(),s.API.preInitSlideshow(),s.slides.length&&s.API.initSlideshow()}}):(n={s:this.selector,c:this.context},e.fn.cycle.log("requeuing slideshow (dom not ready)"),e(function(){e(n.s,n.c).cycle(i)}),this)},e.fn.cycle.API={opts:function(){return this._container.data("cycle.opts")},addInitialSlides:function(){var t=this.opts(),i=t.slides;t.slideCount=0,t.slides=e(),i=i.jquery?i:t.container.find(i),t.random&&i.sort(function(){return Math.random()-.5}),t.API.add(i)},preInitSlideshow:function(){var t=this.opts();t.API.trigger("cycle-pre-initialize",[t]);var i=e.fn.cycle.transitions[t.fx];i&&e.isFunction(i.preInit)&&i.preInit(t),t._preInitialized=!0},postInitSlideshow:function(){var t=this.opts();t.API.trigger("cycle-post-initialize",[t]);var i=e.fn.cycle.transitions[t.fx];i&&e.isFunction(i.postInit)&&i.postInit(t)},initSlideshow:function(){var t,i=this.opts(),n=i.container;i.API.calcFirstSlide(),"static"==i.container.css("position")&&i.container.css("position","relative"),e(i.slides[i.currSlide]).css("opacity",1).show(),i.API.stackSlides(i.slides[i.currSlide],i.slides[i.nextSlide],!i.reverse),i.pauseOnHover&&(i.pauseOnHover!==!0&&(n=e(i.pauseOnHover)),n.hover(function(){i.API.pause(!0)},function(){i.API.resume(!0)})),i.timeout&&(t=i.API.getSlideOpts(i.currSlide),i.API.queueTransition(t,t.timeout+i.delay)),i._initialized=!0,i.API.updateView(!0),i.API.trigger("cycle-initialized",[i]),i.API.postInitSlideshow()},pause:function(t){var i=this.opts(),n=i.API.getSlideOpts(),s=i.hoverPaused||i.paused;t?i.hoverPaused=!0:i.paused=!0,s||(i.container.addClass("cycle-paused"),i.API.trigger("cycle-paused",[i]).log("cycle-paused"),n.timeout&&(clearTimeout(i.timeoutId),i.timeoutId=0,i._remainingTimeout-=e.now()-i._lastQueue,(0>i._remainingTimeout||isNaN(i._remainingTimeout))&&(i._remainingTimeout=void 0)))},resume:function(e){var t=this.opts(),i=!t.hoverPaused&&!t.paused;e?t.hoverPaused=!1:t.paused=!1,i||(t.container.removeClass("cycle-paused"),0===t.slides.filter(":animated").length&&t.API.queueTransition(t.API.getSlideOpts(),t._remainingTimeout),t.API.trigger("cycle-resumed",[t,t._remainingTimeout]).log("cycle-resumed"))},add:function(t,i){var n,s=this.opts(),o=s.slideCount,c=!1;"string"==e.type(t)&&(t=e.trim(t)),e(t).each(function(){var t,n=e(this);i?s.container.prepend(n):s.container.append(n),s.slideCount++,t=s.API.buildSlideOpts(n),s.slides=i?e(n).add(s.slides):s.slides.add(n),s.API.initSlide(t,n,--s._maxZ),n.data("cycle.opts",t),s.API.trigger("cycle-slide-added",[s,t,n])}),s.API.updateView(!0),c=s._preInitialized&&2>o&&s.slideCount>=1,c&&(s._initialized?s.timeout&&(n=s.slides.length,s.nextSlide=s.reverse?n-1:1,s.timeoutId||s.API.queueTransition(s)):s.API.initSlideshow())},calcFirstSlide:function(){var e,t=this.opts();e=parseInt(t.startingSlide||0,10),(e>=t.slides.length||0>e)&&(e=0),t.currSlide=e,t.reverse?(t.nextSlide=e-1,0>t.nextSlide&&(t.nextSlide=t.slides.length-1)):(t.nextSlide=e+1,t.nextSlide==t.slides.length&&(t.nextSlide=0))},calcNextSlide:function(){var e,t=this.opts();t.reverse?(e=0>t.nextSlide-1,t.nextSlide=e?t.slideCount-1:t.nextSlide-1,t.currSlide=e?0:t.nextSlide+1):(e=t.nextSlide+1==t.slides.length,t.nextSlide=e?0:t.nextSlide+1,t.currSlide=e?t.slides.length-1:t.nextSlide-1)},calcTx:function(t,i){var n,s=t;return i&&s.manualFx&&(n=e.fn.cycle.transitions[s.manualFx]),n||(n=e.fn.cycle.transitions[s.fx]),n||(n=e.fn.cycle.transitions.fade,s.API.log('Transition "'+s.fx+'" not found. Using fade.')),n},prepareTx:function(e,t){var i,n,s,o,c,r=this.opts();return 2>r.slideCount?(r.timeoutId=0,void 0):(!e||r.busy&&!r.manualTrump||(r.API.stopTransition(),r.busy=!1,clearTimeout(r.timeoutId),r.timeoutId=0),r.busy||(0!==r.timeoutId||e)&&(n=r.slides[r.currSlide],s=r.slides[r.nextSlide],o=r.API.getSlideOpts(r.nextSlide),c=r.API.calcTx(o,e),r._tx=c,e&&void 0!==o.manualSpeed&&(o.speed=o.manualSpeed),r.nextSlide!=r.currSlide&&(e||!r.paused&&!r.hoverPaused&&r.timeout)?(r.API.trigger("cycle-before",[o,n,s,t]),c.before&&c.before(o,n,s,t),i=function(){r.busy=!1,r.container.data("cycle.opts")&&(c.after&&c.after(o,n,s,t),r.API.trigger("cycle-after",[o,n,s,t]),r.API.queueTransition(o),r.API.updateView(!0))},r.busy=!0,c.transition?c.transition(o,n,s,t,i):r.API.doTransition(o,n,s,t,i),r.API.calcNextSlide(),r.API.updateView()):r.API.queueTransition(o)),void 0)},doTransition:function(t,i,n,s,o){var c=t,r=e(i),l=e(n),a=function(){l.animate(c.animIn||{opacity:1},c.speed,c.easeIn||c.easing,o)};l.css(c.cssBefore||{}),r.animate(c.animOut||{},c.speed,c.easeOut||c.easing,function(){r.css(c.cssAfter||{}),c.sync||a()}),c.sync&&a()},queueTransition:function(t,i){var n=this.opts(),s=void 0!==i?i:t.timeout;return 0===n.nextSlide&&0===--n.loop?(n.API.log("terminating; loop=0"),n.timeout=0,s?setTimeout(function(){n.API.trigger("cycle-finished",[n])},s):n.API.trigger("cycle-finished",[n]),n.nextSlide=n.currSlide,void 0):(s&&(n._lastQueue=e.now(),void 0===i&&(n._remainingTimeout=t.timeout),n.paused||n.hoverPaused||(n.timeoutId=setTimeout(function(){n.API.prepareTx(!1,!n.reverse)},s))),void 0)},stopTransition:function(){var e=this.opts();e.slides.filter(":animated").length&&(e.slides.stop(!1,!0),e.API.trigger("cycle-transition-stopped",[e])),e._tx&&e._tx.stopTransition&&e._tx.stopTransition(e)},advanceSlide:function(e){var t=this.opts();return clearTimeout(t.timeoutId),t.timeoutId=0,t.nextSlide=t.currSlide+e,0>t.nextSlide?t.nextSlide=t.slides.length-1:t.nextSlide>=t.slides.length&&(t.nextSlide=0),t.API.prepareTx(!0,e>=0),!1},buildSlideOpts:function(i){var n,s,o=this.opts(),c=i.data()||{};for(var r in c)c.hasOwnProperty(r)&&/^cycle[A-Z]+/.test(r)&&(n=c[r],s=r.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t),o.API.log("["+(o.slideCount-1)+"]",s+":",n,"("+typeof n+")"),c[s]=n);c=e.extend({},e.fn.cycle.defaults,o,c),c.slideNum=o.slideCount;try{delete c.API,delete c.slideCount,delete c.currSlide,delete c.nextSlide,delete c.slides}catch(l){}return c},getSlideOpts:function(t){var i=this.opts();void 0===t&&(t=i.currSlide);var n=i.slides[t],s=e(n).data("cycle.opts");return e.extend({},i,s)},initSlide:function(t,i,n){var s=this.opts();i.css(t.slideCss||{}),n>0&&i.css("zIndex",n),isNaN(t.speed)&&(t.speed=e.fx.speeds[t.speed]||e.fx.speeds._default),t.sync||(t.speed=t.speed/2),i.addClass(s.slideClass)},updateView:function(e,t){var i=this.opts();if(i._initialized){var n=i.API.getSlideOpts(),s=i.slides[i.currSlide];!e&&t!==!0&&(i.API.trigger("cycle-update-view-before",[i,n,s]),0>i.updateView)||(i.slideActiveClass&&i.slides.removeClass(i.slideActiveClass).eq(i.currSlide).addClass(i.slideActiveClass),e&&i.hideNonActive&&i.slides.filter(":not(."+i.slideActiveClass+")").hide(),0===i.updateView&&setTimeout(function(){i.API.trigger("cycle-update-view",[i,n,s,e])},n.speed/(i.sync?2:1)),0!==i.updateView&&i.API.trigger("cycle-update-view",[i,n,s,e]),e&&i.API.trigger("cycle-update-view-after",[i,n,s]))}},getComponent:function(t){var i=this.opts(),n=i[t];return"string"==typeof n?/^\s*[\>|\+|~]/.test(n)?i.container.find(n):e(n):n.jquery?n:e(n)},stackSlides:function(t,i,n){var s=this.opts();t||(t=s.slides[s.currSlide],i=s.slides[s.nextSlide],n=!s.reverse),e(t).css("zIndex",s.maxZ);var o,c=s.maxZ-2,r=s.slideCount;if(n){for(o=s.currSlide+1;r>o;o++)e(s.slides[o]).css("zIndex",c--);for(o=0;s.currSlide>o;o++)e(s.slides[o]).css("zIndex",c--)}else{for(o=s.currSlide-1;o>=0;o--)e(s.slides[o]).css("zIndex",c--);for(o=r-1;o>s.currSlide;o--)e(s.slides[o]).css("zIndex",c--)}e(i).css("zIndex",s.maxZ-1)},getSlideIndex:function(e){return this.opts().slides.index(e)}},e.fn.cycle.log=function(){window.console&&console.log&&console.log("[cycle2] "+Array.prototype.join.call(arguments," "))},e.fn.cycle.version=function(){return"Cycle2: "+i},e.fn.cycle.transitions={custom:{},none:{before:function(e,t,i,n){e.API.stackSlides(i,t,n),e.cssBefore={opacity:1,display:"block"}}},fade:{before:function(t,i,n,s){var o=t.API.getSlideOpts(t.nextSlide).slideCss||{};t.API.stackSlides(i,n,s),t.cssBefore=e.extend(o,{opacity:0,display:"block"}),t.animIn={opacity:1},t.animOut={opacity:0}}},fadeout:{before:function(t,i,n,s){var o=t.API.getSlideOpts(t.nextSlide).slideCss||{};t.API.stackSlides(i,n,s),t.cssBefore=e.extend(o,{opacity:1,display:"block"}),t.animOut={opacity:0}}},scrollHorz:{before:function(e,t,i,n){e.API.stackSlides(t,i,n);var s=e.container.css("overflow","hidden").width();e.cssBefore={left:n?s:-s,top:0,opacity:1,display:"block"},e.cssAfter={zIndex:e._maxZ-2,left:0},e.animIn={left:0},e.animOut={left:n?-s:s}}}},e.fn.cycle.defaults={allowWrap:!0,autoSelector:".cycle-slideshow[data-cycle-auto-init!=false]",delay:0,easing:null,fx:"fade",hideNonActive:!0,loop:0,manualFx:void 0,manualSpeed:void 0,manualTrump:!0,maxZ:100,pauseOnHover:!1,reverse:!1,slideActiveClass:"cycle-slide-active",slideClass:"cycle-slide",slideCss:{position:"absolute",top:0,left:0},slides:"> img",speed:500,startingSlide:0,sync:!0,timeout:4e3,updateView:0},e(document).ready(function(){e(e.fn.cycle.defaults.autoSelector).cycle()})})(jQuery),/*! Cycle2 autoheight plugin; Copyright (c) M.Alsup, 2012; version: 20130304 */
8
+ function(e){"use strict";function t(t,n){var s,o,c,r=n.autoHeight;if("container"==r)o=e(n.slides[n.currSlide]).outerHeight(),n.container.height(o);else if(n._autoHeightRatio)n.container.height(n.container.width()/n._autoHeightRatio);else if("calc"===r||"number"==e.type(r)&&r>=0){if(c="calc"===r?i(t,n):r>=n.slides.length?0:r,c==n._sentinelIndex)return;n._sentinelIndex=c,n._sentinel&&n._sentinel.remove(),s=e(n.slides[c].cloneNode(!0)),s.removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel"),s.css({position:"static",visibility:"hidden",display:"block"}).prependTo(n.container).addClass("cycle-sentinel cycle-slide").removeClass("cycle-slide-active"),s.find("*").css("visibility","hidden"),n._sentinel=s}}function i(t,i){var n=0,s=-1;return i.slides.each(function(t){var i=e(this).height();i>s&&(s=i,n=t)}),n}function n(t,i,n,s){var o=e(s).outerHeight(),c=i.sync?i.speed/2:i.speed;i.container.animate({height:o},c)}function s(i,o){o._autoHeightOnResize&&(e(window).off("resize orientationchange",o._autoHeightOnResize),o._autoHeightOnResize=null),o.container.off("cycle-slide-added cycle-slide-removed",t),o.container.off("cycle-destroyed",s),o.container.off("cycle-before",n),o._sentinel&&(o._sentinel.remove(),o._sentinel=null)}e.extend(e.fn.cycle.defaults,{autoHeight:0}),e(document).on("cycle-initialized",function(i,o){function c(){t(i,o)}var r,l=o.autoHeight,a=e.type(l),d=null;("string"===a||"number"===a)&&(o.container.on("cycle-slide-added cycle-slide-removed",t),o.container.on("cycle-destroyed",s),"container"==l?o.container.on("cycle-before",n):"string"===a&&/\d+\:\d+/.test(l)&&(r=l.match(/(\d+)\:(\d+)/),r=r[1]/r[2],o._autoHeightRatio=r),"number"!==a&&(o._autoHeightOnResize=function(){clearTimeout(d),d=setTimeout(c,50)},e(window).on("resize orientationchange",o._autoHeightOnResize)),setTimeout(c,30))})}(jQuery),/*! caption plugin for Cycle2; version: 20130306 */
9
+ function(e){"use strict";e.extend(e.fn.cycle.defaults,{caption:"> .cycle-caption",captionTemplate:"{{slideNum}} / {{slideCount}}",overlay:"> .cycle-overlay",overlayTemplate:"<div>{{title}}</div><div>{{desc}}</div>",captionModule:"caption"}),e(document).on("cycle-update-view",function(t,i,n,s){"caption"===i.captionModule&&e.each(["caption","overlay"],function(){var e=this,t=n[e+"Template"],o=i.API.getComponent(e);o.length&&t?(o.html(i.API.tmpl(t,n,i,s)),o.show()):o.hide()})}),e(document).on("cycle-destroyed",function(t,i){var n;e.each(["caption","overlay"],function(){var e=this,t=i[e+"Template"];i[e]&&t&&(n=i.API.getComponent("caption"),n.empty())})})}(jQuery),/*! command plugin for Cycle2; version: 20130707 */
10
+ function(e){"use strict";var t=e.fn.cycle;e.fn.cycle=function(i){var n,s,o,c=e.makeArray(arguments);return"number"==e.type(i)?this.cycle("goto",i):"string"==e.type(i)?this.each(function(){var r;return n=i,o=e(this).data("cycle.opts"),void 0===o?(t.log('slideshow must be initialized before sending commands; "'+n+'" ignored'),void 0):(n="goto"==n?"jump":n,s=o.API[n],e.isFunction(s)?(r=e.makeArray(c),r.shift(),s.apply(o.API,r)):(t.log("unknown command: ",n),void 0))}):t.apply(this,arguments)},e.extend(e.fn.cycle,t),e.extend(t.API,{next:function(){var e=this.opts();if(!e.busy||e.manualTrump){var t=e.reverse?-1:1;e.allowWrap===!1&&e.currSlide+t>=e.slideCount||(e.API.advanceSlide(t),e.API.trigger("cycle-next",[e]).log("cycle-next"))}},prev:function(){var e=this.opts();if(!e.busy||e.manualTrump){var t=e.reverse?1:-1;e.allowWrap===!1&&0>e.currSlide+t||(e.API.advanceSlide(t),e.API.trigger("cycle-prev",[e]).log("cycle-prev"))}},destroy:function(){this.stop();var t=this.opts(),i=e.isFunction(e._data)?e._data:e.noop;clearTimeout(t.timeoutId),t.timeoutId=0,t.API.stop(),t.API.trigger("cycle-destroyed",[t]).log("cycle-destroyed"),t.container.removeData(),i(t.container[0],"parsedAttrs",!1),t.retainStylesOnDestroy||(t.container.removeAttr("style"),t.slides.removeAttr("style"),t.slides.removeClass(t.slideActiveClass)),t.slides.each(function(){e(this).removeData(),i(this,"parsedAttrs",!1)})},jump:function(e){var t,i=this.opts();if(!i.busy||i.manualTrump){var n=parseInt(e,10);if(isNaN(n)||0>n||n>=i.slides.length)return i.API.log("goto: invalid slide index: "+n),void 0;if(n==i.currSlide)return i.API.log("goto: skipping, already on slide",n),void 0;i.nextSlide=n,clearTimeout(i.timeoutId),i.timeoutId=0,i.API.log("goto: ",n," (zero-index)"),t=i.currSlide<i.nextSlide,i.API.prepareTx(!0,t)}},stop:function(){var t=this.opts(),i=t.container;clearTimeout(t.timeoutId),t.timeoutId=0,t.API.stopTransition(),t.pauseOnHover&&(t.pauseOnHover!==!0&&(i=e(t.pauseOnHover)),i.off("mouseenter mouseleave")),t.API.trigger("cycle-stopped",[t]).log("cycle-stopped")},reinit:function(){var e=this.opts();e.API.destroy(),e.container.cycle()},remove:function(t){for(var i,n,s=this.opts(),o=[],c=1,r=0;s.slides.length>r;r++)i=s.slides[r],r==t?n=i:(o.push(i),e(i).data("cycle.opts").slideNum=c,c++);n&&(s.slides=e(o),s.slideCount--,e(n).remove(),t==s.currSlide?s.API.advanceSlide(1):s.currSlide>t?s.currSlide--:s.currSlide++,s.API.trigger("cycle-slide-removed",[s,t,n]).log("cycle-slide-removed"),s.API.updateView())}}),e(document).on("click.cycle","[data-cycle-cmd]",function(t){t.preventDefault();var i=e(this),n=i.data("cycle-cmd"),s=i.data("cycle-context")||".cycle-slideshow";e(s).cycle(n,i.data("cycle-arg"))})}(jQuery),/*! hash plugin for Cycle2; version: 20130905 */
11
+ function(e){"use strict";function t(t,i){var n;return t._hashFence?(t._hashFence=!1,void 0):(n=window.location.hash.substring(1),t.slides.each(function(s){if(e(this).data("cycle-hash")==n){if(i===!0)t.startingSlide=s;else{var o=s>t.currSlide;t.nextSlide=s,t.API.prepareTx(!0,o)}return!1}}),void 0)}e(document).on("cycle-pre-initialize",function(i,n){t(n,!0),n._onHashChange=function(){t(n,!1)},e(window).on("hashchange",n._onHashChange)}),e(document).on("cycle-update-view",function(e,t,i){i.hash&&"#"+i.hash!=window.location.hash&&(t._hashFence=!0,window.location.hash=i.hash)}),e(document).on("cycle-destroyed",function(t,i){i._onHashChange&&e(window).off("hashchange",i._onHashChange)})}(jQuery),/*! loader plugin for Cycle2; version: 20131020 */
12
+ function(e){"use strict";e.extend(e.fn.cycle.defaults,{loader:!1}),e(document).on("cycle-bootstrap",function(t,i){function n(t,n){function o(t){var o;"wait"==i.loader?(r.push(t),0===a&&(r.sort(c),s.apply(i.API,[r,n]),i.container.removeClass("cycle-loading"))):(o=e(i.slides[i.currSlide]),s.apply(i.API,[t,n]),o.show(),i.container.removeClass("cycle-loading"))}function c(e,t){return e.data("index")-t.data("index")}var r=[];if("string"==e.type(t))t=e.trim(t);else if("array"===e.type(t))for(var l=0;t.length>l;l++)t[l]=e(t[l])[0];t=e(t);var a=t.length;a&&(i.eventualSlideCount=i.slideCount+a,t.hide().appendTo("body").each(function(t){function c(){0===--l&&(--a,o(d))}var l=0,d=e(this),u=d.is("img")?d:d.find("img");return d.data("index",t),u=u.filter(":not(.cycle-loader-ignore)").filter(':not([src=""])'),u.length?(l=u.length,u.each(function(){this.complete?c():e(this).load(function(){c()}).error(function(){0===--l&&(i.API.log("slide skipped; img not loaded:",this.src),0===--a&&"wait"==i.loader&&s.apply(i.API,[r,n]))})}),void 0):(--a,r.push(d),void 0)}),a&&i.container.addClass("cycle-loading"))}var s;i.loader&&(s=i.API.add,i.API.add=n)})}(jQuery),/*! pager plugin for Cycle2; version: 20130525 */
13
+ function(e){"use strict";function t(t,i,n){var s,o=t.API.getComponent("pager");o.each(function(){var o=e(this);if(i.pagerTemplate){var c=t.API.tmpl(i.pagerTemplate,i,t,n[0]);s=e(c).appendTo(o)}else s=o.children().eq(t.slideCount-1);s.on(t.pagerEvent,function(e){e.preventDefault(),t.API.page(o,e.currentTarget)})})}function i(e,t){var i=this.opts();if(!i.busy||i.manualTrump){var n=e.children().index(t),s=n,o=s>i.currSlide;i.currSlide!=s&&(i.nextSlide=s,i.API.prepareTx(!0,o),i.API.trigger("cycle-pager-activated",[i,e,t]))}}e.extend(e.fn.cycle.defaults,{pager:"> .cycle-pager",pagerActiveClass:"cycle-pager-active",pagerEvent:"click.cycle",pagerTemplate:"<span>&bull;</span>"}),e(document).on("cycle-bootstrap",function(e,i,n){n.buildPagerLink=t}),e(document).on("cycle-slide-added",function(e,t,n,s){t.pager&&(t.API.buildPagerLink(t,n,s),t.API.page=i)}),e(document).on("cycle-slide-removed",function(t,i,n){if(i.pager){var s=i.API.getComponent("pager");s.each(function(){var t=e(this);e(t.children()[n]).remove()})}}),e(document).on("cycle-update-view",function(t,i){var n;i.pager&&(n=i.API.getComponent("pager"),n.each(function(){e(this).children().removeClass(i.pagerActiveClass).eq(i.currSlide).addClass(i.pagerActiveClass)}))}),e(document).on("cycle-destroyed",function(e,t){var i=t.API.getComponent("pager");i&&(i.children().off(t.pagerEvent),t.pagerTemplate&&i.empty())})}(jQuery),/*! prevnext plugin for Cycle2; version: 20130709 */
14
+ function(e){"use strict";e.extend(e.fn.cycle.defaults,{next:"> .cycle-next",nextEvent:"click.cycle",disabledClass:"disabled",prev:"> .cycle-prev",prevEvent:"click.cycle",swipe:!1}),e(document).on("cycle-initialized",function(e,t){if(t.API.getComponent("next").on(t.nextEvent,function(e){e.preventDefault(),t.API.next()}),t.API.getComponent("prev").on(t.prevEvent,function(e){e.preventDefault(),t.API.prev()}),t.swipe){var i=t.swipeVert?"swipeUp.cycle":"swipeLeft.cycle swipeleft.cycle",n=t.swipeVert?"swipeDown.cycle":"swipeRight.cycle swiperight.cycle";t.container.on(i,function(){t.API.next()}),t.container.on(n,function(){t.API.prev()})}}),e(document).on("cycle-update-view",function(e,t){if(!t.allowWrap){var i=t.disabledClass,n=t.API.getComponent("next"),s=t.API.getComponent("prev"),o=t._prevBoundry||0,c=void 0!==t._nextBoundry?t._nextBoundry:t.slideCount-1;t.currSlide==c?n.addClass(i).prop("disabled",!0):n.removeClass(i).prop("disabled",!1),t.currSlide===o?s.addClass(i).prop("disabled",!0):s.removeClass(i).prop("disabled",!1)}}),e(document).on("cycle-destroyed",function(e,t){t.API.getComponent("prev").off(t.nextEvent),t.API.getComponent("next").off(t.prevEvent),t.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle")})}(jQuery),/*! progressive loader plugin for Cycle2; version: 20130315 */
15
+ function(e){"use strict";e.extend(e.fn.cycle.defaults,{progressive:!1}),e(document).on("cycle-pre-initialize",function(t,i){if(i.progressive){var n,s,o=i.API,c=o.next,r=o.prev,l=o.prepareTx,a=e.type(i.progressive);if("array"==a)n=i.progressive;else if(e.isFunction(i.progressive))n=i.progressive(i);else if("string"==a){if(s=e(i.progressive),n=e.trim(s.html()),!n)return;if(/^(\[)/.test(n))try{n=e.parseJSON(n)}catch(d){return o.log("error parsing progressive slides",d),void 0}else n=n.split(RegExp(s.data("cycle-split")||"\n")),n[n.length-1]||n.pop()}l&&(o.prepareTx=function(e,t){var s,o;return e||0===n.length?(l.apply(i.API,[e,t]),void 0):(t&&i.currSlide==i.slideCount-1?(o=n[0],n=n.slice(1),i.container.one("cycle-slide-added",function(e,t){setTimeout(function(){t.API.advanceSlide(1)},50)}),i.API.add(o)):t||0!==i.currSlide?l.apply(i.API,[e,t]):(s=n.length-1,o=n[s],n=n.slice(0,s),i.container.one("cycle-slide-added",function(e,t){setTimeout(function(){t.currSlide=1,t.API.advanceSlide(-1)},50)}),i.API.add(o,!0)),void 0)}),c&&(o.next=function(){var e=this.opts();if(n.length&&e.currSlide==e.slideCount-1){var t=n[0];n=n.slice(1),e.container.one("cycle-slide-added",function(e,t){c.apply(t.API),t.container.removeClass("cycle-loading")}),e.container.addClass("cycle-loading"),e.API.add(t)}else c.apply(e.API)}),r&&(o.prev=function(){var e=this.opts();if(n.length&&0===e.currSlide){var t=n.length-1,i=n[t];n=n.slice(0,t),e.container.one("cycle-slide-added",function(e,t){t.currSlide=1,t.API.advanceSlide(-1),t.container.removeClass("cycle-loading")}),e.container.addClass("cycle-loading"),e.API.add(i,!0)}else r.apply(e.API)})}})}(jQuery),/*! tmpl plugin for Cycle2; version: 20121227 */
16
+ function(e){"use strict";e.extend(e.fn.cycle.defaults,{tmplRegex:"{{((.)?.*?)}}"}),e.extend(e.fn.cycle.API,{tmpl:function(t,i){var n=RegExp(i.tmplRegex||e.fn.cycle.defaults.tmplRegex,"g"),s=e.makeArray(arguments);return s.shift(),t.replace(n,function(t,i){var n,o,c,r,l=i.split(".");for(n=0;s.length>n;n++)if(c=s[n]){if(l.length>1)for(r=c,o=0;l.length>o;o++)c=r,r=r[l[o]]||i;else r=c[i];if(e.isFunction(r))return r.apply(c,s);if(void 0!==r&&null!==r&&r!=i)return r}return i})}})}(jQuery);
skin/frontend/base/default/js/lib/jquery.cycle2.swipe.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! Plugin for Cycle2; Copyright (c) 2012 M. Alsup; ver: 20121120 */
2
+ (function(a){"use strict";var b="ontouchend"in document;a.event.special.swipe=a.event.special.swipe||{scrollSupressionThreshold:10,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:75,setup:function(){var b=a(this);b.bind("touchstart",function(c){function g(b){if(!f)return;var c=b.originalEvent.touches?b.originalEvent.touches[0]:b;e={time:(new Date).getTime(),coords:[c.pageX,c.pageY]},Math.abs(f.coords[0]-e.coords[0])>a.event.special.swipe.scrollSupressionThreshold&&b.preventDefault()}var d=c.originalEvent.touches?c.originalEvent.touches[0]:c,e,f={time:(new Date).getTime(),coords:[d.pageX,d.pageY],origin:a(c.target)};b.bind("touchmove",g).one("touchend",function(c){b.unbind("touchmove",g),f&&e&&e.time-f.time<a.event.special.swipe.durationThreshold&&Math.abs(f.coords[0]-e.coords[0])>a.event.special.swipe.horizontalDistanceThreshold&&Math.abs(f.coords[1]-e.coords[1])<a.event.special.swipe.verticalDistanceThreshold&&f.origin.trigger("swipe").trigger(f.coords[0]>e.coords[0]?"swipeleft":"swiperight"),f=e=undefined})})}},a.event.special.swipeleft=a.event.special.swipeleft||{setup:function(){a(this).bind("swipe",a.noop)}},a.event.special.swiperight=a.event.special.swiperight||a.event.special.swipeleft})(jQuery);
var/logs_qixol/logs_here.txt ADDED
@@ -0,0 +1 @@
 
1
+