Cybage_Marketplace - Version 1.0.0

Version Notes

After installation of the Marketplace plug-in, please clear the cache.

Download this release

Release Info

Developer Cybage Software Pvt. Ltd.
Extension Cybage_Marketplace
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (159) hide show
  1. app/code/community/Cybage/Marketplace/Block/Adminhtml/Catalog/Product/Grid.php +276 -0
  2. app/code/community/Cybage/Marketplace/Block/Adminhtml/Commission.php +30 -0
  3. app/code/community/Cybage/Marketplace/Block/Adminhtml/Commission/Edit.php +39 -0
  4. app/code/community/Cybage/Marketplace/Block/Adminhtml/Commission/Edit/Form.php +44 -0
  5. app/code/community/Cybage/Marketplace/Block/Adminhtml/Commission/Edit/Tab/Form.php +132 -0
  6. app/code/community/Cybage/Marketplace/Block/Adminhtml/Commission/Edit/Tab/Payhistory.php +72 -0
  7. app/code/community/Cybage/Marketplace/Block/Adminhtml/Commission/Edit/Tabs.php +47 -0
  8. app/code/community/Cybage/Marketplace/Block/Adminhtml/Commission/Grid.php +154 -0
  9. app/code/community/Cybage/Marketplace/Block/Adminhtml/Orderby.php +40 -0
  10. app/code/community/Cybage/Marketplace/Block/Adminhtml/Orderby/Form.php +234 -0
  11. app/code/community/Cybage/Marketplace/Block/Adminhtml/Orderby/Grid.php +131 -0
  12. app/code/community/Cybage/Marketplace/Block/Adminhtml/Orderby/Grid/Abstract.php +198 -0
  13. app/code/community/Cybage/Marketplace/Block/Adminhtml/Orderby/Grid/Name.php +30 -0
  14. app/code/community/Cybage/Marketplace/Block/Adminhtml/Seller.php +30 -0
  15. app/code/community/Cybage/Marketplace/Block/Adminhtml/Seller/Edit.php +51 -0
  16. app/code/community/Cybage/Marketplace/Block/Adminhtml/Seller/Edit/Form.php +44 -0
  17. app/code/community/Cybage/Marketplace/Block/Adminhtml/Seller/Edit/Tab/Form.php +83 -0
  18. app/code/community/Cybage/Marketplace/Block/Adminhtml/Seller/Edit/Tabs.php +41 -0
  19. app/code/community/Cybage/Marketplace/Block/Adminhtml/Seller/Grid.php +151 -0
  20. app/code/community/Cybage/Marketplace/Block/Adminhtml/Widget/Column/Renderer/Paylink.php +36 -0
  21. app/code/community/Cybage/Marketplace/Block/Buyerseller.php +28 -0
  22. app/code/community/Cybage/Marketplace/Block/Buyerseller/Sales/Order/History.php +28 -0
  23. app/code/community/Cybage/Marketplace/Block/Catalog/Product/List.php +61 -0
  24. app/code/community/Cybage/Marketplace/Block/Catalog/Product/View.php +51 -0
  25. app/code/community/Cybage/Marketplace/Block/Myorders.php +35 -0
  26. app/code/community/Cybage/Marketplace/Block/Myorders/Selleroptions.php +58 -0
  27. app/code/community/Cybage/Marketplace/Block/Myorders/View.php +31 -0
  28. app/code/community/Cybage/Marketplace/Block/Order/Item/Renderer/Default.php +26 -0
  29. app/code/community/Cybage/Marketplace/Block/Order/Selleroptions.php +80 -0
  30. app/code/community/Cybage/Marketplace/Block/Order/View.php +24 -0
  31. app/code/community/Cybage/Marketplace/Block/Product.php +85 -0
  32. app/code/community/Cybage/Marketplace/Block/Product/Askquestion/Link.php +32 -0
  33. app/code/community/Cybage/Marketplace/Block/Product/Askquestion/Myquestions.php +46 -0
  34. app/code/community/Cybage/Marketplace/Block/Product/Askquestion/Productquestions.php +49 -0
  35. app/code/community/Cybage/Marketplace/Block/Product/Askquestion/Replyform.php +26 -0
  36. app/code/community/Cybage/Marketplace/Block/Review/Product/View.php +89 -0
  37. app/code/community/Cybage/Marketplace/Block/Review/Product/View/List.php +27 -0
  38. app/code/community/Cybage/Marketplace/Block/Sales/Order/History.php +107 -0
  39. app/code/community/Cybage/Marketplace/Block/Seller/Info.php +35 -0
  40. app/code/community/Cybage/Marketplace/Controller/Router.php +101 -0
  41. app/code/community/Cybage/Marketplace/Helper/Data.php +331 -0
  42. app/code/community/Cybage/Marketplace/Model/Buyerseller.php +293 -0
  43. app/code/community/Cybage/Marketplace/Model/Commission.php +27 -0
  44. app/code/community/Cybage/Marketplace/Model/Customatributestatus.php +46 -0
  45. app/code/community/Cybage/Marketplace/Model/Customer.php +114 -0
  46. app/code/community/Cybage/Marketplace/Model/Image.php +71 -0
  47. app/code/community/Cybage/Marketplace/Model/Logging.php +107 -0
  48. app/code/community/Cybage/Marketplace/Model/Marketplace.php +123 -0
  49. app/code/community/Cybage/Marketplace/Model/Observer.php +156 -0
  50. app/code/community/Cybage/Marketplace/Model/Order.php +239 -0
  51. app/code/community/Cybage/Marketplace/Model/Product/Action.php +34 -0
  52. app/code/community/Cybage/Marketplace/Model/Question.php +56 -0
  53. app/code/community/Cybage/Marketplace/Model/Reply.php +39 -0
  54. app/code/community/Cybage/Marketplace/Model/Resource/Buyerseller.php +26 -0
  55. app/code/community/Cybage/Marketplace/Model/Resource/Buyerseller/Collection.php +27 -0
  56. app/code/community/Cybage/Marketplace/Model/Resource/Commission.php +27 -0
  57. app/code/community/Cybage/Marketplace/Model/Resource/Commission/Collection.php +27 -0
  58. app/code/community/Cybage/Marketplace/Model/Resource/Customer.php +97 -0
  59. app/code/community/Cybage/Marketplace/Model/Resource/Logging.php +26 -0
  60. app/code/community/Cybage/Marketplace/Model/Resource/Orderby/Collection.php +308 -0
  61. app/code/community/Cybage/Marketplace/Model/Resource/Question.php +27 -0
  62. app/code/community/Cybage/Marketplace/Model/Resource/Question/Collection.php +27 -0
  63. app/code/community/Cybage/Marketplace/Model/Resource/Reply.php +27 -0
  64. app/code/community/Cybage/Marketplace/Model/Resource/Reply/Collection.php +27 -0
  65. app/code/community/Cybage/Marketplace/Model/Seller/Attribute/Source/Product/State.php +50 -0
  66. app/code/community/Cybage/Marketplace/Model/Seller/Attribute/Source/Product/Status.php +44 -0
  67. app/code/community/Cybage/Marketplace/Model/Selleroptions.php +140 -0
  68. app/code/community/Cybage/Marketplace/Model/Session.php +26 -0
  69. app/code/community/Cybage/Marketplace/Model/Source/Option.php +51 -0
  70. app/code/community/Cybage/Marketplace/Model/System/Config/Source/Product/State.php +40 -0
  71. app/code/community/Cybage/Marketplace/Model/System/Config/Source/Product/Status.php +32 -0
  72. app/code/community/Cybage/Marketplace/Model/System/Config/Source/Product/Visibility.php +27 -0
  73. app/code/community/Cybage/Marketplace/controllers/AccountController.php +505 -0
  74. app/code/community/Cybage/Marketplace/controllers/Adminhtml/Catalog/ProductController.php +73 -0
  75. app/code/community/Cybage/Marketplace/controllers/Adminhtml/CommissionController.php +151 -0
  76. app/code/community/Cybage/Marketplace/controllers/Adminhtml/OrderbyController.php +87 -0
  77. app/code/community/Cybage/Marketplace/controllers/Adminhtml/SellerController.php +232 -0
  78. app/code/community/Cybage/Marketplace/controllers/BuyersellerController.php +68 -0
  79. app/code/community/Cybage/Marketplace/controllers/DashboardController.php +35 -0
  80. app/code/community/Cybage/Marketplace/controllers/OrderController.php +421 -0
  81. app/code/community/Cybage/Marketplace/controllers/ProductController.php +726 -0
  82. app/code/community/Cybage/Marketplace/controllers/ProductquestionController.php +95 -0
  83. app/code/community/Cybage/Marketplace/controllers/SellerController.php +39 -0
  84. app/code/community/Cybage/Marketplace/etc/adminhtml.xml +80 -0
  85. app/code/community/Cybage/Marketplace/etc/config.xml +280 -0
  86. app/code/community/Cybage/Marketplace/etc/system.xml +331 -0
  87. app/code/community/Cybage/Marketplace/sql/marketplace_setup/mysql4-install-0.1.0.php +156 -0
  88. app/code/community/Cybage/Marketplace/sql/marketplace_setup/mysql4-upgrade-0.1.0-0.1.1.php +119 -0
  89. app/code/community/Cybage/Marketplace/sql/marketplace_setup/mysql4-upgrade-0.1.1-0.1.2.php +38 -0
  90. app/code/community/Cybage/Marketplace/sql/marketplace_setup/mysql4-upgrade-0.1.2-0.1.3.php +38 -0
  91. app/code/community/Cybage/Marketplace/sql/marketplace_setup/mysql4-upgrade-0.1.3-0.1.4.php +39 -0
  92. app/code/community/Cybage/Marketplace/sql/marketplace_setup/mysql4-upgrade-0.1.4-0.1.5.php +34 -0
  93. app/code/community/Cybage/Marketplace/sql/marketplace_setup/mysql4-upgrade-0.1.5-0.1.6.php +51 -0
  94. app/design/adminhtml/default/default/layout/marketplace.xml +58 -0
  95. app/design/frontend/base/default/layout/marketplace.xml +596 -0
  96. app/design/frontend/base/default/template/marketplace/buyerseller/notify.phtml +65 -0
  97. app/design/frontend/base/default/template/marketplace/buyerseller/reply.phtml +84 -0
  98. app/design/frontend/base/default/template/marketplace/buyerseller/sales/order/history.phtml +75 -0
  99. app/design/frontend/base/default/template/marketplace/catalog/product/askquestion/form.phtml +91 -0
  100. app/design/frontend/base/default/template/marketplace/catalog/product/askquestion/link.phtml +40 -0
  101. app/design/frontend/base/default/template/marketplace/catalog/product/askquestion/myquestions.phtml +62 -0
  102. app/design/frontend/base/default/template/marketplace/catalog/product/askquestion/productquestions.phtml +64 -0
  103. app/design/frontend/base/default/template/marketplace/catalog/product/askquestion/reply_form.phtml +89 -0
  104. app/design/frontend/base/default/template/marketplace/catalog/product/view.phtml +147 -0
  105. app/design/frontend/base/default/template/marketplace/catalog/product/view/sellerinfo.phtml +32 -0
  106. app/design/frontend/base/default/template/marketplace/checkout/cart/item/default.phtml +255 -0
  107. app/design/frontend/base/default/template/marketplace/checkout/multishipping/item/default.phtml +41 -0
  108. app/design/frontend/base/default/template/marketplace/checkout/onepage/review/item.phtml +217 -0
  109. app/design/frontend/base/default/template/marketplace/customer/account/myorders/items.phtml +89 -0
  110. app/design/frontend/base/default/template/marketplace/customer/account/myorders/shipitems.phtml +80 -0
  111. app/design/frontend/base/default/template/marketplace/customer/account/navigation.phtml +49 -0
  112. app/design/frontend/base/default/template/marketplace/customer/account/print.phtml +117 -0
  113. app/design/frontend/base/default/template/marketplace/customer/account/selleroptions.phtml +115 -0
  114. app/design/frontend/base/default/template/marketplace/customer/account/shiporder.phtml +157 -0
  115. app/design/frontend/base/default/template/marketplace/customer/account/vieworder.phtml +149 -0
  116. app/design/frontend/base/default/template/marketplace/customer/form/edit.phtml +193 -0
  117. app/design/frontend/base/default/template/marketplace/dashboard/bestseller.phtml +56 -0
  118. app/design/frontend/base/default/template/marketplace/dashboard/dashboard.phtml +23 -0
  119. app/design/frontend/base/default/template/marketplace/dashboard/myorders.phtml +49 -0
  120. app/design/frontend/base/default/template/marketplace/dashboard/notificationcount.phtml +32 -0
  121. app/design/frontend/base/default/template/marketplace/dashboard/questioncount.phtml +32 -0
  122. app/design/frontend/base/default/template/marketplace/persistent/customer/form/register.phtml +242 -0
  123. app/design/frontend/base/default/template/marketplace/product/add.phtml +192 -0
  124. app/design/frontend/base/default/template/marketplace/product/edit.phtml +217 -0
  125. app/design/frontend/base/default/template/marketplace/product/grid.phtml +90 -0
  126. app/design/frontend/base/default/template/marketplace/product/import.phtml +49 -0
  127. app/design/frontend/base/default/template/marketplace/review/product/view/list.phtml +73 -0
  128. app/design/frontend/base/default/template/marketplace/sales/myorder/items/renderer/default.phtml +305 -0
  129. app/design/frontend/base/default/template/marketplace/sales/myorder/items/renderer/ship/default.phtml +307 -0
  130. app/design/frontend/base/default/template/marketplace/sales/order/form.phtml +91 -0
  131. app/design/frontend/base/default/template/marketplace/sales/order/history.phtml +284 -0
  132. app/design/frontend/base/default/template/marketplace/sales/order/items.phtml +105 -0
  133. app/design/frontend/base/default/template/marketplace/sales/order/items/renderer/default.phtml +308 -0
  134. app/design/frontend/base/default/template/marketplace/sales/print.phtml +118 -0
  135. app/design/frontend/base/default/template/marketplace/sales/selleroptions.phtml +130 -0
  136. app/design/frontend/base/default/template/marketplace/sales/vieworder.phtml +89 -0
  137. app/design/frontend/base/default/template/marketplace/seller/account/myorders.phtml +59 -0
  138. app/design/frontend/base/default/template/marketplace/seller/info.phtml +50 -0
  139. app/design/frontend/base/default/template/marketplace/seller/logo.phtml +27 -0
  140. app/design/frontend/base/default/template/marketplace/seller/ratings.phtml +38 -0
  141. app/design/frontend/base/default/template/marketplace/seller/seller_ratings.phtml +35 -0
  142. app/etc/modules/Cybage_Marketplace.xml +29 -0
  143. app/locale/en_US/template/email/newseller_account.html +55 -0
  144. app/locale/en_US/template/email/pendingorder_reminder.html +55 -0
  145. app/locale/en_US/template/email/sales/customer_cancelled_new.html +50 -0
  146. app/locale/en_US/template/email/sales/customer_completed_new.html +57 -0
  147. app/locale/en_US/template/email/sales/customer_processing_new.html +52 -0
  148. app/locale/en_US/template/email/sales/product_comment.html +56 -0
  149. app/locale/en_US/template/email/seller_payment.html +55 -0
  150. app/locale/en_US/template/email/seller_status.html +43 -0
  151. js/jquery/jquery-1.9.1.min.js +5 -0
  152. js/marketplace/fancybox/jquery-1.7.2.min.js +6 -0
  153. js/marketplace/fancybox/jquery.fancybox-1.3.4.pack.js +46 -0
  154. js/marketplace/fancybox/jquery.mousewheel-3.0.4.pack.js +14 -0
  155. js/marketplace/fancybox/jquery.noconflict.js +1 -0
  156. js/marketplace/nicEdit-latest.js.js +125 -0
  157. media/marketplace/productimport.csv +2 -0
  158. package.xml +37 -0
  159. skin/frontend/base/default/css/marketplace/jquery.fancybox-1.3.4.css +422 -0
app/code/community/Cybage/Marketplace/Block/Adminhtml/Catalog/Product/Grid.php ADDED
@@ -0,0 +1,276 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Catalog_Product_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid
22
+ {
23
+ protected function _prepareCollection()
24
+ {
25
+ $store = $this->_getStore();
26
+ $collection = Mage::getModel('catalog/product')->getCollection()
27
+ ->addAttributeToSelect('sku')
28
+ ->addAttributeToSelect('name')
29
+ ->addAttributeToSelect('attribute_set_id')
30
+ ->addAttributeToSelect('type_id');
31
+
32
+ if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) {
33
+ $collection->joinField('qty',
34
+ 'cataloginventory/stock_item',
35
+ 'qty',
36
+ 'product_id=entity_id',
37
+ '{{table}}.stock_id=1',
38
+ 'left');
39
+ }
40
+ if ($store->getId()) {
41
+ $adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;
42
+ $collection->addStoreFilter($store);
43
+ $collection->joinAttribute(
44
+ 'name',
45
+ 'catalog_product/name',
46
+ 'entity_id',
47
+ null,
48
+ 'inner',
49
+ $adminStore
50
+ );
51
+ $collection->joinAttribute(
52
+ 'custom_name',
53
+ 'catalog_product/name',
54
+ 'entity_id',
55
+ null,
56
+ 'inner',
57
+ $store->getId()
58
+ );
59
+ $collection->joinAttribute(
60
+ 'status',
61
+ 'catalog_product/status',
62
+ 'entity_id',
63
+ null,
64
+ 'inner',
65
+ $store->getId()
66
+ );
67
+ $collection->joinAttribute(
68
+ 'visibility',
69
+ 'catalog_product/visibility',
70
+ 'entity_id',
71
+ null,
72
+ 'inner',
73
+ $store->getId()
74
+ );
75
+ $collection->joinAttribute(
76
+ 'price',
77
+ 'catalog_product/price',
78
+ 'entity_id',
79
+ null,
80
+ 'left',
81
+ $store->getId()
82
+ );
83
+ }
84
+ else {
85
+ $collection->addAttributeToSelect('price');
86
+ $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
87
+ $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
88
+ }
89
+
90
+ $collection->joinAttribute('seller_id', 'catalog_product/seller_id', 'entity_id', null, 'left');
91
+ $this->setCollection($collection);
92
+
93
+ Mage_Adminhtml_Block_Widget_Grid::_prepareCollection();
94
+ $this->getCollection()->addWebsiteNamesToResult();
95
+
96
+ return $this;
97
+ }
98
+
99
+ protected function _prepareColumns()
100
+ {
101
+ $this->addColumn('entity_id',
102
+ array(
103
+ 'header'=> Mage::helper('catalog')->__('ID'),
104
+ 'width' => '50px',
105
+ 'type' => 'number',
106
+ 'index' => 'entity_id',
107
+ ));
108
+ $this->addColumn('name',
109
+ array(
110
+ 'header'=> Mage::helper('catalog')->__('Name'),
111
+ 'index' => 'name',
112
+ ));
113
+
114
+ $store = $this->_getStore();
115
+ if ($store->getId()) {
116
+ $this->addColumn('custom_name',
117
+ array(
118
+ 'header'=> Mage::helper('catalog')->__('Name in %s', $store->getName()),
119
+ 'index' => 'custom_name',
120
+ ));
121
+ }
122
+
123
+ $this->addColumn('type',
124
+ array(
125
+ 'header'=> Mage::helper('catalog')->__('Type'),
126
+ 'width' => '60px',
127
+ 'index' => 'type_id',
128
+ 'type' => 'options',
129
+ 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),
130
+ ));
131
+
132
+ $sets = Mage::getResourceModel('eav/entity_attribute_set_collection')
133
+ ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())
134
+ ->load()
135
+ ->toOptionHash();
136
+
137
+ $this->addColumn('set_name',
138
+ array(
139
+ 'header'=> Mage::helper('catalog')->__('Attrib. Set Name'),
140
+ 'width' => '100px',
141
+ 'index' => 'attribute_set_id',
142
+ 'type' => 'options',
143
+ 'options' => $sets,
144
+ ));
145
+
146
+ $this->addColumn('sku',
147
+ array(
148
+ 'header'=> Mage::helper('catalog')->__('SKU'),
149
+ 'width' => '80px',
150
+ 'index' => 'sku',
151
+ ));
152
+
153
+ $store = $this->_getStore();
154
+ $this->addColumn('price',
155
+ array(
156
+ 'header'=> Mage::helper('catalog')->__('Price'),
157
+ 'type' => 'price',
158
+ 'currency_code' => $store->getBaseCurrency()->getCode(),
159
+ 'index' => 'price',
160
+ ));
161
+
162
+ if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) {
163
+ $this->addColumn('qty',
164
+ array(
165
+ 'header'=> Mage::helper('catalog')->__('Qty'),
166
+ 'width' => '100px',
167
+ 'type' => 'number',
168
+ 'index' => 'qty',
169
+ ));
170
+ }
171
+
172
+ // Get the seller name by seller id
173
+ $sellerCollection = Mage::getModel('customer/customer')
174
+ ->getCollection()
175
+ ->addAttributeToSelect('company_name')
176
+ ->addFieldToFilter('seller_subscriber', 1);
177
+
178
+ //Create option array for drop down
179
+ $sellerName = array();
180
+ $temp['value'] = 'entity_id';
181
+ $temp['label'] = 'company_name';
182
+
183
+ foreach ($sellerCollection as $item) {
184
+ foreach ($item as $code => $field) {
185
+ $sellerData[$item[$temp['value']]] = $item[$temp['label']];
186
+ }
187
+ $sellerName = $sellerData;
188
+ }
189
+
190
+ $this->addColumn('seller_id',
191
+ array(
192
+ 'header'=> Mage::helper('catalog')->__('Seller Company Name'),
193
+ 'index' => 'seller_id',
194
+ 'type' => 'options',
195
+ 'width' => '60px',
196
+ 'options' => $sellerName
197
+ ));
198
+
199
+ $this->addColumn('visibility',
200
+ array(
201
+ 'header'=> Mage::helper('catalog')->__('Visibility'),
202
+ 'width' => '70px',
203
+ 'index' => 'visibility',
204
+ 'type' => 'options',
205
+ 'options' => Mage::getModel('catalog/product_visibility')->getOptionArray(),
206
+ ));
207
+
208
+ $this->addColumn('status',
209
+ array(
210
+ 'header'=> Mage::helper('catalog')->__('Status'),
211
+ 'width' => '70px',
212
+ 'index' => 'status',
213
+ 'type' => 'options',
214
+ 'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),
215
+ ));
216
+
217
+ if (!Mage::app()->isSingleStoreMode()) {
218
+ $this->addColumn('websites',
219
+ array(
220
+ 'header'=> Mage::helper('catalog')->__('Websites'),
221
+ 'width' => '100px',
222
+ 'sortable' => false,
223
+ 'index' => 'websites',
224
+ 'type' => 'options',
225
+ 'options' => Mage::getModel('core/website')->getCollection()->toOptionHash(),
226
+ ));
227
+ }
228
+
229
+ $this->addColumn('action',
230
+ array(
231
+ 'header' => Mage::helper('catalog')->__('Action'),
232
+ 'width' => '50px',
233
+ 'type' => 'action',
234
+ 'getter' => 'getId',
235
+ 'actions' => array(
236
+ array(
237
+ 'caption' => Mage::helper('catalog')->__('Edit'),
238
+ 'url' => array(
239
+ 'base'=>'*/*/edit',
240
+ 'params'=>array('store'=>$this->getRequest()->getParam('store'))
241
+ ),
242
+ 'field' => 'id'
243
+ )
244
+ ),
245
+ 'filter' => false,
246
+ 'sortable' => false,
247
+ 'index' => 'stores',
248
+ ));
249
+
250
+ if (Mage::helper('catalog')->isModuleEnabled('Mage_Rss')) {
251
+ $this->addRssList('rss/catalog/notifystock', Mage::helper('catalog')->__('Notify Low Stock RSS'));
252
+ }
253
+
254
+ return parent::_prepareColumns();
255
+ }
256
+
257
+ protected function _prepareMassaction()
258
+ {
259
+ parent::_prepareMassaction();
260
+ $statuses = Mage::getSingleton('catalog/product_status')->getOptionArray();
261
+ $this->getMassactionBlock()->addItem('statusandstate', array(
262
+ 'label'=> Mage::helper('catalog')->__('Change status and state'),
263
+ 'url' => $this->getUrl('*/*/massStatusandstate', array('_current'=>true)),
264
+ 'additional' => array(
265
+ 'visibility' => array(
266
+ 'name' => 'statusandstate',
267
+ 'type' => 'select',
268
+ 'class' => 'required-entry',
269
+ 'label' => Mage::helper('catalog')->__('Status and state'),
270
+ 'values' => $statuses
271
+ )
272
+ )
273
+ ));
274
+ return $this;
275
+ }
276
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Commission.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Commission extends Mage_Adminhtml_Block_Widget_Grid_Container
22
+ {
23
+ public function __construct() {
24
+ $this->_controller = 'adminhtml_commission';
25
+ $this->_blockGroup = 'marketplace';
26
+ $this->_headerText = Mage::helper('marketplace')->__('Manage Sellers Payment');
27
+ parent::__construct();
28
+ $this->_removeButton('add');
29
+ }
30
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Commission/Edit.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Commission_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
22
+ {
23
+ public function __construct()
24
+ {
25
+ parent::__construct();
26
+
27
+ $this->_objectId = 'id';
28
+ $this->_blockGroup = 'marketplace';
29
+ $this->_controller = 'adminhtml_commission';
30
+
31
+ $this->_updateButton('save', 'label', Mage::helper('adminhtml')->__('Pay'));
32
+ $this->removeButton('delete');
33
+ }
34
+
35
+ public function getHeaderText()
36
+ {
37
+ return Mage::helper('marketplace')->__("Pay Seller '%s'", $this->htmlEscape(Mage::registry('current_customer')->getName()));
38
+ }
39
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Commission/Edit/Form.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Commission_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
22
+ {
23
+ protected function _prepareForm()
24
+ {
25
+ $form = new Varien_Data_Form(array(
26
+ 'id' => 'edit_form',
27
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
28
+ 'method' => 'post',
29
+ ));
30
+
31
+ $customer = Mage::registry('current_customer');
32
+
33
+ if ($customer->getId()) {
34
+ $form->addField('entity_id', 'hidden', array(
35
+ 'name' => 'seller_id',
36
+ ));
37
+ $form->setValues($customer->getData());
38
+ }
39
+
40
+ $form->setUseContainer(true);
41
+ $this->setForm($form);
42
+ return parent::_prepareForm();
43
+ }
44
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Commission/Edit/Tab/Form.php ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Commission_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
22
+ {
23
+ protected function _prepareForm()
24
+ {
25
+ $form = new Varien_Data_Form();
26
+ $this->setForm($form);
27
+ $fieldset = $form->addFieldset('commission_form', array('legend'=>Mage::helper('marketplace')->__('Seller Payment Information')));
28
+
29
+ $fieldset->addField('firstname', 'label', array(
30
+ 'label' => Mage::helper('marketplace')->__('First Name'),
31
+ 'name' => 'firstname',
32
+ ));
33
+
34
+ $fieldset->addField('lastname', 'label', array(
35
+ 'label' => Mage::helper('marketplace')->__('Last Name'),
36
+ 'name' => 'lastname',
37
+ ));
38
+
39
+ $fieldset->addField('email', 'label', array(
40
+ 'label' => Mage::helper('marketplace')->__('Email'),
41
+ 'name' => 'email',
42
+ ));
43
+
44
+ $collection = Mage::getResourceModel('customer/customer_collection')
45
+ ->addNameToSelect()
46
+ ->addAttributeToSelect('status')
47
+ ->addAttributeToFilter('status', array('notnull'=>1))
48
+ ->addAttributeToFilter('entity_id', Mage::registry('current_customer')->getId())
49
+ ->joinTable('sales/order_item',
50
+ 'seller_id=entity_id',
51
+ array(
52
+ 'totalsales' => 'IFNULL(SUM(base_row_total), 0)',
53
+ 'amountrecived' => 'IFNULL(SUM(base_row_invoiced), 0)',
54
+ 'amountremain' => 'IFNULL((SUM(base_row_total) - SUM(base_row_invoiced)), 0)',
55
+ ),
56
+ null,
57
+ 'left')
58
+ ->groupByEmail();
59
+
60
+ $query = '('.$collection->getSelect()->__toString().')';
61
+ $collection->getSelect()->reset()->from(array('e' => new Zend_Db_Expr($query)));
62
+ $collection->joinTable(array('commission' => 'marketplace/commission'),
63
+ 'seller_id=entity_id',
64
+ array(
65
+ 'totalpayamount' => 'IFNULL(SUM(commission.amount), 0)',
66
+ ),
67
+ null,
68
+ 'left');
69
+ $collection->getSelect()->group('e.entity_id');
70
+
71
+ $totalsales = 0;
72
+ $amountrecived = 0;
73
+ $amountremain = 0;
74
+ $totalpayamount = 0;
75
+
76
+ if ($collection->getSize() > 0) {
77
+ foreach ($collection as $item) {
78
+ $totalsales = $item->getTotalsales();
79
+ $amountrecived = $item->getAmountrecived();
80
+ $amountremain = $item->getAmountremain();
81
+ $totalpayamount = $item->getTotalpayamount();
82
+ }
83
+ }
84
+
85
+ $fieldset->addField('totalsales', 'label', array(
86
+ 'label' => Mage::helper('marketplace')->__('Total Sales'),
87
+ 'name' => 'totalsales',
88
+ ));
89
+
90
+ $fieldset->addField('labelamountrecived', 'label', array(
91
+ 'label' => Mage::helper('marketplace')->__('Amount Received'),
92
+ 'name' => 'amountrecived',
93
+ ));
94
+
95
+ $fieldset->addField('amountrecived', 'hidden', array(
96
+ 'name' => 'amountrecived',
97
+ ));
98
+
99
+ $fieldset->addField('amountremain', 'label', array(
100
+ 'label' => Mage::helper('marketplace')->__('Amount Remaining'),
101
+ 'name' => 'amountremain',
102
+ ));
103
+
104
+ $fieldset->addField('labeltotalpayamount', 'label', array(
105
+ 'label' => Mage::helper('marketplace')->__('Payment done till date'),
106
+ 'name' => 'totalpayamount',
107
+ ));
108
+
109
+ $fieldset->addField('totalpayamount', 'hidden', array(
110
+ 'name' => 'totalpayamount',
111
+ ));
112
+
113
+ $fieldset->addField('amount', 'text', array(
114
+ 'label' => Mage::helper('marketplace')->__('Pay'),
115
+ 'name' => 'amount',
116
+ 'class' => 'validate-greater-than-zero',
117
+ 'note' => Mage::helper('marketplace')->__('Pay = (Amount Recived - Total Payamount)'),
118
+ ));
119
+
120
+ if ($customer = Mage::registry('current_customer')) {
121
+ $customer->setTotalsales($totalsales);
122
+ $customer->setAmountrecived($amountrecived);
123
+ $customer->setLabelamountrecived($amountrecived);
124
+ $customer->setAmountremain($amountremain);
125
+ $customer->setTotalpayamount($totalpayamount);
126
+ $customer->setLabeltotalpayamount($totalpayamount);
127
+ $form->setValues($customer->getData());
128
+ }
129
+
130
+ return parent::_prepareForm();
131
+ }
132
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Commission/Edit/Tab/Payhistory.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Commission_Edit_Tab_Payhistory extends Mage_Adminhtml_Block_Widget_Grid
22
+ {
23
+ public function __construct()
24
+ {
25
+ parent::__construct();
26
+ $this->setId('payhistory');
27
+ $this->setUseAjax(true);
28
+ }
29
+
30
+ protected function _prepareCollection()
31
+ {
32
+ $collection = Mage::getResourceModel('marketplace/commission_collection');
33
+ $collection->getSelect()->where('seller_id='.$this->getRequest()->getParam('id'));
34
+ $this->setCollection($collection);
35
+ return parent::_prepareCollection();
36
+ }
37
+
38
+ protected function _prepareColumns()
39
+ {
40
+ $this->addColumn('id', array(
41
+ 'header' => Mage::helper('marketplace')->__('ID'),
42
+ 'type' => 'text',
43
+ 'align' => 'left',
44
+ 'index' => 'id'
45
+ ));
46
+
47
+ $this->addColumn('date', array(
48
+ 'header' => Mage::helper('marketplace')->__('Payment Date'),
49
+ 'type' => 'datetime',
50
+ 'align' => 'left',
51
+ 'index' => 'created_at',
52
+ 'gmtoffset' => true
53
+ ));
54
+
55
+ $this->addColumn('amount', array(
56
+ 'header' => Mage::helper('marketplace')->__('Amount'),
57
+ 'width' => '350',
58
+ 'filter' => false,
59
+ 'type' => 'price',
60
+ 'currency_code' => $this->_getStore()->getBaseCurrency()->getCode(),
61
+ 'index' => 'amount'
62
+ ));
63
+
64
+ return parent::_prepareColumns();
65
+ }
66
+
67
+ protected function _getStore()
68
+ {
69
+ $storeId = (int) $this->getRequest()->getParam('store', 0);
70
+ return Mage::app()->getStore($storeId);
71
+ }
72
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Commission/Edit/Tabs.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Commission_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
22
+ {
23
+ public function __construct()
24
+ {
25
+ parent::__construct();
26
+ $this->setId('commission_tabs');
27
+ $this->setDestElementId('edit_form');
28
+ $this->setTitle(Mage::helper('marketplace')->__('Seller Payment Information'));
29
+ }
30
+
31
+ protected function _beforeToHtml()
32
+ {
33
+ $this->addTab('seller_form', array(
34
+ 'label' => Mage::helper('marketplace')->__('Seller Payment Information'),
35
+ 'title' => Mage::helper('marketplace')->__('Seller Payment Information'),
36
+ 'content' => $this->getLayout()->createBlock('marketplace/adminhtml_commission_edit_tab_form')->toHtml(),
37
+ ));
38
+
39
+ $this->addTab('payhistory', array(
40
+ 'label' => Mage::helper('marketplace')->__('Payment History'),
41
+ 'url' => $this->getUrl('*/*/payhistory', array('_current' => true)),
42
+ 'class' => 'ajax',
43
+ ));
44
+
45
+ return parent::_beforeToHtml();
46
+ }
47
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Commission/Grid.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Commission_Grid extends Mage_Adminhtml_Block_Widget_Grid
22
+ {
23
+ public function __construct() {
24
+ parent::__construct();
25
+ $this->setId('commissionGrid');
26
+ $this->setUseAjax(true);
27
+ $this->setDefaultSort('entity_id');
28
+ $this->setSaveParametersInSession(true);
29
+ }
30
+
31
+ protected function _prepareCollection() {
32
+ $collection = Mage::getResourceModel('customer/customer_collection')
33
+ ->addNameToSelect()
34
+ ->addAttributeToSelect('status')
35
+ ->addAttributeToFilter('status', array('notnull'=>1))
36
+ ->joinTable('sales/order_item',
37
+ 'seller_id=entity_id',
38
+ array(
39
+ 'totalsales' => 'IFNULL(SUM(base_row_total), 0)',
40
+ 'amountrecived' => 'IFNULL(SUM(base_row_invoiced), 0)',
41
+ 'amountremain' => 'IFNULL((SUM(base_row_total) - SUM(base_row_invoiced)), 0)',
42
+ ),
43
+ null,
44
+ 'left')
45
+ ->groupByEmail();
46
+
47
+ $query = '('.$collection->getSelect()->__toString().')';
48
+ $collection->getSelect()->reset()->from(array('e' => new Zend_Db_Expr($query)));
49
+ $collection->joinTable(array('commission' => 'marketplace/commission'),
50
+ 'seller_id=entity_id',
51
+ array(
52
+ 'totalpayamount' => 'IFNULL(SUM(commission.amount), 0)',
53
+ ),
54
+ null,
55
+ 'left');
56
+ $collection->getSelect()->group('e.entity_id');
57
+
58
+ $this->setCollection($collection);
59
+ return parent::_prepareCollection();
60
+ }
61
+
62
+ protected function _prepareColumns()
63
+ {
64
+ $this->addColumn('entity_id', array(
65
+ 'header' => Mage::helper('marketplace')->__('ID'),
66
+ 'width' => '50px',
67
+ 'index' => 'entity_id',
68
+ 'type' => 'number',
69
+ ));
70
+
71
+ $this->addColumn('name', array(
72
+ 'header' => Mage::helper('marketplace')->__('Name'),
73
+ 'index' => 'name'
74
+ ));
75
+
76
+ $this->addColumn('email', array(
77
+ 'header' => Mage::helper('marketplace')->__('Email'),
78
+ 'width' => '150',
79
+ 'index' => 'email'
80
+ ));
81
+
82
+ $this->addColumn('status', array(
83
+ 'header' => Mage::helper('marketplace')->__('Status'),
84
+ 'align' => 'left',
85
+ 'index' => 'status',
86
+ 'type' => 'options',
87
+ 'options' => Mage::getModel('marketplace/customatributestatus')->toOptionArray(),
88
+ ));
89
+
90
+ $this->addColumn('totalsales', array(
91
+ 'header' => Mage::helper('marketplace')->__('Total Sales'),
92
+ 'width' => '150',
93
+ 'filter' => false,
94
+ 'type' => 'price',
95
+ 'currency_code' => $this->_getStore()->getBaseCurrency()->getCode(),
96
+ 'index' => 'totalsales'
97
+ ));
98
+
99
+ $this->addColumn('amountrecived', array(
100
+ 'header' => Mage::helper('marketplace')->__('Amount Received'),
101
+ 'width' => '150',
102
+ 'filter' => false,
103
+ 'type' => 'price',
104
+ 'currency_code' => $this->_getStore()->getBaseCurrency()->getCode(),
105
+ 'index' => 'amountrecived'
106
+ ));
107
+
108
+ $this->addColumn('amountremain', array(
109
+ 'header' => Mage::helper('marketplace')->__('Amount Remaining'),
110
+ 'width' => '150',
111
+ 'filter' => false,
112
+ 'type' => 'price',
113
+ 'currency_code' => $this->_getStore()->getBaseCurrency()->getCode(),
114
+ 'index' => 'amountremain'
115
+ ));
116
+
117
+ $this->addColumn('totalpayamount', array(
118
+ 'header' => Mage::helper('marketplace')->__('Payment done till date'),
119
+ 'width' => '150',
120
+ 'filter' => false,
121
+ 'type' => 'price',
122
+ 'currency_code' => $this->_getStore()->getBaseCurrency()->getCode(),
123
+ 'index' => 'totalpayamount'
124
+ ));
125
+
126
+ $this->addColumn('action',
127
+ array(
128
+ 'header' => Mage::helper('marketplace')->__('Action'),
129
+ 'width' => '50px',
130
+ 'type' => 'action',
131
+ 'getter' => 'getId',
132
+ 'filter' => false,
133
+ 'sortable' => false,
134
+ 'index' => 'stores',
135
+ 'renderer' => 'Cybage_Marketplace_Block_Adminhtml_Widget_Column_Renderer_Paylink',
136
+ ));
137
+
138
+ return parent::_prepareColumns();
139
+ }
140
+
141
+ /*
142
+ * get grid url
143
+ */
144
+ public function getGridUrl()
145
+ {
146
+ return $this->getUrl('*/*/grid', array('_current'=>true));
147
+ }
148
+
149
+ protected function _getStore()
150
+ {
151
+ $storeId = (int) $this->getRequest()->getParam('store', 0);
152
+ return Mage::app()->getStore($storeId);
153
+ }
154
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Orderby.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Orderby extends Mage_Adminhtml_Block_Widget_Grid_Container
22
+ {
23
+ public function __construct() {
24
+ $this->_blockGroup = 'marketplace';
25
+ $this->_controller = 'adminhtml_orderby';
26
+ $this->_headerText = Mage::helper('marketplace')->__('Orders By Each Seller');
27
+ $this->setTemplate('report/grid/container.phtml');
28
+ parent::__construct();
29
+ $this->_removeButton('add');
30
+ $this->addButton('filter_form_submit', array(
31
+ 'label' => Mage::helper('marketplace')->__('Show Report'),
32
+ 'onclick' => 'filterFormSubmit()'
33
+ ));
34
+ }
35
+
36
+ public function getFilterUrl() {
37
+ $this->getRequest()->setParam('filter', null);
38
+ return $this->getUrl('*/*/', array('_current' => true));
39
+ }
40
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Orderby/Form.php ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Orderby_Form extends Mage_Adminhtml_Block_Widget_Form
22
+ {
23
+ /**
24
+ * Report field visibility
25
+ */
26
+ protected $_fieldVisibility = array();
27
+
28
+ /**
29
+ * Report field opions
30
+ */
31
+ protected $_fieldOptions = array();
32
+
33
+ /**
34
+ * Set field visibility
35
+ *
36
+ * @param string Field id
37
+ * @param bool Field visibility
38
+ */
39
+ public function setFieldVisibility($fieldId, $visibility) {
40
+ $this->_fieldVisibility[$fieldId] = (bool) $visibility;
41
+ }
42
+
43
+ /**
44
+ * Get field visibility
45
+ *
46
+ * @param string Field id
47
+ * @param bool Default field visibility
48
+ * @return bool
49
+ */
50
+ public function getFieldVisibility($fieldId, $defaultVisibility = true) {
51
+ if (!array_key_exists($fieldId, $this->_fieldVisibility)) {
52
+ return $defaultVisibility;
53
+ }
54
+ return $this->_fieldVisibility[$fieldId];
55
+ }
56
+
57
+ /**
58
+ * Set field option(s)
59
+ *
60
+ * @param string $fieldId Field id
61
+ * @param mixed $option Field option name
62
+ * @param mixed $value Field option value
63
+ */
64
+ public function setFieldOption($fieldId, $option, $value = null) {
65
+ if (is_array($option)) {
66
+ $options = $option;
67
+ } else {
68
+ $options = array($option => $value);
69
+ }
70
+ if (!array_key_exists($fieldId, $this->_fieldOptions)) {
71
+ $this->_fieldOptions[$fieldId] = array();
72
+ }
73
+ foreach ($options as $k => $v) {
74
+ $this->_fieldOptions[$fieldId][$k] = $v;
75
+ }
76
+ }
77
+
78
+ /**
79
+ * Add fieldset with general report fields
80
+ *
81
+ * @return Cybage_Marketplace_Block_Adminhtml_Orderby_Form
82
+ */
83
+ protected function _prepareForm() {
84
+ $actionUrl = $this->getUrl('*/*/');
85
+ $form = new Varien_Data_Form(
86
+ array('id' => 'filter_form', 'action' => $actionUrl, 'method' => 'get')
87
+ );
88
+ $htmlIdPrefix = 'sales_report_';
89
+ $form->setHtmlIdPrefix($htmlIdPrefix);
90
+ $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('marketplace')->__('Filter')));
91
+
92
+ $dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
93
+
94
+ $fieldset->addField('store_ids', 'hidden', array(
95
+ 'name' => 'store_ids'
96
+ ));
97
+
98
+ $collection = Mage::getResourceModel('customer/customer_collection')
99
+ ->addAttributeToSelect('company_name')
100
+ ->addAttributeToSelect('status')
101
+ ->addAttributeToFilter('status', array('eq'=>Mage::getStoreConfig('marketplace/status/approved')));
102
+
103
+ $values[0] = 'All';
104
+ foreach ($collection as $data) {
105
+ $values[$data->getId()] = $data->getCompanyName();
106
+ }
107
+
108
+ $fieldset->addField('marketplace_user', 'select', array(
109
+ 'name' => 'marketplace_user',
110
+ 'options' => $values,
111
+ 'label' => Mage::helper('marketplace')->__('Marketplace Seller'),
112
+ 'title' => Mage::helper('marketplace')->__('Marketplace Seller')
113
+ ));
114
+
115
+ $fieldset->addField('period_type', 'select', array(
116
+ 'name' => 'period_type',
117
+ 'options' => array(
118
+ 'week' => Mage::helper('marketplace')->__('Weekly'),
119
+ 'month' => Mage::helper('marketplace')->__('Monthly'),
120
+ 'quarter' => Mage::helper('marketplace')->__('Quarterly')
121
+ ),
122
+ 'label' => Mage::helper('marketplace')->__('Period'),
123
+ 'title' => Mage::helper('marketplace')->__('Period')
124
+ ));
125
+
126
+ $fieldset->addField('from', 'date', array(
127
+ 'name' => 'from',
128
+ 'format' => $dateFormatIso,
129
+ 'image' => $this->getSkinUrl('images/grid-cal.gif'),
130
+ 'label' => Mage::helper('marketplace')->__('From'),
131
+ 'title' => Mage::helper('marketplace')->__('From'),
132
+ 'required' => true
133
+ ));
134
+
135
+ $fieldset->addField('to', 'date', array(
136
+ 'name' => 'to',
137
+ 'format' => $dateFormatIso,
138
+ 'image' => $this->getSkinUrl('images/grid-cal.gif'),
139
+ 'label' => Mage::helper('marketplace')->__('To'),
140
+ 'title' => Mage::helper('marketplace')->__('To'),
141
+ 'required' => true
142
+ ));
143
+
144
+ if (is_object($fieldset) && $fieldset instanceof Varien_Data_Form_Element_Fieldset) {
145
+
146
+ $statuses = Mage::getModel('sales/order_config')->getStatuses();
147
+ $values = array();
148
+
149
+ foreach ($statuses as $code => $label) {
150
+ //if (false === strpos($code, 'pending')) {
151
+ if (in_array($code, array('canceled', 'complete', 'processing'))) {
152
+ $values[] = array(
153
+ 'label' => Mage::helper('marketplace')->__($label),
154
+ 'value' => $code
155
+ );
156
+ }
157
+ }
158
+
159
+ $fieldset->addField('show_order_statuses', 'select', array(
160
+ 'name' => 'show_order_statuses',
161
+ 'label' => Mage::helper('marketplace')->__('Order Status'),
162
+ 'options' => array(
163
+ '0' => Mage::helper('marketplace')->__('Any'),
164
+ '1' => Mage::helper('marketplace')->__('Specified'),
165
+ ),
166
+ 'note' => Mage::helper('marketplace')->__('Applies to Any of the Specified Order Statuses'),
167
+ ), 'to');
168
+
169
+ $fieldset->addField('order_statuses', 'multiselect', array(
170
+ 'name' => 'order_statuses',
171
+ 'values' => $values,
172
+ 'display' => 'none'
173
+ ), 'show_order_statuses');
174
+
175
+ // define field dependencies
176
+ if ($this->getFieldVisibility('show_order_statuses') && $this->getFieldVisibility('order_statuses')) {
177
+ $this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence')
178
+ ->addFieldMap("{$htmlIdPrefix}show_order_statuses", 'show_order_statuses')
179
+ ->addFieldMap("{$htmlIdPrefix}order_statuses", 'order_statuses')
180
+ ->addFieldDependence('order_statuses', 'show_order_statuses', '1')
181
+ );
182
+ }
183
+ }
184
+
185
+ $form->setUseContainer(true);
186
+ $this->setForm($form);
187
+
188
+ return parent::_prepareForm();
189
+ }
190
+
191
+ /**
192
+ * Initialize form fileds values
193
+ * Method will be called after prepareForm and can be used for field values initialization
194
+ *
195
+ * @return Mage_Adminhtml_Block_Widget_Form
196
+ */
197
+ protected function _initFormValues() {
198
+ $this->getForm()->addValues($this->getFilterData()->getData());
199
+ return parent::_initFormValues();
200
+ }
201
+
202
+ /**
203
+ * This method is called before rendering HTML
204
+ *
205
+ * @return Mage_Adminhtml_Block_Widget_Form
206
+ */
207
+ protected function _beforeToHtml() {
208
+ $result = parent::_beforeToHtml();
209
+
210
+ /** @var Varien_Data_Form_Element_Fieldset $fieldset */
211
+ $fieldset = $this->getForm()->getElement('base_fieldset');
212
+
213
+ if (is_object($fieldset) && $fieldset instanceof Varien_Data_Form_Element_Fieldset) {
214
+ // apply field visibility
215
+ foreach ($fieldset->getElements() as $field) {
216
+ if (!$this->getFieldVisibility($field->getId())) {
217
+ $fieldset->removeField($field->getId());
218
+ }
219
+ }
220
+ // apply field options
221
+ foreach ($this->_fieldOptions as $fieldId => $fieldOptions) {
222
+ $field = $fieldset->getElements()->searchById($fieldId);
223
+ /** @var Varien_Object $field */
224
+ if ($field) {
225
+ foreach ($fieldOptions as $k => $v) {
226
+ $field->setDataUsingMethod($k, $v);
227
+ }
228
+ }
229
+ }
230
+ }
231
+
232
+ return $result;
233
+ }
234
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Orderby/Grid.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Orderby_Grid extends Cybage_Marketplace_Block_Adminhtml_Orderby_Grid_Abstract
22
+ {
23
+ protected $_columnGroupBy = 'seller_name';
24
+
25
+ public function __construct() {
26
+ parent::__construct();
27
+ $this->setCountTotals(true);
28
+ }
29
+
30
+ public function getResourceCollectionName() {
31
+ return 'marketplace/orderby_collection';
32
+ }
33
+
34
+ protected function _prepareColumns() {
35
+ $this->addColumn('seller_name', array(
36
+ 'header' => Mage::helper('sales')->__('Seller Name'),
37
+ 'index' => 'seller_name',
38
+ 'width' => '100px',
39
+ 'type' => 'text',
40
+ 'renderer' => 'Cybage_Marketplace_Block_Adminhtml_Orderby_Grid_Name',
41
+ 'totals_label' => Mage::helper('sales')->__(''),
42
+ 'sortable' => false,
43
+ ));
44
+
45
+ $this->addColumn('created_at', array(
46
+ 'header' => Mage::helper('sales')->__('Period'),
47
+ 'index' => 'created_at',
48
+ 'width' => 100,
49
+ 'sortable' => false,
50
+ 'period_type' => $this->getPeriodType(),
51
+ 'totals_label' => Mage::helper('sales')->__('Total'),
52
+ 'html_decorators' => array('nobr'),
53
+ ));
54
+
55
+ $this->addColumn('total_item_count', array(
56
+ 'header' => Mage::helper('sales')->__('Ordered Items'),
57
+ 'index' => 'total_item_count',
58
+ 'width' => '100px',
59
+ 'type' => 'number',
60
+ 'total' => 'sum',
61
+ 'sortable' => false
62
+ ));
63
+
64
+ $currencyCode = $this->getCurrentCurrencyCode();
65
+
66
+ $this->addColumn('total_income_amount', array(
67
+ 'header' => Mage::helper('sales')->__('Sales Total'),
68
+ 'index' => 'total_income_amount',
69
+ 'currency_code' => $currencyCode,
70
+ 'width' => '100px',
71
+ 'type' => 'currency',
72
+ 'total' => 'sum',
73
+ 'sortable' => false
74
+ ));
75
+
76
+ $this->addColumn('base_total_invoiced', array(
77
+ 'header' => Mage::helper('sales')->__('Invoiced'),
78
+ 'index' => 'base_total_invoiced',
79
+ 'currency_code' => $currencyCode,
80
+ 'width' => '100px',
81
+ 'type' => 'currency',
82
+ 'total' => 'sum',
83
+ 'sortable' => false
84
+ ));
85
+
86
+ $this->addColumn('base_total_refunded', array(
87
+ 'header' => Mage::helper('sales')->__('Refunded'),
88
+ 'index' => 'base_total_refunded',
89
+ 'currency_code' => $currencyCode,
90
+ 'width' => '100px',
91
+ 'type' => 'currency',
92
+ 'total' => 'sum',
93
+ 'sortable' => false
94
+ ));
95
+ /*
96
+ $this->addColumn('base_shipping_amount', array(
97
+ 'header' => Mage::helper('sales')->__('Shipping Amount'),
98
+ 'index' => 'base_shipping_amount',
99
+ 'currency_code' => $currencyCode,
100
+ 'width' => '100px',
101
+ 'type' => 'currency',
102
+ 'total' => 'sum',
103
+ 'sortable' => false
104
+ ));
105
+ */
106
+ $this->addColumn('discount_amount', array(
107
+ 'header' => Mage::helper('sales')->__('Total Discount'),
108
+ 'index' => 'discount_amount',
109
+ 'currency_code' => $currencyCode,
110
+ 'width' => '100px',
111
+ 'type' => 'currency',
112
+ 'total' => 'sum',
113
+ 'sortable' => false
114
+ ));
115
+ /*
116
+ $this->addColumn('base_total_canceled', array(
117
+ 'header' => Mage::helper('sales')->__('Total Cancelled'),
118
+ 'index' => 'base_total_canceled',
119
+ 'currency_code' => $currencyCode,
120
+ 'width' => '100px',
121
+ 'type' => 'currency',
122
+ 'total' => 'sum',
123
+ 'sortable' => false
124
+ ));
125
+ */
126
+
127
+ $this->addExportType('*/*/exportOrderCsv', Mage::helper('marketplace')->__('CSV'));
128
+ $this->addExportType('*/*/exportOrderExcel', Mage::helper('marketplace')->__('Excel XML'));
129
+ return parent::_prepareColumns();
130
+ }
131
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Orderby/Grid/Abstract.php ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Orderby_Grid_Abstract extends Mage_Adminhtml_Block_Widget_Grid
22
+ {
23
+ protected $_resourceCollectionName = '';
24
+ protected $_currentCurrencyCode = null;
25
+ protected $_storeIds = array();
26
+ protected $_aggregatedColumns = null;
27
+
28
+ public function __construct() {
29
+ parent::__construct();
30
+ $this->setFilterVisibility(false);
31
+ $this->setPagerVisibility(false);
32
+ $this->setUseAjax(false);
33
+ if (isset($this->_columnGroupBy)) {
34
+ $this->isColumnGrouped($this->_columnGroupBy, true);
35
+ }
36
+ $this->setEmptyCellLabel(Mage::helper('reports')->__('No records found for this period.'));
37
+ }
38
+
39
+ public function getResourceCollectionName() {
40
+ return $this->_resourceCollectionName;
41
+ }
42
+
43
+ public function getCollection() {
44
+ if (is_null($this->_collection)) {
45
+ $this->setCollection(Mage::getModel('reports/grouped_collection'));
46
+ }
47
+ return $this->_collection;
48
+ }
49
+
50
+ protected function _getAggregatedColumns() {
51
+ if (is_null($this->_aggregatedColumns)) {
52
+ foreach ($this->getColumns() as $column) {
53
+ if (!is_array($this->_aggregatedColumns)) {
54
+ $this->_aggregatedColumns = array();
55
+ }
56
+ if ($column->hasTotal()) {
57
+ $this->_aggregatedColumns[$column->getId()] = "{$column->getTotal()}({$column->getIndex()})";
58
+ }
59
+ }
60
+ }
61
+ return $this->_aggregatedColumns;
62
+ }
63
+
64
+ /**
65
+ * Add column to grid
66
+ * Overriden to add support for visibility_filter column option
67
+ * It stands for conditional visibility of the column depending on filter field values
68
+ * Value of visibility_filter supports (filter_field_name => filter_field_value) pairs
69
+ *
70
+ * @param string $columnId
71
+ * @param array $column
72
+ * @return Mage_Adminhtml_Block_Report_Grid_Abstract
73
+ */
74
+ public function addColumn($columnId, $column) {
75
+ if (is_array($column) && array_key_exists('visibility_filter', $column)) {
76
+ $filterData = $this->getFilterData();
77
+ $visibilityFilter = $column['visibility_filter'];
78
+ if (!is_array($visibilityFilter)) {
79
+ $visibilityFilter = array($visibilityFilter);
80
+ }
81
+ foreach ($visibilityFilter as $k => $v) {
82
+ if (is_int($k)) {
83
+ $filterFieldId = $v;
84
+ $filterFieldValue = true;
85
+ } else {
86
+ $filterFieldId = $k;
87
+ $filterFieldValue = $v;
88
+ }
89
+ if (!$filterData->hasData($filterFieldId) || $filterData->getData($filterFieldId) != $filterFieldValue) {
90
+ return $this; // don't add column
91
+ }
92
+ }
93
+ }
94
+ return parent::addColumn($columnId, $column);
95
+ }
96
+
97
+ protected function _prepareCollection() {
98
+ $filterData = $this->getFilterData();
99
+
100
+ if ($filterData->getData('from') == null || $filterData->getData('to') == null) {
101
+ $this->setCountTotals(false);
102
+ $this->setCountSubTotals(false);
103
+ return parent::_prepareCollection();
104
+ }
105
+
106
+ $resourceCollection = Mage::getResourceModel($this->getResourceCollectionName())
107
+ ->setPeriod($filterData->getData('period_type'))
108
+ ->setDateRange($filterData->getData('from', null), $filterData->getData('to', null))
109
+ ->setMarketplaceUser($filterData->getData('marketplace_user'))
110
+ ->addStoreFilter(explode(',', $filterData->getData('store_ids')))
111
+ ->addOrderStatusFilter($filterData->getData('order_statuses'))
112
+ ->setAggregatedColumns($this->_getAggregatedColumns());
113
+
114
+ if ($this->_isExport) {
115
+ $this->setCollection($resourceCollection);
116
+ return $this;
117
+ }
118
+
119
+ if ($filterData->getData('show_empty_rows', false)) {
120
+ Mage::helper('reports')->prepareIntervalsCollection(
121
+ $this->getCollection(), $filterData->getData('from', null), $filterData->getData('to', null), $filterData->getData('period_type')
122
+ );
123
+ }
124
+
125
+ if ($this->getCountSubTotals()) {
126
+ $this->getSubTotals();
127
+ }
128
+
129
+ if ($this->getCountTotals()) {
130
+ $totalsCollection = Mage::getResourceModel($this->getResourceCollectionName())
131
+ ->setPeriod($filterData->getData('period_type'))
132
+ ->setDateRange($filterData->getData('from', null), $filterData->getData('to', null))
133
+ ->setMarketplaceUser($filterData->getData('marketplace_user'))
134
+ ->addStoreFilter(explode(',', $filterData->getData('store_ids')))
135
+ ->addOrderStatusFilter($filterData->getData('order_statuses'))
136
+ ->setAggregatedColumns($this->_getAggregatedColumns())
137
+ ->isTotals(true);
138
+ foreach ($totalsCollection as $item) {
139
+ $this->setTotals($item);
140
+ break;
141
+ }
142
+ }
143
+
144
+ $this->getCollection()->setColumnGroupBy($this->_columnGroupBy);
145
+ $this->getCollection()->setResourceCollection($resourceCollection);
146
+
147
+ return parent::_prepareCollection();
148
+ }
149
+
150
+ public function getCountTotals() {
151
+ if (!$this->getTotals()) {
152
+ $filterData = $this->getFilterData();
153
+ $totalsCollection = Mage::getResourceModel($this->getResourceCollectionName())
154
+ ->setPeriod($filterData->getData('period_type'))
155
+ ->setDateRange($filterData->getData('from', null), $filterData->getData('to', null))
156
+ ->setMarketplaceUser($filterData->getData('marketplace_user'))
157
+ ->addStoreFilter(explode(',', $filterData->getData('store_ids')))
158
+ ->addOrderStatusFilter($filterData->getData('order_statuses'))
159
+ ->setAggregatedColumns($this->_getAggregatedColumns())
160
+ ->isTotals(true);
161
+ if (count($totalsCollection->getItems()) < 1 || !$filterData->getData('from')) {
162
+ $this->setTotals(new Varien_Object());
163
+ } else {
164
+ foreach ($totalsCollection->getItems() as $item) {
165
+ $this->setTotals($item);
166
+ break;
167
+ }
168
+ }
169
+ }
170
+ return parent::getCountTotals();
171
+ }
172
+
173
+ public function getSubTotals() {
174
+ $filterData = $this->getFilterData();
175
+ $subTotalsCollection = Mage::getResourceModel($this->getResourceCollectionName())
176
+ ->setPeriod($filterData->getData('period_type'))
177
+ ->setDateRange($filterData->getData('from', null), $filterData->getData('to', null))
178
+ ->setMarketplaceUser($filterData->getData('marketplace_user'))
179
+ ->addStoreFilter(explode(',', $filterData->getData('store_ids')))
180
+ ->addOrderStatusFilter($filterData->getData('order_statuses'))
181
+ ->setAggregatedColumns($this->_getAggregatedColumns())
182
+ ->isSubTotals(true);
183
+ $this->setSubTotals($subTotalsCollection->getItems());
184
+ return parent::getSubTotals();
185
+ }
186
+
187
+ public function setStoreIds($storeIds) {
188
+ $this->_storeIds = $storeIds;
189
+ return $this;
190
+ }
191
+
192
+ public function getCurrentCurrencyCode() {
193
+ if (is_null($this->_currentCurrencyCode)) {
194
+ $this->_currentCurrencyCode = (count($this->_storeIds) > 0) ? Mage::app()->getStore(array_shift($this->_storeIds))->getBaseCurrencyCode() : Mage::app()->getStore()->getBaseCurrencyCode();
195
+ }
196
+ return $this->_currentCurrencyCode;
197
+ }
198
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Orderby/Grid/Name.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Orderby_Grid_Name extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
22
+ {
23
+ public function render(Varien_Object $row) {
24
+ $id = $row->getData($this->getColumn()->getIndex());
25
+ $customerFirstname = Mage::getModel('customer/customer')->load($id)->getFirstname();
26
+ $customerLastname = Mage::getModel('customer/customer')->load($id)->getLastname();
27
+ $customerName = $customerFirstname . ' ' . $customerLastname;
28
+ return $customerName;
29
+ }
30
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Seller.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Seller extends Mage_Adminhtml_Block_Widget_Grid_Container
22
+ {
23
+ public function __construct() {
24
+ $this->_controller = 'adminhtml_seller';
25
+ $this->_blockGroup = 'marketplace';
26
+ $this->_headerText = Mage::helper('marketplace')->__('Manage Sellers');
27
+ parent::__construct();
28
+ $this->_removeButton('add');
29
+ }
30
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Seller/Edit.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Seller_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
22
+ {
23
+ public function __construct()
24
+ {
25
+ parent::__construct();
26
+
27
+ $this->_objectId = 'id';
28
+ $this->_blockGroup = 'marketplace';
29
+ $this->_controller = 'adminhtml_seller';
30
+
31
+ $this->_updateButton('save', 'label', Mage::helper('adminhtml')->__('Save Seller'));
32
+ $this->_updateButton('delete', 'label', Mage::helper('adminhtml')->__('Delete Seller'));
33
+
34
+ $this->_addButton('saveandcontinue', array(
35
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
36
+ 'onclick' => 'saveAndContinueEdit()',
37
+ 'class' => 'save',
38
+ ), -100);
39
+
40
+ $this->_formScripts[] = "
41
+ function saveAndContinueEdit(){
42
+ editForm.submit($('edit_form').action+'back/edit/');
43
+ }
44
+ ";
45
+ }
46
+
47
+ public function getHeaderText()
48
+ {
49
+ return Mage::helper('marketplace')->__("Edit Seller '%s'", $this->htmlEscape(Mage::registry('current_customer')->getName()));
50
+ }
51
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Seller/Edit/Form.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Seller_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
22
+ {
23
+ protected function _prepareForm()
24
+ {
25
+ $form = new Varien_Data_Form(array(
26
+ 'id' => 'edit_form',
27
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
28
+ 'method' => 'post',
29
+ ));
30
+
31
+ $customer = Mage::registry('current_customer');
32
+
33
+ if ($customer->getId()) {
34
+ $form->addField('entity_id', 'hidden', array(
35
+ 'name' => 'seller_id',
36
+ ));
37
+ $form->setValues($customer->getData());
38
+ }
39
+
40
+ $form->setUseContainer(true);
41
+ $this->setForm($form);
42
+ return parent::_prepareForm();
43
+ }
44
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Seller/Edit/Tab/Form.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Seller_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
22
+ {
23
+ protected function _prepareForm()
24
+ {
25
+ $form = new Varien_Data_Form();
26
+ $this->setForm($form);
27
+ $fieldset = $form->addFieldset('seller_form', array('legend'=>Mage::helper('marketplace')->__('Seller information')));
28
+
29
+ $fieldset->addField('firstname', 'label', array(
30
+ 'label' => Mage::helper('marketplace')->__('First Name'),
31
+ 'name' => 'firstname',
32
+ ));
33
+
34
+ $fieldset->addField('lastname', 'label', array(
35
+ 'label' => Mage::helper('marketplace')->__('Last Name'),
36
+ 'name' => 'lastname',
37
+ ));
38
+
39
+ $fieldset->addField('email', 'label', array(
40
+ 'label' => Mage::helper('marketplace')->__('Email'),
41
+ 'name' => 'email',
42
+ ));
43
+
44
+ $status = array();
45
+ foreach (Mage::getModel('marketplace/customatributestatus')->toOptionArray() as $key => $value) {
46
+ $status[] = array (
47
+ 'value' => $key,
48
+ 'label' => $value,
49
+ );
50
+ }
51
+
52
+ $fieldset->addField('status', 'select', array(
53
+ 'label' => Mage::helper('marketplace')->__('Status'),
54
+ 'name' => 'status',
55
+ 'values' => $status
56
+ ));
57
+
58
+ $commission_fieldset = $form->addFieldset('seller_form_commission', array('legend'=>Mage::helper('marketplace')->__('Seller Commission')));
59
+ $commission_fieldset->addField('seller_commission', 'text', array(
60
+ 'label' => Mage::helper('marketplace')->__('Commission (%)'),
61
+ 'name' => 'seller_commission',
62
+ ));
63
+
64
+ $product_fieldset = $form->addFieldset('seller_form_product', array('legend'=>Mage::helper('marketplace')->__('Seller Product Approval')));
65
+ $product_fieldset->addField('seller_product_state', 'select', array(
66
+ 'label' => Mage::helper('marketplace')->__('New Product State'),
67
+ 'name' => 'seller_product_state',
68
+ 'values' => Mage::getModel('marketplace/seller_attribute_source_product_state')->toOptionArray()
69
+ ));
70
+
71
+ $product_fieldset->addField('seller_product_status', 'select', array(
72
+ 'label' => Mage::helper('marketplace')->__('New Product Status'),
73
+ 'name' => 'seller_product_status',
74
+ 'values' => Mage::getModel('marketplace/seller_attribute_source_product_status')->toOptionArray()
75
+ ));
76
+
77
+ if ($customer = Mage::registry('current_customer')) {
78
+ $form->setValues($customer->getData());
79
+ }
80
+
81
+ return parent::_prepareForm();
82
+ }
83
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Seller/Edit/Tabs.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Seller_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
22
+ {
23
+ public function __construct()
24
+ {
25
+ parent::__construct();
26
+ $this->setId('seller_tabs');
27
+ $this->setDestElementId('edit_form');
28
+ $this->setTitle(Mage::helper('marketplace')->__('Seller Information'));
29
+ }
30
+
31
+ protected function _beforeToHtml()
32
+ {
33
+ $this->addTab('seller_form', array(
34
+ 'label' => Mage::helper('marketplace')->__('Seller Information'),
35
+ 'title' => Mage::helper('marketplace')->__('Seller Information'),
36
+ 'content' => $this->getLayout()->createBlock('marketplace/adminhtml_seller_edit_tab_form')->toHtml(),
37
+ ));
38
+
39
+ return parent::_beforeToHtml();
40
+ }
41
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Seller/Grid.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Seller_Grid extends Mage_Adminhtml_Block_Widget_Grid
22
+ {
23
+ public function __construct() {
24
+ parent::__construct();
25
+ $this->setId('sellerGrid');
26
+ $this->setUseAjax(true);
27
+ $this->setDefaultSort('entity_id');
28
+ $this->setSaveParametersInSession(true);
29
+ }
30
+
31
+ protected function _prepareCollection() {
32
+ $collection = Mage::getResourceModel('customer/customer_collection')
33
+ ->addNameToSelect()
34
+ ->addAttributeToSelect('status')
35
+ ->addAttributeToFilter('seller_subscriber', 1);
36
+
37
+ $this->setCollection($collection);
38
+ return parent::_prepareCollection();
39
+ }
40
+
41
+ protected function _prepareColumns()
42
+ {
43
+ $this->addColumn('entity_id', array(
44
+ 'header' => Mage::helper('marketplace')->__('ID'),
45
+ 'width' => '50px',
46
+ 'index' => 'entity_id',
47
+ 'type' => 'number',
48
+ ));
49
+
50
+ $this->addColumn('name', array(
51
+ 'header' => Mage::helper('marketplace')->__('Name'),
52
+ 'index' => 'name'
53
+ ));
54
+
55
+ $this->addColumn('email', array(
56
+ 'header' => Mage::helper('marketplace')->__('Email'),
57
+ 'width' => '150',
58
+ 'index' => 'email'
59
+ ));
60
+ /*
61
+ $this->addColumn('store_name', array(
62
+ 'header' => Mage::helper('marketplace')->__('Store Name'),
63
+ 'align' => 'left',
64
+ 'index' => 'store_name',
65
+ 'width' => '250px',
66
+ ));
67
+
68
+ $this->addColumn('contact_no', array(
69
+ 'header' => Mage::helper('marketplace')->__('Contact No'),
70
+ 'align' => 'left',
71
+ 'index' => 'contact_no',
72
+ ));
73
+
74
+ $this->addColumn('item_shipped_from', array(
75
+ 'header' => Mage::helper('marketplace')->__('Item Shipped From'),
76
+ 'align' => 'left',
77
+ 'index' => 'item_shipped_from',
78
+ ));
79
+ */
80
+
81
+ $this->addColumn('status', array(
82
+ 'header' => Mage::helper('marketplace')->__('Status'),
83
+ 'align' => 'left',
84
+ 'index' => 'status',
85
+ 'type' => 'options',
86
+ 'options' => Mage::getModel('marketplace/customatributestatus')->toOptionArray(),
87
+ ));
88
+
89
+ $this->addColumn('action',
90
+ array(
91
+ 'header' => Mage::helper('marketplace')->__('Action'),
92
+ 'width' => '50px',
93
+ 'type' => 'action',
94
+ 'getter' => 'getId',
95
+ 'actions' => array(
96
+ array(
97
+ 'caption' => Mage::helper('marketplace')->__('Edit'),
98
+ 'url' => array(
99
+ 'base'=>'*/*/edit',
100
+ 'params'=>array('store'=>$storeId)
101
+ ),
102
+ 'field' => 'id'
103
+ )
104
+ ),
105
+ 'filter' => false,
106
+ 'sortable' => false,
107
+ 'index' => 'stores',
108
+ ));
109
+
110
+ return parent::_prepareColumns();
111
+ }
112
+
113
+ protected function _prepareMassaction()
114
+ {
115
+ $this->setMassactionIdField('id');
116
+ $this->getMassactionBlock()->setFormFieldName('id');
117
+
118
+ $this->getMassactionBlock()->addItem('delete', array(
119
+ 'label' => Mage::helper('marketplace')->__('Delete'),
120
+ 'url' => $this->getUrl('*/*/massDelete'),
121
+ 'confirm' => Mage::helper('marketplace')->__('Are you sure you want to delete selected records?')
122
+ ));
123
+
124
+ $this->getMassactionBlock()->addItem('approve', array(
125
+ 'label' => Mage::helper('marketplace')->__('Approve'),
126
+ 'url' => $this->getUrl('*/*/massApprove'),
127
+ 'confirm' => Mage::helper('marketplace')->__('Are you sure you want to approve selected records?')
128
+ ));
129
+
130
+ $this->getMassactionBlock()->addItem('reject', array(
131
+ 'label' => Mage::helper('marketplace')->__('Reject'),
132
+ 'url' => $this->getUrl('*/*/massReject'),
133
+ 'confirm' => Mage::helper('marketplace')->__('Are you sure you want to reject selected records?')
134
+ ));
135
+
136
+ return $this;
137
+ }
138
+
139
+ /*
140
+ * get grid url
141
+ */
142
+ public function getGridUrl()
143
+ {
144
+ return $this->getUrl('*/*/grid', array('_current'=>true));
145
+ }
146
+
147
+ public function getRowUrl($row)
148
+ {
149
+ return $this->getUrl('*/*/edit', array('id'=>$row->getId()));
150
+ }
151
+ }
app/code/community/Cybage/Marketplace/Block/Adminhtml/Widget/Column/Renderer/Paylink.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Adminhtml_Widget_Column_Renderer_Paylink extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
22
+ {
23
+ public function render(Varien_Object $row)
24
+ {
25
+ $url = $this->getUrl('marketplace/adminhtml_commission/pay', array('id' => $row->getEntityId()));
26
+
27
+ $_approvedStatusId = Mage::getModel('marketplace/selleroptions')->getSellerApprovedStatusId();
28
+ $_sellerStatusId = $row->getStatus();
29
+
30
+ if(isset($_approvedStatusId) && $_approvedStatusId == $_sellerStatusId){
31
+ $html = '<a href="' . $url . '">Pay</a>';
32
+ }
33
+
34
+ return $html;
35
+ }
36
+ }
app/code/community/Cybage/Marketplace/Block/Buyerseller.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Buyerseller extends Mage_Core_Block_Template
22
+ {
23
+ public function __construct() {
24
+ parent::__construct();
25
+ /* $collection = new Varien_Object(Mage::getModel('marketplace/buyerseller')->getColection());
26
+ $this->setCollection($collection); */
27
+ }
28
+ }
app/code/community/Cybage/Marketplace/Block/Buyerseller/Sales/Order/History.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Buyerseller_Sales_Order_History extends Mage_Sales_Block_Order_History
22
+ {
23
+ public function __construct()
24
+ {
25
+ parent::__construct();
26
+ $this->setTemplate('marketplace/buyerseller/sales/order/history.phtml');
27
+ }
28
+ }
app/code/community/Cybage/Marketplace/Block/Catalog/Product/List.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Catalog_Product_List extends Mage_Catalog_Block_Product_List
22
+ {
23
+ protected $_prodCollection;
24
+
25
+ /**
26
+ * Retrieve loaded category collection
27
+ *
28
+ * @return Mage_Eav_Model_Entity_Collection_Abstract
29
+ */
30
+ protected function _getProductCollection()
31
+ {
32
+ if (is_null($this->_prodCollection)) {
33
+ $collection = parent::_getProductCollection();
34
+
35
+ /*Get customer "status" attribute options*/
36
+ $_approvedStatusId = Mage::getStoreConfig('marketplace/status/approved');
37
+
38
+ if($_approvedStatusId) {
39
+ $_customerData = Mage::getModel('customer/customer')->getCollection()->addFieldToFilter('status', $_approvedStatusId)->load();
40
+ $where = 'ce.value IS NULL';
41
+ $_sellerIds = array();
42
+
43
+ /*Get array of seller ids with stats approved*/
44
+ foreach($_customerData as $_data){
45
+ $_sellerIds[] = $_data['entity_id'];
46
+ }
47
+
48
+ if ($_sellerIds) {
49
+ $where .= " OR ce.value in (".implode(',', $_sellerIds).")";
50
+ }
51
+
52
+ $collection->getSelect()->joinLeft(array('ce' => 'catalog_product_entity_int'), 'ce.entity_id=e.entity_id AND ce.attribute_id='.Mage::helper('marketplace')->getProductSellerAttributeId(),null);
53
+ $collection->getSelect()->where($where);
54
+ }
55
+
56
+ $this->_prodCollection = $collection;
57
+ }
58
+
59
+ return $this->_prodCollection;
60
+ }
61
+ }
app/code/community/Cybage/Marketplace/Block/Catalog/Product/View.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Catalog_Product_View extends Mage_Catalog_Block_Product_View
22
+ {
23
+ /*
24
+ * @param sellerId (int)
25
+ * @return (String)Seller Name
26
+ */
27
+ public function getSellerCompany($productSellerId)
28
+ {
29
+ $seller = $this->getSellerobject()->load($productSellerId);
30
+ return $seller->getCompanyName();
31
+ }
32
+
33
+ /*
34
+ * @param sellerId (int)
35
+ * @return (String)Seller Name
36
+ */
37
+ public function getSellerName($sellerId)
38
+ {
39
+ $seller = $this->getSellerobject()->load($sellerId);
40
+ return $seller->getFirstname()." ".$seller->getLastname();
41
+ }
42
+
43
+ /*
44
+ * @created 09-Oct-2013
45
+ * @modified 10-Oct-2013
46
+ */
47
+ public function getSellerobject()
48
+ {
49
+ return mage::getModel('customer/customer');
50
+ }
51
+ }
app/code/community/Cybage/Marketplace/Block/Myorders.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Myorders extends Mage_Core_Block_Template
22
+ {
23
+ public function _construct(){
24
+ }
25
+
26
+ public function getShippingInfo($_order)
27
+ {
28
+ $shipments = $_order->getShipmentsCollection();
29
+ foreach ($shipments as $shipment)
30
+ {
31
+ $tracks = $shipment->getTracksCollection();
32
+ }
33
+ return $tracks;
34
+ }
35
+ }
app/code/community/Cybage/Marketplace/Block/Myorders/Selleroptions.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Myorders_Selleroptions extends Mage_Catalog_Block_Product_List_Toolbar
22
+ {
23
+ /* public function getPagerHtml()
24
+ {
25
+ $pagerBlock = $this->getLayout()->createBlock('page/html_pager');
26
+
27
+ if ($pagerBlock instanceof Varien_Object) {
28
+
29
+
30
+ $pagerBlock->setAvailableLimit($this->getAvailableLimit());
31
+
32
+ $pagerBlock->setUseContainer(false)
33
+ ->setShowPerPage(false)
34
+ ->setShowAmounts(false)
35
+ ->setLimitVarName($this->getLimitVarName())
36
+ ->setPageVarName($this->getPageVarName())
37
+ ->setLimit($this->getLimit())
38
+ ->setCollection($this->getCollection());
39
+ return $pagerBlock->toHtml();
40
+ }
41
+ return '';
42
+ }*/
43
+
44
+ /* Set order status options in dropdown.*/
45
+ public function selectAction($id) {
46
+ $order = Mage::getModel('sales/order')->load($id);
47
+
48
+ if ($order->getStatus() == 'pending') {
49
+ return array('processing', 'cancelled' );
50
+ } else if ($order->getStatus() == 'processing') {
51
+ if($order->hasInvoices()){
52
+ return array('processing');
53
+ }else{
54
+ return array('processing', 'cancelled' );
55
+ }
56
+ }
57
+ }
58
+ }
app/code/community/Cybage/Marketplace/Block/Myorders/View.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Myorders_View extends Mage_Sales_Block_Items_Abstract
22
+ {
23
+ public function selectAction($id) {
24
+ $order = Mage::getModel('sales/order')->load($id);
25
+ if ($order->getStatus() == 'pending') {
26
+ return array('processing', 'cancelled' );
27
+ } else if ($order->getStatus() == 'processing') {
28
+ return array('processing', 'cancelled' );
29
+ }
30
+ }
31
+ }
app/code/community/Cybage/Marketplace/Block/Order/Item/Renderer/Default.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Order_Item_Renderer_Default extends Mage_Sales_Block_Order_Item_Renderer_Default
22
+ {
23
+ public function getCustomerId() {
24
+ return $customer_data=Mage::getSingleton('customer/session')->getCustomer()->getId();
25
+ }
26
+ }
app/code/community/Cybage/Marketplace/Block/Order/Selleroptions.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Order_Selleroptions extends Mage_Core_Block_Template
22
+ {
23
+ public function __construct()
24
+ {
25
+ parent::__construct();
26
+ $orderId = Mage::app()->getRequest()->getParam('order_id');
27
+ $collection = Mage::getModel('marketplace/selleroptions')->getCommentCollction($orderId);
28
+ $this->setCollection($collection);
29
+ }
30
+
31
+ protected function _prepareLayout()
32
+ {
33
+ parent::_prepareLayout();
34
+
35
+ $pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
36
+ $pager->setAvailableLimit(array(5=>5,10=>10,20=>20,'all'=>'all'));
37
+ $pager->setCollection($this->getCollection());
38
+ $this->setChild('pager', $pager);
39
+ $this->getCollection()->load();
40
+ return $this;
41
+ }
42
+
43
+ public function getPagerHtml()
44
+ {
45
+ return $this->getChildHtml('pager');
46
+ }
47
+
48
+ /* Set order status options in dropdown.*/
49
+ public function selectAction($id) {
50
+ $order = Mage::getModel('sales/order')->load($id);
51
+
52
+ if ($order->getStatus() == 'pending') {
53
+ return array('processing', 'cancelled' );
54
+ } else if ($order->getStatus() == 'processing') {
55
+ if($order->hasInvoices()){
56
+ return array('processing');
57
+ }else{
58
+ return array('processing', 'cancelled' );
59
+ }
60
+ }
61
+ }
62
+
63
+ /*Hide status dropdown if all items for specific seller are shipped*/
64
+ public function getItemsShipmentStatus(){
65
+ $orderId = Mage::app()->getRequest()->getParam('order_id');
66
+ $_orderedItems = Mage::getSingleton('marketplace/order')->getOrderDetails($orderId);
67
+ $totalQtyOrdered = $qtyShipped = 0;
68
+
69
+ foreach ($_orderedItems as $_orderedItem) {
70
+ $qtyShipped += (float)$_orderedItem->getQtyShipped();
71
+ $totalQtyOrdered += (float)$_orderedItem->getQtyOrdered();
72
+ }
73
+
74
+ if($qtyShipped == $totalQtyOrdered){
75
+ return false;
76
+ }else{
77
+ return true;
78
+ }
79
+ }
80
+ }
app/code/community/Cybage/Marketplace/Block/Order/View.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Order_View extends Mage_Sales_Block_Items_Abstract
22
+ {
23
+
24
+ }
app/code/community/Cybage/Marketplace/Block/Product.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Product extends Mage_Core_Block_Template
22
+ {
23
+ public function __construct() {
24
+ parent::__construct();
25
+ $customerId = Mage::getSingleton('customer/session')->getCustomerId();
26
+ $collection = Mage::getModel('catalog/product')->getCollection()
27
+ ->addAttributeToSelect(array('marketplace_state', 'name', 'price', 'status'))
28
+ ->addAttributeToFilter('seller_id', $customerId)
29
+ ->addAttributeToFilter('marketplace_state', array('neq' => Mage::helper('marketplace')->getDeletedOptionValue()))
30
+ ->setOrder('entity_id', 'desc');
31
+ $this->setCollection($collection);
32
+ }
33
+
34
+ public function getPagerHtml() {
35
+ return $this->getChildHtml('pager');
36
+ }
37
+
38
+ public function _prepareLayout() {
39
+ parent::_prepareLayout();
40
+ $pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
41
+ $pager->setAvailableLimit(array(5 => 5, 15 => 15, 30 => 30, 50 => 50, 100 => 100, 200 => 200));
42
+ $pager->setCollection($this->getCollection());
43
+ $this->setChild('pager', $pager);
44
+ $this->getCollection()->load();
45
+
46
+ return $this;
47
+ }
48
+
49
+ public function getFormData() {
50
+ $data = $this->getData('form_data');
51
+ if (is_null($data)) {
52
+ $data = new Varien_Object(Mage::getSingleton('marketplace/session')->getMarketplaceFormData(true));
53
+ $this->setData('form_data', $data);
54
+ }
55
+ return $data;
56
+ }
57
+
58
+ /**
59
+ * Get image delete url
60
+ *
61
+ * @return string
62
+ */
63
+ public function getImageDeleteUrl($imageType) {
64
+ if ($this->hasDeleteUrl()) {
65
+ return $this->getData('delete_url');
66
+ }
67
+
68
+ return $this->getUrl(
69
+ 'marketplace/product/productImageDelete', array(
70
+ 'product_id' => $this->getRequest()->getParam('id'),
71
+ 'image_type' => $imageType,
72
+ Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED => $this->helper('core/url')->getEncodedUrl()
73
+ )
74
+ );
75
+ }
76
+
77
+ public function getBackUrl()
78
+ {
79
+ if ($this->getData('back_url')) {
80
+ return $this->getData('back_url');
81
+ } else {
82
+ return $this->getUrl('marketplace/product');
83
+ }
84
+ }
85
+ }
app/code/community/Cybage/Marketplace/Block/Product/Askquestion/Link.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Product_Askquestion_Link extends Mage_Core_Block_Template
22
+ {
23
+ public function _construct() {
24
+ $currentProduct = Mage::registry('current_product');
25
+ $marketplaceHelper = Mage::helper('marketplace');
26
+ $url = '';
27
+ if ($marketplaceHelper->isMarketplaceApprovedProduct($currentProduct) && !$marketplaceHelper->isSelfProduct($currentProduct)) {
28
+ $url = Mage::getBaseUrl() . 'marketplace/productquestion/link/id/' . $currentProduct->getId();
29
+ $this->setData('url', $url);
30
+ }
31
+ }
32
+ }
app/code/community/Cybage/Marketplace/Block/Product/Askquestion/Myquestions.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Product_Askquestion_Myquestions extends Mage_Core_Block_Template
22
+ {
23
+ public function __construct() {
24
+ parent::__construct();
25
+ $customerId = Mage::getSingleton('customer/session')->getCustomerId();
26
+ $collection = Mage::getModel('marketplace/question')
27
+ ->getCollection()
28
+ ->addFieldToFilter('customer_id', $customerId)
29
+ ->setOrder('entity_id', 'DESC');
30
+ $this->setCollection($collection);
31
+ }
32
+
33
+ protected function _prepareLayout() {
34
+ parent::_prepareLayout();
35
+ $pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
36
+ $pager->setAvailableLimit(array(5 => 5, 15 => 15, 30 => 30, 50 => 50, 100 => 100, 200 => 200));
37
+ $pager->setCollection($this->getCollection());
38
+ $this->setChild('pager', $pager);
39
+ $this->getCollection()->load();
40
+ return $this;
41
+ }
42
+
43
+ public function getPagerHtml() {
44
+ return $this->getChildHtml('pager');
45
+ }
46
+ }
app/code/community/Cybage/Marketplace/Block/Product/Askquestion/Productquestions.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Product_Askquestion_Productquestions extends Mage_Core_Block_Template
22
+ {
23
+ public function __construct() {
24
+ parent::__construct();
25
+ $customerId = Mage::getSingleton('customer/session')->getCustomerId();
26
+ $data = Mage::getModel('catalog/product')->getCollection()->addFieldToFilter('seller_id', $customerId);
27
+ $products = array();
28
+ foreach ($data as $record) {
29
+ array_push($products, $record->getEntityId());
30
+ }
31
+
32
+ $collection = Mage::getModel('marketplace/question')->getMyQuestions($products);
33
+ $this->setCollection($collection);
34
+ }
35
+
36
+ protected function _prepareLayout() {
37
+ parent::_prepareLayout();
38
+ $pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
39
+ $pager->setAvailableLimit(array(5 => 5, 15 => 15, 30 => 30, 50 => 50, 100 => 100, 200 => 200));
40
+ $pager->setCollection($this->getCollection());
41
+ $this->setChild('pager', $pager);
42
+ $this->getCollection()->load();
43
+ return $this;
44
+ }
45
+
46
+ public function getPagerHtml() {
47
+ return $this->getChildHtml('pager');
48
+ }
49
+ }
app/code/community/Cybage/Marketplace/Block/Product/Askquestion/Replyform.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Product_Askquestion_Replyform extends Mage_Core_Block_Template
22
+ {
23
+ public function displayThread($qId) {
24
+ return Mage::getModel('marketplace/reply')->getReplies($qId);
25
+ }
26
+ }
app/code/community/Cybage/Marketplace/Block/Review/Product/View.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Review_Product_View extends Mage_Catalog_Block_Product_View
22
+ {
23
+ protected $_reviewsCollection;
24
+
25
+ protected function _prepareLayout()
26
+ {
27
+ $sellerId = $this->getRequest()->getParam('seller_id');
28
+ if(!empty($sellerId))
29
+ {
30
+ $listAllowedValue = Mage::getStoreConfig('catalog/frontend/list_per_page_values');
31
+ $listAllowedValues = explode(",", $listAllowedValue);
32
+
33
+ $listAllowedValues = array_combine($listAllowedValues,$listAllowedValues);
34
+
35
+ $pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
36
+ $pager->setAvailableLimit($listAllowedValues);
37
+ $pager->setCollection($this->getReviewsCollection());
38
+ $this->setChild('pager', $pager);
39
+ $this->getReviewsCollection()->load();
40
+ return $this;
41
+ }
42
+ }
43
+
44
+ public function getPagerHtml()
45
+ {
46
+ return $this->getChildHtml('pager');
47
+ }
48
+
49
+ public function getReviewsCollection()
50
+ {
51
+ $sellerId = $this->getRequest()->getParam('seller_id');
52
+
53
+ if(!empty($sellerId))
54
+ {
55
+ $collection = Mage::getModel('catalog/product')->getCollection()
56
+ ->addAttributeToFilter('seller_id', $sellerId)
57
+ ->addAttributeToSelect('entity_id');
58
+
59
+ $productIds = array();
60
+ foreach ($collection as $product)
61
+ {
62
+ $productIds[] = $product->getId();
63
+ }
64
+
65
+ if (null === $this->_reviewsCollection)
66
+ {
67
+ $this->_reviewsCollection = Mage::getModel('review/review')->getCollection()
68
+ ->addStoreFilter(Mage::app()->getStore()->getId())
69
+ ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
70
+ ->addFieldToFilter('entity_pk_value', array('in'=>$productIds))
71
+ ->setDateOrder();
72
+
73
+ }
74
+ return $this->_reviewsCollection;
75
+ }
76
+ }
77
+
78
+ public function getRatingInfo($_review)
79
+ {
80
+ $votesCollection = Mage::getModel('rating/rating_option_vote')
81
+ ->getResourceCollection()
82
+ ->setReviewFilter($_review->getId())
83
+ ->setStoreFilter(Mage::app()->getStore()->getId())
84
+ ->addRatingInfo(Mage::app()->getStore()->getId())
85
+ ->load();
86
+ return $votesCollection;
87
+
88
+ }
89
+ }
app/code/community/Cybage/Marketplace/Block/Review/Product/View/List.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Review_Product_View_List extends Cybage_Marketplace_Block_Review_Product_View
22
+ {
23
+ public function getProductId()
24
+ {
25
+ return '';
26
+ }
27
+ }
app/code/community/Cybage/Marketplace/Block/Sales/Order/History.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Sales_Order_History extends Mage_Sales_Block_Order_History
22
+ {
23
+ public function __construct()
24
+ {
25
+ parent::__construct();
26
+ $this->setTemplate('marketplace/sales/order/history.phtml');
27
+ $sellerId=Mage::getSingleton('customer/session')->getId();
28
+
29
+ $orderItems = Mage::getResourceModel('sales/order_item_collection')
30
+ ->addFieldToSelect('order_id')
31
+ ->addFieldToFilter('seller_id', $sellerId)
32
+ ->distinct(true);
33
+ $arr_order_for_filter=array();
34
+ foreach ($orderItems->getData() as $orderItem) {
35
+ $arr_order_for_filter[]=$orderItem['order_id'];
36
+ }
37
+
38
+ $orders = Mage::getResourceModel('sales/order_collection')
39
+ ->addFieldToSelect('*')
40
+
41
+ //->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId())
42
+ ->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
43
+ ->setOrder('created_at', 'desc');
44
+
45
+ $dateTo = (Mage::app()->getRequest()->getParam('date_to')!='')?date('Y-m-d H:i:s', (strtotime(Mage::app()->getRequest()->getParam('date_to') . "+1 day")-1)) : '';
46
+ $dateFrom = (Mage::app()->getRequest()->getParam('date_from')!=="")? date('Y-m-d H:i:s', strtotime(Mage::app()->getRequest()->getParam('date_from'))): '' ;
47
+ $orderStatus = Mage::app()->getRequest()->getParam('orderstatus');
48
+
49
+ if($dateFrom!='')
50
+ {
51
+ $orders->addFieldToFilter('created_at', array('from' => "$dateFrom"));
52
+ Mage::getSingleton('core/session')->setDateFrom(Mage::app()->getRequest()->getParam('date_from'));
53
+ }
54
+ else
55
+ {
56
+ Mage::getSingleton('core/session')->setDateFrom('');
57
+ }
58
+ if($dateTo!='')
59
+ {
60
+ Mage::getSingleton('core/session')->setDateTo(Mage::app()->getRequest()->getParam('date_to'));
61
+ $orders->addFieldToFilter('created_at', array('to' => "$dateTo"));
62
+ }
63
+ else
64
+ {
65
+ Mage::getSingleton('core/session')->setDateTo('');
66
+ }
67
+
68
+ if ($orderStatus != '') {
69
+ Mage::getSingleton('core/session')->setSalesOrderSatus(Mage::app()->getRequest()->getParam('orderstatus'));
70
+ $orders->addFieldToFilter('status', "$orderStatus");
71
+ }else
72
+ {
73
+ Mage::getSingleton('core/session')->setSalesOrderSatus('');
74
+ }
75
+
76
+ $orders->addFieldToFilter('entity_id',array('in'=>$arr_order_for_filter));
77
+ $this->setOrders($orders);
78
+
79
+ Mage::app()->getFrontController()->getAction()->getLayout()->getBlock('root')->setHeaderTitle(Mage::helper('sales')->__('My Orders'));
80
+ }
81
+
82
+ protected function _prepareLayout()
83
+ {
84
+ parent::_prepareLayout();
85
+
86
+ $pager = $this->getLayout()->createBlock('page/html_pager', 'sales.order.history.pager')
87
+ ->setCollection($this->getOrders());
88
+ $this->setChild('pager', $pager);
89
+ $this->getOrders()->load();
90
+ return $this;
91
+ }
92
+
93
+ public function getPagerHtml()
94
+ {
95
+ return $this->getChildHtml('pager');
96
+ }
97
+
98
+ public function getViewUrl($order)
99
+ {
100
+ return $this->getUrl('*/account/vieworder', array('order_id' => $order->getId()));
101
+ }
102
+
103
+ public function getBackUrl()
104
+ {
105
+ return $this->getUrl('customer/account/');
106
+ }
107
+ }
app/code/community/Cybage/Marketplace/Block/Seller/Info.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Block_Seller_Info extends Mage_Core_Block_Template
22
+ {
23
+ /**
24
+ * Function to get the seller info
25
+ * @created at 08-Oct-2013
26
+ * @modified at 09-Oct-2013
27
+ * @return object
28
+ */
29
+ public function getSellerData()
30
+ {
31
+ $sellerName = urldecode(Mage::registry('seller_company'));
32
+ $seller = Mage::helper('marketplace')->getSellerInfo($sellerName);
33
+ return $seller;
34
+ }
35
+ }
app/code/community/Cybage/Marketplace/Controller/Router.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Controller_Router extends Mage_Core_Controller_Varien_Router_Abstract
22
+ {
23
+ /**
24
+ * @var Zend_Controller_Request_Http
25
+ */
26
+ protected $_request;
27
+
28
+ /**
29
+ * Front controller looks for collectRoutes() although it is not defined
30
+ * in abstract router class!
31
+ *
32
+ * (non-PHPdoc)
33
+ * @see Mage_Core_Controller_Varien_Router_Standard::collectRoutes()
34
+ */
35
+ public function collectRoutes()
36
+ {
37
+ // nothing to do here
38
+ }
39
+
40
+ /**
41
+ * Validate and Match Cms Page and modify request
42
+ *
43
+ * @param Zend_Controller_Request_Http $request
44
+ * @return bool
45
+ */
46
+ public function match(Zend_Controller_Request_Http $request) {
47
+ if (Mage::app()->getStore()->isAdmin()) {
48
+ return false;
49
+ }
50
+
51
+ $sellerAtttributeName = Mage::getConfig()->getNode('default/seller_page/attribute_name');
52
+ $seoDisplay = Mage::getConfig()->getNode('default/seller_page/seo_display');
53
+
54
+ if (empty($sellerAtttributeName)) {
55
+ //Seller attribute not configured
56
+ return false;
57
+ }
58
+
59
+ $pageId = $request->getPathInfo();
60
+ $param = explode('/', $pageId);
61
+ $seller = '';
62
+ if (count($param) > 1 and strtolower($param[1]) == $seoDisplay and !empty($param[2])) {
63
+ //Identify Seller
64
+ $sellerPage = $param[2];
65
+ if (strpos($sellerPage, '.') !== false) {
66
+
67
+ $sellerPage = urldecode(substr($sellerPage,0,-5));
68
+ if($sellerPage) {
69
+ $seller = str_replace('-',' ', $sellerPage);
70
+ } else {
71
+ return false;
72
+ }
73
+ } else {
74
+ $seller = $sellerPage;
75
+ }
76
+ } else {
77
+ return false;
78
+ }
79
+
80
+ if ($seller) {
81
+ Mage::register('seller_company', $seller);
82
+
83
+ $realModule = 'Cybage_Marketplace';
84
+ $request->setModuleName('marketplace');
85
+ $request->setRouteName('marketplace');
86
+ $request->setControllerName('seller');
87
+ $request->setActionName('sellerinfo');
88
+ $request->setControllerModule($realModule);
89
+ $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, ltrim($request->getRequestString(), '/'));
90
+ $file = Mage::getModuleDir('controllers', $realModule) . DS . 'SellerController.php';
91
+ include $file;
92
+
93
+ //compatibility with 1.3
94
+ $class = $realModule . '_SellerController';
95
+ $controllerInstance = new $class($request, $this->getFront()->getResponse());
96
+ $request->setDispatched(true);
97
+ $controllerInstance->dispatch('sellerinfo');
98
+ }
99
+ return true;
100
+ }
101
+ }
app/code/community/Cybage/Marketplace/Helper/Data.php ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Helper_Data extends Mage_Core_Helper_Abstract
22
+ {
23
+ const MARKETPLACE_PRODUCT_VISIBILITY = 'marketplace/product/visibility';
24
+ const MARKETPLACE_PRODUCT_STATUS = 'marketplace/product/status';
25
+ const MARKETPLACE_PRODUCT_STATE = 'marketplace/product/state';
26
+ const MARKETPLACE_PRODUCT_UPLOAD_IMAGE_SIZE = 'marketplace/product/upload_image_size';
27
+ const DELETED_OPTION_LABEL = "Deleted";
28
+ const APPROVED_OPTION_LABEL = "Approved";
29
+ const MARKETPLACE_ENABLE = "marketplace/marketplace/enable";
30
+ const MARKETPLACE_STATUS_APPROVED = "marketplace/status/approved";
31
+ const MARKETPLACE_PRODUCT_PENDING = 'marketplace/product/pending';
32
+ const MARKETPLACE_PRODUCT_APPROVED = 'marketplace/product/approved';
33
+ const MARKETPLACE_PRODUCT_REJECTED = 'marketplace/product/rejected';
34
+ const MARKETPLACE_PRODUCT_DELETED = 'marketplace/product/deleted';
35
+
36
+ /**
37
+ * Collection of Allowed Category for Marketplace
38
+ * */
39
+ public function getCategoryCollection() {
40
+ return Mage::getModel('catalog/category')->getCollection()
41
+ ->addAttributeToFilter('is_active', 1)
42
+ ->addAttributeToFilter('category_marketplace', 1) //category_marketplace
43
+ ;
44
+ }
45
+
46
+ public function getNewProductVisibility() {
47
+
48
+ return Mage::getStoreConfig(self::MARKETPLACE_PRODUCT_VISIBILITY);
49
+ }
50
+
51
+ public function isMarketplaceEnabled() {
52
+ return (bool) Mage::getStoreConfig(self::MARKETPLACE_ENABLE, Mage::app()->getStore());
53
+ }
54
+
55
+ public function isMarketplaceActiveSellar() {
56
+ if ($this->isMarketplaceEnabled()) {
57
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
58
+ if ($customer->getStatus() == Mage::getStoreConfig(self::MARKETPLACE_STATUS_APPROVED) && (bool) $customer->getSellerSubscriber()) {
59
+ return true;
60
+ } else {
61
+ return false;
62
+ }
63
+ } else {
64
+ return false;
65
+ }
66
+ }
67
+
68
+ public function getNewProductStatus() {
69
+
70
+ return Mage::getStoreConfig(self::MARKETPLACE_PRODUCT_STATUS);
71
+ }
72
+
73
+ public function getNewProductState() {
74
+
75
+ return Mage::getStoreConfig(self::MARKETPLACE_PRODUCT_STATE);
76
+ }
77
+
78
+ public function getNewProductUploadImageSize($check) {
79
+ if ($check == 'validate') {
80
+ return Mage::getStoreConfig(self::MARKETPLACE_PRODUCT_UPLOAD_IMAGE_SIZE);
81
+ } else {
82
+ return round(Mage::getStoreConfig(self::MARKETPLACE_PRODUCT_UPLOAD_IMAGE_SIZE)/(1024 * 1024), 2) .' MB';
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Method : To get Product Pending Status Id
88
+ * */
89
+ public function getProductPendingStatusId() {
90
+ return Mage::getStoreConfig(self::MARKETPLACE_PRODUCT_PENDING);
91
+ }
92
+
93
+ /**
94
+ * Method : To get Product Pending Status Id
95
+ * */
96
+ public function getProductApprovedStatusId() {
97
+ return Mage::getStoreConfig(self::MARKETPLACE_PRODUCT_APPROVED);
98
+ }
99
+
100
+ /**
101
+ * Method : To get Product Pending Status Id
102
+ * */
103
+ public function getProductRejectedStatusId() {
104
+ return Mage::getStoreConfig(self::MARKETPLACE_PRODUCT_REJECTED);
105
+ }
106
+
107
+ /**
108
+ * Method : To get Product Pending Status Id
109
+ * */
110
+ public function getProductDeletedStatusId() {
111
+ return Mage::getStoreConfig(self::MARKETPLACE_PRODUCT_DELETED);
112
+ }
113
+
114
+ public function getDeletedOptionValue() {
115
+ $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'marketplace_state');
116
+ $optionValue = "";
117
+ foreach ($attribute->getSource()->getAllOptions(true, true) as $option) {
118
+ if ($option['label'] == self::DELETED_OPTION_LABEL) {
119
+ $optionValue = $option['value'];
120
+ }
121
+ }
122
+ if ($optionValue) {
123
+ return $optionValue;
124
+ } else {
125
+ return FALSE;
126
+ }
127
+ }
128
+
129
+ public function getApprovedOptionValue() {
130
+ $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'marketplace_state');
131
+ $optionValue = "";
132
+ foreach ($attribute->getSource()->getAllOptions(true, true) as $option) {
133
+ if ($option['label'] == self::APPROVED_OPTION_LABEL) {
134
+ $optionValue = $option['value'];
135
+ }
136
+ }
137
+ if ($optionValue) {
138
+ return $optionValue;
139
+ } else {
140
+ return FALSE;
141
+ }
142
+ }
143
+
144
+ public function getSku($productId) {
145
+ return Mage::getModel('catalog/product')->load($productId)->getSku();
146
+ }
147
+
148
+ public function getProductName($productId) {
149
+ return Mage::getModel('catalog/product')->load($productId)->getName();
150
+ }
151
+
152
+ public function isMarketplaceApprovedProduct($currentProduct) {
153
+ $marketplaceState = $currentProduct->getMarketplaceState();
154
+ $marketplaceApprovedOptionValue = $this->getApprovedOptionValue();
155
+
156
+ if ($marketplaceState === $marketplaceApprovedOptionValue) {
157
+ return TRUE;
158
+ } else {
159
+ return FALSE;
160
+ }
161
+ }
162
+
163
+ public function isSelfProduct($currentProduct) {
164
+
165
+ $sellerId = $currentProduct->getSellerId();
166
+ $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
167
+ if ($sellerId === $customerId) {
168
+ return TRUE;
169
+ } else {
170
+ return FALSE;
171
+ }
172
+ }
173
+
174
+ /**
175
+ * @param customer_id
176
+ * @return customer object
177
+ * @author srinidhid@cybage.com
178
+ */
179
+ public function getSellerInfo($productSellerName) {
180
+ $customer = Mage::getModel('customer/customer')
181
+ ->getCollection()
182
+ ->addFieldToFilter('company_name', $productSellerName)
183
+ ->getFirstItem()
184
+ ->load();
185
+ return $customer->getData();
186
+ }
187
+
188
+ /* To fetch MarketOrders From sales ordered to seller in Csv */
189
+
190
+ public function getMarketOrders() {
191
+ $dateTo = Mage::getSingleton('core/session')->getDateTo();
192
+ $dateFrom = Mage::getSingleton('core/session')->getDateFrom();
193
+ $orderStatus = Mage::getSingleton('core/session')->getSalesOrderSatus();
194
+
195
+ $sellerId = Mage::getSingleton('customer/session')->getId();
196
+
197
+ $orderItemCollection = Mage::getResourceModel('sales/order_item_collection')
198
+ ->addFieldToSelect('order_id')
199
+ ->addFieldToFilter('main_table.seller_id', $sellerId)
200
+ ->distinct(true);
201
+
202
+ $orderItemCollection->getSelect()
203
+ ->join('sales_flat_order', 'sales_flat_order.entity_id=main_table.order_id', array('increment_id', 'status'))
204
+ ->columns(new Zend_Db_Expr("CONCAT(`sales_flat_order`.`customer_firstname`, ' ',`sales_flat_order`.`customer_lastname`) AS billname"));
205
+
206
+ $orderItemCollection->getSelect()->columns('SUM(row_total + shipping_charges) AS Total');
207
+ $orderItemCollection->getSelect()->columns('SUM(row_invoiced) AS Amount Received');
208
+ $orderItemCollection->getSelect()->columns('SUM((row_total + shipping_charges) - row_invoiced) AS Amount Remain');
209
+ $orderItemCollection->getSelect()->group('main_table.order_id');
210
+
211
+ $dateFrom = date('Y-m-d H:i:s', strtotime($dateFrom));
212
+ $dateTo = date('Y-m-d H:i:s', strtotime($dateTo . "+1 day"));
213
+
214
+ if ($dateFrom != '') {
215
+ $orderItemCollection->addFieldToFilter('sales_flat_order.created_at', array('from' => "$dateFrom"));
216
+ }
217
+ if ($dateTo != '') {
218
+ $orderItemCollection->addFieldToFilter('sales_flat_order.created_at', array('to' => "$dateTo"));
219
+ }
220
+ if ($orderStatus != '') {
221
+ $orderItemCollection->addFieldToFilter('sales_flat_order.status', "$orderStatus");
222
+ }
223
+
224
+ return($orderItemCollection);
225
+ }
226
+
227
+ /**
228
+ * Generates CSV file with product's list according to the collection in the $this->_list
229
+ * @return array
230
+ */
231
+ public function generateMarketCsv() {
232
+ $this->getMarketListOrders();
233
+ if (!is_null($this->_list)) {
234
+ $orders = $this->_list->getItems();
235
+ if (count($orders) > 0) {
236
+ $io = new Varien_Io_File();
237
+ $path = Mage::getBaseDir('var') . DS . 'export' . DS;
238
+ $name = md5(microtime());
239
+ $file = $path . DS . $name . '.csv';
240
+ $io->setAllowCreateFolders(true);
241
+ $io->open(array('path' => $path));
242
+ $io->streamOpen($file, 'w+');
243
+ $io->streamLock(true);
244
+ $io->streamWriteCsv($this->_getCsvHeaders());
245
+
246
+ foreach ($orders as $order) {
247
+ $data = array();
248
+ $data[] = $order->getData('increment_id');
249
+ $data[] = $order->getData('billname');
250
+ $data[] = $order->getData('status');
251
+ $data[] = $order->getData('Total');
252
+ $data[] = $order->getData('Amount Received');
253
+ $data[] = $order->getData('Amount Remain');
254
+ $io->streamWriteCsv($data);
255
+ }
256
+
257
+ return array
258
+ (
259
+ 'type' => 'filename',
260
+ 'value' => $file,
261
+ 'rm' => true
262
+ );
263
+ }
264
+ }
265
+ }
266
+
267
+ /* Retrieve Market list to export data orders */
268
+
269
+ public function getMarketListOrders() {
270
+ $orders = $this->getMarketOrders();
271
+ $this->setList($orders);
272
+ }
273
+
274
+ /**
275
+ * Sets current collection
276
+ * @param $query
277
+ */
278
+ public function setList($collection) {
279
+ $this->_list = $collection;
280
+ }
281
+
282
+ /* Generate headers for CSV file */
283
+
284
+ protected function _getCsvHeaders() {
285
+ $headers = array('Order#', 'Bill to Name', 'Status', 'Total sales', 'Amount Received', 'Amount Remain');
286
+ return $headers;
287
+ }
288
+
289
+ /**
290
+ Get order sutotal.shipping charge and grand total for specific seller.
291
+ * */
292
+ public function getOrderTotals($orderId) {
293
+ $marketPlaceModel = Mage::getModel('marketplace/order');
294
+ $orderItemCollection = $marketPlaceModel->getOrderDetails($orderId);
295
+
296
+ $orderTotal = array();
297
+
298
+ foreach ($orderItemCollection as $_item) {
299
+ $orderTotal['subtotal'] += (float) $_item->getRowTotal();
300
+ $orderTotal['shippingcharge'] += (float) $_item->getShippingCharges();
301
+ }
302
+
303
+ $orderTotal['grandtotal'] = $orderTotal['subtotal'] + $orderTotal['shippingcharge'];
304
+
305
+ return $orderTotal;
306
+ }
307
+
308
+ /**
309
+ * @param seller_id
310
+ * @return customer name
311
+ */
312
+ public function getSellerName($seller_id) {
313
+ $customer = Mage::getModel('customer/customer')->load($seller_id);
314
+ return $customer->getCompanyName();
315
+ }
316
+
317
+ public function getProductSellerAttributeId(){
318
+ $_sellerAttrId = $_attributeData = '';
319
+ $_attributeData = Mage::getModel('eav/entity_attribute')->getCollection()
320
+ ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())
321
+ ->addFieldToFilter('attribute_code', 'seller_id');
322
+
323
+ if($_attributeData){
324
+ foreach($_attributeData as $_data){
325
+ $_sellerAttrId = $_data['attribute_id'];
326
+ }
327
+ }
328
+
329
+ return $_sellerAttrId;
330
+ }
331
+ }
app/code/community/Cybage/Marketplace/Model/Buyerseller.php ADDED
@@ -0,0 +1,293 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Buyerseller extends Mage_Core_Model_Abstract
22
+ {
23
+ const XML_PATH_EMAIL_COMMENT_TEMPLATE = 'sales_email/product_comment';
24
+ const XML_PATH_EMAIL_IDENTITY = 'sales_email/order/identity';
25
+
26
+ public function _construct() {
27
+ parent::_construct();
28
+ $this->_init('marketplace/buyerseller');
29
+ }
30
+
31
+ public function resource() {
32
+ return Mage::getSingleton("core/resource");
33
+ }
34
+
35
+ public function read() {
36
+ return $this->resource()->getConnection('core_read');
37
+ }
38
+
39
+ public function write() {
40
+ return $this->resource()->getConnection('core_write');
41
+ }
42
+
43
+ public function saveComments() {
44
+ $comment = Mage::app()->getRequest()->getPost('question');
45
+ $order_id = Mage::app()->getRequest()->getPost('order_id');
46
+ $customer_id = Mage::app()->getRequest()->getPost('customer_id');
47
+ $product_id = Mage::app()->getRequest()->getPost('product_id');
48
+ $notify = Mage::app()->getRequest()->getPost('notify');
49
+ $flag = "1";
50
+ $object = Mage::getModel('marketplace/buyerseller');
51
+ $object->setComment(strip_tags($comment));
52
+ $object->setOrderId($order_id);
53
+ $object->setCustomerId($customer_id);
54
+ $object->setProductId($product_id);
55
+ $object->setFlag($flag);
56
+ $object->save();
57
+
58
+ if($notify) {
59
+ $order = Mage::getModel('sales/order')->load($order_id);
60
+ $incrementId = $order->getIncrementId();
61
+ $seller_id = $this->getSellerInfo($order_id);
62
+ $customer = Mage::getModel('customer/customer')->load($seller_id);
63
+ $toName = $customer->getName();
64
+ $to = $customer->getEmail();
65
+ $customer = Mage::getModel('customer/customer')->load($customer_id);
66
+ $fromName = $customer->getName();
67
+ $from = $customer->getEmail();
68
+
69
+ $productName = Mage::getModel('catalog/product')->load($product_id)->getName();
70
+ $this->notifyEmail($to, $toName, $comment, $incrementId,$productName,$from,$fromName);
71
+ }
72
+ }
73
+
74
+ public function replyComments() {
75
+ $comment = Mage::app()->getRequest()->getPost('reply');
76
+ $order_id = Mage::app()->getRequest()->getPost('order_id');
77
+ $customer_id = Mage::app()->getRequest()->getPost('customer_id');
78
+ $product_id = Mage::app()->getRequest()->getPost('product_id');
79
+ $notify = Mage::app()->getRequest()->getPost('notify');
80
+ $flag = "1";
81
+
82
+ $object = Mage::getModel('marketplace/buyerseller');
83
+ $object->setComment(strip_tags($comment));
84
+ $object->setOrderId($order_id);
85
+ $object->setCustomerId($customer_id);
86
+ $object->setProductId($product_id);
87
+ $object->setFlag($flag);
88
+ $object->save();
89
+ $this->updateFlag();
90
+
91
+ if($notify) {
92
+ $order = Mage::getModel('sales/order')->load($order_id);
93
+ $incrementId = $order->getIncrementId();
94
+ $buyer = $this->getBuyerinfo($order_id);
95
+ $customer = Mage::getModel('customer/customer')->load($customer_id);
96
+ $fromName = $customer->getName();
97
+ $from = $customer->getEmail();
98
+ $to = $buyer['email'];
99
+ $toName = $buyer['name'];
100
+ $product = Mage::getModel('catalog/product')->load($product_id);
101
+ $productName = $product->getName();
102
+ $this->notifyEmail($to, $toName, $comment, $incrementId,$productName,$from,$fromName);
103
+ }
104
+
105
+ return true;
106
+ }
107
+
108
+ public function getActiveNotificationForOrder($oid,$pid) {
109
+ if($pid) {
110
+ $select =$this->read()->select()->from("marketplace_buyersellercomm_notifications","count('flag')")
111
+ ->where("order_id=?",$oid)
112
+ ->where("product_id=?",$pid)
113
+ ->where("flag=?","1");
114
+ $result = $this->read()->fetchAll($select);
115
+
116
+ foreach ($result as $data) {
117
+ return $data["count('flag')"];
118
+ }
119
+ } else {
120
+ $select = $this->read()->select()->from("marketplace_buyersellercomm_notifications","count('flag')")
121
+ ->where("order_id=?",$oid)
122
+ ->where("flag=?","1");
123
+ $result = $this->read()->fetchAll($select);
124
+
125
+ foreach ($result as $data) {
126
+ return $data["count('flag')"];
127
+ }
128
+ }
129
+ }
130
+
131
+ public function getColection() {
132
+ $params = Mage::app()->getRequest()->getParams();
133
+ $oid =$params['order'];
134
+ $pid =$params['product'];
135
+ if(Mage::getSingleton('customer/session')->isLoggedIn()) {
136
+ $customerData = Mage::getSingleton('customer/session')->getCustomer();
137
+ $sellerId=$customerData->getId();
138
+ }
139
+ //Create query to gate prodcut name
140
+ $selectProducNameId = $this->read()->select()
141
+ ->from(array('ea' => 'eav_attribute'),array('ea.attribute_id'))
142
+ ->where('ea.attribute_code=?','name')
143
+ ->join(array('eet' => 'eav_entity_type'),'ea.entity_type_id = eet.entity_type_id',array())
144
+ ->where('eet.entity_type_code=?','catalog_product');
145
+ $producNameId = $this->read()->fetchOne($selectProducNameId);
146
+
147
+ //Create query to gate customer first name ,last name
148
+ $selectCustomerfirstnameId = $this->read()->select()
149
+ ->from(array('ea' => 'eav_attribute'),array('ea.attribute_id'))
150
+ ->where('ea.attribute_code =?','firstname')
151
+ ->join(array('eet' => 'eav_entity_type'),'ea.entity_type_id = eet.entity_type_id',array())
152
+ ->where('eet.entity_type_code=?','customer');
153
+ $customerfirstnameId = $this->read()->fetchOne($selectCustomerfirstnameId);
154
+
155
+ $selectCustomerLastNameId = $this->read()->select()
156
+ ->from(array('ea' => 'eav_attribute'),array('ea.attribute_id'))
157
+ ->where('ea.attribute_code =?','lastname')
158
+ ->join(array('eet' => 'eav_entity_type'),'ea.entity_type_id = eet.entity_type_id',array())
159
+ ->where('eet.entity_type_code=?','customer');
160
+ $customerLastNameId = $this->read()->fetchOne($selectCustomerLastNameId);
161
+
162
+ if($pid) {
163
+ $select = $this->read()->select()->from(array('buyer'=>'marketplace_buyersellercomm_notifications'),
164
+ array('sales.increment_id','prod.value','comment','created_at','sales.customer_firstname','sales.customer_lastname'))
165
+ ->joinLeft(array('sales'=>'sales_flat_order'),
166
+ 'buyer.order_id = sales.entity_id',array())
167
+ ->joinLeft(array('prod'=>'catalog_product_entity_varchar'),
168
+ 'buyer.product_id = prod.entity_id',array())
169
+ ->where('buyer.product_id=?',$pid)
170
+ ->where('buyer.order_id=?',$oid)
171
+ ->where('buyer.flag=?','1')
172
+ ->where('prod.attribute_id=?',$producNameId)
173
+ ->where('prod.store_id=?',Mage::app()->getStore()->getCode());
174
+ } else {
175
+ $select = $this->read()->select()
176
+ ->from(array('buyer'=>'marketplace_buyersellercomm_notifications'),
177
+ array("prod.value","comment","created_at","sales.seller_id","buyer.customer_id",new Zend_Db_Expr("CONCAT_WS(' ', custfirstname.value, custlastname.value) as fullname")))
178
+ ->where('buyer.order_id=?',$oid)
179
+ ->joinLeft(array('prod'=>'catalog_product_entity_varchar'),
180
+ 'buyer.product_id = prod.entity_id',array())
181
+ //Remove hard coded value for product name and added by query
182
+ ->where('prod.attribute_id=?',$producNameId)
183
+ ->where('prod.store_id=?',Mage::app()->getStore()->getCode())
184
+ ->joinLeft(array('sales'=>'sales_flat_order_item'),
185
+ 'buyer.order_id = sales.order_id',array())
186
+ //Added seller condition
187
+ ->where('sales.seller_id=?',$sellerId)
188
+ ->joinLeft(array('custfirstname'=>'customer_entity_varchar'),
189
+ 'buyer.customer_id = custfirstname.entity_id',array())
190
+ //Remove hard coded value for customer name and added by query
191
+ ->where('custfirstname.attribute_id=?',$customerfirstnameId)
192
+ ->joinLeft(array('custlastname'=>'customer_entity_varchar'),
193
+ 'buyer.customer_id = custlastname.entity_id',array())
194
+ ->where('custlastname.attribute_id=?',$customerLastNameId);
195
+ }
196
+
197
+ $result = $this->read()->fetchAll($select);
198
+
199
+ foreach ($result as $data) {
200
+ $collection[] = array($data);
201
+ }
202
+
203
+ return $collection;
204
+ }
205
+
206
+ public function updateFlag() {
207
+ $oid = Mage::app()->getRequest()->getPost('order_id');
208
+ $pid = Mage::app()->getRequest()->getPost('product_id');
209
+ $sql = "update marketplace_buyersellercomm_notifications set flag = 0 where order_id=$oid and product_id = $pid and flag =1";
210
+ $this->write()->query($sql);
211
+ return true;
212
+ }
213
+
214
+ public function getTotalNotificationCount() {
215
+ $sellerId = Mage::getSingleton('customer/session')->getId();
216
+
217
+ $orderItems = Mage::getResourceModel('sales/order_item_collection')
218
+ ->addFieldToSelect('order_id')
219
+ ->addFieldToFilter('seller_id', $sellerId)
220
+ ->distinct(true);
221
+
222
+ $arr_order_for_filter=array();
223
+ foreach ($orderItems->getData() as $orderItem) {
224
+ $arr_order_for_filter[]=$orderItem['order_id'];
225
+ }
226
+
227
+ $orderIds = implode(', ',$arr_order_for_filter);
228
+ if($orderIds) {
229
+ $select = $this->read()->select()->from("marketplace_buyersellercomm_notifications","count('flag')")
230
+ ->where("order_id IN (".$orderIds.")")
231
+ ->where("flag=?","1");
232
+ $result = $this->read()->fetchAll($select);
233
+
234
+ foreach ($result as $data) {
235
+ return $data["count('flag')"];
236
+ }
237
+ } else {
238
+ return "";
239
+ }
240
+ }
241
+
242
+ public function notifyEmail($to, $toName, $comment, $orderId,$productName, $from,$fromName) {
243
+ $storeId = Mage::app()->getStore()->getCode();
244
+ $templateId = '';
245
+ $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_COMMENT_TEMPLATE);
246
+
247
+ $mailer = Mage::getModel('core/email_template_mailer');
248
+ $emailInfo = Mage::getModel('core/email_info');
249
+ $emailInfo->addTo($to, $toName);
250
+ $emailInfo->addBcc($from);
251
+ $mailer->addEmailInfo($emailInfo);
252
+
253
+ // Set all required params and send emails
254
+ $mailer->setSender(Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY));
255
+ $mailer->setStoreId($storeId);
256
+ $mailer->setTemplateId($templateId);
257
+ $mailer->setTemplateParams(array(
258
+ 'name' => $toName,
259
+ 'comment' => $comment,
260
+ 'product'=>$productName,
261
+ 'order_id' => $orderId,
262
+ 'seller_email' => $from,
263
+ 'seller_name' => $fromName)
264
+ );
265
+
266
+ $mailer->send();
267
+ $this->setEmailSent(true);
268
+ return $this;
269
+ }
270
+
271
+ public function getSellerInfo($order) {
272
+ $select = $this->read()->select()->distinct(true)->from(array('sales'=>'sales_flat_order_item'),
273
+ array('seller_id'))
274
+ ->where('sales.order_id=?',$order);
275
+ $result = $this->read()->fetchAll($select);
276
+
277
+ foreach ($result as $data) {
278
+ return $data["seller_id"];
279
+ }
280
+ }
281
+
282
+ public function getBuyerinfo($orderid) {
283
+ $select = $this->read()->select()->distinct(true)->from(array('sales'=>'sales_flat_order'),
284
+ array('customer_email','customer_firstname','customer_lastname'))
285
+ ->where('sales.entity_id=?',$orderid);
286
+ $result = $this->read()->fetchAll($select);
287
+
288
+ foreach ($result as $data) {
289
+ $buyer= array("name"=>$data["customer_firstname"]." ".$data['customer_lastname'],"email"=>$data["customer_email"]);
290
+ return $buyer;
291
+ }
292
+ }
293
+ }
app/code/community/Cybage/Marketplace/Model/Commission.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Commission extends Mage_Core_Model_Abstract
22
+ {
23
+ protected function _construct() {
24
+ parent::_construct();
25
+ $this->_init('marketplace/commission');
26
+ }
27
+ }
app/code/community/Cybage/Marketplace/Model/Customatributestatus.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Customatributestatus
22
+ {
23
+ //Source Model for displaying status option
24
+ public function toOptionArray($multiSelect = false)
25
+ {
26
+ //Load state attribute values by id
27
+ $attributeId = Mage::getResourceModel('eav/entity_attribute')
28
+ ->getIdByCode('customer', 'status');
29
+ $attribute = Mage::getModel('catalog/resource_eav_attribute')
30
+ ->load($attributeId);
31
+ $attributeOptions = $attribute->getSource()->getAllOptions(false);
32
+
33
+ //Create option array for drop down
34
+ $stateName = array();
35
+ $additional['value'] = 'value';
36
+ $additional['label'] = 'label';
37
+
38
+ foreach ($attributeOptions as $item) {
39
+ foreach ($item as $code => $field) {
40
+ $data[$item[$additional['value']]] = $item[$additional['label']];
41
+ }
42
+ $stateName = $data;
43
+ }
44
+ return $stateName;
45
+ }
46
+ }
app/code/community/Cybage/Marketplace/Model/Customer.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Customer extends Mage_Customer_Model_Customer
22
+ {
23
+ const XML_PATH_REGISTER_SELLER_EMAIL_TEMPLATE = 'marketplace/seller/email_template';
24
+
25
+ public function customValidate($customer)
26
+ {
27
+ $errors = array();
28
+ // custom validation for seller profile
29
+ if (!Zend_Validate::is( trim($customer->getCompanyLocality()) , 'NotEmpty')) {
30
+ $errors[] = Mage::helper('customer')->__('The company locality cannot be empty.');
31
+ }
32
+
33
+ if (!Zend_Validate::is( trim($customer->getCompanyName()) , 'NotEmpty')) {
34
+ $errors[] = Mage::helper('customer')->__('The company name cannot be empty.');
35
+ }
36
+ // end of custom validation for seller profile
37
+
38
+ if (!Zend_Validate::is( trim($customer->getFirstname()) , 'NotEmpty')) {
39
+ $errors[] = Mage::helper('customer')->__('The first name cannot be empty.');
40
+ }
41
+
42
+ if (!Zend_Validate::is( trim($customer->getLastname()) , 'NotEmpty')) {
43
+ $errors[] = Mage::helper('customer')->__('The last name cannot be empty.');
44
+ }
45
+
46
+ if (!Zend_Validate::is($customer->getEmail(), 'EmailAddress')) {
47
+ $errors[] = Mage::helper('customer')->__('Invalid email address "%s".', $customer->getEmail());
48
+ }
49
+
50
+ $password = $customer->getPassword();
51
+ if (!$customer->getId() && !Zend_Validate::is($password , 'NotEmpty')) {
52
+ $errors[] = Mage::helper('customer')->__('The password cannot be empty.');
53
+ }
54
+ if (strlen($password) && !Zend_Validate::is($password, 'StringLength', array(6))) {
55
+ $errors[] = Mage::helper('customer')->__('The minimum password length is %s', 6);
56
+ }
57
+ $confirmation = $customer->getConfirmation();
58
+ if ($password != $confirmation) {
59
+ $errors[] = Mage::helper('customer')->__('Please make sure your passwords match.');
60
+ }
61
+
62
+ $entityType = Mage::getSingleton('eav/config')->getEntityType('customer');
63
+ $attribute = Mage::getModel('customer/attribute')->loadByCode($entityType, 'dob');
64
+ if ($attribute->getIsRequired() && '' == trim($customer->getDob())) {
65
+ $errors[] = Mage::helper('customer')->__('The Date of Birth is required.');
66
+ }
67
+ $attribute = Mage::getModel('customer/attribute')->loadByCode($entityType, 'taxvat');
68
+ if ($attribute->getIsRequired() && '' == trim($customer->getTaxvat())) {
69
+ $errors[] = Mage::helper('customer')->__('The TAX/VAT number is required.');
70
+ }
71
+ $attribute = Mage::getModel('customer/attribute')->loadByCode($entityType, 'gender');
72
+ if ($attribute->getIsRequired() && '' == trim($customer->getGender())) {
73
+ $errors[] = Mage::helper('customer')->__('Gender is required.');
74
+ }
75
+ if (empty($errors)) {
76
+ return true;
77
+ }
78
+ return $errors;
79
+ }
80
+
81
+ /**
82
+ * Send email with new account related information
83
+ *
84
+ * @param string $type
85
+ * @param string $backUrl
86
+ * @param string $storeId
87
+ * @throws Mage_Core_Exception
88
+ * @return Mage_Customer_Model_Customer
89
+ */
90
+ public function sendNewAccountEmail($type = 'registered', $backUrl = '', $storeId = '0')
91
+ {
92
+ if(Mage::app()->getRequest()->getParam('check_seller_form'))
93
+ {
94
+ $types = array(
95
+ 'registered' => self::XML_PATH_REGISTER_SELLER_EMAIL_TEMPLATE, // welcome email, when confirmation is disabled
96
+ );
97
+
98
+
99
+ if (!isset($types[$type])) {
100
+ Mage::throwException(Mage::helper('customer')->__('Wrong transactional account email type'));
101
+ }
102
+
103
+ if (!$storeId) {
104
+ $storeId = $this->_getWebsiteStoreId($this->getSendemailStoreId());
105
+ }
106
+
107
+ $this->_sendEmailTemplate($types[$type], self::XML_PATH_REGISTER_EMAIL_IDENTITY,
108
+ array('customer' => $this, 'back_url' => $backUrl), $storeId);
109
+
110
+ return $this;
111
+ }
112
+ return parent::sendNewAccountEmail($type = 'registered', $backUrl = '', $storeId = '0');
113
+ }
114
+ }
app/code/community/Cybage/Marketplace/Model/Image.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Image extends Mage_Core_Model_Abstract
22
+ {
23
+ public function process(array $csvData, $cid, $imageDir)
24
+ {
25
+ $cnt = count($csvData);
26
+ $importDir = Mage::getBaseDir() . DS . 'media' . DS . 'marketplace' . DS . $cid . DS . $imageDir . DS;
27
+
28
+ if($cnt > 1)
29
+ {
30
+ for($i=1; $i<$cnt; $i++)
31
+ {
32
+ try {
33
+
34
+ $sku = $csvData[$i][0];
35
+
36
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);
37
+ $fileName = trim($csvData[$i][11]);
38
+ $filePath = $importDir . $fileName;
39
+
40
+ if (file_exists($filePath) && $fileName != '')
41
+ {
42
+ $types = array('image', 'small_image', 'thumbnail');
43
+
44
+ foreach($types as $type)
45
+ {
46
+ $product->addImageToMediaGallery($filePath, array($type), false);
47
+ }
48
+
49
+ $mediaGallery = $product->getMediaGallery();
50
+ if (isset($mediaGallery['images'])){
51
+ foreach ($mediaGallery['images'] as $key=>$image){
52
+ Mage::getSingleton('catalog/product_action')->updateAttributes(array($product->getId()), array($types[$key] => $image['file']), 0);
53
+ }
54
+ }
55
+
56
+ $product->save();
57
+
58
+ unlink($filePath);
59
+ } else {
60
+ $message = 'Image does not exist for sku '. $sku;
61
+ Mage::log($message, null, 'sellerimages_debug.log', true);
62
+ }
63
+ } catch(Exception $e) {
64
+ Mage::logException($e);
65
+ }
66
+ }
67
+ }
68
+
69
+ return true;
70
+ }
71
+ }
app/code/community/Cybage/Marketplace/Model/Logging.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Logging extends Mage_Core_Model_Abstract
22
+ {
23
+ const LOGGING_SUCCESS_ACTION = 'SUCCESS';
24
+ const LOGGING_FAILURE_ACTION = 'FAILURE';
25
+ const LOGGING_PRODUCT_DELETE_ACTION = 'DELETE';
26
+ const LOGGING_PRODUCT_EDIT_ACTION = 'EDIT';
27
+ const LOGGING_PRODUCT_SAVE_ACTION = 'SAVE';
28
+
29
+ /**
30
+ * Initialize model
31
+ */
32
+ public function _construct()
33
+ {
34
+ parent::_construct();
35
+ $this->_init('marketplace/logging');
36
+ }
37
+
38
+ /**
39
+ * get resource module for connection with database
40
+ * @return : Mage_Core_Model_Resource
41
+ */
42
+ public function resource()
43
+ {
44
+ return Mage::getSingleton("core/resource");
45
+ }
46
+
47
+ /**
48
+ * Get permission for reading data from database
49
+ * @return : Read Object
50
+ */
51
+ public function read()
52
+ {
53
+ return $this->resource()->getConnection('core_read');
54
+ }
55
+
56
+ /**
57
+ * Get permission for writing data to database
58
+ * @return : write Object
59
+ */
60
+ public function write()
61
+ {
62
+ return $this->resource()->getConnection('core_write');
63
+ }
64
+
65
+ /**
66
+ * Save logging for product add, edit or delete action for marketplace product
67
+ * @param : $actionId (delete,save or edit), $result (success or failure) , $productId (Mage_catalog_Model_Product)
68
+ * @return : void
69
+ */
70
+ public function saveProductLog($actionId, $result, $productId,$prodSellerId=0)
71
+ {
72
+ if ( $productId ){
73
+ $product = Mage::getModel('catalog/product')->load($productId);
74
+ $sellerId = $product->getSellerId();
75
+ }
76
+ else{
77
+ $sellerId = $prodSellerId;
78
+ }
79
+ if ( $sellerId ){
80
+ $customerIp = $_SERVER['REMOTE_ADDR'];
81
+ $logDate = date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time()));
82
+ if ( $result == 1 ){
83
+ $resultText = self::LOGGING_SUCCESS_ACTION;
84
+ }
85
+ else{
86
+ $resultText = self::LOGGING_FAILURE_ACTION;
87
+ }
88
+ if ( $actionId == 1 ){
89
+ $action = self::LOGGING_PRODUCT_DELETE_ACTION;
90
+ }
91
+ else if ( $actionId == 2 ){
92
+ $action = self::LOGGING_PRODUCT_EDIT_ACTION;
93
+ }
94
+ else{
95
+ $action = self::LOGGING_PRODUCT_SAVE_ACTION;
96
+ }
97
+ $logObject = Mage::getModel('marketplace/logging');
98
+ $logObject->setCustomerId($sellerId);
99
+ $logObject->setAction($action);
100
+ $logObject->setCustomerIp($customerIp);
101
+ $logObject->setCreatedAt($logDate);
102
+ $logObject->setResult($resultText);
103
+ $logObject->save();
104
+ }
105
+ return;
106
+ }
107
+ }
app/code/community/Cybage/Marketplace/Model/Marketplace.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Marketplace extends Mage_Core_Model_Abstract
22
+ {
23
+ const CACHE_TAG = 'marketplace';
24
+ const ATTRIBUTE_SET_NAME = 'default';
25
+
26
+ /**
27
+ * Method : To get attribute set id
28
+ **/
29
+ public function getAttributeSet() {
30
+ $attr_set_name = self::ATTRIBUTE_SET_NAME;
31
+ $attribute_set_id = Mage::getModel('eav/entity_attribute_set')
32
+ ->load($attr_set_name, 'attribute_set_name')
33
+ ->getAttributeSetId();
34
+ return $attribute_set_id;
35
+ }
36
+
37
+ /**
38
+ * Method : To get size of file to upload
39
+ **/
40
+ public function getFileSize() {
41
+ return Mage::getStoreConfig('marketplace/upload_file_size');
42
+ }
43
+
44
+ /**
45
+ * Get few Best Seller Product of the Seller based on admin configuration
46
+ * @return Array
47
+ * * */
48
+ public function getBestSellerProducts() {
49
+ $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
50
+ $products = Mage::getResourceModel('reports/product_collection')
51
+ ->addAttributeToSelect('*')
52
+ ->addOrderedQty()
53
+ ->addAttributeToFilter('seller_id', $customerId)
54
+ ->setOrder('ordered_qty', 'desc');
55
+ return $products;
56
+ }
57
+
58
+ /**
59
+ * Get Last few orders of Seller Product
60
+ * @return Array
61
+ * * */
62
+ public function getLastFewOrder() {
63
+ //Get seller's product id
64
+ $sellerProductIds = $this->getsellersProducts();
65
+ $collection = Mage::getResourceModel('sales/order_item_collection')
66
+ ->addAttributeToSelect('*')
67
+ ->addAttributeToFilter('product_id', array('in' => $sellerProductIds))
68
+ ->setOrder('qty_ordered', 'desc');
69
+ return $collection;
70
+ }
71
+
72
+ /**
73
+ * Get Seller's produc ids
74
+ * @return Array
75
+ * * */
76
+ public function getSellersProducts() {
77
+ //Get Logged in customer id
78
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
79
+ $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
80
+ $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');
81
+ //Get Seller_id attribute id
82
+ $_product = Mage::getModel('catalog/product');
83
+ $attributeId = $_product->getResource()->getAttribute('seller_id')->getAttributeId();
84
+ $select = $connectionRead->select('coe.entity_id')
85
+ ->from('catalog_product_entity As coe')
86
+ ->joinLeft(array('cpet' => 'catalog_product_entity_int'), 'coe.entity_id = cpet.entity_id')
87
+ ->where('attribute_id=?', $attributeId)
88
+ ->where('value=?', $customerId);
89
+ $sellerProducts = $connectionRead->fetchCol($select);
90
+ return $sellerProducts;
91
+ }
92
+ }
93
+
94
+ public function resource() {
95
+ return Mage::getSingleton("core/resource");
96
+ }
97
+
98
+ public function read() {
99
+ return $this->resource()->getConnection('core_read');
100
+ }
101
+
102
+ public function write() {
103
+ return $this->resource()->getConnection('core_write');
104
+ }
105
+
106
+ /* Get question count for which reply not present. */
107
+ public function getUnrepliedQueCount() {
108
+ $unrepliedQueCount = 0;
109
+ $subselect = $this->read()->select()->distinct(true)->from(array('q' => 'marketplace_askquestion_question'), array('q.entity_id'))
110
+ ->joinRight(array('r' => 'marketplace_askquestion_reply'), ' q.entity_id = r.parent_id', array());
111
+
112
+ $select = $this->read()->select()->from(array("q" => "marketplace_askquestion_question"), array("count(distinct q.entity_id)"))
113
+ ->where("q.entity_id not in ($subselect)");
114
+
115
+ if ($product_str = implode(",", $this->getSellersProducts())) {
116
+ $where = "q.product_id in (" . $product_str . ")";
117
+ $select->where($where);
118
+ $unrepliedQueCount = $this->read()->fetchOne($select);
119
+ }
120
+
121
+ return $unrepliedQueCount;
122
+ }
123
+ }
app/code/community/Cybage/Marketplace/Model/Observer.php ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Observer {
22
+ /*Save seller id and sipping charge in quote table.*/
23
+ public function saveSellerId(Varien_Event_Observer $observer) {
24
+ $event = $observer->getEvent();
25
+ $quoteItem = $event->getQuoteItem();
26
+ $product = $event->getProduct();
27
+
28
+ $sellerId = $product->getData('seller_id');
29
+ $shippingCharges = $product->getData('shipping_charges');
30
+
31
+ $quoteItem->setData('seller_id',$sellerId);
32
+ $quoteItem->setData('shipping_charges',$shippingCharges);
33
+ }
34
+
35
+ public $productActionModel;
36
+ /**
37
+ * Validate Product's markeplace status if status of the product is enabled while editing or adding product
38
+ * @param catalog_product_save_before
39
+ * @author Shilpag
40
+ */
41
+ public function validateProductMarketplaceStatus($observer)
42
+ {
43
+
44
+
45
+ $product = $product =$observer->getEvent()->getProduct();
46
+ $productStatus = $product->getStatus();
47
+ $isSeller = $product->getSellerId();
48
+ $productMktStatus = $product->getMarketplaceState();
49
+
50
+ if ($isSeller)
51
+ {
52
+ $this->getproductActionModel()->validateProductStatus($productStatus, $productMktStatus);
53
+ }
54
+ }
55
+
56
+ /**
57
+ * Validate Products markeplace status if status of the products is enabled while performing mass action on them
58
+ * @param catalog_product_attribute_update_before
59
+ * @author Shilpag
60
+ */
61
+ public function validateMassActionProductMarketplaceStatus($observer)
62
+ {
63
+ $productData = $observer->getEvent()->getData();
64
+ $arrProductIds = $productData['product_ids'];
65
+ $atributeData = $observer->getEvent()->getAttributesData();
66
+ $productMktStatus = $atributeData['marketplace_state'];
67
+ $productStatus = $atributeData['status'];
68
+ $productAction = $this->getproductActionModel();
69
+ foreach ($arrProductIds as $productId)
70
+ {
71
+ $product = Mage::getModel('catalog/product')->load($productId);
72
+ //$attributeSetId = $product->getAttributeSetId();
73
+ $isSeller = $product->getSellerId();
74
+ if ($isSeller )
75
+ {
76
+ if ( $productStatus && $productMktStatus)
77
+ {
78
+ $productAction->validateProductStatus($productStatus, $productMktStatus);
79
+ } else if ( $productStatus ) {
80
+ $originalMarkeplaceStatus = $product->getMarketplaceStatus();
81
+ $productAction->validateProductStatus($productStatus, $originalMarkeplaceStatus);
82
+ } else if ( $productMktStatus ) {
83
+ $originalproductStatus = $product->getStatus();
84
+ $productAction->validateProductStatus($originalproductStatus, $productMktStatus);
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Get model instance for class TM_Adminhtml_Model_Product_Action
92
+ */
93
+ public function getproductActionModel() {
94
+ if (!($this->productActionModel)) {
95
+ $this->productActionModel = Mage::getModel('marketplace/product_action');
96
+ }
97
+ return $this->productActionModel;
98
+ }
99
+
100
+ public function pendingorders()
101
+ {
102
+ $daylimit = Mage::getStoreConfig('marketplace/seller/order_pending_before_days',Mage::app()->getStore());
103
+ $date1=date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(strtotime('-'.$daylimit.'day', time())));
104
+ $orderItemsCollection = Mage::getResourceModel('sales/order_item_collection');
105
+ $orderItemsCollection->getSelect()->join(array('sfo' =>'sales_flat_order'), 'main_table.order_id = sfo.entity_id', array('sfo.entity_id','sfo.status','sfo.created_at'));
106
+ $orderItemsCollection->addAttributeToFilter('sfo.created_at',array('lteq' =>$date1));
107
+ $orderItemsCollection->addAttributeToFilter('status', array('eq' =>'pending'));
108
+
109
+ $arr_order_for_filter=array();
110
+ foreach ($orderItemsCollection->getData() as $orderItem) {
111
+ $sellerId=$orderItem['seller_id'];
112
+ $arr_order_for_filter[$orderItem['order_id']]= $sellerId;
113
+ }
114
+
115
+ $orderDetail = array();
116
+ foreach($arr_order_for_filter as $key => $value){
117
+ $orderDetail[$value][] = $key;
118
+ }
119
+
120
+ foreach($orderDetail as $key=>$value){
121
+
122
+ $sellerId = $key;
123
+ $customer = Mage::getModel('customer/customer')->load($sellerId);
124
+ $orderCount = count($value);
125
+ $orderIds = implode(",", $value);
126
+ $this->sendTransactionalEmail($customer,$orderCount,$orderIds);
127
+ }
128
+ }
129
+
130
+ public function sendTransactionalEmail($customer,$orderCount,$orderIds)
131
+ {
132
+ // Transactional Email Template's ID
133
+ $templateId = Mage::getStoreConfig('marketplace/seller/order_pending_reminder_template');
134
+ // Set sender information
135
+ $senderName = Mage::getStoreConfig('trans_email/ident_support/name');
136
+ $senderEmail = Mage::getStoreConfig('trans_email/ident_support/email');
137
+ $sender = array('name' => $senderName,
138
+ 'email' => $senderEmail);
139
+ // Set recepient information
140
+ $recepientEmail = $customer->getEmail();
141
+ $recepientName = $customer->getName();
142
+ // Get Store ID
143
+ $store = Mage::app()->getStore()->getId();
144
+ // Set variables that can be used in email template
145
+ $vars = array(
146
+ 'customer'=>$customer,
147
+ 'ordercount'=>$orderCount,
148
+ 'orderids'=>$orderIds
149
+ );
150
+ $translate = Mage::getSingleton('core/translate');
151
+ // Send Transactional Email
152
+ Mage::getModel('core/email_template')
153
+ ->sendTransactional($templateId, $sender, $recepientEmail, $recepientName, $vars, $storeId);
154
+ $translate->setTranslateInline(true);
155
+ }
156
+ }
app/code/community/Cybage/Marketplace/Model/Order.php ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Order extends Mage_Sales_Model_Order
22
+ {
23
+ /**
24
+ * XML configuration paths
25
+ */
26
+ const XML_PATH_EMAIL_PROCESSING_TEMPLATE = 'sales_email/order/processing_template';
27
+ const XML_PATH_EMAIL_COMPLETED_TEMPLATE = 'sales_email/order/completed_template';
28
+ const XML_PATH_EMAIL_CANCELLED_TEMPLATE = 'sales_email/order/cancelled_template';
29
+ const XML_PATH_EMAIL_IDENTITY = 'sales_email/order/identity';
30
+
31
+ /**
32
+ * Send email with order update information
33
+ *
34
+ * @param boolean $notifyCustomer
35
+ * @param string $comment
36
+ * @return Mage_Sales_Model_Order
37
+ */
38
+ public function sendOrderStatusEmail($status, $buyerEmail, $buyerName, $comment, $orderId, $sellerEmail,$sellerName){
39
+ $storeId = $this->getStore()->getId();
40
+ $templateId = '';
41
+
42
+ if (strcmp($status, 'cancelled') == 0) {
43
+ $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_CANCELLED_TEMPLATE);
44
+ }
45
+
46
+ if (strcmp($status, 'complete') == 0) {
47
+ $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_COMPLETED_TEMPLATE);
48
+ }
49
+
50
+ if (strcmp($status, 'processing') == 0) {
51
+ $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_PROCESSING_TEMPLATE);
52
+ }
53
+
54
+ $mailer = Mage::getModel('core/email_template_mailer');
55
+ $emailInfo = Mage::getModel('core/email_info');
56
+ $emailInfo->addTo($buyerEmail, $buyerName);
57
+ $emailInfo->addBcc($sellerEmail);
58
+
59
+ $mailer->addEmailInfo($emailInfo);
60
+
61
+ // Set all required params and send emails
62
+ $mailer->setSender(Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY));
63
+ $mailer->setStoreId($storeId);
64
+ $mailer->setTemplateId($templateId);
65
+ $mailer->setTemplateParams(array(
66
+ 'name' => $buyerName,
67
+ 'comment' => $comment,
68
+ 'order_id' => $orderId,
69
+ 'seller_email' => $sellerEmail,
70
+ 'seller_name' => $sellerName)
71
+ );
72
+
73
+ $mailer->send();
74
+
75
+ $this->setEmailSent(true);
76
+ $this->_getResource()->saveAttribute($this, 'email_sent');
77
+ return $this;
78
+ }
79
+
80
+ /**
81
+ * Completes the Shipment, followed by completing the Order life-cycle
82
+ * It is assumed that the Invoice has already been generated
83
+ * and the amount has been captured.
84
+ */
85
+ public function processOrder($status,$orderId,$trackingNo,$comment)
86
+ {
87
+ /**
88
+ * Provide the Shipment Tracking Number,
89
+ */
90
+ $shipmentTrackingNumber = isset($trackingNo) ? $trackingNo : '';
91
+
92
+ $customerEmailComments = isset($comment) ? $comment : '';
93
+
94
+ $order = Mage::getModel('sales/order')->load($orderId);
95
+
96
+ if (!$order->getId()) {
97
+ Mage::throwException("Order does not exist, for the Shipment process to complete");
98
+ }
99
+
100
+ if (strcmp($status, 'cancelled') == 0) {
101
+ $this->cancel()->save();
102
+ return true;
103
+ }
104
+
105
+ try {
106
+ /* Check if invoice is created for order then only shipment will be created.*/
107
+ if($order->hasInvoices()) {
108
+ $totalQtyOrdered = (float)$order->getTotalQtyOrdered();
109
+
110
+ if (strcmp($status, 'processing') == 0) {
111
+ $shipment = Mage::getModel('sales/service_order', $order)
112
+ ->prepareShipment($this->_getItemQtys($order));
113
+
114
+ $shipmentCarrierCode = 'SPECIFIC_CARRIER_CODE';
115
+ $shipmentCarrierTitle = 'SPECIFIC_CARRIER_TITLE';
116
+
117
+ $arrTracking = array(
118
+ 'carrier_code' => isset($shipmentCarrierCode) ? $shipmentCarrierCode : $order->getShippingCarrier()->getCarrierCode(),
119
+ 'title' => isset($shipmentCarrierTitle) ? $shipmentCarrierTitle : $order->getShippingCarrier()->getConfigData('title'),
120
+ 'number' => $shipmentTrackingNumber,
121
+ );
122
+
123
+ $track = Mage::getModel('sales/order_shipment_track')->addData($arrTracking);
124
+ $shipment->addTrack($track);
125
+
126
+ // Register Shipment
127
+ $shipment->register();
128
+
129
+ // Save the Shipment
130
+ $this->_saveShipment($shipment, $order, $customerEmailComments);
131
+
132
+ // Finally, Save the Order
133
+ $this->_saveOrder($order);
134
+
135
+ return true;
136
+
137
+ }
138
+ }else{
139
+ return false;
140
+ }
141
+ } catch (Exception $e) {
142
+ Mage::getModel('core/session')->addError($e->getMessage());
143
+ $this->_redirect('marketplace/account/vieworder',$arguement=array('order_id' => $orderId));
144
+ }
145
+ }
146
+
147
+ /**
148
+ * Get the Quantities shipped for the Order, based on an item-level
149
+ * This method can also be modified, to have the Partial Shipment functionality in place
150
+ *
151
+ * @param $order Mage_Sales_Model_Order
152
+ * @return array
153
+ */
154
+ protected function _getItemQtys(Mage_Sales_Model_Order $order)
155
+ {
156
+ $qty = array();
157
+
158
+ $customerId = Mage::getSingleton('customer/session')->getId();
159
+
160
+ foreach ($order->getAllItems() as $_eachItem) {
161
+ $sellerId = $_eachItem->getSellerId();
162
+
163
+ //check for artial shipment
164
+ if($sellerId == $customerId){
165
+ if ($_eachItem->getParentItemId()) {
166
+ $qty[$_eachItem->getParentItemId()] = $_eachItem->getQtyOrdered();
167
+ } else {
168
+ $qty[$_eachItem->getId()] = $_eachItem->getQtyOrdered();
169
+ }
170
+ }
171
+ }
172
+
173
+ return $qty;
174
+ }
175
+
176
+ /**
177
+ * Saves the Shipment changes in the Order
178
+ *
179
+ * @param $shipment Mage_Sales_Model_Order_Shipment
180
+ * @param $order Mage_Sales_Model_Order
181
+ * @param $customerEmailComments string
182
+ */
183
+ protected function _saveShipment(Mage_Sales_Model_Order_Shipment $shipment, Mage_Sales_Model_Order $order, $customerEmailComments = '')
184
+ {
185
+ $shipment->getOrder()->setIsInProcess(true);
186
+ $transactionSave = Mage::getModel('core/resource_transaction')
187
+ ->addObject($shipment)
188
+ ->addObject($order)
189
+ ->save();
190
+
191
+ $emailSentStatus = $shipment->getData('email_sent');
192
+
193
+ return $this;
194
+ }
195
+
196
+ /** Saves the Order, to complete the full life-cycle of the Order
197
+ * Order status will now show as Complete
198
+ * @param $order Mage_Sales_Model_Order
199
+ */
200
+ protected function _saveOrder(Mage_Sales_Model_Order $order)
201
+ {
202
+ $totalQtyOrdered = (float)$order->getTotalQtyOrdered();
203
+
204
+ $qtyShipped = '';
205
+
206
+ foreach ($order->getAllItems() as $_eachItem) {
207
+ $qtyShipped += (float)$_eachItem->getQtyShipped();
208
+ }
209
+
210
+ if($qtyShipped < $totalQtyOrdered){
211
+ $order->setData('state', Mage_Sales_Model_Order::STATE_PROCESSING);
212
+ $order->setData('status', Mage_Sales_Model_Order::STATE_PROCESSING);
213
+ }else{
214
+ $order->setData('state', Mage_Sales_Model_Order::STATE_COMPLETE);
215
+ $order->setData('status', Mage_Sales_Model_Order::STATE_COMPLETE);
216
+ }
217
+
218
+ $order->save();
219
+
220
+ return $this;
221
+ }
222
+
223
+ /*Filter ordered items on the basis of seller id*/
224
+ public function getOrderDetails($orderId) {
225
+ $seller_id = Mage::getSingleton('customer/session')->getId();
226
+ $customer = Mage::getModel('customer/customer')->load($seller_id);
227
+
228
+ $seller = $customer->getData('company_name');
229
+
230
+ $ordersCollection = Mage::getResourceModel('sales/order_item_collection')
231
+ ->addAttributeToFilter('order_id',array('in' => $orderId));
232
+
233
+ if($seller){
234
+ $ordersCollection->addAttributeToFilter('seller_id', array('in' => $seller_id));
235
+ }
236
+
237
+ return $ordersCollection;
238
+ }
239
+ }
app/code/community/Cybage/Marketplace/Model/Product/Action.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Product_Action extends Mage_Catalog_Model_Product_Action
22
+ {
23
+ /**
24
+ * Validate product's status against markeplace status os the same product
25
+ * @param : Mage_Catalog_Product_Model($productStatus, $markeplaceStatus)
26
+ */
27
+ public function validateProductStatus($productStatus, $markeplaceStatus)
28
+ {
29
+ if ( $productStatus == Mage_Catalog_Model_Product_Status::STATUS_ENABLED && !($markeplaceStatus == Mage::helper('marketplace')->getProductApprovedStatusId()) )
30
+ {
31
+ Mage::throwException('Please change marketplace status to approved or make product status as disabled');
32
+ }
33
+ }
34
+ }
app/code/community/Cybage/Marketplace/Model/Question.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Question extends Mage_Core_Model_Abstract
22
+ {
23
+ protected function _construct() {
24
+ parent::_construct();
25
+ $this->_init('marketplace/question');
26
+ }
27
+
28
+ public function saveQuestions() {
29
+ $object = Mage::getModel('marketplace/question');
30
+ $object->setQuestion(strip_tags(Mage::app()->getRequest()->getPost('question')));
31
+ $object->setProductId(Mage::app()->getRequest()->getPost('product_id'));
32
+ $object->setCustomerId(Mage::getSingleton('customer/session')->getCustomer()->getId());
33
+ $object->save();
34
+ return;
35
+ }
36
+
37
+ public function getQuestions($products, $flag) {
38
+ $collection = Mage::getModel('marketplace/question')->getCollection();
39
+ if ($flag) {
40
+ $collection->addFieldToFilter('product_id', array('in' => $products))->setOrder('entity_id', 'DESC');
41
+ } else {
42
+ $collection->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId())->setOrder('entity_id', 'DESC');
43
+ if (!empty($products)) {
44
+ $collection->addFieldToFilter('product_id', array('nin' => $products));
45
+ }
46
+ }
47
+ $collection->load();
48
+ return $collection;
49
+ }
50
+
51
+ public function getMyQuestions($products, $flag='in') {
52
+ return Mage::getModel('marketplace/question')->getCollection()
53
+ ->addFieldToFilter('product_id', array($flag => $products))
54
+ ->setOrder('entity_id', 'DESC');
55
+ }
56
+ }
app/code/community/Cybage/Marketplace/Model/Reply.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Reply extends Mage_Core_Model_Abstract
22
+ {
23
+ protected function _construct() {
24
+ parent::_construct();
25
+ $this->_init('marketplace/reply');
26
+ }
27
+
28
+ public function saveReplies() {
29
+ $object = Mage::getModel('marketplace/reply');
30
+ $object->setReply(strip_tags(Mage::app()->getRequest()->getPost('reply')));
31
+ $object->setParentId(strip_tags(Mage::app()->getRequest()->getPost('parent_id')));
32
+ $object->setCustomerId(Mage::getSingleton('customer/session')->getCustomer()->getId());
33
+ $object->save();
34
+ }
35
+
36
+ public function getReplies($qId) {
37
+ return Mage::getModel('marketplace/reply')->getCollection()->addFieldToFilter('parent_id', $qId)->setOrder('created_at', 'desc');
38
+ }
39
+ }
app/code/community/Cybage/Marketplace/Model/Resource/Buyerseller.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Resource_Buyerseller extends Mage_Core_Model_Mysql4_Abstract
22
+ {
23
+ public function _construct() {
24
+ $this->_init('marketplace/buyerseller', 'entity_id');
25
+ }
26
+ }
app/code/community/Cybage/Marketplace/Model/Resource/Buyerseller/Collection.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Resource_Buyerseller_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
22
+ {
23
+ public function _construct()
24
+ {
25
+ $this->_init('marketplace/buyerseller');
26
+ }
27
+ }
app/code/community/Cybage/Marketplace/Model/Resource/Commission.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Resource_Commission extends Mage_Core_Model_Resource_Db_Abstract
22
+ {
23
+ protected function _construct()
24
+ {
25
+ $this->_init('marketplace/commission','id');
26
+ }
27
+ }
app/code/community/Cybage/Marketplace/Model/Resource/Commission/Collection.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Resource_Commission_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
22
+ {
23
+ protected function _construct()
24
+ {
25
+ $this->_init('marketplace/commission');
26
+ }
27
+ }
app/code/community/Cybage/Marketplace/Model/Resource/Customer.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Resource_Customer extends Mage_Customer_Model_Resource_Customer
22
+ {
23
+ /**
24
+ * Check customer scope, email,company name and confirmation key before saving
25
+ */
26
+ protected function _beforeSave(Varien_Object $customer)
27
+ {
28
+ parent::_beforeSave($customer);
29
+
30
+ if (!$customer->getEmail()) {
31
+ throw Mage::exception('Mage_Customer', Mage::helper('customer')->__('Customer email is required'));
32
+ }
33
+
34
+ $adapter = $this->_getWriteAdapter();
35
+ $bind = array('email' => $customer->getCompanyName());
36
+
37
+ $select = $adapter->select()
38
+ ->from($this->getEntityTable(), array($this->getEntityIdField()))
39
+ ->where('email = :email');
40
+
41
+ if ($customer->getSharingConfig()->isWebsiteScope()) {
42
+ $bind['website_id'] = (int)$customer->getWebsiteId();
43
+ $select->where('website_id = :website_id');
44
+ }
45
+ if ($customer->getId()) {
46
+ $bind['entity_id'] = (int)$customer->getId();
47
+ $select->where('entity_id != :entity_id');
48
+ }
49
+
50
+ $result = $adapter->fetchOne($select, $bind);
51
+ if ($result) {
52
+ throw Mage::exception(
53
+ 'Mage_Customer', Mage::helper('customer')->__('This customer email already exists'),
54
+ Mage_Customer_Model_Customer::EXCEPTION_EMAIL_EXISTS
55
+ );
56
+ }
57
+
58
+ /*Get attribute id of attribute company_name*/
59
+ $code = 'company_name';
60
+ $companyAttribute = Mage::getResourceModel('eav/entity_attribute_collection')
61
+ ->setCodeFilter($code)
62
+ ->getFirstItem();
63
+
64
+ $companyAttrId = $companyAttribute->getId();
65
+
66
+ /*Check if same company name already exist*/
67
+ $writeAdapter = $this->_getWriteAdapter();
68
+ $companybind = array('company_name' => $customer->getCompanyName());
69
+
70
+ $compselect = $writeAdapter->select()
71
+ ->from('customer_entity_varchar', array($this->getEntityIdField()))
72
+ ->where('value = :company_name AND attribute_id ='.$companyAttrId);
73
+
74
+ if ($customer->getId()) {
75
+ $companybind['entity_id'] = (int)$customer->getId();
76
+ $compselect->where('entity_id != :entity_id');
77
+ }
78
+
79
+ $compresult = $writeAdapter->fetchOne($compselect, $companybind);
80
+ if ($compresult) {
81
+ throw Mage::exception('Mage_Customer', Mage::helper('customer')->__('Company name already exist'));
82
+ }
83
+ /*Check if same company name already exist*/
84
+ // set confirmation key logic
85
+ if ($customer->getForceConfirmed()) {
86
+ $customer->setConfirmation(null);
87
+ } elseif (!$customer->getId() && $customer->isConfirmationRequired()) {
88
+ $customer->setConfirmation($customer->getRandomConfirmationKey());
89
+ }
90
+ // remove customer confirmation key from database, if empty
91
+ if (!$customer->getConfirmation()) {
92
+ $customer->setConfirmation(null);
93
+ }
94
+
95
+ return $this;
96
+ }
97
+ }
app/code/community/Cybage/Marketplace/Model/Resource/Logging.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Resource_Logging extends Mage_Core_Model_Mysql4_Abstract
22
+ {
23
+ public function _construct() {
24
+ $this->_init('marketplace/logging', 'log_id');
25
+ }
26
+ }
app/code/community/Cybage/Marketplace/Model/Resource/Orderby/Collection.php ADDED
@@ -0,0 +1,308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Resource_Orderby_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
22
+ {
23
+ protected $_periodFormat;
24
+ protected $_selectedColumns = array();
25
+ protected $_from = null;
26
+ protected $_to = null;
27
+ protected $_orderStatus = null;
28
+ protected $_period = null;
29
+ protected $_storesIds = 0;
30
+ protected $_applyFilters = true;
31
+ protected $_isTotals = false;
32
+ protected $_isSubTotals = false;
33
+ protected $_aggregatedColumns = array();
34
+ protected $_marketplaceuser = 0;
35
+ protected $_tablealias = 'main_table';
36
+
37
+ /**
38
+ * Initialize custom resource model
39
+ */
40
+ public function __construct() {
41
+ parent::_construct();
42
+ $this->setModel('adminhtml/report_item');
43
+ $this->_resource = Mage::getResourceModel('sales/order_item');
44
+ $this->setConnection($this->getResource()->getReadConnection());
45
+ }
46
+
47
+ protected function _getSelectedColumns() {
48
+ if ('month' == $this->_period) {
49
+ $this->_periodFormat = 'DATE_FORMAT('.$this->_tablealias.'.created_at, \'%Y-%m\')';
50
+ } elseif ('quarter' == $this->_period) {
51
+ $this->_periodFormat = 'CONCAT(YEAR('.$this->_tablealias.'.created_at), \', Quarter\', QUARTER(created_at))'; //'DATE_FORMAT(created_at, \'%Y-Quarter %q \')';
52
+ } else {
53
+ $this->_periodFormat = 'DATE_FORMAT('.$this->_tablealias.'.created_at, \'%Y- Week %u\')';
54
+ }
55
+
56
+ $this->_selectedColumns = array(
57
+ 'created_at' => $this->_periodFormat,
58
+ 'seller_name' => $this->_tablealias.'.seller_id',
59
+ 'total_item_count' => 'SUM('.$this->_tablealias.'.qty_ordered)',
60
+ 'total_income_amount' => 'IFNULL(SUM(('.$this->_tablealias.'.base_row_total)), 0)',
61
+ 'base_total_invoiced' => 'IFNULL(SUM('.$this->_tablealias.'.base_row_invoiced),0)',
62
+ 'base_total_refunded' => 'IFNULL(SUM('.$this->_tablealias.'.base_amount_refunded),0)',
63
+ //'base_shipping_amount' => 'IFNULL(SUM(base_shipping_amount),0)',
64
+ 'discount_amount' => 'IFNULL(SUM('.$this->_tablealias.'.base_discount_amount),0)',
65
+ //'base_total_canceled' => 'IFNULL(SUM(base_total_canceled),0)'
66
+ );
67
+
68
+ return $this->_selectedColumns;
69
+ }
70
+
71
+ /**
72
+ * Add selected data
73
+ *
74
+ * @return TM_Report_Model_Mysql4_Report_Order_Collection
75
+ */
76
+ protected function _initSelect() {
77
+ $this->getSelect()->from(array($this->_tablealias => $this->getResource()->getMainTable()), $this->_getSelectedColumns());
78
+ if (!$this->isTotals()) {
79
+ $this->getSelect()->group($this->_tablealias.'.seller_id')->group($this->_periodFormat);
80
+ }
81
+ return $this;
82
+ }
83
+
84
+ /**
85
+ * Set marketplace user id
86
+ *
87
+ * @param $marketplaceUser
88
+ * @return TM_Report_Model_Mysql4_Report_Order_Collection
89
+ */
90
+ public function setMarketplaceUser($marketplaceUser) {
91
+ $this->_marketplaceuser = $marketplaceUser;
92
+ return $this;
93
+ }
94
+
95
+ /**
96
+ * Set array of columns that should be aggregated
97
+ *
98
+ * @param array $columns
99
+ * @return TM_Report_Model_Mysql4_Report_Order_Collection
100
+ */
101
+ public function setAggregatedColumns(array $columns) {
102
+ $this->_aggregatedColumns = $columns;
103
+ return $this;
104
+ }
105
+
106
+ /**
107
+ * Retrieve array of columns that should be aggregated
108
+ *
109
+ * @return array
110
+ */
111
+ public function getAggregatedColumns() {
112
+ return $this->_aggregatedColumns;
113
+ }
114
+
115
+ /**
116
+ * Set date range
117
+ *
118
+ * @param mixed $from
119
+ * @param mixed $to
120
+ * @return TM_Report_Model_Mysql4_Report_Order_Collection
121
+ */
122
+ public function setDateRange($from = null, $to = null) {
123
+ $this->_from = $from;
124
+ $this->_to = $to;
125
+ return $this;
126
+ }
127
+
128
+ /**
129
+ * Set period
130
+ *
131
+ * @param string $period
132
+ * @return TM_Report_Model_Mysql4_Report_Order_Collection
133
+ */
134
+ public function setPeriod($period) {
135
+ $this->_period = $period;
136
+ return $this;
137
+ }
138
+
139
+ /**
140
+ * Apply date range filter
141
+ *
142
+ * @return TM_Report_Model_Mysql4_Report_Order_Collection
143
+ */
144
+ protected function _applyDateRangeFilter() {
145
+ if (!is_null($this->_from)) {
146
+ $this->_from = date('Y-m-d G:i:s', strtotime($this->_from));
147
+ $this->getSelect()->where($this->_tablealias.'.created_at >= ?', $this->_from);
148
+ }
149
+ if (!is_null($this->_to)) {
150
+ $this->_to = date('Y-m-d G:i:s', strtotime($this->_to));
151
+ }
152
+ $this->getSelect()->where($this->_tablealias.'.created_at <= ?', $this->_to);
153
+ return $this;
154
+ }
155
+
156
+ /**
157
+ * Set store ids
158
+ *
159
+ * @param mixed $storeIds (null, int|string, array, array may contain null)
160
+ * @return TM_Report_Model_Mysql4_Report_Order_Collection
161
+ */
162
+ public function addStoreFilter($storeIds) {
163
+ $this->_storesIds = $storeIds;
164
+ return $this;
165
+ }
166
+
167
+ /**
168
+ * Apply stores filter to select object
169
+ *
170
+ * @param Zend_Db_Select $select
171
+ * @return TM_Report_Model_Mysql4_Report_Order_Collection
172
+ */
173
+ protected function _applyStoresFilterToSelect(Zend_Db_Select $select) {
174
+ $nullCheck = false;
175
+ $storeIds = $this->_storesIds;
176
+
177
+ if (!is_array($storeIds)) {
178
+ $storeIds = array($storeIds);
179
+ }
180
+
181
+ $storeIds = array_unique($storeIds);
182
+
183
+ if ($index = array_search(null, $storeIds)) {
184
+ unset($storeIds[$index]);
185
+ $nullCheck = true;
186
+ }
187
+
188
+ $storeIds[0] = ($storeIds[0] == '') ? 0 : $storeIds[0];
189
+
190
+ if ($nullCheck) {
191
+ $select->where('store_id IN(?) OR store_id IS NULL', $storeIds);
192
+ } else {
193
+ $select->where('store_id IN(?)', $storeIds);
194
+ }
195
+
196
+ return $this;
197
+ }
198
+
199
+ /**
200
+ * Apply stores filter
201
+ *
202
+ * @return TM_Report_Model_Mysql4_Report_Order_Collection
203
+ */
204
+ protected function _applyStoresFilter() {
205
+ return $this->_applyStoresFilterToSelect($this->getSelect());
206
+ }
207
+
208
+ /**
209
+ * Set status filter
210
+ *
211
+ * @param string|array $state
212
+ * @return TM_Report_Model_Mysql4_Report_Order_Collection
213
+ */
214
+ public function addOrderStatusFilter($orderStatus) {
215
+ $this->_orderStatus = $orderStatus;
216
+ return $this;
217
+ }
218
+
219
+ /**
220
+ * Apply order status filter
221
+ *
222
+ * @return TM_Report_Model_Mysql4_Report_Order_Collection
223
+ */
224
+ protected function _applyOrderStatusFilter() {
225
+ if (is_null($this->_orderStatus)) {
226
+ return $this;
227
+ }
228
+ $orderStatus = $this->_orderStatus;
229
+ if (!is_array($orderStatus)) {
230
+ $orderStatus = array($orderStatus);
231
+ }
232
+ $this->getSelect()->join(array('sfo' =>'sales_flat_order'), $this->_tablealias.'.order_id = sfo.entity_id', array('sfo.entity_id','sfo.status'));
233
+ $this->getSelect()->where('sfo.status IN(?)', $orderStatus);
234
+ return $this;
235
+ }
236
+
237
+ /**
238
+ * Set apply filters flag
239
+ *
240
+ * @param boolean $flag
241
+ * @return TM_Report_Model_Mysql4_Report_Order_Collection
242
+ */
243
+ public function setApplyFilters($flag) {
244
+ $this->_applyFilters = $flag;
245
+ return $this;
246
+ }
247
+
248
+ /**
249
+ * Getter/Setter for isTotals
250
+ *
251
+ * @param null|boolean $flag
252
+ * @return boolean|TM_Report_Model_Mysql4_Report_Order_Collection
253
+ */
254
+ public function isTotals($flag = null) {
255
+ if (is_null($flag)) {
256
+ return $this->_isTotals;
257
+ }
258
+ $this->_isTotals = $flag;
259
+ return $this;
260
+ }
261
+
262
+ /**
263
+ * Getter/Setter for isSubTotals
264
+ *
265
+ * @param null|boolean $flag
266
+ * @return boolean|TM_Report_Model_Mysql4_Report_Order_Collection
267
+ */
268
+ public function isSubTotals($flag = null) {
269
+ if (is_null($flag)) {
270
+ return $this->_isSubTotals;
271
+ }
272
+ $this->_isSubTotals = $flag;
273
+ return $this;
274
+ }
275
+
276
+ /**
277
+ * Apply seller name filter
278
+ *
279
+ * @return TM_Report_Model_Mysql4_Report_Order_Collection
280
+ */
281
+ protected function _applySellerNameFilter() {
282
+ if (!$this->_marketplaceuser) {
283
+ $this->getSelect()->where($this->_tablealias.'.seller_id > ?', 0);
284
+ } else {
285
+ $this->getSelect()->where($this->_tablealias.'.seller_id = ?', $this->_marketplaceuser);
286
+ }
287
+ return $this;
288
+ }
289
+
290
+ /**
291
+ * Load data
292
+ * Redeclare parent load method just for adding method _beforeLoad
293
+ *
294
+ * @return Varien_Data_Collection_Db
295
+ */
296
+ public function load($printQuery = false, $logQuery = false) {
297
+ if ($this->isLoaded()) {
298
+ return $this;
299
+ }
300
+ $this->_initSelect();
301
+ if ($this->_applyFilters) {
302
+ $this->_applyDateRangeFilter()
303
+ ->_applyOrderStatusFilter()
304
+ ->_applySellerNameFilter();
305
+ }
306
+ return parent::load($printQuery, $logQuery);
307
+ }
308
+ }
app/code/community/Cybage/Marketplace/Model/Resource/Question.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Resource_Question extends Mage_Core_Model_Resource_Db_Abstract
22
+ {
23
+ protected function _construct()
24
+ {
25
+ $this->_init('marketplace/question','entity_id');
26
+ }
27
+ }
app/code/community/Cybage/Marketplace/Model/Resource/Question/Collection.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Resource_Question_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
22
+ {
23
+ protected function _construct()
24
+ {
25
+ $this->_init('marketplace/question');
26
+ }
27
+ }
app/code/community/Cybage/Marketplace/Model/Resource/Reply.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Resource_Reply extends Mage_Core_Model_Resource_Db_Abstract
22
+ {
23
+ protected function _construct()
24
+ {
25
+ $this->_init('marketplace/reply','entity_id');
26
+ }
27
+ }
app/code/community/Cybage/Marketplace/Model/Resource/Reply/Collection.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Resource_Reply_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
22
+ {
23
+ protected function _construct()
24
+ {
25
+ $this->_init('marketplace/reply');
26
+ }
27
+ }
app/code/community/Cybage/Marketplace/Model/Seller/Attribute/Source/Product/State.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Seller_Attribute_Source_Product_State extends Cybage_Marketplace_Model_System_Config_Source_Product_State
22
+ {
23
+ /**
24
+ * Get value from the store configuration settings
25
+ */
26
+ const ENABLE_USE_CONFIG = 0;
27
+
28
+ /**
29
+ * Retrieve all attribute options with Use config
30
+ *
31
+ * @return array
32
+ */
33
+ public function toOptionArray()
34
+ {
35
+ $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'marketplace_state');
36
+ $optionArray = array();
37
+ foreach ($attribute->getSource()->getAllOptions(true, true) as $option) {
38
+ $optionArray[] = array(
39
+ 'value' => $option['value'],
40
+ 'label' => $option['label']
41
+ );
42
+ }
43
+
44
+ $optionArray[] = array(
45
+ 'value' => self::ENABLE_USE_CONFIG,
46
+ 'label' => Mage::helper('marketplace')->__('Use config')
47
+ );
48
+ return $optionArray;
49
+ }
50
+ }
app/code/community/Cybage/Marketplace/Model/Seller/Attribute/Source/Product/Status.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Seller_Attribute_Source_Product_Status extends Cybage_Marketplace_Model_System_Config_Source_Product_Status
22
+ {
23
+ /**
24
+ * Get value from the store configuration settings
25
+ */
26
+ const ENABLE_USE_CONFIG = 0;
27
+
28
+ /**
29
+ * Retrieve all attribute options with Use config
30
+ *
31
+ * @return array
32
+ */
33
+ public function toOptionArray()
34
+ {
35
+ $optionArray = array();
36
+ $optionArray = $this->getAllOptions();
37
+
38
+ $optionArray[] = array(
39
+ 'value' => self::ENABLE_USE_CONFIG,
40
+ 'label' => Mage::helper('marketplace')->__('Use config')
41
+ );
42
+ return $optionArray;
43
+ }
44
+ }
app/code/community/Cybage/Marketplace/Model/Selleroptions.php ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Selleroptions extends Mage_Core_Model_Abstract
22
+ {
23
+ public function getCommentCollction(){
24
+ $orderId = Mage::app()->getRequest()->getParam('order_id');
25
+ $_order = Mage::getModel('sales/order')->load($orderId);
26
+
27
+ $collection = Mage::getResourceModel('sales/order_status_history_collection')
28
+ ->addFieldToFilter('comment',array('neq'=>NULL))
29
+ ->setOrder('entity_id', 'desc')
30
+ ->addFieldToFilter('parent_id', $orderId)
31
+ ->load();
32
+
33
+ return $collection;
34
+ }
35
+
36
+ /*Calculate aggregate of seller ratings.*/
37
+ public function getSellerRatingsAggregate(){
38
+ $sellerName = urldecode(Mage::registry('seller_company'));
39
+ $seller = Mage::helper('marketplace')->getSellerInfo($sellerName);
40
+ $_sellerId = $seller['entity_id'];
41
+
42
+ $_avgRating = $_percent = $_prodCount = $_reviewCount = $optionCount= 0;
43
+ $_sellerReviewData = array();
44
+
45
+ $_productCollection = Mage::getResourceModel('catalog/product_collection')
46
+ ->addAttributeToSelect('entity_id')
47
+ ->addAttributeToFilter('seller_id',array('eq' => $_sellerId ));
48
+
49
+ $_prodCount = count($_productCollection);
50
+
51
+ foreach($_productCollection as $_product){
52
+ $_productId = $_product->getEntityId();
53
+
54
+ $_reviews = Mage::getModel('review/review')
55
+ ->getResourceCollection()
56
+ ->addStoreFilter(Mage::app()->getStore()->getId())
57
+ ->addEntityFilter('product', $_productId)
58
+ ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
59
+ ->setDateOrder()
60
+ ->addRateVotes();
61
+
62
+ $_reviewCount = $_reviewCount + count($_reviews);
63
+
64
+ if ($_reviewCount > 0) {
65
+ foreach ($_reviews->getItems() as $_review) {
66
+ foreach( $_review->getRatingVotes() as $_vote ) {
67
+ $optionCount++;
68
+ $_percent = $_percent + $_vote->getPercent();
69
+ }
70
+ }
71
+ }
72
+ }
73
+
74
+ $_avgRating = $_percent / $_prodCount;
75
+ $_avgRating = $_avgRating/$optionCount;
76
+ $_sellerReviewData['avgrating'] = $_avgRating;
77
+ $_sellerReviewData['reviewcount'] = $_reviewCount;
78
+ $_sellerReviewData['seller_id'] = $_sellerId;
79
+
80
+ return $_sellerReviewData;
81
+ }
82
+
83
+ public function getSellerAllRatingsAggregate($_sellerId) {
84
+ $_avgRating = $_percent = $_prodCount = $_reviewCount = $optionCount= 0;
85
+ $_sellerReviewData = array();
86
+
87
+ $_productCollection = Mage::getResourceModel('catalog/product_collection')
88
+ ->addAttributeToSelect('entity_id')
89
+ ->addAttributeToFilter('seller_id',array('eq' => $_sellerId ));
90
+
91
+ $_prodCount = count($_productCollection);
92
+
93
+ foreach($_productCollection as $_product){
94
+ $_productId = $_product->getEntityId();
95
+
96
+ $_reviews = Mage::getModel('review/review')
97
+ ->getResourceCollection()
98
+ ->addStoreFilter(Mage::app()->getStore()->getId())
99
+ ->addEntityFilter('product', $_productId)
100
+ ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
101
+ ->setDateOrder()
102
+ ->addRateVotes();
103
+
104
+ $_reviewCount = $_reviewCount + count($_reviews);
105
+
106
+ if ($_reviewCount > 0) {
107
+ foreach ($_reviews->getItems() as $_review) {
108
+ foreach( $_review->getRatingVotes() as $_vote ) {
109
+ $optionCount++;
110
+ $_percent = $_percent + $_vote->getPercent();
111
+ }
112
+ }
113
+ }
114
+ }
115
+
116
+ $_avgRating = $_percent / $_prodCount;
117
+ $_avgRating = $_avgRating/$optionCount;
118
+ $_sellerReviewData['avgrating'] = $_avgRating;
119
+ $_sellerReviewData['reviewcount'] = $_reviewCount;
120
+ $_sellerReviewData['seller_id'] = $_sellerId;
121
+
122
+ return $_sellerReviewData;
123
+ }
124
+
125
+ /*Get seller "approved" status id for filtering result set*/
126
+ public function getSellerApprovedStatusId(){
127
+ /*Get customer "status" attribute options*/
128
+ $options = Mage::getModel('eav/config')->getAttribute('customer', 'status')->getSource()->getAllOptions(); //get all options
129
+
130
+ $optionId = false;
131
+ foreach ($options as $option) {
132
+ if ($option['label'] == 'Approved'){
133
+ $optionId = $option['value'];
134
+ break;
135
+ }
136
+ }
137
+
138
+ return $optionId;
139
+ }
140
+ }
app/code/community/Cybage/Marketplace/Model/Session.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Session extends Mage_Core_Model_Session_Abstract
22
+ {
23
+ public function __construct() {
24
+ $this->init('marketplace');
25
+ }
26
+ }
app/code/community/Cybage/Marketplace/Model/Source/Option.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_Source_Option extends Mage_Eav_Model_Entity_Attribute_Source_Table
22
+ {
23
+ public function getAllOptions()
24
+ {
25
+ return $this->getOptionFromTable();
26
+ }
27
+
28
+ private function getOptionFromTable(){
29
+ // Get the seller name by seller id
30
+ $sellerCollection = Mage::getModel('customer/customer')
31
+ ->getCollection()
32
+ ->addAttributeToSelect('company_name')
33
+ ->addFieldToFilter('seller_subscriber', 1);
34
+
35
+ //Create option array for drop down
36
+ $sellerData = array();
37
+ $temp['value'] = 'entity_id';
38
+ $temp['label'] = 'company_name';
39
+
40
+ $sellerData[]['label'] = 'Please Select';
41
+ foreach ($sellerCollection as $item) {
42
+ //$sellerData[$item[$temp['value']]] = $item[$temp['label']];
43
+ $sellerData[] = array (
44
+ 'label' => $item[$temp['label']],
45
+ 'value' => $item[$temp['value']]
46
+ );
47
+ }
48
+
49
+ return $sellerData;
50
+ }
51
+ }
app/code/community/Cybage/Marketplace/Model/System/Config/Source/Product/State.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_System_Config_Source_Product_State
22
+ {
23
+ /**
24
+ * Retrieve all attribute options with Use config
25
+ *
26
+ * @return array
27
+ */
28
+ public function toOptionArray() {
29
+ $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'marketplace_state');
30
+ $optionArray = array();
31
+ foreach ($attribute->getSource()->getAllOptions(false) as $option) {
32
+ $optionArray[] = array(
33
+ 'value' => $option['value'],
34
+ 'label' => $option['label']
35
+ );
36
+ }
37
+
38
+ return $optionArray;
39
+ }
40
+ }
app/code/community/Cybage/Marketplace/Model/System/Config/Source/Product/Status.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_System_Config_Source_Product_Status extends Mage_Catalog_Model_Product_Status
22
+ {
23
+ /**
24
+ * Retrieve all attribute options with Use config
25
+ *
26
+ * @return array
27
+ */
28
+ public function toOptionArray() {
29
+
30
+ return $this->getAllOptions();
31
+ }
32
+ }
app/code/community/Cybage/Marketplace/Model/System/Config/Source/Product/Visibility.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Model_System_Config_Source_Product_Visibility extends Mage_Catalog_Model_Product_Visibility
22
+ {
23
+ public function toOptionArray()
24
+ {
25
+ return $this->getAllOptions();
26
+ }
27
+ }
app/code/community/Cybage/Marketplace/controllers/AccountController.php ADDED
@@ -0,0 +1,505 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ require_once 'Mage/Customer/controllers/AccountController.php';
22
+ class Cybage_Marketplace_AccountController extends Mage_Customer_AccountController
23
+ {
24
+ /**
25
+ * Create customer account action
26
+ */
27
+ public function createPostAction()
28
+ {
29
+ $session = $this->_getSession();
30
+ if ($session->isLoggedIn()) {
31
+ $this->_redirect('*/*/');
32
+ return;
33
+ }
34
+
35
+ $session->setEscapeMessages(true); // prevent XSS injection in user input
36
+ if ($this->getRequest()->isPost()) {
37
+ $errors = array();
38
+
39
+ if (!$customer = Mage::registry('current_customer')) {
40
+ $customer = Mage::getModel('customer/customer')->setId(null);
41
+ }
42
+
43
+ /* @var $customerForm Mage_Customer_Model_Form */
44
+ $customerForm = Mage::getModel('customer/form');
45
+ $customerForm->setFormCode('customer_account_create')
46
+ ->setEntity($customer);
47
+
48
+ $customerData = $customerForm->extractData($this->getRequest());
49
+
50
+ if ($this->getRequest()->getParam('is_subscribed', false)) {
51
+ $customer->setIsSubscribed(1);
52
+ }
53
+ /**
54
+ * Initialize customer group id
55
+ */
56
+ $customer->getGroupId();
57
+
58
+ if ($this->getRequest()->getPost('create_address')) {
59
+ /* @var $address Mage_Customer_Model_Address */
60
+ $address = Mage::getModel('customer/address');
61
+ /* @var $addressForm Mage_Customer_Model_Form */
62
+ $addressForm = Mage::getModel('customer/form');
63
+ $addressForm->setFormCode('customer_register_address')
64
+ ->setEntity($address);
65
+
66
+ $addressData = $addressForm->extractData($this->getRequest(), 'address', false);
67
+ $addressErrors = $addressForm->validateData($addressData);
68
+ if ($addressErrors === true) {
69
+ $address->setId(null)
70
+ ->setIsDefaultBilling($this->getRequest()->getParam('default_billing', false))
71
+ ->setIsDefaultShipping($this->getRequest()->getParam('default_shipping', false));
72
+ $addressForm->compactData($addressData);
73
+ $customer->addAddress($address);
74
+
75
+ $addressErrors = $address->validate();
76
+ if (is_array($addressErrors)) {
77
+ $errors = array_merge($errors, $addressErrors);
78
+ }
79
+ } else {
80
+ $errors = array_merge($errors, $addressErrors);
81
+ }
82
+ }
83
+
84
+ try {
85
+ $customerErrors = $customerForm->validateData($customerData);
86
+ if ($customerErrors !== true) {
87
+ $errors = array_merge($customerErrors, $errors);
88
+ } else {
89
+ $customerForm->compactData($customerData);
90
+ $customer->setPassword($this->getRequest()->getPost('password'));
91
+ $customer->setConfirmation($this->getRequest()->getPost('confirmation'));
92
+ if($this->getRequest()->getParam('check_seller_form'))
93
+ {
94
+ $validationFlag = 1;
95
+ }
96
+ else
97
+ {
98
+ $validationFlag = 0;
99
+ }
100
+ if($validationFlag == 1)
101
+ {
102
+ $customer->setData($this->getRequest()->getPost());
103
+ $customerErrors = Mage::getModel('marketplace/customer')->customValidate($customer);
104
+ }
105
+
106
+ $customerErrors = $customer->validate();
107
+ if (is_array($customerErrors)) {
108
+ $errors = array_merge($customerErrors, $errors);
109
+ }
110
+ }
111
+
112
+ $validationResult = count($errors) == 0;
113
+
114
+ if (true === $validationResult) {
115
+ $customer->save();
116
+
117
+ Mage::dispatchEvent('customer_register_success',
118
+ array('account_controller' => $this, 'customer' => $customer)
119
+ );
120
+
121
+ $validationFlag = 0;
122
+ // saving seller information
123
+ if($this->getRequest()->getParam('check_seller_form'))
124
+ {
125
+ $customerId = $customer->getEntityId();
126
+ /******************** company banner upload code ******************************** */
127
+ if (isset($_FILES['company_banner']['name']) && $_FILES['company_banner']['name'] != '')
128
+ {
129
+ $fileName = $_FILES['company_banner']['name'];
130
+ $fieldName = 'company_banner';
131
+
132
+ $companyBanner = $this->_uploadImage($fileName,$fieldName,$customerId);
133
+ $customer->setCompanyBanner($companyBanner);
134
+ }
135
+ /******************* end of company banner code ******************************** */
136
+
137
+ /******************** company logo upload code ******************************** */
138
+ if (isset($_FILES['company_logo']['name']) && $_FILES['company_logo']['name'] != '')
139
+ {
140
+ $fileName = $_FILES['company_logo']['name'];
141
+ $fieldName = 'company_logo';
142
+ $companyLogo = $this->_uploadImage($fileName,$fieldName,$customerId);
143
+ $customer->setCompanyLogo($companyLogo);
144
+ }
145
+ /******************* end of company logo code ******************************** */
146
+
147
+ $customer->setCompanyLocality($this->getRequest()->getPost('company_locality'));
148
+ $customer->setCompanyName($this->getRequest()->getPost('company_name'));
149
+ $customer->setCompanyDescription($this->getRequest()->getPost('company_description'));
150
+ $customer->setSellerSubscriber(1);
151
+
152
+ // Auto approval of seller check
153
+ if (Mage::getStoreConfig('marketplace/marketplace/auto_approval_seller')) {
154
+ $customer->setStatus(Mage::getStoreConfig('marketplace/status/approved'));
155
+ } else {
156
+ $customer->setStatus(Mage::getStoreConfig('marketplace/status/pending'));
157
+ }
158
+
159
+ $validationFlag = 1;
160
+ }
161
+ else
162
+ {
163
+ $customer->setSellerSubscriber(0);
164
+ }
165
+
166
+ if ($customer->isConfirmationRequired()) {
167
+ Mage::getModel('marketplace/customer')->sendNewAccountEmail(
168
+ 'confirmation',
169
+ $session->getBeforeAuthUrl(),
170
+ Mage::app()->getStore()->getId()
171
+ );
172
+ $session->addSuccess($this->__('Account confirmation is required. Please, check your email for the confirmation link. To resend the confirmation email please <a href="%s">click here</a>.', Mage::helper('customer')->getEmailConfirmationUrl($customer->getEmail())));
173
+ $this->_redirectSuccess(Mage::getUrl('*/*/index', array('_secure'=>true)));
174
+ return;
175
+ } else {
176
+ $session->setCustomerAsLoggedIn($customer);
177
+ $url = $this->_welcomeCustomer($customer);
178
+ $this->_redirectSuccess($url);
179
+ return;
180
+ }
181
+ } else {
182
+ $session->setCustomerFormData($this->getRequest()->getPost());
183
+ if (is_array($errors)) {
184
+ foreach ($errors as $errorMessage) {
185
+ $session->addError($errorMessage);
186
+ }
187
+ } else {
188
+ $session->addError($this->__('Invalid customer data'));
189
+ }
190
+ }
191
+ } catch (Mage_Core_Exception $e) {
192
+ $session->setCustomerFormData($this->getRequest()->getPost());
193
+ if ($e->getCode() === Mage_Customer_Model_Customer::EXCEPTION_EMAIL_EXISTS) {
194
+ $url = Mage::getUrl('customer/account/forgotpassword');
195
+ $message = $this->__('There is already an account with this email address. If you are sure that it is your email address, <a href="%s">click here</a> to get your password and access your account.', $url);
196
+ $session->setEscapeMessages(false);
197
+ } else {
198
+ $message = $e->getMessage();
199
+ }
200
+ $session->addError($message);
201
+ } catch (Exception $e) {
202
+ $session->setCustomerFormData($this->getRequest()->getPost())
203
+ ->addException($e, $this->__('Cannot save the customer.'));
204
+ }
205
+ }
206
+
207
+ $this->_redirectError(Mage::getUrl('*/*/create', array('_secure' => true)));
208
+ }
209
+
210
+ /**
211
+ * Image upload method
212
+ *
213
+ */
214
+ protected function _uploadImage($fileName,$fieldName,$customerId)
215
+ {
216
+ try
217
+ {
218
+ /* Starting upload */
219
+
220
+ $uploader = new Varien_File_Uploader($fieldName);
221
+ // Any extention would work
222
+ $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
223
+ $uploader->setAllowRenameFiles(true);
224
+ $uploader->setFilesDispersion(false);
225
+ $checkPath = Mage::getBaseDir() . DS . 'media' . DS . 'marketplace/'.$customerId;
226
+ $createPath = Mage::getBaseDir() . DS . 'media';
227
+ if(!file_exists($checkPath))
228
+ {
229
+ mkdir($createPath ."/" . "marketplace/".$customerId, 0777);
230
+ }
231
+
232
+ // We set media as the upload dir
233
+ $path = Mage::getBaseDir() . DS . 'media' . DS . 'marketplace/'.$customerId;
234
+ $result = $uploader->save($path,$fileName);
235
+ } catch (Exception $e)
236
+ {
237
+ $this->_getSession()->setCustomerFormData($this->getRequest()->getPost())
238
+ ->addException($e, $this->__('Cannot save the image. Please check the owner and folder permission.'));
239
+ }
240
+
241
+ //this way the name is saved in DB
242
+ $companyBanner = 'marketplace/'.$customerId.'/'.$result['file'];
243
+ if($fieldName == 'company_banner')
244
+ {
245
+ $width = Mage::getStoreConfig('marketplace/marketplace/default_width',Mage::app()->getStore());
246
+ $height = Mage::getStoreConfig('marketplace/marketplace/default_height',Mage::app()->getStore());
247
+ //$resizedURL = $this->_getresizeImg($fileName, $width, $height, $path, $customerId);
248
+ //return $resizedURL;
249
+ }
250
+ else if($fieldName == 'company_logo')
251
+ {
252
+ $width = Mage::getStoreConfig('marketplace/marketplace/default_logo_width',Mage::app()->getStore());
253
+ $height = Mage::getStoreConfig('marketplace/marketplace/default_logo_width',Mage::app()->getStore());
254
+
255
+ }
256
+
257
+ $resizedURL = $this->_getresizeImg($fileName, $width, $height, $path, $customerId);
258
+ return $resizedURL;
259
+ }
260
+
261
+ /**
262
+ * Image resize code (700 X 100).
263
+ */
264
+ protected function _getresizeImg($fileName, $width, $height, $path, $sid)
265
+ {
266
+ $folderURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA). DS . 'marketplace/'.$sid;
267
+ $imageURL = $folderURL .'/'. $fileName;
268
+
269
+ $basePath = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA). DS . 'marketplace/'.$sid.'/'.$fileName;
270
+ $newPath = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA). DS . 'marketplace/'.$sid.'/'.$fileName;
271
+ //if width empty then return original size image's URL
272
+ if ($width != '')
273
+ {
274
+ //if image has already resized then just return URL
275
+ if (file_exists($basePath) && is_file($basePath)) {
276
+ $imageObj = new Varien_Image($basePath);
277
+ $imageObj->constrainOnly(TRUE);
278
+ $imageObj->keepAspectRatio(FALSE);
279
+ $imageObj->keepFrame(FALSE);
280
+ $imageObj->resize($width, $height);
281
+ $imageObj->save($newPath);
282
+ }
283
+ $resizedURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA). 'marketplace/'.$sid.'/'.$fileName;
284
+ } else {
285
+ $resizedURL = $imageURL;
286
+ }
287
+
288
+ return $resizedURL;
289
+ }
290
+
291
+ public function editPostAction()
292
+ {
293
+ if (!$this->_validateFormKey()) {
294
+ return $this->_redirect('*/*/edit');
295
+ }
296
+
297
+ if ($this->getRequest()->isPost()) {
298
+ /** @var $customer Mage_Customer_Model_Customer */
299
+ $customer = $this->_getSession()->getCustomer();
300
+
301
+ /** @var $customerForm Mage_Customer_Model_Form */
302
+ $customerForm = Mage::getModel('customer/form');
303
+ $customerForm->setFormCode('customer_account_edit')
304
+ ->setEntity($customer);
305
+
306
+ $customerData = $customerForm->extractData($this->getRequest());
307
+
308
+ $errors = array();
309
+ $customerErrors = $customerForm->validateData($customerData);
310
+ if ($customerErrors !== true) {
311
+ $errors = array_merge($customerErrors, $errors);
312
+ } else {
313
+ $customerForm->compactData($customerData);
314
+ $errors = array();
315
+
316
+ // If password change was requested then add it to common validation scheme
317
+ if ($this->getRequest()->getParam('change_password')) {
318
+ $currPass = $this->getRequest()->getPost('current_password');
319
+ $newPass = $this->getRequest()->getPost('password');
320
+ $confPass = $this->getRequest()->getPost('confirmation');
321
+
322
+ $oldPass = $this->_getSession()->getCustomer()->getPasswordHash();
323
+ if (Mage::helper('core/string')->strpos($oldPass, ':')) {
324
+ list($_salt, $salt) = explode(':', $oldPass);
325
+ } else {
326
+ $salt = false;
327
+ }
328
+
329
+ if ($customer->hashPassword($currPass, $salt) == $oldPass) {
330
+ if (strlen($newPass)) {
331
+ /**
332
+ * Set entered password and its confirmation - they
333
+ * will be validated later to match each other and be of right length
334
+ */
335
+ $customer->setPassword($newPass);
336
+ $customer->setConfirmation($confPass);
337
+ } else {
338
+ $errors[] = $this->__('New password field cannot be empty.');
339
+ }
340
+ } else {
341
+ $errors[] = $this->__('Invalid current password');
342
+ }
343
+ }
344
+ $validationFlag = 0;
345
+
346
+ // saving seller information
347
+ if($this->getRequest()->getParam('check_seller_form'))
348
+ {
349
+ $customerId = Mage::getSingleton('customer/session')->getId();
350
+
351
+ /******************** company banner upload code ******************************** */
352
+ if (isset($_FILES['company_banner']['name']) && $_FILES['company_banner']['name'] != '')
353
+ {
354
+ $dimensions = getimagesize($_FILES["company_banner"]["tmp_name"]);
355
+ $width = Mage::getStoreConfig('marketplace/marketplace/default_width');
356
+ $height = Mage::getStoreConfig('marketplace/marketplace/default_height');
357
+
358
+ if(is_array($dimensions) && !empty($dimensions))
359
+ {
360
+ /**if($dimensions[0] > $width || $dimensions[1] > $height)
361
+ {
362
+ $errors[] = $this->__('Please upload company banner within specified dimensions.');
363
+ }
364
+ else**/
365
+ {
366
+ $fileName = $_FILES['company_banner']['name'];
367
+ $fieldName = 'company_banner';
368
+ $companyBanner = $this->_uploadImage($fileName,$fieldName,$customerId);
369
+ $customer->setCompanyBanner($companyBanner);
370
+ }
371
+ }
372
+ else
373
+ {
374
+ $errors[] = $this->__('Please upload valid file for company banner.');
375
+ }
376
+ }
377
+ /******************* end of company banner code ******************************** */
378
+
379
+ /******************** company logo upload code ******************************** */
380
+ if (isset($_FILES['company_logo']['name']) && $_FILES['company_logo']['name'] != '')
381
+ {
382
+ $dimensions = getimagesize($_FILES["company_logo"]["tmp_name"]);
383
+ $width = Mage::getStoreConfig('marketplace/marketplace/default_logo_width');
384
+ $height = Mage::getStoreConfig('marketplace/marketplace/default_logo_height');
385
+
386
+ if(is_array($dimensions) && !empty($dimensions))
387
+ {
388
+ /**if($dimensions[0] > $width || $dimensions[1] > $height)
389
+ {
390
+ $errors[] = $this->__('Please upload company logo within specified dimensions.');
391
+ }
392
+ else**/
393
+ {
394
+ $fileName = $_FILES['company_logo']['name'];
395
+ $fieldName = 'company_logo';
396
+ $companyLogo = $this->_uploadImage($fileName,$fieldName,$customerId);
397
+ $customer->setCompanyLogo($companyLogo);
398
+ }
399
+ }
400
+ else
401
+ {
402
+ $errors[] = $this->__('Please upload valid file for company logo.');
403
+ }
404
+ }
405
+ /******************* end of company logo code ******************************** */
406
+
407
+ $customer->setCompanyLocality($this->getRequest()->getPost('company_locality'));
408
+ $customer->setCompanyName($this->getRequest()->getPost('company_name'));
409
+ $customer->setCompanyDescription($this->getRequest()->getPost('company_description'));
410
+ $customer->setSellerSubscriber(1);
411
+
412
+ // Auto approval of seller check
413
+ if (Mage::getStoreConfig('marketplace/marketplace/auto_approval_seller')) {
414
+ $customer->setStatus(Mage::getStoreConfig('marketplace/status/approved'));
415
+ } else {
416
+ $customer->setStatus(Mage::getStoreConfig('marketplace/status/pending'));
417
+ }
418
+
419
+ $validationFlag = 1;
420
+ $sellerSubscriber = $this->getRequest()->getPost('is_seller_subscribe');
421
+ if(empty($sellerSubscriber))
422
+ {
423
+ $url = $this->_welcomeCustomer($customer);
424
+ }
425
+ }
426
+ else
427
+ {
428
+ $sellerSubscriber = $this->getRequest()->getPost('is_seller_subscribe');
429
+ if(empty($sellerSubscriber))
430
+ {
431
+ $customer->setSellerSubscriber(0);
432
+ }
433
+ }
434
+
435
+ // Validate account and compose list of errors if any
436
+ if($validationFlag == 1)
437
+ {
438
+ $customerErrors = Mage::getModel('marketplace/customer')->customValidate($customer);
439
+ }
440
+ else
441
+ {
442
+ $customerErrors = $customer->validate();
443
+ }
444
+
445
+ if (is_array($customerErrors)) {
446
+ $errors = array_merge($errors, $customerErrors);
447
+ }
448
+ }
449
+
450
+ if (!empty($errors)) {
451
+ $this->_getSession()->setCustomerFormData($this->getRequest()->getPost());
452
+ foreach ($errors as $message) {
453
+ $this->_getSession()->addError($message);
454
+ }
455
+ $this->_redirect('*/*/edit');
456
+ return $this;
457
+ }
458
+
459
+ try {
460
+ $customer->setConfirmation(null);
461
+ $customer->save();
462
+ $this->_getSession()->setCustomer($customer)
463
+ ->addSuccess($this->__('The account information has been saved.'));
464
+
465
+ $this->_redirect('customer/account');
466
+ return;
467
+ } catch (Mage_Core_Exception $e) {
468
+ $this->_getSession()->setCustomerFormData($this->getRequest()->getPost())
469
+ ->addError($e->getMessage());
470
+ } catch (Exception $e) {
471
+ $this->_getSession()->setCustomerFormData($this->getRequest()->getPost())
472
+ ->addException($e, $this->__('Cannot save the customer.'));
473
+ }
474
+ }
475
+
476
+ $this->_redirect('*/*/edit');
477
+ }
478
+
479
+ public function marketplaceOrdersAction()
480
+ {
481
+ $this->loadLayout();
482
+ $this->renderLayout();
483
+ }
484
+
485
+ public function viewOrderAction(){
486
+ $this->_validateCustomerLogin();
487
+ $this->loadLayout();
488
+ $this->renderLayout();
489
+ }
490
+
491
+ /**
492
+ * validate Customer Login and redirect previous page
493
+ * */
494
+ protected function _validateCustomerLogin() {
495
+ $session = Mage::getSingleton('customer/session');
496
+ if (!$session->isLoggedIn()) {
497
+ $session->setAfterAuthUrl(Mage::helper('core/url')->getCurrentUrl());
498
+ $session->setBeforeAuthUrl(Mage::helper('core/url')->getCurrentUrl());
499
+ $this->_redirect('customer/account/login/');
500
+ return $this;
501
+ }elseif(!Mage::helper('marketplace')->isMarketplaceActiveSellar()){
502
+ $this->_redirect('customer/account/');
503
+ }
504
+ }
505
+ }
app/code/community/Cybage/Marketplace/controllers/Adminhtml/Catalog/ProductController.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ require_once 'Mage/Adminhtml/controllers/Catalog/ProductController.php';
22
+ class Cybage_Marketplace_Adminhtml_Catalog_ProductController extends Mage_Adminhtml_Catalog_ProductController
23
+ {
24
+ /**
25
+ * Update product(s) status and state action
26
+ *
27
+ */
28
+ public function massStatusandstateAction()
29
+ {
30
+ $productIds = (array)$this->getRequest()->getParam('product');
31
+ $storeId = (int)$this->getRequest()->getParam('store', 0);
32
+ $status = (int)$this->getRequest()->getParam('statusandstate');
33
+
34
+ try {
35
+ $this->_validateMassStatus($productIds, $status);
36
+ Mage::getSingleton('catalog/product_action')
37
+ ->updateAttributes($productIds, array('status' => $status, 'marketplace_state' => Mage::helper('marketplace')->getProductApprovedStatusId()), $storeId);
38
+
39
+ $this->_getSession()->addSuccess(
40
+ $this->__('Total of %d record(s) have been updated.', count($productIds))
41
+ );
42
+ }
43
+ catch (Mage_Core_Model_Exception $e) {
44
+ $this->_getSession()->addError($e->getMessage());
45
+ } catch (Mage_Core_Exception $e) {
46
+ $this->_getSession()->addError($e->getMessage());
47
+ } catch (Exception $e) {
48
+ $this->_getSession()
49
+ ->addException($e, $this->__('An error occurred while updating the product(s) status.'));
50
+ }
51
+
52
+ $this->_redirect('*/*/', array('store'=> $storeId));
53
+ }
54
+
55
+ /**
56
+ * Validate batch of products before theirs status will be set
57
+ *
58
+ * @throws Mage_Core_Exception
59
+ * @param array $productIds
60
+ * @param int $status
61
+ * @return void
62
+ */
63
+ public function _validateMassStatus(array $productIds, $status)
64
+ {
65
+ if ($status == Mage_Catalog_Model_Product_Status::STATUS_ENABLED) {
66
+ if (!Mage::getModel('catalog/product')->isProductsHasSku($productIds)) {
67
+ throw new Mage_Core_Exception(
68
+ $this->__('Some of the processed products have no SKU value defined. Please fill it prior to performing operations on these products.')
69
+ );
70
+ }
71
+ }
72
+ }
73
+ }
app/code/community/Cybage/Marketplace/controllers/Adminhtml/CommissionController.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Adminhtml_CommissionController extends Mage_Adminhtml_Controller_Action
22
+ {
23
+ /**
24
+ * Init action breadcrumbs and active menu
25
+ */
26
+ protected function _initAction() {
27
+ $this->loadLayout()
28
+ ->_setActiveMenu('marketplace/commission')
29
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Manage Sellers Payment'), Mage::helper('adminhtml')->__('Manage Sellers Payment'));
30
+ return $this;
31
+ }
32
+
33
+ /**
34
+ * index action
35
+ */
36
+ public function indexAction() {
37
+ $this->loadLayout();
38
+ $this->renderLayout();
39
+ }
40
+
41
+ /**
42
+ * Commission grid action for AJAX request
43
+ */
44
+ public function gridAction()
45
+ {
46
+ $this->getResponse()->setBody(
47
+ $this->getLayout()->createBlock('marketplace/adminhtml_commission_grid')->toHtml()
48
+ );
49
+ }
50
+
51
+ /**
52
+ * Commission pay action
53
+ */
54
+ public function payAction()
55
+ {
56
+ $customerId = (int) $this->getRequest()->getParam('id');
57
+ $customer = Mage::getModel('customer/customer');
58
+
59
+ if ($customerId) {
60
+ $customer->load($customerId);
61
+ }
62
+
63
+ if ($customer->getId()) {
64
+ Mage::register('current_customer', $customer);
65
+ $this->loadLayout();
66
+
67
+ $this->_addContent($this->getLayout()->createBlock('marketplace/adminhtml_commission_edit'))
68
+ ->_addLeft($this->getLayout()->createBlock('marketplace/adminhtml_commission_edit_tabs'));
69
+
70
+ $this->renderLayout();
71
+ } else {
72
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('marketplace')->__('Seller does not exist'));
73
+ $this->_redirect('*/*/');
74
+ }
75
+ }
76
+
77
+ /**
78
+ * Commission save action
79
+ */
80
+ public function saveAction()
81
+ {
82
+ $data = $this->getRequest()->getPost();
83
+ if ($data) {
84
+ try {
85
+ if ($data['amount'] > 0) {
86
+ $actualdue = $data['amountrecived'] - $data['totalpayamount'];
87
+
88
+ if ($data['amount'] <= $actualdue) {
89
+ $commission = Mage::getModel('marketplace/commission');
90
+ $commission->setSellerId($data['seller_id']);
91
+ $commission->setAmount($data['amount']);
92
+
93
+ $commission->save();
94
+
95
+ Mage::getSingleton('adminhtml/session')->addSuccess(
96
+ Mage::helper('adminhtml')->__('Payment details added successfully.')
97
+ );
98
+ $this->sendTransactionalEmail(Mage::getModel('customer/customer')->load($data['seller_id']),$commission);
99
+ $this->_redirect('*/*/');
100
+ return;
101
+ } else {
102
+ Mage::getSingleton('adminhtml/session')->addError('Pay amount not exceed Amount recived.');
103
+ $this->_redirect('*/*/pay', array('id' => $this->getRequest()->getParam('id')));
104
+ return;
105
+ }
106
+ } else {
107
+ Mage::getSingleton('adminhtml/session')->addError('Please enter a number greater than 0 in Pay.');
108
+ $this->_redirect('*/*/pay', array('id' => $this->getRequest()->getParam('id')));
109
+ return;
110
+ }
111
+ } catch (Exception $e) {
112
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
113
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
114
+ $this->_redirect('*/*/pay', array('id' => $this->getRequest()->getParam('id')));
115
+ return;
116
+ }
117
+ }
118
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('marketplace')->__('Unable to find item to save'));
119
+ $this->_redirect('*/*/');
120
+ }
121
+
122
+ public function sendTransactionalEmail($customer,$commission)
123
+ {
124
+ // Transactional Email Template's ID
125
+ $templateId = Mage::getStoreConfig('marketplace/seller/email_payment_template');
126
+ // Set sender information
127
+ $senderName = Mage::getStoreConfig('trans_email/ident_support/name');
128
+ $senderEmail = Mage::getStoreConfig('trans_email/ident_support/email');
129
+ $sender = array('name' => $senderName,
130
+ 'email' => $senderEmail);
131
+ // Set recepient information
132
+ $recepientEmail = $customer->getEmail();
133
+ $recepientName = $customer->getName();
134
+ // Get Store ID
135
+ $store = Mage::app()->getStore()->getId();
136
+ // Set variables that can be used in email template
137
+ $vars = array('customer'=>$customer,
138
+ 'commission'=>$commission
139
+ );
140
+ $translate = Mage::getSingleton('core/translate');
141
+ // Send Transactional Email
142
+ Mage::getModel('core/email_template')
143
+ ->sendTransactional($templateId, $sender, $recepientEmail, $recepientName, $vars, $storeId);
144
+ $translate->setTranslateInline(true);
145
+ }
146
+
147
+ public function payhistoryAction() {
148
+ $this->loadLayout();
149
+ $this->renderLayout();
150
+ }
151
+ }
app/code/community/Cybage/Marketplace/controllers/Adminhtml/OrderbyController.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Adminhtml_OrderbyController extends Mage_Adminhtml_Controller_Action
22
+ {
23
+ /**
24
+ * Init action breadcrumbs and active menu
25
+ */
26
+ protected function _initAction() {
27
+ $this->loadLayout()
28
+ ->_setActiveMenu('marketplace/orderby')
29
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Orders By Each Seller'), Mage::helper('adminhtml')->__('Orders By Each Seller'));
30
+ return $this;
31
+ }
32
+
33
+ /**
34
+ * Reports of Order by each seller
35
+ */
36
+ public function indexAction() {
37
+ $this->_title($this->__('Reports'))->_title($this->__('Marketplace'))->_title($this->__('Orders By Each Seller'));
38
+ $this->_initAction()
39
+ ->_setActiveMenu('marketplace/orderby')
40
+ ->_addBreadcrumb(Mage::helper('marketplace')->__('Orders By Each Seller'), Mage::helper('marketplace')->__('Orders By Each Seller'));
41
+ $gridBlock = $this->getLayout()->getBlock('adminhtml_orderby.grid');
42
+ $filterFormBlock = $this->getLayout()->getBlock('grid.filter.form');
43
+ $this->_initReportAction(array(
44
+ $gridBlock,
45
+ $filterFormBlock
46
+ ));
47
+ $this->renderLayout();
48
+ }
49
+
50
+ /**
51
+ * init the report action for Reports of Order by each seller
52
+ */
53
+ public function _initReportAction($blocks) {
54
+ if (!is_array($blocks)) {
55
+ $blocks = array($blocks);
56
+ }
57
+ $requestData = Mage::helper('adminhtml')->prepareFilterString($this->getRequest()->getParam('filter'));
58
+ $requestData = $this->_filterDates($requestData, array('from', 'to'));
59
+ $params = new Varien_Object();
60
+ foreach ($requestData as $key => $value) {
61
+ if (!empty($value)) {
62
+ $params->setData($key, $value);
63
+ }
64
+ }
65
+ foreach ($blocks as $block) {
66
+ if ($block) {
67
+ $block->setPeriodType($params->getData('period_type'));
68
+ $block->setFilterData($params);
69
+ }
70
+ }
71
+ return $this;
72
+ }
73
+
74
+ public function exportOrderCsvAction() {
75
+ $fileName = 'order.csv';
76
+ $grid = $this->getLayout()->createBlock('marketplace/adminhtml_orderby_grid');
77
+ $this->_initReportAction($grid);
78
+ $this->_prepareDownloadResponse($fileName, $grid->getCsvFile($fileName));
79
+ }
80
+
81
+ public function exportOrderExcelAction() {
82
+ $fileName = 'order.xml';
83
+ $grid = $this->getLayout()->createBlock('marketplace/adminhtml_orderby_grid');
84
+ $this->_initReportAction($grid);
85
+ $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
86
+ }
87
+ }
app/code/community/Cybage/Marketplace/controllers/Adminhtml/SellerController.php ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_Adminhtml_SellerController extends Mage_Adminhtml_Controller_Action
22
+ {
23
+ /**
24
+ * Init action breadcrumbs and active menu
25
+ */
26
+ protected function _initAction() {
27
+ $this->loadLayout()
28
+ ->_setActiveMenu('marketplace/seller')
29
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Manage Sellers'), Mage::helper('adminhtml')->__('Manage Sellers'));
30
+ return $this;
31
+ }
32
+
33
+ /**
34
+ * index action
35
+ */
36
+ public function indexAction() {
37
+ $this->loadLayout();
38
+ $this->renderLayout();
39
+ }
40
+
41
+ /**
42
+ * seller grid action for AJAX request
43
+ */
44
+ public function gridAction()
45
+ {
46
+ $this->getResponse()->setBody(
47
+ $this->getLayout()->createBlock('marketplace/adminhtml_seller_grid')->toHtml()
48
+ );
49
+ }
50
+
51
+ /**
52
+ * Seller edit action
53
+ */
54
+ public function editAction()
55
+ {
56
+ $customerId = (int) $this->getRequest()->getParam('id');
57
+ $customer = Mage::getModel('customer/customer');
58
+
59
+ if ($customerId) {
60
+ $customer->load($customerId);
61
+ }
62
+
63
+ if ($customer->getId()) {
64
+ Mage::register('current_customer', $customer);
65
+ $this->loadLayout();
66
+
67
+ $this->_addContent($this->getLayout()->createBlock('marketplace/adminhtml_seller_edit'))
68
+ ->_addLeft($this->getLayout()->createBlock('marketplace/adminhtml_seller_edit_tabs'));
69
+
70
+ $this->renderLayout();
71
+ } else {
72
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('marketplace')->__('Seller does not exist'));
73
+ $this->_redirect('*/*/');
74
+ }
75
+ }
76
+
77
+ /**
78
+ * Seller save action
79
+ */
80
+ public function saveAction()
81
+ {
82
+ $data = $this->getRequest()->getPost();
83
+ if ($data) {
84
+ try {
85
+ $customer = Mage::getModel('customer/customer')->load($data['seller_id']);
86
+
87
+ $customer->setSellerCommission($data['seller_commission']);
88
+ $customer->setSellerProductState($data['seller_product_state']);
89
+ $customer->setSellerProductStatus($data['seller_product_status']);
90
+ $customer->setStatus($data['status']);
91
+ $customer->save();
92
+ Mage::getSingleton('adminhtml/session')->addSuccess(
93
+ Mage::helper('adminhtml')->__('Seller details successfully updated.')
94
+ );
95
+
96
+ $this->sendTransactionalEmail($customer);
97
+ if ($this->getRequest()->getParam('back')) {
98
+ $this->_redirect('*/*/edit', array('id' => $customer->getId()));
99
+ return;
100
+ }
101
+ $this->_redirect('*/*/');
102
+ return;
103
+ } catch (Exception $e) {
104
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
105
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
106
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
107
+ return;
108
+ }
109
+ }
110
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('marketplace')->__('Unable to find item to save'));
111
+ $this->_redirect('*/*/');
112
+ }
113
+
114
+ public function sendTransactionalEmail($customer)
115
+ {
116
+ // Transactional Email Template's ID
117
+ $templateId = Mage::getStoreConfig('marketplace/seller/email_status_template');
118
+ // Set sender information
119
+ $senderName = Mage::getStoreConfig('trans_email/ident_support/name');
120
+ $senderEmail = Mage::getStoreConfig('trans_email/ident_support/email');
121
+ $sender = array('name' => $senderName,
122
+ 'email' => $senderEmail);
123
+ // Set recepient information
124
+ $recepientEmail = $customer->getEmail();
125
+ $recepientName = $customer->getName();
126
+ // Get Store ID
127
+ $store = Mage::app()->getStore()->getId();
128
+ $statusCode = $customer->getStatus();
129
+ $sellerStatus = Mage::getModel('marketplace/customatributestatus')->toOptionArray();
130
+ $status = $sellerStatus[$statusCode];
131
+ // Set variables that can be used in email template
132
+ $vars = array(
133
+ 'customer'=>$customer,
134
+ 'status'=>$status
135
+ );
136
+ $translate = Mage::getSingleton('core/translate');
137
+ // Send Transactional Email
138
+ Mage::getModel('core/email_template')
139
+ ->sendTransactional($templateId, $sender, $recepientEmail, $recepientName, $vars, $storeId);
140
+ $translate->setTranslateInline(true);
141
+ }
142
+
143
+ /**
144
+ * mass delete action
145
+ */
146
+ public function massDeleteAction() {
147
+ $sellerIds = $this->getRequest()->getParam('id');
148
+
149
+ if (!is_array($sellerIds)) {
150
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select seller(s)'));
151
+ } else {
152
+ try {
153
+ $deleted = Mage::getStoreConfig('marketplace/status/deleted');
154
+ foreach ($sellerIds as $sellerId) {
155
+ $seller = Mage::getModel('customer/customer')->load($sellerId);
156
+ $seller->setStatus($deleted);
157
+ $seller->save();
158
+ $this->sendTransactionalEmail($seller);
159
+ }
160
+
161
+ Mage::getSingleton('adminhtml/session')->addSuccess(
162
+ Mage::helper('adminhtml')->__(
163
+ 'Total of %d record(s) were successfully deleted.', count($sellerIds)
164
+ )
165
+ );
166
+ } catch (Exception $e) {
167
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
168
+ }
169
+ }
170
+ $this->_redirect('*/*/index');
171
+ }
172
+
173
+ /**
174
+ * mass approve action
175
+ */
176
+ public function massApproveAction() {
177
+ $sellerIds = $this->getRequest()->getParam('id');
178
+
179
+ if (!is_array($sellerIds)) {
180
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select seller(s)'));
181
+ } else {
182
+ try {
183
+ $approved = Mage::getStoreConfig('marketplace/status/approved');
184
+ foreach ($sellerIds as $sellerId) {
185
+ $seller = Mage::getModel('customer/customer')->load($sellerId);
186
+ $seller->setStatus($approved);
187
+ $seller->save();
188
+ $this->sendTransactionalEmail($seller);
189
+ }
190
+
191
+ Mage::getSingleton('adminhtml/session')->addSuccess(
192
+ Mage::helper('adminhtml')->__(
193
+ 'Total of %d record(s) were successfully approved.', count($sellerIds)
194
+ )
195
+ );
196
+ } catch (Exception $e) {
197
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
198
+ }
199
+ }
200
+ $this->_redirect('*/*/index');
201
+ }
202
+
203
+ /**
204
+ * mass reject action
205
+ */
206
+ public function massRejectAction() {
207
+ $sellerIds = $this->getRequest()->getParam('id');
208
+
209
+ if (!is_array($sellerIds)) {
210
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select seller(s)'));
211
+ } else {
212
+ try {
213
+ $rejected = Mage::getStoreConfig('marketplace/status/rejected');
214
+ foreach ($sellerIds as $sellerId) {
215
+ $seller = Mage::getModel('customer/customer')->load($sellerId);
216
+ $seller->setStatus($rejected);
217
+ $seller->save();
218
+ $this->sendTransactionalEmail($seller);
219
+ }
220
+
221
+ Mage::getSingleton('adminhtml/session')->addSuccess(
222
+ Mage::helper('adminhtml')->__(
223
+ 'Total of %d record(s) were successfully rejected.', count($sellerIds)
224
+ )
225
+ );
226
+ } catch (Exception $e) {
227
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
228
+ }
229
+ }
230
+ $this->_redirect('*/*/index');
231
+ }
232
+ }
app/code/community/Cybage/Marketplace/controllers/BuyersellerController.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_BuyersellerController extends Mage_Core_Controller_Front_Action
22
+ {
23
+ public function commentAction(){
24
+ $this->loadLayout();
25
+ $this->renderLayout();
26
+ }
27
+
28
+ public function saveAction() {
29
+ try {
30
+ Mage::getModel('marketplace/buyerseller')->saveComments();
31
+
32
+ Mage::getSingleton('core/session')->addSuccess($this->__('Question was successfully submitted!!'));
33
+ } catch (Exception $e) {
34
+ Mage::getSingleton('core/session')->addError($this->__('Question was not submitted, Please Try After Some Time.'.$e));
35
+ }
36
+ $block = $this->getLayout()->createBlock('core/messages', 'global_messages');
37
+ $html = $block->toHtml();
38
+ $this->getResponse()->setBody($html);
39
+
40
+ }
41
+
42
+ public function replyQuestionAction() {
43
+
44
+ try {
45
+ Mage::getModel('marketplace/buyerseller')->replyComments();
46
+ Mage::getSingleton('core/session')->addSuccess($this->__('Question was successfully submitted!!'));
47
+ return $this->_redirect('marketplace/order/history/');
48
+
49
+ } catch (Exception $e) {
50
+ Mage::getSingleton('core/session')->addError($this->__('Question was not submitted, Please Try After Some Time. '.$e));
51
+ }
52
+ $block = $this->getLayout()->createBlock('core/messages', 'global_messages');
53
+ $html = $block->toHtml();
54
+ $this->getResponse()->setBody($html);
55
+
56
+ }
57
+
58
+ public function replyAction() {
59
+ $this->loadLayout();
60
+ $this->renderLayout();
61
+ }
62
+
63
+ public function notificationAction() {
64
+
65
+ $this->loadLayout();
66
+ $this->renderLayout();
67
+ }
68
+ }
app/code/community/Cybage/Marketplace/controllers/DashboardController.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_DashboardController extends Mage_Core_Controller_Front_Action
22
+ {
23
+ /**
24
+ * Add marketplace product
25
+ * */
26
+ public function indexAction() {
27
+ if(!Mage::helper('marketplace')->isMarketplaceActiveSellar()){
28
+ $this->_redirect('customer/account/');
29
+ } else {
30
+ $this->loadLayout();
31
+ $this->_initLayoutMessages('marketplace/session');
32
+ $this->renderLayout();
33
+ }
34
+ }
35
+ }
app/code/community/Cybage/Marketplace/controllers/OrderController.php ADDED
@@ -0,0 +1,421 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_OrderController extends Mage_Core_Controller_Front_Action
22
+ {
23
+ /**
24
+ * Add order comment action
25
+ */
26
+ public function addCommentAction() {
27
+ $data = $this->getRequest()->getPost();
28
+ if (!$data) {
29
+ $this->_redirect('marketplace/account/vieworder',$arguement=array('order_id' => $orderId));
30
+ }
31
+
32
+ try {
33
+ $error = array();
34
+ $orderId = $buyerName = $buyerEmail = $sellerEmail = $sellerName = '';
35
+ $orderId = $this->getRequest()->getParam('order_id');
36
+ $order = Mage::getModel('sales/order')->load($orderId);
37
+
38
+ if (empty($data['status']) ) {
39
+ $error['status'] = $this->__('Please select a status');
40
+ }
41
+
42
+ if(empty($error)) {
43
+ if($order->hasInvoices() || $data['status'] == 'cancelled') {
44
+ $notify = isset($data['is_customer_notified']) ? $data['is_customer_notified'] : false;
45
+ $order->addStatusHistoryComment($data['sellerform_comment'], $data['status'])->setIsCustomerNotified($notify);
46
+ $comment = isset($data['sellerform_comment'])? trim(strip_tags($data['sellerform_comment'])) : '';
47
+ $trackingNo = isset($data['trackin_no']) ? $data['trackin_no']:'';
48
+
49
+ $order->save();
50
+ $processOrder = $order->processOrder($data['status'],$orderId,$trackingNo,$comment);
51
+
52
+ if($notify) {
53
+ /*Get Buyer information*/
54
+ $buyerEmail = $order->getCustomerEmail();
55
+ $buyerName = $order->getCustomerFirstname() . ' ' . $order->getCustomerLastname();
56
+
57
+ /*Get Seller information*/
58
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
59
+ $sellerEmail = $customer->getEmail();
60
+ $sellerName = $customer->getName();
61
+ $order->sendOrderStatusEmail(($data['status']), $buyerEmail, $buyerName, $comment, $orderId, $sellerEmail,$sellerName);
62
+ }
63
+
64
+ if($processOrder) {
65
+ Mage::getSingleton('core/session')->addSuccess('Order status is updated.');
66
+ $this->_redirect('marketplace/account/vieworder',$arguement=array('order_id' => $orderId));
67
+ }
68
+ } else {
69
+ Mage::getModel('core/session')->addError("Invoice is not generated for this order,please contact administrator.");
70
+ $this->_redirect('marketplace/account/vieworder',$arguement=array('order_id' => $orderId));
71
+ }
72
+ } else {
73
+ Mage::getSingleton('core/session')->addSuccess('Comment is not added.');
74
+ Mage::throwException(implode('<br/>', $error));
75
+ }
76
+ } catch (Exception $e) {
77
+ Mage::getModel('core/session')->addError($e->getMessage());
78
+ $this->_redirect('marketplace/account/vieworder',$arguement=array('order_id' => $orderId));
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Check order view availability
84
+ *
85
+ * @param Mage_Sales_Model_Order $order
86
+ * @return bool
87
+ */
88
+ protected function _canViewOrder($order)
89
+ {
90
+ $customerId = Mage::getSingleton('customer/session')->getCustomerId();
91
+ $availableStates = Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates();
92
+ if ($order->getId() && $order->getCustomerId() && ($order->getCustomerId() == $customerId)
93
+ && in_array($order->getState(), $availableStates, $strict = true)
94
+ ) {
95
+ return true;
96
+ }
97
+ return false;
98
+ }
99
+
100
+ /**
101
+ * Init layout, messages and set active block for customer
102
+ *
103
+ * @return null
104
+ */
105
+ protected function _viewAction()
106
+ {
107
+ if (!$this->_loadValidOrder()) {
108
+ return;
109
+ }
110
+
111
+ $this->loadLayout();
112
+ $this->_initLayoutMessages('catalog/session');
113
+
114
+ $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');
115
+ if ($navigationBlock) {
116
+ $navigationBlock->setActive('sales/order/history');
117
+ }
118
+ $this->renderLayout();
119
+ }
120
+
121
+ /**
122
+ * Try to load valid order by order_id and register it
123
+ *
124
+ * @param int $orderId
125
+ * @return bool
126
+ */
127
+ protected function _loadValidOrder($orderId = null)
128
+ {
129
+ if (null === $orderId) {
130
+ $orderId = (int) $this->getRequest()->getParam('order_id');
131
+ }
132
+ if (!$orderId) {
133
+ $this->_forward('noRoute');
134
+ return false;
135
+ }
136
+
137
+ $order = Mage::getModel('sales/order')->load($orderId);
138
+
139
+ if ($this->_canViewOrder($order)) {
140
+ Mage::register('current_order', $order);
141
+ return true;
142
+ } else {
143
+ $this->_redirect('*/*/history');
144
+ }
145
+ return false;
146
+ }
147
+
148
+ /**
149
+ * Order view page
150
+ */
151
+ public function viewAction()
152
+ {
153
+ $this->_viewAction();
154
+ }
155
+
156
+ /**
157
+ * Print Order Action
158
+ */
159
+ public function printAction()
160
+ {
161
+ if (!$this->_loadValidOrder()) {
162
+ return;
163
+ }
164
+ $this->loadLayout('print');
165
+ $this->renderLayout();
166
+ }
167
+
168
+ /**
169
+ * Action predispatch
170
+ *
171
+ * Check customer authentication for some actions
172
+ */
173
+ public function preDispatch()
174
+ {
175
+ parent::preDispatch();
176
+ $action = $this->getRequest()->getActionName();
177
+ $loginUrl = Mage::helper('customer')->getLoginUrl();
178
+
179
+ if (!Mage::getSingleton('customer/session')->authenticate($this, $loginUrl)) {
180
+ $this->setFlag('', self::FLAG_NO_DISPATCH, true);
181
+ }
182
+ }
183
+
184
+ /**
185
+ * Customer order history
186
+ */
187
+ public function historyAction()
188
+ {
189
+ $this->_validateCustomerLogin();
190
+ $this->loadLayout();
191
+ $this->_initLayoutMessages('catalog/session');
192
+
193
+ $this->getLayout()->getBlock('head')->setTitle($this->__('My Orders'));
194
+
195
+ if ($block = $this->getLayout()->getBlock('customer.account.link.back')) {
196
+ $block->setRefererUrl($this->_getRefererUrl());
197
+ }
198
+ $this->renderLayout();
199
+ }
200
+
201
+ /*To print individual order in order view page.*/
202
+ public function printOrderAction(){
203
+ $this->loadLayout();
204
+ $this->renderLayout();
205
+ }
206
+
207
+ /* Generate CSV file for Marketplace order grid.*/
208
+ public function expoAction(){
209
+ if (Mage::getModel('customer/session')->isLoggedIn()) {
210
+ $fileName = 'order.csv';
211
+ $content = Mage::helper('marketplace')->generateMarketCsv();
212
+ $this->_prepareDownloadResponse($fileName, $content);
213
+ } else {
214
+ $this->_redirect('customer/account/login');
215
+ return;
216
+ }
217
+ }
218
+
219
+ /* Generate XML file for Marketplace order grid.*/
220
+ public function expoXmlAction(){
221
+ if (Mage::getModel('customer/session')->isLoggedIn()) {
222
+ $orders = Mage::helper('marketplace')->getMarketOrders();
223
+ $filename = 'order.xml';
224
+
225
+ $data[0] = array(
226
+ $this->__("Order#"), $this->__("Bill to Name"),
227
+ $this->__("Status"), $this->__("Total Sales"),
228
+ $this->__("Amount Received"), $this->__("Amount Remain"),
229
+ );
230
+ foreach ($orders as $order) {
231
+ $data[] = array(
232
+ $order['increment_id'], $order['billname'],$order['status'],
233
+ round($order['Total'], 2), round($order['Amount Received'], 2), round($order['Amount Remain'], 2)
234
+ );
235
+ }
236
+ // Unparsing in Excel Format
237
+ $xmlObj = new Varien_Convert_Parser_Xml_Excel();
238
+ $xmlObj->setVar('single_sheet', $filename);
239
+ $xmlObj->setData($data);
240
+ $xmlObj->unparse();
241
+ $content = $xmlObj->getData();
242
+ // Force Download
243
+ $this->_prepareDownloadResponse($filename, $content);
244
+ } else {
245
+ $this->_redirect('customer/account/login');
246
+ return;
247
+ }
248
+ }
249
+
250
+ public function shipAction() {
251
+ $this->loadLayout();
252
+ $this->renderLayout();
253
+ }
254
+
255
+ protected function _initShipment()
256
+ {
257
+ $shipment = false;
258
+ $shipmentId = $this->getRequest()->getParam('shipment_id');
259
+ $orderId = $this->getRequest()->getParam('order_id');
260
+ if ($shipmentId) {
261
+ $shipment = Mage::getModel('sales/order_shipment')->load($shipmentId);
262
+ } elseif ($orderId) {
263
+ $order = Mage::getModel('sales/order')->load($orderId);
264
+
265
+ /**
266
+ * Check order existing
267
+ */
268
+ if (!$order->getId()) {
269
+ $this->_getSession()->addError($this->__('The order no longer exists.'));
270
+ return false;
271
+ }
272
+ /**
273
+ * Check shipment is available to create separate from invoice
274
+ */
275
+ if ($order->getForcedDoShipmentWithInvoice()) {
276
+ $this->_getSession()->addError($this->__('Cannot do shipment for the order separately from invoice.'));
277
+ return false;
278
+ }
279
+ /**
280
+ * Check shipment create availability
281
+ */
282
+ $savedQtys = $this->_getItemQtys();
283
+ $shipment = Mage::getModel('sales/service_order', $order)->prepareShipment($savedQtys);
284
+
285
+ $tracks = $this->getRequest()->getPost('tracking');
286
+ if ($tracks) {
287
+ foreach ($tracks as $data) {
288
+ if (empty($data['number'])) {
289
+ Mage::throwException($this->__('Tracking number cannot be empty.'));
290
+ }
291
+ $track = Mage::getModel('sales/order_shipment_track')
292
+ ->addData($data);
293
+ $shipment->addTrack($track);
294
+ }
295
+ }
296
+ }
297
+
298
+ Mage::register('current_shipment', $shipment);
299
+ return $shipment;
300
+ }
301
+
302
+ protected function _saveShipment($shipment)
303
+ {
304
+ $shipment->getOrder()->setIsInProcess(true);
305
+ $transactionSave = Mage::getModel('core/resource_transaction')
306
+ ->addObject($shipment)
307
+ ->addObject($shipment->getOrder())
308
+ ->save();
309
+
310
+ return $this;
311
+ }
312
+
313
+ protected function _getItemQtys()
314
+ {
315
+ $data = $this->getRequest()->getParam('shipment');
316
+ if (isset($data['items'])) {
317
+ $qtys = $data['items'];
318
+ } else {
319
+ $qtys = array();
320
+ }
321
+ return $qtys;
322
+ }
323
+
324
+ protected function _getSession()
325
+ {
326
+ return Mage::getSingleton('customer/session');
327
+ }
328
+
329
+ public function saveAction()
330
+ {
331
+ $data = $this->getRequest()->getPost('shipment');
332
+
333
+ if (!empty($data['comment_text'])) {
334
+ Mage::getSingleton('adminhtml/session')->setCommentText($data['comment_text']);
335
+ }
336
+
337
+ try {
338
+ $shipment = $this->_initShipment();
339
+
340
+ if (!$shipment) {
341
+ $this->_forward('noRoute');
342
+ return;
343
+ }
344
+
345
+ $shipment->register();
346
+ $comment = '';
347
+
348
+ if (!empty($data['comment_text'])) {
349
+ $shipment->addComment(
350
+ $data['comment_text'],
351
+ isset($data['comment_customer_notify']),
352
+ isset($data['is_visible_on_front'])
353
+ );
354
+ if (isset($data['comment_customer_notify'])) {
355
+ $comment = $data['comment_text'];
356
+ }
357
+ }
358
+
359
+ if (!empty($data['send_email'])) {
360
+ $shipment->setEmailSent(true);
361
+ }
362
+
363
+ $shipment->getOrder()->setCustomerNoteNotify(!empty($data['send_email']));
364
+ $responseAjax = new Varien_Object();
365
+ $isNeedCreateLabel = isset($data['create_shipping_label']) && $data['create_shipping_label'];
366
+
367
+ if ($isNeedCreateLabel && $this->_createShippingLabel($shipment)) {
368
+ $responseAjax->setOk(true);
369
+ }
370
+
371
+ $this->_saveShipment($shipment);
372
+ $shipment->sendEmail(!empty($data['send_email']), $comment);
373
+
374
+ $shipmentCreatedMessage = $this->__('The shipment has been created.');
375
+ $labelCreatedMessage = $this->__('The shipping label has been created.');
376
+
377
+ $this->_getSession()->addSuccess($isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage
378
+ : $shipmentCreatedMessage);
379
+ Mage::getSingleton('adminhtml/session')->getCommentText(true);
380
+ } catch (Mage_Core_Exception $e) {
381
+ if ($isNeedCreateLabel) {
382
+ $responseAjax->setError(true);
383
+ $responseAjax->setMessage($e->getMessage());
384
+ } else {
385
+ $this->_getSession()->addError($e->getMessage());
386
+ $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));
387
+ }
388
+ } catch (Exception $e) {
389
+ Mage::logException($e);
390
+ if ($isNeedCreateLabel) {
391
+ $responseAjax->setError(true);
392
+ $responseAjax->setMessage(
393
+ Mage::helper('sales')->__('An error occurred while creating shipping label.'));
394
+ } else {
395
+ $this->_getSession()->addError($this->__('Cannot save shipment.'));
396
+ $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));
397
+ }
398
+
399
+ }
400
+ if ($isNeedCreateLabel) {
401
+ $this->getResponse()->setBody($responseAjax->toJson());
402
+ } else {
403
+ $this->_redirect('*/order/history/');
404
+ }
405
+ }
406
+
407
+ /**
408
+ * validate Customer Login and redirect previous page
409
+ * */
410
+ protected function _validateCustomerLogin() {
411
+ $session = Mage::getSingleton('customer/session');
412
+ if (!$session->isLoggedIn()) {
413
+ $session->setAfterAuthUrl(Mage::helper('core/url')->getCurrentUrl());
414
+ $session->setBeforeAuthUrl(Mage::helper('core/url')->getCurrentUrl());
415
+ $this->_redirect('customer/account/login/');
416
+ return $this;
417
+ }elseif(!Mage::helper('marketplace')->isMarketplaceActiveSellar()){
418
+ $this->_redirect('customer/account/');
419
+ }
420
+ }
421
+ }
app/code/community/Cybage/Marketplace/controllers/ProductController.php ADDED
@@ -0,0 +1,726 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_ProductController extends Mage_Core_Controller_Front_Action
22
+ {
23
+ /**
24
+ * Create session
25
+ * */
26
+ protected function _getSession() {
27
+ return Mage::getSingleton('marketplace/session');
28
+ }
29
+
30
+ /**
31
+ * validate Customer Login and redirect previous page
32
+ * */
33
+ protected function _validateCustomerLogin() {
34
+ $session = Mage::getSingleton('customer/session');
35
+ if (!$session->isLoggedIn()) {
36
+ $session->setAfterAuthUrl(Mage::helper('core/url')->getCurrentUrl());
37
+ $session->setBeforeAuthUrl(Mage::helper('core/url')->getCurrentUrl());
38
+ $this->_redirect('customer/account/login/');
39
+ return $this;
40
+ }elseif(!Mage::helper('marketplace')->isMarketplaceActiveSellar()){
41
+ $this->_redirect('customer/account/');
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Add marketplace product
47
+ * */
48
+ public function indexAction() {
49
+ $this->_validateCustomerLogin();
50
+ $this->loadLayout();
51
+ $this->_initLayoutMessages('marketplace/session');
52
+ $this->renderLayout();
53
+ }
54
+
55
+ /**
56
+ * Add marketplace product
57
+ * */
58
+ public function addAction() {
59
+ $this->_validateCustomerLogin();
60
+ $checkCategory = Mage::helper('marketplace')->getCategoryCollection();
61
+ $count = $checkCategory->getSize();
62
+ if ($count == 0) {
63
+ $session = $this->_getSession();
64
+ $session->addError($this->__('Their is no category available, please try after some time.'));
65
+ $this->_redirect('*/*/');
66
+ return;
67
+ }
68
+
69
+ $this->loadLayout();
70
+
71
+ $this->_initLayoutMessages('marketplace/session');
72
+ $this->renderLayout();
73
+ }
74
+
75
+ /**
76
+ * Edit marketplace product
77
+ * */
78
+ public function editAction() {
79
+ $this->_validateCustomerLogin();
80
+ $session = $this->_getSession();
81
+ $product = Mage::getModel('catalog/product');
82
+ $productId = $this->getRequest()->getParam('id');
83
+
84
+ if ($productId) {
85
+ try {
86
+ $product->load($productId);
87
+ if ($product->getMarketplaceState() == Mage::helper('marketplace')->getDeletedOptionValue()) {
88
+ $session->addError($this->__('Not allow to update product details.'));
89
+ $this->_redirect('*/product/');
90
+ return;
91
+ }
92
+ } catch (Exception $e) {
93
+ $product->setTypeId(Mage_Catalog_Model_Product_Type::DEFAULT_TYPE);
94
+ Mage::logException($e);
95
+ }
96
+ }
97
+
98
+ /**
99
+ * Add categories to Form data
100
+ * */
101
+ $product['categories_ids'] = $product->getCategoryIds();
102
+
103
+ $session->setMarketplaceFormData($product->getData());
104
+ $this->loadLayout();
105
+ // $this->getLayout()->getBlock('marketplace_edit')->setFormAction( Mage::getUrl('*/*/save') );
106
+ $this->_initLayoutMessages('marketplace/session');
107
+ $this->renderLayout();
108
+ }
109
+
110
+ /**
111
+ * soft Delete product action
112
+ */
113
+ public function softDeleteAction() {
114
+
115
+ $this->_validateCustomerLogin();
116
+ $result = 0;
117
+ $action = 1;
118
+ if ($id = $this->getRequest()->getParam('id')) {
119
+
120
+ $deletedOptionValue = Mage::helper('marketplace')->getDeletedOptionValue();
121
+ $session = $this->_getSession();
122
+
123
+ try {
124
+
125
+ $website = Mage::app()->getStore($this->getRequest()->getParam('store', 0))->getWebsite();
126
+ $stores = $website->getStoreIds();
127
+ foreach ($stores as $storeId) {
128
+
129
+ Mage::getSingleton('catalog/product_action')
130
+ ->updateAttributes(
131
+ array($id), array('status' => Mage_Catalog_Model_Product_Status::STATUS_DISABLED,
132
+ 'marketplace_state' => $deletedOptionValue
133
+ )
134
+ , $storeId);
135
+ }
136
+ $session->addSuccess(Mage::helper('marketplace')->__('The product has been removed.'));
137
+ //logging data for product delete action with success status
138
+ $result = 1;
139
+ $this->saveLoggingAction($action,$result,$id);
140
+ $this->_redirect('*/product/');
141
+ } catch (Exception $e) {
142
+ $session->addError($this->__('Unable to remove record.'));
143
+ //logging data for product delete action with failure status
144
+ $result = 0;
145
+ $this->saveLoggingAction($action,$result,$id);
146
+ $this->_redirect('*/product/');
147
+ }
148
+ }
149
+
150
+ return;
151
+ }
152
+
153
+ /**
154
+ * Product Image Delete product action
155
+ */
156
+ public function productImageDeleteAction() {
157
+
158
+ $this->_validateCustomerLogin();
159
+ $productId = $this->getRequest()->getParam('product_id');
160
+ $imageType = $this->getRequest()->getParam('image_type');
161
+ if ($productId && $imageType) {
162
+ $session = $this->_getSession();
163
+ try {
164
+ $product = Mage::getSingleton('catalog/product');
165
+ $removeGalleryImages = array();
166
+ Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID);
167
+ $mediaApi = Mage::getModel("catalog/product_attribute_media_api");
168
+ $mediaApiItems = $mediaApi->items($productId);
169
+ foreach ($mediaApiItems as $item) {
170
+ // $mediaApi->remove($product_id, $item['file']);
171
+
172
+ $itemTypes = $item['types'];
173
+ if (count($itemTypes)) {
174
+ foreach ($itemTypes as $itemType) {
175
+ if ($imageType == $itemType) {
176
+ $removeGalleryImages[$itemType] = $item['file'];
177
+ }
178
+ }
179
+ }
180
+ }
181
+ foreach ($removeGalleryImages as $image) {
182
+ $mediaApi->remove($productId, $image);
183
+ $imagePath = Mage::getBaseDir('media') . DS . 'catalog' . DS . 'product' . DS . $image;
184
+ if (file_exists($imagePath))
185
+ @unlink($imagePath);
186
+ }
187
+
188
+ $product->save();
189
+ $session->addSuccess(Mage::helper('marketplace')->__('The product Image has been removed.'));
190
+ $this->_redirect("*/product/edit/id/$productId");
191
+ } catch (Exception $e) {
192
+ $session->addError($this->__($e->getMessage()));
193
+ $this->_redirect("*/product/edit/id/$productId");
194
+ }
195
+ }
196
+
197
+ return;
198
+ }
199
+
200
+ /**
201
+ * save Marketplace product data
202
+ *
203
+ */
204
+ public function saveAction() {
205
+ $result = 0;
206
+ Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
207
+ $product = $this->_initProductSave();
208
+ $session = $this->_getSession();
209
+
210
+ try {
211
+ $product->validate();
212
+ if ($product->getIsError()) {
213
+ Mage::throwException();
214
+ }
215
+ $product->save();
216
+ if ($product->getIsEditMode()) {
217
+ $action = 2;
218
+ $session->addSuccess($this->__("Product Updated Successfully."));
219
+ } else {
220
+ $action = 3;
221
+ $session->addSuccess($this->__("Product Added Successfully."));
222
+ }
223
+ //logging data for product edit and add action with success status
224
+ $result = 1;
225
+ $this->saveLoggingAction($action, $result, $product->getId());
226
+ $this->_getSession()->setMarketplaceFormData();
227
+ $this->_redirect('*/product/');
228
+ } catch (Exception $e) {
229
+ $result = 0;
230
+ $session->addError($this->__($e->getMessage()));
231
+ $productId = $this->getRequest()->getParam('id');
232
+ if (!$productId) {
233
+ $productId = $product->getId();
234
+ }
235
+ if ($productId) {
236
+ $this->_redirect('*/product/edit/id/' . $productId);
237
+ //logging data for product edit action with failure status
238
+ $action = 2;
239
+ $this->saveLoggingAction($action, $result, $productId);
240
+ return;
241
+ }
242
+ //logging data for product add action with failure status
243
+ $sellerId = $product->getSellerId();
244
+ $action = 3;
245
+ $this->saveLoggingAction($action, $result, $this->getRequest()->getParam('id'), $sellerId);
246
+ $this->_redirect('*/product/add/');
247
+ return;
248
+ }
249
+ }
250
+
251
+ /**
252
+ * Initialize product before saving
253
+ *
254
+ * @return Mage_Catalog_Model_Product
255
+ */
256
+ protected function _initProductSave() {
257
+ $data = $this->getRequest()->getPost();
258
+
259
+ $productData = $data['product'];
260
+ $this->_getSession()->setMarketplaceFormData($productData);
261
+ $qty = $productData['qty'];
262
+
263
+ //get stock
264
+ $productStockData = $this->getStockData($qty);
265
+
266
+ /**
267
+ * Websites
268
+ */
269
+ if (!isset($productData['website_ids'])) {
270
+ $productData['website_ids'] = array(1);
271
+ }
272
+ $productModel = Mage::getModel('catalog/product');
273
+ $productEdit = "";
274
+ if ((isset($productData['id']) && $productId = $productData['id'])) {
275
+ $productEdit = $productModel->load($productId);
276
+ $productEdit->setIsEditMode(TRUE);
277
+ $product = $this->getDefaultData($productEdit);
278
+ } else {
279
+ // default product data
280
+ $product = $this->getDefaultData($productModel);
281
+ }
282
+
283
+ $product->addData($productData);
284
+ $product->addData($productStockData);
285
+ // $product->addData($productImageData);
286
+ //get image data
287
+ $product = $this->getUploadedProductImageData($productModel);
288
+
289
+ return $product;
290
+ }
291
+
292
+ protected function getStockData($qty) {
293
+ $productData = array();
294
+ $productData['stock_data']['is_in_stock'] = 1;
295
+ $productData['stock_data']['stock_id'] = 1;
296
+ $productData['stock_data']['manage_stock'] = 1;
297
+
298
+ $productData['stock_data']['use_config_manage_stock'] = 1;
299
+
300
+ $productData['stock_data']['use_config_min_sale_qty'] = 1;
301
+
302
+ $productData['stock_data']['use_config_max_sale_qty'] = 1;
303
+ $productData['stock_data']['qty'] = $qty;
304
+
305
+ return $productData;
306
+ }
307
+
308
+ protected function getDefaultData($product) {
309
+
310
+ $marketplaceHelper = Mage::helper('marketplace');
311
+
312
+ if (!$product->getIsEditMode()) {
313
+ $attributeSetId = $product->getResource()->getEntityType()->getDefaultAttributeSetId();
314
+ $product->setAttributeSetId($attributeSetId);
315
+ $productType = Mage_Catalog_Model_Product_Type::DEFAULT_TYPE;
316
+ $product->setTypeId($productType);
317
+ $storeId = $this->getRequest()->getParam('store', 0);
318
+ $product->setStoreId($storeId);
319
+ }
320
+
321
+ $customer=Mage::getSingleton('customer/session')->getCustomer();
322
+ $productState=$customer->getSellerProductState();
323
+ $productStatus=$customer->getSellerProductStatus();
324
+
325
+ $newProductStatus=$productStatus?$productStatus:$marketplaceHelper->getNewProductStatus();
326
+ $newProductState=$productState?$productState:$marketplaceHelper->getNewProductState();
327
+
328
+ $product->setStatus($newProductStatus);
329
+ $product->setMarketplaceState($newProductState);
330
+
331
+ $product->setVisibility($marketplaceHelper->getNewProductVisibility());
332
+ $product->setSellerId(Mage::getSingleton('customer/session')->getCustomerId());
333
+ $product->setTaxClassId(1);
334
+
335
+ return $product;
336
+ }
337
+
338
+ protected function getUploadedProductImageData($product) {
339
+ //$product = Mage::getModel('catalog/product')->load($productId);
340
+ $wasLockedMedia = false;
341
+ if ($product->isLockedAttribute('media')) {
342
+ $product->unlockAttribute('media');
343
+ $wasLockedMedia = true;
344
+ }
345
+ $mediaArray = array();
346
+ if ($_FILES) {
347
+ foreach ($_FILES as $key => $value) {
348
+ $fileSize = (int) Mage::helper('marketplace')->getNewProductUploadImageSize('validate');
349
+ if ($value['size'] > $fileSize) {
350
+ $this->_getSession()->addError(Mage::helper('marketplace')->__('Unable to process your request due to large image size, please try again.'));
351
+ $product->setIsError(true);
352
+ return $product;
353
+ }
354
+ $imageName = $_FILES[$key]['name'];
355
+ $imageTmpName = $_FILES[$key]['tmp_name'];
356
+
357
+ if (isset($imageName) && (file_exists($imageTmpName))) {
358
+ try {
359
+ $uploader = new Varien_File_Uploader($key);
360
+ $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
361
+ $uploader->setAllowRenameFiles(true);
362
+ $path1 = DS . 'temp' . DS . 'catalog' . DS . 'product';
363
+ //$path2 = DS . 'catalog' . DS . 'product';
364
+ $path = Mage::getBaseDir('media') . $path1;
365
+ $uploader->setFilesDispersion(true);
366
+ $uploader->save($path, $imageName);
367
+ $uploadedFile = $path1 . $uploader->getUploadedFileName();
368
+ $mediaArray[$key] = $uploadedFile;
369
+ } catch (Exception $e) {
370
+ $this->_getSession()->addError($e->getMessage());
371
+ //die($e->getMessage());
372
+ }
373
+ }
374
+ }
375
+ }
376
+
377
+ // Remove unset images, add image to gallery if exists
378
+ $importDir = Mage::getBaseDir('media');
379
+
380
+ foreach ($mediaArray as $imageType => $fileName) {
381
+ $filePath = $importDir . $fileName;
382
+ if (file_exists($filePath)) {
383
+ try {
384
+ $product->addImageToMediaGallery($filePath, $imageType, false);
385
+ } catch (Exception $e) {
386
+ $this->_getSession()->addError($e->getMessage());
387
+ $product->setIsError(true);
388
+ return $product;
389
+ }
390
+ } else {
391
+ $this->_getSession()->addError("Image file Dose not exists ");
392
+ $product->setIsError(true);
393
+ return $product;
394
+ }
395
+ }
396
+ $product->setIsError(false);
397
+ return $product;
398
+ }
399
+ /**
400
+ * Calling Log Model file for logging product add, edit or delete action
401
+ * @param : $action(edit or add or delete), $result (success or failure),$productId(Mage_Catalog_Product_Model)
402
+ * @return : void
403
+ */
404
+ public function saveLoggingAction($action,$result,$productId,$sellerId)
405
+ {
406
+ return Mage::getModel('marketplace/logging')->saveProductLog($action,$result,$productId,$sellerId);
407
+ }
408
+
409
+ // Used for product Import
410
+ public function importAction() {
411
+ $this->_validateCustomerLogin();
412
+ $checkCategory = Mage::helper('marketplace')->getCategoryCollection();
413
+ $count = $checkCategory->getSize();
414
+ if ($count == 0) {
415
+ $session = $this->_getSession();
416
+ $session->addError($this->__('Their is no category available, please try after some time.'));
417
+ $this->_redirect('*/*/');
418
+ return;
419
+ }
420
+
421
+ $this->loadLayout();
422
+ $this->_initLayoutMessages('marketplace/session');
423
+ $this->renderLayout();
424
+ }
425
+
426
+ /* Sample CSV file for Marketplace product import.*/
427
+ public function samplecsvAction() {
428
+ if (Mage::getModel('customer/session')->isLoggedIn()) {
429
+ $fileName = 'productimport.csv';
430
+ $content = array (
431
+ 'type' => 'filename',
432
+ 'value' => Mage::getBaseDir('media') . DS . 'marketplace' . DS . 'productimport.csv'
433
+ );
434
+ $this->_prepareDownloadResponse($fileName, $content);
435
+ } else {
436
+ $this->_redirect('customer/account/login');
437
+ return;
438
+ }
439
+ }
440
+
441
+ public function importvalidateAction() {
442
+ $this->_validateCustomerLogin();
443
+ $session = $this->_getSession();
444
+ $this->_initLayoutMessages('marketplace/session');
445
+ $data = $this->getRequest()->getPost();
446
+ $time = time();
447
+
448
+ if ($data) {
449
+ try {
450
+ $marketplaceHelper = Mage::helper('marketplace');
451
+ $customer=Mage::getSingleton('customer/session')->getCustomer();
452
+ $productState=$customer->getSellerProductState();
453
+ $productStatus=$customer->getSellerProductStatus();
454
+ $newProductStatus=$productStatus?$productStatus:$marketplaceHelper->getNewProductStatus();
455
+ $newProductState=$productState?$productState:$marketplaceHelper->getNewProductState();
456
+ $newProductStateValue = Mage::getModel('eav/config')->getAttribute('catalog_product', 'marketplace_state')->getSource()->getOptionText($newProductState);
457
+
458
+ $this->loadLayout();
459
+ /** @var $import Mage_ImportExport_Model_Import */
460
+ $import = Mage::getModel('importexport/import');
461
+ $source = $import->setData($data)->uploadSource();
462
+
463
+ // Modify CSV file
464
+ $io = new Varien_Io_File();
465
+ $io->streamOpen($source, 'r');
466
+ $io->streamLock(true);
467
+ $newCsvData = array();
468
+ $i=0;
469
+
470
+ while ($data = $io->streamReadCsv()) {
471
+ if ($i == 0) {
472
+ $data[] = '_attribute_set';
473
+ $data[] = '_type';
474
+ $data[] = '_product_websites';
475
+ $data[] = 'tax_class_id';
476
+ $data[] = 'visibility';
477
+ $data[] = 'seller_id';
478
+ $data[] = 'marketplace_state';
479
+ $data[] = 'status';
480
+ $data[] = 'media_gallery';
481
+
482
+ $newCsvData[] = $data;
483
+ } else {
484
+ $data[] = 'Default';
485
+ $data[] = Mage_Catalog_Model_Product_Type::DEFAULT_TYPE;
486
+ $data[] = 'base';
487
+ $data[] = 0;
488
+ $data[] = $marketplaceHelper->getNewProductVisibility();
489
+ $data[] = $customer->getCompanyName();
490
+ $data[] = $newProductStateValue;
491
+ $data[] = $newProductStatus;
492
+ $data[] = ' ';
493
+
494
+ if ($this->validateSellerCSV($data)) {
495
+ $newCsvData[] = $data;
496
+ }
497
+ }
498
+
499
+ $i++;
500
+ }
501
+ $io->close();
502
+ unlink($source);
503
+
504
+ $checkPath = Mage::getBaseDir() . DS . 'media' . DS . 'marketplace/'.$customer->getId();
505
+ if(!file_exists($checkPath))
506
+ {
507
+ mkdir($checkPath, 0777);
508
+ }
509
+ $newSource = $checkPath. DS .'productimport.csv';
510
+ $io = new Varien_File_Csv();
511
+ $io->saveData($newSource, $newCsvData);
512
+
513
+ $validationResult = $import->validateSource($newSource);
514
+
515
+ if (!$import->getProcessedRowsCount()) {
516
+ $session->addError($this->__('File does not contain data or duplicate sku. Please upload another one'));
517
+ } else {
518
+ if (!$validationResult) {
519
+ if ($import->getProcessedRowsCount() == $import->getInvalidRowsCount()) {
520
+ $session->addNotice(
521
+ $this->__('File is totally invalid. Please fix errors and re-upload file')
522
+ );
523
+ } elseif ($import->getErrorsCount() >= $import->getErrorsLimit()) {
524
+ $session->addNotice(
525
+ $this->__('Errors limit (%d) reached. Please fix errors and re-upload file', $import->getErrorsLimit())
526
+ );
527
+ } else {
528
+ if ($import->isImportAllowed()) {
529
+ $session->addNotice(
530
+ $this->__('Please fix errors and re-upload file or simply press "Import" button to skip rows with errors'),
531
+ true
532
+ );
533
+ } else {
534
+ $session->addNotice(
535
+ $this->__('File is partially valid, but import is not possible'), false
536
+ );
537
+ }
538
+ }
539
+ // errors info
540
+ foreach ($import->getErrors() as $errorCode => $rows) {
541
+ $error = $errorCode . ' ' . $this->__('in rows:') . ' ' . implode(', ', $rows);
542
+ $session->addError($error);
543
+ }
544
+ } else {
545
+ if ($import->isImportAllowed()) {
546
+ $import->importSource();
547
+
548
+ //Process Images
549
+ $status = $this->_uploadZipImages($time);
550
+ if($status !== false)
551
+ {
552
+ if($status[0] == 'success')
553
+ {
554
+ $returnVal = Mage::getModel('marketplace/image')->process($newCsvData, $customer->getId(), $time);
555
+
556
+ if($returnVal === true)
557
+ {
558
+ $customDir = Mage::getBaseDir() . DS . 'media' . DS . 'marketplace'. DS . $customer->getId(). DS . $time;
559
+ self::delTree($customDir);
560
+ }
561
+ $session->addSuccess( $this->__($status[1]), true );
562
+ }
563
+ else
564
+ {
565
+ $session->addError($this->__($status[1]));
566
+ }
567
+ }
568
+
569
+ $import->invalidateIndex();
570
+ $session->addSuccess(
571
+ $this->__('Import successfully done.'), true
572
+ );
573
+ $this->_redirect('*/*/import');
574
+ } else {
575
+ $session->addError(
576
+ $this->__('File is valid, but import is not possible'), false
577
+ );
578
+ }
579
+ }
580
+ $session->addNotice($import->getNotices());
581
+ $session->addNotice($this->__('Checked rows: %d, checked entities: %d, invalid rows: %d, total errors: %d', $import->getProcessedRowsCount(), $import->getProcessedEntitiesCount(), $import->getInvalidRowsCount(), $import->getErrorsCount()));
582
+ }
583
+ } catch (Exception $e) {
584
+ $session->addNotice($this->__('Please fix errors and re-upload file'))->addError($e->getMessage());
585
+ }
586
+ } elseif ($this->getRequest()->isPost() && empty($_FILES)) {
587
+ $session->addError($this->__('File was not uploaded'));
588
+ } else {
589
+ $session->addError($this->__('Data is invalid or file is not uploaded'));
590
+ }
591
+
592
+ $this->_redirect('*/*/import');
593
+ }
594
+
595
+ private function _uploadZipImages($time)
596
+ {
597
+ if($_FILES['import_image']['name'])
598
+ {
599
+ if($_FILES['import_image']['size'] > Mage::helper('marketplace')->getNewProductUploadImageSize('validate'))
600
+ {
601
+ $message = array('failure', 'Unable to process request for zip upload due to large size, please try again.');
602
+ return $message;
603
+ }
604
+
605
+ $message = '';
606
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
607
+
608
+ $filename = $_FILES['import_image']['name'];
609
+ $source = $_FILES['import_image']['tmp_name'];
610
+
611
+ $name = explode('.', $filename);
612
+
613
+ $continue = strtolower($name[count($name)-1]) == 'zip' ? true : false;
614
+ if(!$continue)
615
+ {
616
+ $message = array('failure', 'The file you are trying to upload is not a .zip file. ZIP upload failed. Please try again with correct file.');
617
+ return $message;
618
+ }
619
+
620
+ $target = Mage::getBaseDir() . DS . 'media' . DS . 'marketplace'. DS . $customer->getId();
621
+ if(!file_exists($target))
622
+ {
623
+ mkdir($target, 0777);
624
+ }
625
+
626
+ $dir = $target. DS . $time;
627
+ if(!file_exists($dir))
628
+ {
629
+ mkdir($dir, 0777);
630
+ }
631
+
632
+ $file = $dir. DS . $time . '.zip';
633
+
634
+ if(move_uploaded_file($source, $file))
635
+ {
636
+ $zip = new ZipArchive();
637
+ $x = $zip->open($file);
638
+ if ($x === true)
639
+ {
640
+ $zip->extractTo($dir);
641
+ $zip->close();
642
+
643
+ unlink($file);
644
+ $this->_validateZip($dir);
645
+ }
646
+ $message = array('success', 'Zip file was uploaded and unpacked.');
647
+ } else {
648
+ $message = array('failure', 'There was a problem with the upload. Please try again.');
649
+ }
650
+
651
+ return $message;
652
+ }
653
+
654
+ return false;
655
+ }
656
+
657
+ private function _validateZip($dir)
658
+ {
659
+ $cnt = 0;
660
+ $invalid = array();
661
+ $larger = array();
662
+
663
+ if ($handle = opendir($dir))
664
+ {
665
+ $fileSize = (int) Mage::helper('marketplace')->getNewProductUploadImageSize('validate');
666
+ while (false !== ($entry = readdir($handle)))
667
+ {
668
+ if ($entry != "." && $entry != "..")
669
+ {
670
+ $entry = $dir . DS . $entry;
671
+ if(is_file($entry))
672
+ {
673
+ $ext = substr(strrchr($entry, "."), 1);
674
+ if(in_array($ext, array('jpg', 'jpeg', 'gif', 'png')))
675
+ {
676
+ if(filesize($entry) > $fileSize)
677
+ {
678
+ $larger[] = basename($entry);
679
+ unlink($entry);
680
+ }
681
+ } else {
682
+ $invalid[] = basename($entry);
683
+ unlink($entry);
684
+ }
685
+ } elseif(is_dir($entry)) {
686
+ $invalid[] = basename($entry);
687
+ self::delTree($dir);
688
+ }
689
+ }
690
+ }
691
+ closedir($handle);
692
+ }
693
+
694
+ if(!empty($invalid))
695
+ {
696
+ $this->_getSession()->addError($this->__('Below invalid files have been ignored. <br> '.implode("<br>", $invalid)));
697
+ }
698
+
699
+ if(!empty($larger))
700
+ {
701
+ $this->_getSession()->addError($this->__('Unable to process request for below files due to large image size, please try again. <br> '.implode("<br>", $larger)));
702
+ }
703
+ }
704
+
705
+ public static function delTree($dir)
706
+ {
707
+ $files = array_diff(scandir($dir), array('.','..'));
708
+ foreach ($files as $file) {
709
+ (is_dir("$dir/$file") && !is_link($dir)) ? self::delTree("$dir/$file") : unlink("$dir/$file");
710
+ }
711
+ return rmdir($dir);
712
+ }
713
+
714
+ public function validateSellerCSV($data) {
715
+ // validate sku
716
+ $productModel = Mage::getModel('catalog/product')->getIdBySku($data[0]);
717
+ if ($productModel){
718
+ return false;
719
+ } else {
720
+ if ($data[1] != '')
721
+ return true;
722
+ else
723
+ return false;
724
+ }
725
+ }
726
+ }
app/code/community/Cybage/Marketplace/controllers/ProductquestionController.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_ProductquestionController extends Mage_Core_Controller_Front_Action
22
+ {
23
+ //action to save question after submitting the form
24
+ public function submitAction() {
25
+ $this->_validateCustomerLogin();
26
+
27
+ try {
28
+ Mage::getModel('marketplace/question')->saveQuestions();
29
+ Mage::getSingleton('core/session')->addSuccess($this->__('Question was successfully submitted!!'));
30
+ } catch (Exception $e) {
31
+ Mage::getSingleton('core/session')->addError($this->__('Question was not submitted, Please Try After Some Time.'));
32
+ }
33
+ $block = $this->getLayout()->createBlock('core/messages', 'global_messages');
34
+ $html = $block->toHtml();
35
+ $this->getResponse()->setBody($html);
36
+ }
37
+
38
+ //action to disply link on product page
39
+ public function linkAction() {
40
+ $productId = $this->getRequest()->getParam('id');
41
+ $_product = Mage::getModel('catalog/product')->load($productId);
42
+ $status = $_product->getStatus();
43
+
44
+ if ($status == Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
45
+ Mage::getSingleton('core/session')->addError($this->__('This product is not available now.'));
46
+ $this->_redirectError(Mage::getUrl());
47
+ return;
48
+ }
49
+
50
+ $this->loadLayout();
51
+ $this->renderLayout();
52
+ }
53
+
54
+ /**
55
+ * validate Customer Login and redirect previous page
56
+ * */
57
+ protected function _validateCustomerLogin() {
58
+ $session = Mage::getSingleton('customer/session');
59
+ if (!$session->isLoggedIn()) {
60
+ $session->setAfterAuthUrl(Mage::helper('core/url')->getCurrentUrl());
61
+ $session->setBeforeAuthUrl(Mage::helper('core/url')->getCurrentUrl());
62
+ $this->_redirect('customer/account/login/');
63
+ return $this;
64
+ }
65
+ }
66
+
67
+ //Marketplace My Products Question
68
+ public function indexAction() {
69
+ $this->_validateCustomerLogin();
70
+ $this->loadLayout();
71
+ $this->_initLayoutMessages('catalog/session');
72
+ $this->getLayout()->getBlock('head')->setTitle($this->__('My Products Questions'));
73
+ $this->renderLayout();
74
+ }
75
+
76
+ //action to give reply to a question.
77
+ public function replyAction() {
78
+ $this->_validateCustomerLogin();
79
+ $this->loadLayout();
80
+ if ($navigationBlock = $this->getLayout()->getBlock('customer_account_navigation')) {
81
+ $navigationBlock->setActive('marketplace/productquestion');
82
+ }
83
+ $this->_initLayoutMessages('catalog/session');
84
+ $this->getLayout()->getBlock('head')->setTitle($this->__('My Products Questions Reply'));
85
+ $this->renderLayout();
86
+ }
87
+
88
+ //action to save reply after submitting the form.
89
+ public function repliedAction() {
90
+ $this->_validateCustomerLogin();
91
+ Mage::getModel('marketplace/reply')->saveReplies();
92
+ Mage::getSingleton('core/session')->addSuccess($this->__('Reply was successfully submitted!!'));
93
+ $this->_redirect('*/*');
94
+ }
95
+ }
app/code/community/Cybage/Marketplace/controllers/SellerController.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ class Cybage_Marketplace_SellerController extends Mage_Core_Controller_Front_Action
22
+ {
23
+ /*
24
+ * display seller info
25
+ * @created at 08-Oct-2013
26
+ * @modified at 09-Oct-2013
27
+ * @author Srinidhi Damle <srinidhid@cybage.com>
28
+ */
29
+ public function sellerinfoAction()
30
+ {
31
+ $this->loadLayout();
32
+ $this->renderLayout();
33
+ }
34
+ public function ratingAction()
35
+ {
36
+ $this->loadLayout();
37
+ $this->renderLayout();
38
+ }
39
+ }
app/code/community/Cybage/Marketplace/etc/adminhtml.xml ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Cybage Marketplace Plugin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * It is available on the World Wide Web at:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you are unable to access it on the World Wide Web, please send an email
12
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
13
+ *
14
+ * @category Marketplace Plugin
15
+ * @package Cybage_Marketplace
16
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
17
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
20
+ */
21
+ -->
22
+ <config>
23
+ <menu>
24
+ <marketplace translate="title" module="marketplace">
25
+ <title>Marketplace</title>
26
+ <sort_order>71</sort_order>
27
+ <children>
28
+ <seller translate="title" module="marketplace">
29
+ <title>Manage Sellers</title>
30
+ <sort_order>850</sort_order>
31
+ <action>marketplace/adminhtml_seller</action>
32
+ </seller>
33
+ <orderby translate="title" module="marketplace">
34
+ <title>Orders By Each Seller</title>
35
+ <sort_order>860</sort_order>
36
+ <action>marketplace/adminhtml_orderby</action>
37
+ </orderby>
38
+ <commission translate="title" module="marketplace">
39
+ <title>Manage Payments</title>
40
+ <sort_order>870</sort_order>
41
+ <action>marketplace/adminhtml_commission</action>
42
+ </commission>
43
+ </children>
44
+ </marketplace>
45
+ </menu>
46
+ <acl>
47
+ <resources>
48
+ <admin>
49
+ <children>
50
+ <system>
51
+ <children>
52
+ <config>
53
+ <children>
54
+ <marketplace translate="title">
55
+ <title>Marketplace Section</title>
56
+ </marketplace>
57
+ </children>
58
+ </config>
59
+ </children>
60
+ </system>
61
+ <marketplace translate="title" module="marketplace">
62
+ <title>Marketplace</title>
63
+ <sort_order>100</sort_order>
64
+ <children>
65
+ <seller translate="title">
66
+ <title>Manage Sellers</title>
67
+ </seller>
68
+ <orderby translate="title">
69
+ <title>Orders By Each Seller</title>
70
+ </orderby>
71
+ <commission translate="title">
72
+ <title>Pending Payment and Commission Report</title>
73
+ </commission>
74
+ </children>
75
+ </marketplace>
76
+ </children>
77
+ </admin>
78
+ </resources>
79
+ </acl>
80
+ </config>
app/code/community/Cybage/Marketplace/etc/config.xml ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Cybage Marketplace Plugin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * It is available on the World Wide Web at:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you are unable to access it on the World Wide Web, please send an email
12
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
13
+ *
14
+ * @category Marketplace Plugin
15
+ * @package Cybage_Marketplace
16
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
17
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
20
+ */
21
+ -->
22
+ <config>
23
+ <modules>
24
+ <Cybage_Marketplace>
25
+ <version>0.1.6</version>
26
+ </Cybage_Marketplace>
27
+ </modules>
28
+ <frontend>
29
+ <routers>
30
+ <marketplace>
31
+ <use>standard</use>
32
+ <args>
33
+ <module>Cybage_Marketplace</module>
34
+ <frontName>marketplace</frontName>
35
+ </args>
36
+ </marketplace>
37
+ <customer>
38
+ <args>
39
+ <modules>
40
+ <cybage_marketplace before="Mage_Customer">Cybage_Marketplace</cybage_marketplace>
41
+ </modules>
42
+ </args>
43
+ </customer>
44
+ </routers>
45
+ <layout>
46
+ <updates>
47
+ <marketplace>
48
+ <file>marketplace.xml</file>
49
+ </marketplace>
50
+ </updates>
51
+ </layout>
52
+ <events>
53
+ <checkout_cart_product_add_after>
54
+ <observers>
55
+ <checkout_product_observer>
56
+ <type>singleton</type>
57
+ <class>Cybage_Marketplace_Model_Observer</class>
58
+ <method>saveSellerId</method>
59
+ </checkout_product_observer>
60
+ </observers>
61
+ </checkout_cart_product_add_after>
62
+ </events>
63
+ </frontend>
64
+ <admin>
65
+ <routers>
66
+ <marketplace>
67
+ <use>admin</use>
68
+ <args>
69
+ <module>Cybage_Marketplace</module>
70
+ <frontName>marketplace</frontName>
71
+ </args>
72
+ </marketplace>
73
+ <adminhtml>
74
+ <args>
75
+ <modules>
76
+ <Cybage_Marketplace_Adminhtml before="Mage_Adminhtml">Cybage_Marketplace_Adminhtml</Cybage_Marketplace_Adminhtml>
77
+ </modules>
78
+ </args>
79
+ </adminhtml>
80
+ </routers>
81
+ </admin>
82
+ <adminhtml>
83
+ <events>
84
+ <catalog_product_attribute_update_before>
85
+ <observers>
86
+ <marketplace>
87
+ <type>singleton</type>
88
+ <class>Cybage_Marketplace_Model_Observer</class>
89
+ <method>validateMassActionProductMarketplaceStatus</method>
90
+ </marketplace>
91
+ </observers>
92
+ </catalog_product_attribute_update_before>
93
+ </events>
94
+ <layout>
95
+ <updates>
96
+ <marketplace>
97
+ <file>marketplace.xml</file>
98
+ </marketplace>
99
+ </updates>
100
+ </layout>
101
+ </adminhtml>
102
+ <global>
103
+ <events>
104
+ <catalog_product_save_before>
105
+ <observers>
106
+ <marketplace>
107
+ <type>singleton</type>
108
+ <class>Cybage_Marketplace_Model_Observer</class>
109
+ <method>validateProductMarketplaceStatus</method>
110
+ </marketplace>
111
+ </observers>
112
+ </catalog_product_save_before>
113
+ </events>
114
+ <models>
115
+ <marketplace>
116
+ <class>Cybage_Marketplace_Model</class>
117
+ <resourceModel>marketplace_resource</resourceModel>
118
+ </marketplace>
119
+ <marketplace_resource>
120
+ <class>Cybage_Marketplace_Model_Resource</class>
121
+ <entities>
122
+ <question>
123
+ <table>marketplace_askquestion_question</table>
124
+ </question>
125
+ <reply>
126
+ <table>marketplace_askquestion_reply</table>
127
+ </reply>
128
+ <commission>
129
+ <table>marketplace_commission</table>
130
+ </commission>
131
+ <buyerseller>
132
+ <table>marketplace_buyersellercomm_notifications</table>
133
+ </buyerseller>
134
+ <logging>
135
+ <table>marketplace_logging</table>
136
+ </logging>
137
+ </entities>
138
+ </marketplace_resource>
139
+ <customer_resource>
140
+ <rewrite>
141
+ <customer>Cybage_Marketplace_Model_Resource_Customer</customer>
142
+ </rewrite>
143
+ </customer_resource>
144
+ <sales>
145
+ <rewrite>
146
+ <order>Cybage_Marketplace_Model_Order</order>
147
+ </rewrite>
148
+ </sales>
149
+ </models>
150
+ <resources>
151
+ <marketplace_setup>
152
+ <setup>
153
+ <module>Cybage_Marketplace</module>
154
+ <class>Mage_Catalog_Model_Resource_Setup</class>
155
+ </setup>
156
+ </marketplace_setup>
157
+ </resources>
158
+ <helpers>
159
+ <marketplace>
160
+ <class>Cybage_Marketplace_Helper</class>
161
+ </marketplace>
162
+ </helpers>
163
+ <blocks>
164
+ <marketplace>
165
+ <class>Cybage_Marketplace_Block</class>
166
+ </marketplace>
167
+ <review_product_view>Cybage_Marketplace_Block_Review_Product_View</review_product_view>
168
+ <review_product_view_list>Cybage_Marketplace_Block_Review_Product_View_List</review_product_view_list>
169
+ <adminhtml>
170
+ <rewrite>
171
+ <catalog_product_grid>Cybage_Marketplace_Block_Adminhtml_Catalog_Product_Grid</catalog_product_grid>
172
+ </rewrite>
173
+ </adminhtml>
174
+ <!--Show products of approved seller only-->
175
+ <catalog>
176
+ <rewrite>
177
+ <product_list>Cybage_Marketplace_Block_Catalog_Product_List</product_list>
178
+ </rewrite>
179
+ </catalog>
180
+ <!--Show products of approved seller only-->
181
+ </blocks>
182
+ <fieldsets>
183
+ <sales_convert_quote_item>
184
+ <seller_id>
185
+ <to_order_item>*</to_order_item>
186
+ </seller_id>
187
+ </sales_convert_quote_item>
188
+ </fieldsets>
189
+ <template>
190
+ <email>
191
+ <sales_email_order_processing_template translate="label" module="sales">
192
+ <label>From Seller</label>
193
+ <file>sales/customer_processing_new.html</file>
194
+ <type>html</type>
195
+ </sales_email_order_processing_template>
196
+ <sales_email_order_completed_template translate="label" module="sales">
197
+ <label>From Seller</label>
198
+ <file>sales/customer_completed_new.html</file>
199
+ <type>html</type>
200
+ </sales_email_order_completed_template>
201
+ <sales_email_order_cancelled_template translate="label" module="sales">
202
+ <label>From Seller</label>
203
+ <file>sales/customer_cancelled_new.html</file>
204
+ <type>html</type>
205
+ </sales_email_order_cancelled_template>
206
+ <sales_email_product_comment_template translate="label" module="sales">
207
+ <label>Product Comment</label>
208
+ <file>sales/product_comment.html</file>
209
+ <type>html</type>
210
+ </sales_email_product_comment_template>
211
+ <marketplace_seller_email_template translate="label" module="marketplace">
212
+ <label>Seller email Template</label>
213
+ <file>newseller_account.html</file>
214
+ <type>html</type>
215
+ </marketplace_seller_email_template>
216
+ <marketplace_seller_email_status_template translate="label" module="marketplace">
217
+ <label>Seller Status Email Template</label>
218
+ <file>seller_status.html</file>
219
+ <type>html</type>
220
+ </marketplace_seller_email_status_template>
221
+ <marketplace_seller_email_payment_template translate="label" module="marketplace">
222
+ <label>Seller Payment Email Template</label>
223
+ <file>seller_payment.html</file>
224
+ <type>html</type>
225
+ </marketplace_seller_email_payment_template>
226
+ <marketplace_seller_order_pending_reminder_template translate="label" module="marketplace">
227
+ <label>Pending Order Reminder Email Template</label>
228
+ <file>pendingorder_reminder.html</file>
229
+ <type>html</type>
230
+ </marketplace_seller_order_pending_reminder_template>
231
+ </email>
232
+ </template>
233
+ </global>
234
+ <default>
235
+ <marketplace>
236
+ <product>
237
+ <status>2</status>
238
+ <visibility>1</visibility>
239
+ <upload_image_size>1519159</upload_image_size>
240
+ </product>
241
+ </marketplace>
242
+ <sales_email>
243
+ <order>
244
+ <enabled>1</enabled>
245
+ <processing_template>sales_email_order_processing_template</processing_template>
246
+ <completed_template>sales_email_order_completed_template</completed_template>
247
+ <cancelled_template>sales_email_order_cancelled_template</cancelled_template>
248
+ <identity>sales</identity>
249
+ </order>
250
+ <product_comment>sales_email_product_comment_template</product_comment>
251
+ </sales_email>
252
+ <seller_page>
253
+ <attribute_name>seller_id</attribute_name>
254
+ <seo_display>marketplace</seo_display>
255
+ </seller_page>
256
+ <!--
257
+ /*For creating new router by srinidhid*/
258
+ -->
259
+ <web>
260
+ <routers>
261
+ <cybagemarketplace>
262
+ <area>frontend</area>
263
+ <class>Cybage_Marketplace_Controller_Router</class>
264
+ </cybagemarketplace>
265
+ </routers>
266
+ </web>
267
+ </default>
268
+ <crontab>
269
+ <jobs>
270
+ <pendingorder_send_all>
271
+ <schedule>
272
+ <cron_expr>0 1 * * *</cron_expr>
273
+ </schedule>
274
+ <run>
275
+ <model>marketplace/observer::pendingorders</model>
276
+ </run>
277
+ </pendingorder_send_all>
278
+ </jobs>
279
+ </crontab>
280
+ </config>
app/code/community/Cybage/Marketplace/etc/system.xml ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Cybage Marketplace Plugin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * It is available on the World Wide Web at:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you are unable to access it on the World Wide Web, please send an email
12
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
13
+ *
14
+ * @category Marketplace Plugin
15
+ * @package Cybage_Marketplace
16
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
17
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
20
+ */
21
+ -->
22
+ <config>
23
+ <tabs>
24
+ <cybage>
25
+ <label>Cybage</label>
26
+ <sort_order>200</sort_order>
27
+ </cybage>
28
+ </tabs>
29
+ <sections>
30
+ <marketplace translate="label" module="marketplace">
31
+ <label>Marketplace</label>
32
+ <tab>cybage</tab>
33
+ <frontend_type>text</frontend_type>
34
+ <sort_order>100</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>1</show_in_store>
38
+ <groups>
39
+ <marketplace translate="label">
40
+ <label>Marketplace Plugin</label>
41
+ <frontend_type>text</frontend_type>
42
+ <sort_order>20</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>1</show_in_store>
46
+ <fields>
47
+ <enable translate="label">
48
+ <label>Enable Marketplace</label>
49
+ <frontend_type>select</frontend_type>
50
+ <source_model>adminhtml/system_config_source_yesno</source_model>
51
+ <sort_order>1</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>1</show_in_store>
55
+ </enable>
56
+ <auto_approval_seller translate="label">
57
+ <depends>
58
+ <enable>1</enable>
59
+ </depends>
60
+ <label>Automatic Approval of Seller</label>
61
+ <frontend_type>select</frontend_type>
62
+ <source_model>adminhtml/system_config_source_yesno</source_model>
63
+ <sort_order>2</sort_order>
64
+ <show_in_default>1</show_in_default>
65
+ <show_in_website>1</show_in_website>
66
+ <show_in_store>1</show_in_store>
67
+ </auto_approval_seller>
68
+ <default_approval_product translate="label">
69
+ <depends>
70
+ <enable>1</enable>
71
+ </depends>
72
+ <label>Default Product Approval for Marketplace</label>
73
+ <frontend_type>select</frontend_type>
74
+ <source_model>adminhtml/system_config_source_yesno</source_model>
75
+ <sort_order>3</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <show_in_website>1</show_in_website>
78
+ <show_in_store>1</show_in_store>
79
+ </default_approval_product>
80
+ <default_commission translate="label">
81
+ <depends>
82
+ <enable>1</enable>
83
+ </depends>
84
+ <label>Default Commission Percentage</label>
85
+ <frontend_type>text</frontend_type>
86
+ <sort_order>4</sort_order>
87
+ <show_in_default>1</show_in_default>
88
+ <show_in_website>1</show_in_website>
89
+ <show_in_store>1</show_in_store>
90
+ </default_commission>
91
+ <default_width translate="label">
92
+ <depends>
93
+ <enable>1</enable>
94
+ </depends>
95
+ <label>Default Company Banner Width</label>
96
+ <comment>Company Banner Default Width in pixel.</comment>
97
+ <frontend_type>text</frontend_type>
98
+ <sort_order>5</sort_order>
99
+ <show_in_default>1</show_in_default>
100
+ <show_in_website>1</show_in_website>
101
+ <show_in_store>1</show_in_store>
102
+ <validate>required-entry validate-digits</validate>
103
+ </default_width>
104
+ <default_height translate="label">
105
+ <depends>
106
+ <enable>1</enable>
107
+ </depends>
108
+ <label>Default Company Banner Height</label>
109
+ <comment>Company Banner Default Height in pixel.</comment>
110
+ <frontend_type>text</frontend_type>
111
+ <sort_order>6</sort_order>
112
+ <show_in_default>1</show_in_default>
113
+ <show_in_website>1</show_in_website>
114
+ <show_in_store>1</show_in_store>
115
+ <validate>required-entry validate-digits</validate>
116
+ </default_height>
117
+ <default_logo_width translate="label">
118
+ <depends>
119
+ <enable>1</enable>
120
+ </depends>
121
+ <label>Default Company Logo Width</label>
122
+ <comment>Company Logo Default Width in pixel.</comment>
123
+ <frontend_type>text</frontend_type>
124
+ <sort_order>7</sort_order>
125
+ <show_in_default>1</show_in_default>
126
+ <show_in_website>1</show_in_website>
127
+ <show_in_store>1</show_in_store>
128
+ <validate>required-entry validate-digits</validate>
129
+ </default_logo_width>
130
+ <default_logo_height translate="label">
131
+ <depends>
132
+ <enable>1</enable>
133
+ </depends>
134
+ <label>Default Company Logo Height</label>
135
+ <comment>Company Logo Default Height in pixel.</comment>
136
+ <frontend_type>text</frontend_type>
137
+ <sort_order>8</sort_order>
138
+ <show_in_default>1</show_in_default>
139
+ <show_in_website>1</show_in_website>
140
+ <show_in_store>1</show_in_store>
141
+ <validate>required-entry validate-digits</validate>
142
+ </default_logo_height>
143
+ </fields>
144
+ </marketplace>
145
+ <product translate="label">
146
+ <label>Product</label>
147
+ <frontend_type>text</frontend_type>
148
+ <sort_order>30</sort_order>
149
+ <show_in_default>1</show_in_default>
150
+ <show_in_website>1</show_in_website>
151
+ <show_in_store>1</show_in_store>
152
+ <fields>
153
+ <status translate="label">
154
+ <label>New Product Status</label>
155
+ <frontend_type>select</frontend_type>
156
+ <source_model>marketplace/system_config_source_product_status</source_model>
157
+ <sort_order>1</sort_order>
158
+ <show_in_default>1</show_in_default>
159
+ <show_in_website>1</show_in_website>
160
+ <show_in_store>1</show_in_store>
161
+ </status>
162
+ <state translate="label">
163
+ <label>New Product State</label>
164
+ <frontend_type>select</frontend_type>
165
+ <source_model>marketplace/system_config_source_product_state</source_model>
166
+ <sort_order>1</sort_order>
167
+ <show_in_default>1</show_in_default>
168
+ <show_in_website>1</show_in_website>
169
+ <show_in_store>1</show_in_store>
170
+ </state>
171
+ <visibility>
172
+ <label>New Product Visibility</label>
173
+ <frontend_type>select</frontend_type>
174
+ <source_model>marketplace/system_config_source_product_visibility</source_model>
175
+ <sort_order>1</sort_order>
176
+ <show_in_default>1</show_in_default>
177
+ <show_in_website>1</show_in_website>
178
+ <show_in_store>1</show_in_store>
179
+ </visibility>
180
+ <upload_image_size>
181
+ <label>Upload File Size</label>
182
+ <comment>File size must be in bytes.</comment>
183
+ <frontend_type>text</frontend_type>
184
+ <sort_order>4</sort_order>
185
+ <show_in_default>1</show_in_default>
186
+ <show_in_website>1</show_in_website>
187
+ <show_in_store>1</show_in_store>
188
+ </upload_image_size>
189
+ <pending translate="label">
190
+ <label>Pending State Id</label>
191
+ <frontend_type>select</frontend_type>
192
+ <source_model>marketplace/system_config_source_product_state</source_model>
193
+ <sort_order>20</sort_order>
194
+
195
+ <show_in_default>1</show_in_default>
196
+ <show_in_website>1</show_in_website>
197
+ <show_in_store>1</show_in_store>
198
+ </pending>
199
+ <approved translate="label">
200
+ <label>Approved State Id</label>
201
+ <frontend_type>select</frontend_type>
202
+ <source_model>marketplace/system_config_source_product_state</source_model>
203
+ <sort_order>30</sort_order>
204
+ <show_in_default>1</show_in_default>
205
+ <show_in_website>1</show_in_website>
206
+ <show_in_store>1</show_in_store>
207
+ </approved>
208
+ <rejected translate="label">
209
+ <label>Rejected State Id</label>
210
+ <frontend_type>select</frontend_type>
211
+ <source_model>marketplace/system_config_source_product_state</source_model>
212
+ <sort_order>40</sort_order>
213
+ <show_in_default>1</show_in_default>
214
+ <show_in_website>1</show_in_website>
215
+ <show_in_store>1</show_in_store>
216
+ </rejected>
217
+ <deleted translate="label">
218
+ <label>Deleted State Id</label>
219
+ <frontend_type>select</frontend_type>
220
+ <source_model>marketplace/system_config_source_product_state</source_model>
221
+ <sort_order>50</sort_order>
222
+ <show_in_default>1</show_in_default>
223
+ <show_in_website>1</show_in_website>
224
+ <show_in_store>1</show_in_store>
225
+ </deleted>
226
+ </fields>
227
+ </product>
228
+ <status translate="label">
229
+ <label>Seller Status Id Setting</label>
230
+ <frontend_type>text</frontend_type>
231
+ <sort_order>21</sort_order>
232
+ <show_in_default>1</show_in_default>
233
+ <show_in_website>1</show_in_website>
234
+ <show_in_store>1</show_in_store>
235
+ <fields>
236
+ <pending translate="label">
237
+ <label>Pending Status Id</label>
238
+ <frontend_type>select</frontend_type>
239
+ <source_model>marketplace/customatributestatus</source_model>
240
+ <sort_order>1</sort_order>
241
+ <show_in_default>1</show_in_default>
242
+ <show_in_website>1</show_in_website>
243
+ <show_in_store>1</show_in_store>
244
+ </pending>
245
+ <approved translate="label">
246
+ <label>Approved Status Id</label>
247
+ <frontend_type>select</frontend_type>
248
+ <source_model>marketplace/customatributestatus</source_model>
249
+ <sort_order>2</sort_order>
250
+ <show_in_default>1</show_in_default>
251
+ <show_in_website>1</show_in_website>
252
+ <show_in_store>1</show_in_store>
253
+ </approved>
254
+ <rejected translate="label">
255
+ <label>Rejected Status Id</label>
256
+ <frontend_type>select</frontend_type>
257
+ <source_model>marketplace/customatributestatus</source_model>
258
+ <sort_order>3</sort_order>
259
+ <show_in_default>1</show_in_default>
260
+ <show_in_website>1</show_in_website>
261
+ <show_in_store>1</show_in_store>
262
+ </rejected>
263
+ <deleted translate="label">
264
+ <label>Deleted Status Id</label>
265
+ <frontend_type>select</frontend_type>
266
+ <source_model>marketplace/customatributestatus</source_model>
267
+ <sort_order>4</sort_order>
268
+ <show_in_default>1</show_in_default>
269
+ <show_in_website>1</show_in_website>
270
+ <show_in_store>1</show_in_store>
271
+ </deleted>
272
+ </fields>
273
+ </status>
274
+ <seller translate="label">
275
+ <label>Email Settings</label>
276
+ <frontend_type>text</frontend_type>
277
+ <sort_order>40</sort_order>
278
+ <show_in_default>1</show_in_default>
279
+ <show_in_website>1</show_in_website>
280
+ <show_in_store>1</show_in_store>
281
+ <fields>
282
+ <email_template translate="label">
283
+ <label>Seller Welcome Email</label>
284
+ <frontend_type>select</frontend_type>
285
+ <source_model>adminhtml/system_config_source_email_template</source_model>
286
+ <sort_order>3</sort_order>
287
+ <show_in_default>1</show_in_default>
288
+ <show_in_website>1</show_in_website>
289
+ <show_in_store>1</show_in_store>
290
+ </email_template>
291
+ <email_status_template translate="label">
292
+ <label>Status Email Template</label>
293
+ <frontend_type>select</frontend_type>
294
+ <source_model>adminhtml/system_config_source_email_template</source_model>
295
+ <sort_order>4</sort_order>
296
+ <show_in_default>1</show_in_default>
297
+ <show_in_website>1</show_in_website>
298
+ <show_in_store>1</show_in_store>
299
+ </email_status_template>
300
+ <email_payment_template translate="label">
301
+ <label>Payment Comission Email Template</label>
302
+ <frontend_type>select</frontend_type>
303
+ <source_model>adminhtml/system_config_source_email_template</source_model>
304
+ <sort_order>5</sort_order>
305
+ <show_in_default>1</show_in_default>
306
+ <show_in_website>1</show_in_website>
307
+ <show_in_store>1</show_in_store>
308
+ </email_payment_template>
309
+ <order_pending_reminder_template translate="label">
310
+ <label>Pending Order Reminder Email Template</label>
311
+ <frontend_type>select</frontend_type>
312
+ <source_model>adminhtml/system_config_source_email_template</source_model>
313
+ <sort_order>6</sort_order>
314
+ <show_in_default>1</show_in_default>
315
+ <show_in_website>1</show_in_website>
316
+ <show_in_store>1</show_in_store>
317
+ </order_pending_reminder_template>
318
+ <order_pending_before_days translate="label">
319
+ <label>Order placement reminder (after specific days)</label>
320
+ <frontend_type>text</frontend_type>
321
+ <sort_order>7</sort_order>
322
+ <show_in_default>1</show_in_default>
323
+ <show_in_website>1</show_in_website>
324
+ <show_in_store>1</show_in_store>
325
+ </order_pending_before_days>
326
+ </fields>
327
+ </seller>
328
+ </groups>
329
+ </marketplace>
330
+ </sections>
331
+ </config>
app/code/community/Cybage/Marketplace/sql/marketplace_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $this->startSetup();
22
+ $this->addAttribute('catalog_category', 'category_marketplace', array(
23
+ 'group' => 'General Information',
24
+ 'type' => 'varchar',
25
+ 'label' => 'Allow Marketplace',
26
+ 'input' => 'select',
27
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
28
+ 'visible' => true,
29
+ 'required' => true,
30
+ 'user_defined' => false,
31
+ 'visible_on_front' => 1,
32
+ 'source' => 'eav/entity_attribute_source_boolean',
33
+ ));
34
+
35
+ $this->addAttribute('catalog_product', 'seller_id', array(
36
+ 'label' => 'Seller',
37
+ 'type' => 'int',
38
+ 'required' => 0,
39
+ 'visible' => true,
40
+ 'input' => 'select',
41
+ 'source' => 'marketplace/source_option',
42
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
43
+ ));
44
+
45
+ $this->addAttribute('catalog_product', 'delivery_time', array(
46
+ 'label' => 'Delivery Time',
47
+ 'type' => 'text',
48
+ 'required' => 0,
49
+ 'visible' => true,
50
+ 'input' => 'text',
51
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
52
+ ));
53
+
54
+ $this->addAttribute('catalog_product', 'shipping_charges', array(
55
+ 'label' => 'Shipping Charges',
56
+ 'type' => 'text',
57
+ 'required' => 0,
58
+ 'visible' => true,
59
+ 'input' => 'text',
60
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
61
+ ));
62
+
63
+ $this->addAttribute('catalog_product', 'marketplace_state', array(
64
+ 'label' => 'Marketplace State',
65
+ 'type' => 'varchar',
66
+ 'required' => 0,
67
+ 'visible' => true,
68
+ 'input' => 'select',
69
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
70
+ 'option' => array(
71
+ 'value' => array(
72
+ 'approved' => array(0 => 'Approved'),
73
+ 'pending' => array(0 => 'Pending'),
74
+ 'rejected' => array(0 => 'Rejected'),
75
+ 'deleted' => array(0 => 'Deleted'),
76
+ )
77
+ ),
78
+ ));
79
+
80
+ // Add status for seller
81
+ $this->addAttribute('customer', 'status', array(
82
+ 'label' => 'Status',
83
+ 'visible' => true,
84
+ 'required' => false,
85
+ 'type' => 'int',
86
+ 'input' => 'select',
87
+ 'source' => 'eav/entity_attribute_source_table',
88
+ ));
89
+
90
+ $tableOptions = $this->getTable('eav_attribute_option');
91
+ $tableOptionValues = $this->getTable('eav_attribute_option_value');
92
+
93
+ // add options for level of politeness
94
+ $attributeId = (int)$this->getAttribute('customer', 'status', 'attribute_id');
95
+ foreach (array('Pending','Approved','Rejected','Deleted') as $sortOrder => $label) {
96
+ // add option
97
+ $data = array(
98
+ 'attribute_id' => $attributeId,
99
+ 'sort_order' => $sortOrder,
100
+ );
101
+ $this->getConnection()->insert($tableOptions, $data);
102
+
103
+ // add option label
104
+ $optionId = (int)$this->getConnection()->lastInsertId($tableOptions, 'option_id');
105
+ $data = array(
106
+ 'option_id' => $optionId,
107
+ 'store_id' => 0,
108
+ 'value' => $label,
109
+ );
110
+ $this->getConnection()->insert($tableOptionValues, $data);
111
+ }
112
+
113
+ // Add seller commision attribute
114
+ $this->addAttribute('customer', 'seller_commission', array(
115
+ 'label' => 'Seller Commission',
116
+ 'visible' => true,
117
+ 'required' => false,
118
+ 'type' => 'text',
119
+ 'input' => 'text',
120
+ ));
121
+
122
+ // Add seller new product state
123
+ $this->addAttribute('customer', 'seller_product_state', array(
124
+ 'label' => 'Seller Product State',
125
+ 'visible' => true,
126
+ 'required' => false,
127
+ 'type' => 'int',
128
+ 'input' => 'select',
129
+ 'source' => 'eav/entity_attribute_source_table',
130
+ 'option' => array(
131
+ 'value' => array(
132
+ 'approved' => array(0 => 'Approved'),
133
+ 'pending' => array(0 => 'Pending'),
134
+ 'rejected' => array(0 => 'Rejected'),
135
+ 'deleted' => array(0 => 'Deleted'),
136
+ )
137
+ ),
138
+ ));
139
+
140
+ // Add seller new product status
141
+ $this->addAttribute('customer', 'seller_product_status', array(
142
+ 'label' => 'Seller Product Status',
143
+ 'visible' => true,
144
+ 'required' => false,
145
+ 'type' => 'int',
146
+ 'input' => 'select',
147
+ 'source' => 'eav/entity_attribute_source_table',
148
+ 'option' => array(
149
+ 'value' => array(
150
+ 'enabled' => array(0 => 'Enabled'),
151
+ 'disabled' => array(0 => 'Disabled'),
152
+ )
153
+ ),
154
+ ));
155
+
156
+ $this->endSetup();
app/code/community/Cybage/Marketplace/sql/marketplace_setup/mysql4-upgrade-0.1.0-0.1.1.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $this->startSetup();
22
+ $this->addAttribute('customer', 'company_banner', array(
23
+ 'type' => 'varchar',
24
+ 'input' => 'text',
25
+ 'label' => 'Company Banner',
26
+ 'global' => true,
27
+ 'visible' => true,
28
+ 'required' => false,
29
+ 'user_defined' => true,
30
+ 'default' => '',
31
+ 'visible_on_front' => true,
32
+ 'note' => 'Upload 700px X 100px for better look'
33
+ ));
34
+ $this->addAttribute('customer', 'company_logo', array(
35
+ 'type' => 'varchar',
36
+ 'input' => 'text',
37
+ 'label' => 'Company logo',
38
+ 'global' => true,
39
+ 'visible' => true,
40
+ 'required' => false,
41
+ 'user_defined' => true,
42
+ 'default' => '',
43
+ 'visible_on_front' => true,
44
+ 'note' => 'Upload 180px X 180px for better look'
45
+ ));
46
+ $this->addAttribute('customer', 'company_locality', array(
47
+ 'type' => 'varchar',
48
+ 'input' => 'text',
49
+ 'label' => 'Company Locality',
50
+ 'global' => true,
51
+ 'visible' => true,
52
+ 'required' => false,
53
+ 'user_defined' => true,
54
+ 'default' => '',
55
+ 'visible_on_front' => true,
56
+ ));
57
+ $this->addAttribute('customer', 'company_name', array(
58
+ 'type' => 'varchar',
59
+ 'input' => 'text',
60
+ 'label' => 'Company Name',
61
+ 'global' => true,
62
+ 'visible' => true,
63
+ 'required' => false,
64
+ 'user_defined' => true,
65
+ 'default' => '',
66
+ 'visible_on_front' => true,
67
+ ));
68
+ $this->addAttribute('customer', 'company_description', array(
69
+ 'type' => 'text',
70
+ 'input' => 'text',
71
+ 'label' => 'Company Description',
72
+ 'global' => true,
73
+ 'visible' => true,
74
+ 'required' => false,
75
+ 'user_defined' => true,
76
+ 'default' => '',
77
+ 'visible_on_front' => true,
78
+ 'is_wysiwyg_enabled'=>true
79
+ ));
80
+
81
+ $this->run("
82
+ CREATE TABLE `{$this->getTable('marketplace/question')}` (
83
+ `entity_id` int(10) unsigned NOT NULL auto_increment,
84
+ `question` text NOT NULL,
85
+ `customer_id` int(10) unsigned,
86
+ `product_id` int(10) unsigned,
87
+ `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
88
+ PRIMARY KEY (`entity_id`),
89
+ CONSTRAINT `FK_askquestion_question_customer_id` FOREIGN KEY (`customer_id`) REFERENCES {$this->getTable('customer_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
90
+ CONSTRAINT `FK_askquestion_question_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
91
+ )
92
+ ENGINE = InnoDB;
93
+
94
+ CREATE TABLE `{$this->getTable('marketplace/reply')}` (
95
+ `entity_id` int(10) unsigned NOT NULL auto_increment,
96
+ `reply` text NOT NULL,
97
+ `customer_id` int(10) unsigned,
98
+ `parent_id` int(10) unsigned NOT NULL,
99
+ `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
100
+ PRIMARY KEY (`entity_id`),
101
+ CONSTRAINT `FK_askquestion_reply_customer_id` FOREIGN KEY (`customer_id`) REFERENCES {$this->getTable('customer_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
102
+ CONSTRAINT `FK_askquestion_reply_askquestion_question` FOREIGN KEY (`parent_id`) REFERENCES {$this->getTable('marketplace/question')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
103
+ )
104
+ ENGINE = InnoDB;
105
+
106
+ ");
107
+
108
+ $this->addAttribute('customer', 'seller_subscriber', array(
109
+ 'type' => 'int',
110
+ 'input' => 'text',
111
+ 'label' => 'Seller Subscriber',
112
+ 'global' => 1,
113
+ 'visible' => 1,
114
+ 'required' => 0,
115
+ 'user_defined' => 1,
116
+ 'default' => 0,
117
+ 'visible_on_front' => 1,
118
+ ));
119
+ $this->endSetup();
app/code/community/Cybage/Marketplace/sql/marketplace_setup/mysql4-upgrade-0.1.1-0.1.2.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $installer = new Mage_Sales_Model_Resource_Setup;
22
+ $installer->startSetup();
23
+ $attribute = array(
24
+ 'type' => 'int',
25
+ 'backend_type' => 'text',
26
+ 'frontend_input' => 'text',
27
+ 'is_user_defined' => true,
28
+ 'label' => 'Seller id',
29
+ 'visible' => true,
30
+ 'required' => false,
31
+ 'user_defined' => true,
32
+ 'searchable' => false,
33
+ 'filterable' => true,
34
+ 'comparable' => true,
35
+ 'default' => 0
36
+ );
37
+ $installer->addAttribute('quote_item', 'seller_id', $attribute);
38
+ $installer->endSetup();
app/code/community/Cybage/Marketplace/sql/marketplace_setup/mysql4-upgrade-0.1.2-0.1.3.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $installer = new Mage_Sales_Model_Resource_Setup;
22
+ $installer->startSetup();
23
+ $attribute = array(
24
+ 'type' => 'int',
25
+ 'backend_type' => 'text',
26
+ 'frontend_input' => 'text',
27
+ 'is_user_defined' => true,
28
+ 'label' => 'Seller id',
29
+ 'visible' => true,
30
+ 'required' => false,
31
+ 'user_defined' => true,
32
+ 'searchable' => false,
33
+ 'filterable' => true,
34
+ 'comparable' => true,
35
+ 'default' => 0
36
+ );
37
+ $installer->addAttribute('order_item', 'seller_id', $attribute);
38
+ $installer->endSetup();
app/code/community/Cybage/Marketplace/sql/marketplace_setup/mysql4-upgrade-0.1.3-0.1.4.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $installer = new Mage_Sales_Model_Resource_Setup('core_setup');
22
+ $installer->startSetup();
23
+ $attribute = array(
24
+ 'type' => 'int',
25
+ 'backend_type' => 'text',
26
+ 'frontend_input' => 'text',
27
+ 'is_user_defined' => true,
28
+ 'label' => 'Shipping Charges',
29
+ 'visible' => true,
30
+ 'required' => false,
31
+ 'user_defined' => true,
32
+ 'searchable' => false,
33
+ 'filterable' => true,
34
+ 'comparable' => true,
35
+ 'default' => 0
36
+ );
37
+ $installer->addAttribute('quote_item', 'shipping_charges', $attribute);
38
+ $installer->addAttribute('order_item', 'shipping_charges', $attribute);
39
+ $installer->endSetup();
app/code/community/Cybage/Marketplace/sql/marketplace_setup/mysql4-upgrade-0.1.4-0.1.5.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $this->startSetup();
22
+
23
+ $this->run("
24
+ CREATE TABLE `{$this->getTable('marketplace/commission')}` (
25
+ `id` int(10) unsigned NOT NULL auto_increment,
26
+ `seller_id` int(10) unsigned,
27
+ `amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
28
+ `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
29
+ PRIMARY KEY (`id`),
30
+ CONSTRAINT `FK_commission_id` FOREIGN KEY (`seller_id`) REFERENCES {$this->getTable('customer_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
31
+ )ENGINE = InnoDB;
32
+ ");
33
+
34
+ $this->endSetup();
app/code/community/Cybage/Marketplace/sql/marketplace_setup/mysql4-upgrade-0.1.5-0.1.6.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $installer = $this;
22
+ $installer->startSetup();
23
+ $installer->run("
24
+ CREATE TABLE `{$installer->getTable('marketplace/buyerseller')}` (
25
+ `entity_id` int(10) unsigned NOT NULL auto_increment,
26
+ `order_id` int(10) unsigned,
27
+ `customer_id` int(10) unsigned,
28
+ `product_id` int(10) unsigned,
29
+ `flag` int(10) unsigned,
30
+ `comment` text NOT NULL,
31
+ `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
32
+ PRIMARY KEY (`entity_id`),
33
+ CONSTRAINT `FK_buyersellercomm_notifications_order_id` FOREIGN KEY (`order_id`) REFERENCES {$this->getTable('sales_flat_order')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
34
+ CONSTRAINT `FK_buyersellercomm_notifications_customer_id` FOREIGN KEY (`customer_id`) REFERENCES {$this->getTable('customer_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
35
+ CONSTRAINT `FK_buyersellercomm_notifications_product_id` FOREIGN KEY (`product_id`) REFERENCES {$this->getTable('catalog_product_entity')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
36
+ )
37
+ ENGINE = InnoDB;
38
+
39
+ CREATE TABLE `{$installer->getTable('marketplace/logging')}` (
40
+ `log_id` int(10) unsigned NOT NULL auto_increment,
41
+ `customer_id` int(11) NOT NULL default '0',
42
+ `action` enum('SAVE','EDIT','DELETE') NOT NULL default 'SAVE',
43
+ `customer_ip` varchar(45),
44
+ `created_at` datetime NOT NULL default '0000-00-00 00:00:00',
45
+ `result` enum('SUCCESS','FAILURE') NOT NULL default 'FAILURE',
46
+ PRIMARY KEY (`log_id`)
47
+ )
48
+ ENGINE = InnoDB;"
49
+ );
50
+
51
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/marketplace.xml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Cybage Marketplace Plugin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * It is available on the World Wide Web at:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you are unable to access it on the World Wide Web, please send an email
12
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
13
+ *
14
+ * @category Marketplace Plugin
15
+ * @package Cybage_Marketplace
16
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
17
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
20
+ */
21
+ -->
22
+ <layout version="0.1.0">
23
+ <marketplace_adminhtml_seller_index>
24
+ <reference name="content">
25
+ <block type="marketplace/adminhtml_seller" name="seller" />
26
+ </reference>
27
+ </marketplace_adminhtml_seller_index>
28
+ <marketplace_adminhtml_orderby_index>
29
+ <reference name="messages">
30
+ <action method="addNotice" translate="message">
31
+ <message>This report depends on timezone configuration. Once timezone is changed, the lifetime statistics need to be refreshed.</message>
32
+ </action>
33
+ </reference>
34
+ <reference name="content">
35
+ <block type="marketplace/adminhtml_orderby" template="report/grid/container.phtml" name="marketplace.report.refreshstatistics" >
36
+ <block type="adminhtml/store_switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher">
37
+ <action method="setStoreVarName"><var_name>store_ids</var_name></action>
38
+ </block>
39
+ <block type="marketplace/adminhtml_orderby_form" name="grid.filter.form">
40
+ <action method="setFieldVisibility">
41
+ <field>report_type</field>
42
+ <visibility>0</visibility>
43
+ </action>
44
+ </block>
45
+ </block>
46
+ </reference>
47
+ </marketplace_adminhtml_orderby_index>
48
+ <marketplace_adminhtml_commission_index>
49
+ <reference name="content">
50
+ <block type="marketplace/adminhtml_commission" name="commission" />
51
+ </reference>
52
+ </marketplace_adminhtml_commission_index>
53
+ <marketplace_adminhtml_commission_payhistory>
54
+ <block type="core/text_list" name="root" output="toHtml">
55
+ <block type="marketplace/adminhtml_commission_edit_tab_payhistory" name="payhistory" />
56
+ </block>
57
+ </marketplace_adminhtml_commission_payhistory>
58
+ </layout>
app/design/frontend/base/default/layout/marketplace.xml ADDED
@@ -0,0 +1,596 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Cybage Marketplace Plugin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * It is available on the World Wide Web at:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you are unable to access it on the World Wide Web, please send an email
12
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
13
+ *
14
+ * @category Marketplace Plugin
15
+ * @package Cybage_Marketplace
16
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
17
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
20
+ */
21
+ -->
22
+ <layout version="0.1.0">
23
+ <!--
24
+ Marketplace Product Grid layout
25
+ -->
26
+ <marketplace_product_index>
27
+ <reference name="root">
28
+ <action method="setTemplate">
29
+ <template>page/2columns-left.phtml</template>
30
+ </action>
31
+ </reference>
32
+ <reference name="head">
33
+ <action method="addItem">
34
+ <type>skin_css</type>
35
+ <name>css/marketplace/styles.css</name>
36
+ </action>
37
+ <action method="setTitle" translate="title" module="marketplace">
38
+ <title>Marketplace Product Grid</title>
39
+ </action>
40
+ </reference>
41
+ <update handle="customer_account"/>
42
+ <reference name="content">
43
+ <remove name="viewed_product" />
44
+ <block type="marketplace/product" name="marketplace.product.grid" template="marketplace/product/grid.phtml"/>
45
+ </reference>
46
+ </marketplace_product_index>
47
+
48
+ <marketplace_dashboard_index>
49
+ <reference name="root">
50
+ <action method="setTemplate">
51
+ <template>page/2columns-left.phtml</template>
52
+ </action>
53
+ </reference>
54
+ <reference name="head">
55
+ <action method="addItem">
56
+ <type>skin_css</type>
57
+ <name>css/marketplace/styles.css</name>
58
+ </action>
59
+ <action method="setTitle" translate="title" module="marketplace">
60
+ <title>Marketplace Dashboard</title>
61
+ </action>
62
+ </reference>
63
+ <update handle="customer_account"/>
64
+ <reference name="content">
65
+ <block type="core/template" name="marketplace.dashboard" as="marketplace_dashboard" template="marketplace/dashboard/dashboard.phtml" />
66
+ <block type="core/template" name="marketplace.bestseller" as="marketplace_bestseller" template="marketplace/dashboard/bestseller.phtml"/>
67
+ <block type="core/template" as="marketplace_askquestionnotification" name="marketplace.askquestionnotification" template="marketplace/dashboard/dashboard/askquestionnotification.phtml"/>
68
+ <block type="core/template" name="marketplace.myorders" as="marketplace_myorders" template="marketplace/dashboard/myorders.phtml"/>
69
+ <block type="core/template" name="marketplace.questioncount" as="marketplace_questioncount" template="marketplace/dashboard/questioncount.phtml"/>
70
+ <block type="core/template" name="marketplace.notificationcount" as="marketplace_notificationcount" template="marketplace/dashboard/notificationcount.phtml"/>
71
+ </reference>
72
+ </marketplace_dashboard_index>
73
+
74
+ <!--
75
+ Marketplace Product Add layout
76
+ -->
77
+ <marketplace_product_add>
78
+ <reference name="root">
79
+ <action method="setTemplate">
80
+ <template>page/2columns-left.phtml</template>
81
+ </action>
82
+ </reference>
83
+ <reference name="head">
84
+ <action method="addItem">
85
+ <type>skin_css</type>
86
+ <name>css/marketplace/styles.css</name>
87
+ </action>
88
+ <action method="addItem">
89
+ <type>js</type>
90
+ <name>tiny_mce/tiny_mce.js</name>
91
+ </action>
92
+ <action method="setTitle" translate="title" module="marketplace">
93
+ <title>Marketplace Product Add</title>
94
+ </action>
95
+ </reference>
96
+
97
+ <update handle="customer_account"/>
98
+ <reference name="content">
99
+ <!--<remove name="viewed_product" /> -->
100
+ <block type="marketplace/product" name="marketplace.product.add" template="marketplace/product/add.phtml">
101
+ </block>
102
+ </reference>
103
+ </marketplace_product_add>
104
+
105
+ <!--
106
+ Marketplace Product import layout
107
+ -->
108
+ <marketplace_product_import>
109
+ <reference name="root">
110
+ <action method="setTemplate">
111
+ <template>page/2columns-left.phtml</template>
112
+ </action>
113
+ </reference>
114
+ <reference name="head">
115
+ <action method="addItem">
116
+ <type>skin_css</type>
117
+ <name>css/marketplace/styles.css</name>
118
+ </action>
119
+ <action method="setTitle" translate="title" module="marketplace">
120
+ <title>Marketplace Product Import</title>
121
+ </action>
122
+ </reference>
123
+ <update handle="customer_account"/>
124
+ <reference name="content">
125
+ <!--<remove name="viewed_product" /> -->
126
+ <block type="marketplace/product" name="marketplace.product.import" template="marketplace/product/import.phtml">
127
+ </block>
128
+ </reference>
129
+ </marketplace_product_import>
130
+
131
+ <!--
132
+ Marketplace Product Edit layout
133
+ -->
134
+ <marketplace_product_edit>
135
+ <reference name="root">
136
+ <action method="setTemplate">
137
+ <template>page/2columns-left.phtml</template>
138
+ </action>
139
+ </reference>
140
+ <reference name="head">
141
+ <action method="addItem">
142
+ <type>skin_css</type>
143
+ <name>css/marketplace/styles.css</name>
144
+ </action>
145
+ <action method="addItem">
146
+ <type>js</type>
147
+ <name>tiny_mce/tiny_mce.js</name>
148
+ </action>
149
+ <action method="setTitle" translate="title" module="marketplace">
150
+ <title>Marketplace Product Edit</title>
151
+ </action>
152
+ </reference>
153
+ <update handle="customer_account"/>
154
+ <reference name="content">
155
+ <!--<remove name="viewed_product" /> -->
156
+ <block type="marketplace/product" name="marketplace.product.edit" template="marketplace/product/edit.phtml">
157
+ </block>
158
+ </reference>
159
+ </marketplace_product_edit>
160
+
161
+ <marketplace_account_vieworder>
162
+ <reference name="root">
163
+ <action method="setTemplate">
164
+ <template>page/2columns-left.phtml</template>
165
+ </action>
166
+ </reference>
167
+ <!--for left hand navigation of customer-->
168
+ <update handle="customer_account"/>
169
+ <reference name="head">
170
+ <action method="addItem">
171
+ <type>skin_css</type>
172
+ <name>css/marketplace/styles.css</name>
173
+ </action>
174
+ <action method="addItem">
175
+ <type>js</type>
176
+ <name>jquery/jquery-1.9.1.min.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>-->
177
+ </action>
178
+ </reference>
179
+ <reference name="content">
180
+ <block type="marketplace/myorders" name="marketplace.myorders" template="marketplace/customer/account/vieworder.phtml">
181
+ <block type="marketplace/myorders_view" name="marketplace.items" as="items" template="marketplace/customer/account/myorders/items.phtml">
182
+ <action method="addItemRender">
183
+ <type>default</type>
184
+ <block>sales/order_item_renderer_default</block>
185
+ <template>marketplace/sales/myorder/items/renderer/default.phtml</template>
186
+ </action>
187
+ <block type="marketplace/myorders_totals" name="myorders_totals" as="myorders_totals" template="marketplace/customer/account/myorders/totals.phtml">
188
+ <action method="setLabelProperties">
189
+ <value>colspan="4" class="a-right"</value>
190
+ </action>
191
+ <action method="setValueProperties">
192
+ <value>class="last a-right"</value>
193
+ </action>
194
+ <block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml" />
195
+ </block>
196
+ </block>
197
+ <block type="marketplace/myorders_view" name="marketplace.selleroptions" as="selleroptions" template="marketplace/customer/account/selleroptions.phtml"/>
198
+ </block>
199
+ </reference>
200
+ </marketplace_account_vieworder>
201
+
202
+ <marketplace_order_printorder>
203
+ <reference name="root">
204
+ <action method="setTemplate"><template>page/empty.phtml</template></action>
205
+ </reference>
206
+ <reference name="content">
207
+ <block type="marketplace/myorders_view" name="marketplace.myordersprint" template="marketplace/customer/account/print.phtml">
208
+ <action method="addItemRender"><type>default</type><block>sales/order_item_renderer_default</block><template>sales/order/items/renderer/default.phtml</template></action>
209
+ <action method="addItemRender"><type>grouped</type><block>sales/order_item_renderer_grouped</block><template>sales/order/items/renderer/default.phtml</template></action>
210
+ </block>
211
+ </reference>
212
+ </marketplace_order_printorder>
213
+
214
+ <customer_account translate="label">
215
+ <reference name="customer_account_navigation">
216
+ <action method="setTemplate"><template>marketplace/customer/account/navigation.phtml</template></action>
217
+ <action method="addLink" translate="label" module="customer">
218
+ <name>marketplace</name>
219
+ <path>marketplace/dashboard</path>
220
+ <label>Marketplace Dashboard</label>
221
+ </action>
222
+ <action method="addLink" translate="label" module="customer">
223
+ <name>marketplace_orders</name>
224
+ <path>marketplace/order/history</path>
225
+ <label>Marketplace Orders</label>
226
+ </action>
227
+ <action method="addLink" translate="label" module="customer">
228
+ <name>marketplace_product</name>
229
+ <path>marketplace/product</path>
230
+ <label>Marketplace Product</label>
231
+ </action>
232
+ <action method="addLink" translate="label" module="customer">
233
+ <name>marketplace_product_add</name>
234
+ <path>marketplace/product/add</path>
235
+ <label>Marketplace Product Add</label>
236
+ </action>
237
+ <action method="addLink" translate="label" module="customer">
238
+ <name>marketplace_product_import</name>
239
+ <path>marketplace/product/import</path>
240
+ <label>Marketplace Product Import</label>
241
+ </action>
242
+ <action method="addLink" translate="label" module="customer">
243
+ <name>marketplace_products_question</name>
244
+ <path>marketplace/productquestion</path>
245
+ <label>My Question</label>
246
+ </action>
247
+ </reference>
248
+ </customer_account>
249
+
250
+ <catalog_product_view>
251
+ <reference name="head">
252
+ <action method="addItem">
253
+ <type>skin_css</type>
254
+ <name>css/marketplace/jquery.fancybox-1.3.4.css</name>
255
+ </action>
256
+ <action method="addItem">
257
+ <type>js</type>
258
+ <name>marketplace/fancybox/jquery-1.7.2.min.js</name>
259
+ </action>
260
+ <action method="addItem">
261
+ <type>js</type>
262
+ <name>marketplace/fancybox/jquery.noconflict.js</name>
263
+ </action>
264
+ <action method="addItem">
265
+ <type>js</type>
266
+ <name>marketplace/fancybox/jquery.mousewheel-3.0.4.pack.js</name>
267
+ </action>
268
+ <action method="addItem">
269
+ <type>js</type>
270
+ <name>marketplace/fancybox/jquery.fancybox-1.3.4.pack.js</name>
271
+ </action>
272
+ </reference>
273
+ <reference name="product.info">
274
+ <action method="setTemplate">
275
+ <template>marketplace/catalog/product/view.phtml</template>
276
+ </action>
277
+ <block type="marketplace/catalog_product_view" name="catalog.product.view.sellerinfo" as="catalog_product_view_sellerinfo" template="marketplace/catalog/product/view/sellerinfo.phtml" />
278
+ <block type="marketplace/product_askquestion_link" name="marketplace.product.askquestion.link" as="product_askquestion_link" template="marketplace/catalog/product/askquestion/link.phtml" />
279
+ </reference>
280
+ </catalog_product_view>
281
+
282
+ <marketplace_productquestion_link>
283
+ <reference name="root">
284
+ <action method="setTemplate">
285
+ <template>page/popup.phtml</template>
286
+ </action>
287
+ </reference>
288
+ <reference name="head">
289
+ <action method="addItem">
290
+ <type>skin_css</type>
291
+ <name>css/marketplace/styles.css</name>
292
+ </action>
293
+ </reference>
294
+ <reference name="content">
295
+ <block type="core/template" name="product.ask.form" template="marketplace/catalog/product/askquestion/form.phtml">
296
+ <block type="core/messages" name="global_messages" as="global_messages"/>
297
+ </block>
298
+ </reference>
299
+ </marketplace_productquestion_link>
300
+
301
+ <marketplace_order_history translate="label">
302
+ <label>Customer My Account Order History</label>
303
+ <update handle="customer_account"/>
304
+ <reference name="head">
305
+ <action method="addItem">
306
+ <type>skin_css</type>
307
+ <name>css/marketplace/styles.css</name>
308
+ </action>
309
+ <action method="addItem">
310
+ <type>js_css</type>
311
+ <name>calendar/calendar-win2k-1.css</name>
312
+ <params/><!--<if/><condition>can_load_calendar_js</condition>-->
313
+ </action>
314
+ <action method="addItem">
315
+ <type>js</type>
316
+ <name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>-->
317
+ </action>
318
+ <action method="addItem">
319
+ <type>js</type>
320
+ <name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>-->
321
+ </action>
322
+ <action method="addItem">
323
+ <type>js</type>
324
+ <name>jquery/jquery-1.9.1.min.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>-->
325
+ </action>
326
+ </reference>
327
+ <reference name="my.account.wrapper">
328
+ <block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
329
+ <block type="marketplace/sales_order_history" name="sales.order.history">
330
+ <block type="core/text_list" name="sales.order.history.info" as="info" translate="label">
331
+ <label>Order History Info</label>
332
+ </block>
333
+ </block>
334
+ <!--block type="customer/account_dashboard" name="customer.account.link.back" template="customer/account/link/back.phtml"/-->
335
+ </reference>
336
+ </marketplace_order_history>
337
+
338
+ <marketplace_productquestion_index>
339
+ <reference name="root">
340
+ <action method="setTemplate">
341
+ <template>page/2columns-left.phtml</template>
342
+ </action>
343
+ </reference>
344
+ <update handle="customer_account"/>
345
+ <reference name="content">
346
+ <block type="marketplace/product_askquestion_myquestions" name="marketplace.product.askquestion.myquestions" as="product_askquestion_myQuestions" template="marketplace/catalog/product/askquestion/myquestions.phtml" />
347
+ <block type="marketplace/product_askquestion_productquestions" name="marketplace.product.askquestion.productquestions" as="product_askquestion_productquestions" template="marketplace/catalog/product/askquestion/productquestions.phtml" />
348
+ </reference>
349
+ </marketplace_productquestion_index>
350
+
351
+ <marketplace_productquestion_reply>
352
+ <reference name="root">
353
+ <action method="setTemplate">
354
+ <template>page/2columns-left.phtml</template>
355
+ </action>
356
+ </reference>
357
+
358
+ <update handle="customer_account"/>
359
+
360
+ <reference name="content">
361
+ <block type="marketplace/product_askquestion_replyform" name="marketplace.product.askquestion.reply.form" as="product_askquestion_replyform" template="marketplace/catalog/product/askquestion/reply_form.phtml"/>
362
+ </reference>
363
+ </marketplace_productquestion_reply>
364
+
365
+ <!-- //Layout node for sellerinfo page -->
366
+ <marketplace_seller_sellerinfo translate="label">
367
+ <reference name="root">
368
+ <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
369
+ </reference>
370
+ <reference name="head">
371
+ <action method="addItem">
372
+ <type>skin_css</type>
373
+ <name>css/marketplace/styles.css</name>
374
+ </action>
375
+ <action method="setTitle" translate="title" module="marketplace">
376
+ <title>Seller Information page</title>
377
+ </action>
378
+ </reference>
379
+ <reference name="left">
380
+ <block type="marketplace/seller_info" name="seller_logo" before="-" template="marketplace/seller/logo.phtml"/>
381
+ <block type="core/template" template="marketplace/seller/ratings.phtml" />
382
+ </reference>
383
+ <reference name="content">
384
+ <block type="marketplace/seller_info" name="seller_info" template="marketplace/seller/info.phtml"/>
385
+ </reference>
386
+ </marketplace_seller_sellerinfo>
387
+
388
+ <marketplace_seller_rating translate="label">
389
+ <reference name="root">
390
+ <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
391
+ </reference>
392
+ <reference name="head">
393
+ <action method="addItem">
394
+ <type>skin_css</type>
395
+ <name>css/marketplace/styles.css</name>
396
+ </action>
397
+ <action method="setTitle" translate="title" module="marketplace">
398
+ <title>Seller Ratings Information page</title>
399
+ </action>
400
+ </reference>
401
+ <reference name="content">
402
+ <block type="marketplace/review_product_view" name="seller_rating" template="marketplace/review/product/view/list.phtml">
403
+ </block>
404
+ <block type="core/template" name="product_review" as="product_review" template="marketplace/seller/seller_ratings.phtml" />
405
+ </reference>
406
+ </marketplace_seller_rating>
407
+
408
+ <customer_account_edit translate="label">
409
+ <reference name="head">
410
+ <action method="addItem">
411
+ <type>js</type>
412
+ <name>marketplace/nicEdit-latest.js</name>
413
+ </action>
414
+ </reference>
415
+ <reference name="my.account.wrapper">
416
+ <block type="customer/form_edit" name="customer_edit" template="marketplace/customer/form/edit.phtml"/>
417
+ </reference>
418
+ </customer_account_edit>
419
+
420
+ <customer_account_create>
421
+ <reference name="customer_form_register">
422
+ <action method="setTemplate"><template>marketplace/persistent/customer/form/register.phtml</template></action>
423
+ <block type="persistent/form_remember" name="persistent.remember.me" template="persistent/remember_me.phtml" />
424
+ <block type="core/template" name="persistent.remember.me.tooltip" template="persistent/remember_me_tooltip.phtml" />
425
+ </reference>
426
+ </customer_account_create>
427
+
428
+ <sales_order_view translate="label">
429
+ <reference name="head">
430
+ <action method="addItem">
431
+ <type>skin_css</type>
432
+ <name>css/marketplace/jquery.fancybox-1.3.4.css</name>
433
+ </action>
434
+ <action method="addItem">
435
+ <type>js</type>
436
+ <name>marketplace/fancybox/jquery-1.7.2.min.js</name>
437
+ </action>
438
+ <action method="addItem">
439
+ <type>js</type>
440
+ <name>marketplace/fancybox/jquery.noconflict.js</name>
441
+ </action>
442
+ <action method="addItem">
443
+ <type>js</type>
444
+ <name>marketplace/fancybox/jquery.mousewheel-3.0.4.pack.js</name>
445
+ </action>
446
+ <action method="addItem">
447
+ <type>js</type>
448
+ <name>marketplace/fancybox/jquery.fancybox-1.3.4.pack.js</name>
449
+ </action>
450
+ <!-- <action method="addItem">
451
+ <type>skin_css</type>
452
+ <name>css/marketplace/styles.css</name>
453
+ </action> -->
454
+ </reference>
455
+ <reference name="my.account.wrapper">
456
+ <block type="sales/order_view" name="sales.order.view">
457
+ <block type="sales/order_items" name="order_items" template="marketplace/sales/order/items.phtml">
458
+ <action method="addItemRender"><type>default</type><block>sales/order_item_renderer_default</block><template>marketplace/sales/order/items/renderer/default.phtml</template></action>
459
+ <action method="addItemRender"><type>grouped</type><block>sales/order_item_renderer_grouped</block><template>marketplace/sales/order/items/renderer/default.phtml</template></action>
460
+ </block>
461
+ </block>
462
+ </reference>
463
+ </sales_order_view>
464
+
465
+ <marketplace_buyerseller_comment>
466
+ <reference name="root">
467
+ <action method="setTemplate">
468
+ <template>page/popup.phtml</template>
469
+ </action>
470
+ </reference>
471
+ <reference name="head">
472
+ <action method="addItem">
473
+ <type>skin_css</type>
474
+ <name>css/marketplace/styles.css</name>
475
+ </action>
476
+ </reference>
477
+ <reference name="content">
478
+ <block type="core/template" name="product.ask.form" template="marketplace/sales/order/form.phtml">
479
+ <block type="core/messages" name="global_messages" as="global_messages"/>
480
+ </block>
481
+ </reference>
482
+ </marketplace_buyerseller_comment>
483
+
484
+ <marketplace_buyerseller_reply>
485
+ <reference name="root">
486
+ <action method="setTemplate">
487
+ <template>page/2columns-left.phtml</template>
488
+ </action>
489
+ </reference>
490
+ <update handle="customer_account"/>
491
+ <reference name="content">
492
+ <block type="marketplace/buyerseller" name="marketplace.buyerseller" template="marketplace/buyerseller/reply.phtml">
493
+ <block type="core/messages" name="global_messages" as="global_messages"/>
494
+ </block>
495
+ </reference>
496
+ </marketplace_buyerseller_reply>
497
+
498
+ <marketplace_buyerseller_notification>
499
+ <reference name="root">
500
+ <action method="setTemplate">
501
+ <template>page/2columns-left.phtml</template>
502
+ </action>
503
+ </reference>
504
+ <update handle="customer_account"/>
505
+ <reference name="content">
506
+ <block type="marketplace/buyerseller" name="marketplace.buyerseller" template="marketplace/buyerseller/notify.phtml"> </block>
507
+ </reference>
508
+ </marketplace_buyerseller_notification>
509
+
510
+ <sales_order_history translate="label">
511
+ <update name="my.account.wrapper">
512
+ <block type="maketplace/buyerseller_sales_order_history" name="sales.order.history" template="marketplace/buyerseller/sales/order/history.phtml">
513
+ <block type="core/text_list" name="sales.order.history.info" as="info" translate="label">
514
+ <label>Order History Info</label>
515
+ </block>
516
+ </block>
517
+ <block type="customer/account_dashboard" name="customer.account.link.back" template="customer/account/link/back.phtml"/>
518
+ </update>
519
+ </sales_order_history>
520
+
521
+ <marketplace_order_ship>
522
+ <reference name="root">
523
+ <action method="setTemplate">
524
+ <template>page/2columns-left.phtml</template>
525
+ </action>
526
+ </reference>
527
+ <!--for left hand navigation of customer-->
528
+ <update handle="customer_account"/>
529
+ <reference name="content">
530
+ <block type="marketplace/myorders" name="marketplace.myorders" template="marketplace/customer/account/shiporder.phtml">
531
+ <block type="marketplace/myorders_view" name="marketplace.items" as="items" template="marketplace/customer/account/myorders/shipitems.phtml">
532
+ <action method="addItemRender">
533
+ <type>default</type>
534
+ <block>sales/order_item_renderer_default</block>
535
+ <template>marketplace/sales/myorder/items/renderer/ship/default.phtml</template>
536
+ </action>
537
+ <block type="marketplace/myorders_totals" name="myorders_totals" as="myorders_totals" template="marketplace/customer/account/myorders/totals.phtml">
538
+ <action method="setLabelProperties">
539
+ <value>colspan="4" class="a-right"</value>
540
+ </action>
541
+ <action method="setValueProperties">
542
+ <value>class="last a-right"</value>
543
+ </action>
544
+ <block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml" />
545
+ </block>
546
+ </block>
547
+ </block>
548
+ </reference>
549
+ </marketplace_order_ship>
550
+
551
+ <checkout_cart_index translate="label">
552
+ <reference name="checkout.cart">
553
+ <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>marketplace/checkout/cart/item/default.phtml</template></action>
554
+ <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>marketplace/checkout/cart/item/default.phtml</template></action>
555
+ <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>marketplace/checkout/cart/item/default.phtml</template></action>
556
+ </reference>
557
+ </checkout_cart_index>
558
+
559
+ <checkout_multishipping_addresses translate="label">
560
+ <reference name="checkout_addresses">
561
+ <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>marketplace/checkout/multishipping/item/default.phtml</template></action>
562
+ <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>marketplace/checkout/multishipping/item/default.phtml</template></action>
563
+ <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>marketplace/checkout/multishipping/item/default.phtml</template></action>
564
+ </reference>
565
+ </checkout_multishipping_addresses>
566
+
567
+ <checkout_multishipping_shipping translate="label">
568
+ <reference name="checkout_shipping">
569
+ <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>marketplace/checkout/multishipping/item/default.phtml</template></action>
570
+ <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>marketplace/checkout/multishipping/item/default.phtml</template></action>
571
+ <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>marketplace/checkout/multishipping/item/default.phtml</template></action>
572
+ </reference>
573
+ <reference name="checkout_billing_items">
574
+ <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>marketplace/checkout/multishipping/item/default.phtml</template></action>
575
+ <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>marketplace/checkout/multishipping/item/default.phtml</template></action>
576
+ <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>marketplace/checkout/multishipping/item/default.phtml</template></action>
577
+ </reference>
578
+ </checkout_multishipping_shipping>
579
+
580
+ <checkout_onepage_review translate="label">
581
+ <block type="checkout/onepage_review_info" name="root" output="toHtml" template="checkout/onepage/review/info.phtml">
582
+ <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>marketplace/checkout/onepage/review/item.phtml</template></action>
583
+ <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>marketplace/checkout/onepage/review/item.phtml</template></action>
584
+ <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>marketplace/checkout/onepage/review/item.phtml</template></action>
585
+ <block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="checkout/onepage/review/totals.phtml"/>
586
+ <block type="core/text_list" name="checkout.onepage.review.info.items.before" as="items_before" translate="label">
587
+ <label>Items Before</label>
588
+ </block>
589
+ <block type="core/text_list" name="checkout.onepage.review.info.items.after" as="items_after" translate="label">
590
+ <label>Items After</label>
591
+ </block>
592
+ <block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>
593
+ <block type="core/template" name="checkout.onepage.review.button" as="button" template="checkout/onepage/review/button.phtml"/>
594
+ </block>
595
+ </checkout_onepage_review>
596
+ </layout>
app/design/frontend/base/default/template/marketplace/buyerseller/notify.phtml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ $collection = Mage::getModel("marketplace/buyerseller")->getColection();
21
+ echo $this->getMessagesBlock()->getGroupedHtml();
22
+ ?>
23
+ <div class="page-title">
24
+ <h1><?php echo $this->__('Past Comments') ?></h1>
25
+ </div>
26
+ <?php //echo $this->getPagerHtml(); ?>
27
+ <?php if(count($collection)): ?>
28
+ <table class="data-table" id="my-orders-table">
29
+ <col width="1" />
30
+ <col width="1" />
31
+ <thead>
32
+ <tr>
33
+ <th><?php echo $this->__('Comments') ?></th>
34
+ <th><?php echo $this->__('Date') ?></th>
35
+ </tr>
36
+ </thead>
37
+ <tbody>
38
+ <?php $_odd = ''; ?>
39
+ <?php foreach ($collection as $data): ?>
40
+ <tr>
41
+ <td>
42
+ <?php
43
+ $buyer = $data[0]['customer_id'];
44
+ $seller = $data[0]['seller_id'];
45
+
46
+ if($buyer ==$seller){
47
+ $from = "Seller";
48
+ }else{
49
+ $from = "Buyer";
50
+ }
51
+ ?>
52
+ <p> <?php echo $this->__("For Product ".$data[0]['value']." by ".$from." ". $data[0]['fullname'])?></p>
53
+ <p><?php echo $data[0]['comment'] ?></p>
54
+ </td>
55
+ <td><span class="nobr"><?php echo $this->formatDate($data[0]['created_at']) ?></span></td>
56
+ </tr>
57
+ <?php endforeach; ?>
58
+ </tbody>
59
+ </table>
60
+ <script type="text/javascript">decorateTable('my-orders-table');</script>
61
+ <?php //echo $this->getPagerHtml(); ?>
62
+
63
+ <?php else: ?>
64
+ <p><?php echo $this->__('You have received no orders comments.'); ?></p>
65
+ <?php endif ?>
app/design/frontend/base/default/template/marketplace/buyerseller/reply.phtml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ $collection = Mage::getModel("marketplace/buyerseller")->getColection();
21
+ ?>
22
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
23
+ <div class="page-title">
24
+ <h1><?php echo $this->__('Marketplace Orders') ?></h1>
25
+ </div>
26
+ <?php // echo $this->getPagerHtml(); ?>
27
+ <?php if(count($collection)): ?>
28
+ <table class="data-table" id="my-orders-table">
29
+ <col width="1" />
30
+ <col width="1" />
31
+ <col width="1" />
32
+ <col width="1" />
33
+ <col width="1" />
34
+ <thead>
35
+ <tr>
36
+ <th><?php echo $this->__('Order #') ?></th>
37
+ <th><?php echo $this->__('Date') ?></th>
38
+ <th><?php echo $this->__('Product') ?></th>
39
+ <th><?php echo $this->__('Comment') ?></th>
40
+ <th><?php echo $this->__('From') ?></th>
41
+ </tr>
42
+ </thead>
43
+ <tbody>
44
+ <?php $_odd = ''; ?>
45
+ <?php foreach ($collection as $_order): ?>
46
+ <tr>
47
+ <td><?php echo $_order[0]['increment_id'] ?></td>
48
+ <td><span class="nobr"><?php echo $this->formatDate($_order[0]['created_at']) ?></span></td>
49
+ <td><?php echo $_order[0]['value'] ?></td>
50
+ <td><?php echo $_order[0]['comment'] ?></td>
51
+ <td><em><?php echo $_order[0]['customer_firstname']." ".$_order[0]['customer_lastname'] ?></em></td>
52
+
53
+ </tr>
54
+ <?php endforeach; ?>
55
+ </tbody>
56
+ </table>
57
+ <script type="text/javascript">decorateTable('my-orders-table');</script>
58
+ <?php //echo $this->getPagerHtml(); ?>
59
+ <form id="question_reply_question_form" method="post" action="<?php echo $this->getBaseUrl().'marketplace/buyerseller/replyquestion'?>" >
60
+ <input type="hidden" name="order_id" value="<?php echo $this->getRequest()->getParam('order')?>" />
61
+ <input type="hidden" name="customer_id" value="<?php echo Mage::getSingleton('customer/session')->getCustomer()->getId();?>" />
62
+ <input type="hidden" name="product_id" value="<?php echo $this->getRequest()->getParam('product')?>"/>
63
+ <ul class="form-list">
64
+ <li class="wide">
65
+ <label for="comment" class=""><?php echo $this->__('Reply') ?><span class="required">*</span></label>
66
+ <div class="input-box">
67
+ <textarea name="reply" id="reply" title="<?php echo $this->__('Reply') ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
68
+ </div>
69
+ <div class="check-box">
70
+ <input type="checkbox" name="notify" value="Notify">Notify by email
71
+ </div>
72
+ </li>
73
+ </ul>
74
+ <div class="buttons-set">
75
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
76
+ <button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><?php echo $this->__('Submit') ?></span></button>
77
+ </div>
78
+ </form>
79
+ <?php else: ?>
80
+ <p><?php echo $this->__('You have received no orders comments.'); ?></p>
81
+ <?php endif ?>
82
+ <script type="text/javascript">
83
+ var myForm = new VarienForm('question_reply_question_form', true);
84
+ </script>
app/design/frontend/base/default/template/marketplace/buyerseller/sales/order/history.phtml ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ echo $this->getMessagesBlock()->getGroupedHtml();
21
+ ?>
22
+ <?php $_orders = $this->getOrders(); ?>
23
+ <div class="page-title">
24
+ <h1><?php echo $this->__('My Orders') ?></h1>
25
+ </div>
26
+ <?php echo $this->getPagerHtml(); ?>
27
+ <?php if($_orders->getSize()): ?>
28
+ <table class="data-table" id="my-orders-table">
29
+ <col width="1" />
30
+ <col width="1" />
31
+ <col />
32
+ <col width="1" />
33
+ <col width="1" />
34
+ <col width="1" />
35
+ <thead>
36
+ <tr>
37
+ <th><?php echo $this->__('Order #') ?></th>
38
+ <th><?php echo $this->__('Date') ?></th>
39
+ <th><?php echo $this->__('Ship To') ?></th>
40
+ <th><span class="nobr"><?php echo $this->__('Order Total') ?></span></th>
41
+ <th><span class="nobr"><?php echo $this->__('Order Status') ?></span></th>
42
+ <th><span class="nobr"><?php echo $this->__('Notification') ?></span></th>
43
+ <th>&nbsp;</th>
44
+ </tr>
45
+ </thead>
46
+ <tbody>
47
+ <?php $_odd = ''; ?>
48
+ <?php foreach ($_orders as $_order): ?>
49
+ <tr>
50
+ <td><?php echo $_order->getRealOrderId() ?></td>
51
+ <td><span class="nobr"><?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?></span></td>
52
+ <td><?php echo $_order->getShippingAddress() ? $this->escapeHtml($_order->getShippingAddress()->getName()) : '&nbsp;' ?></td>
53
+ <td><?php echo $_order->formatPrice($_order->getGrandTotal()) ?></td>
54
+ <td><em><?php echo $_order->getStatusLabel() ?></em></td>
55
+ <td class="a-center">
56
+ <?php echo Mage::getModel("marketplace/buyerseller")->getTotalNotification($_order->getId());?>
57
+ <a href="<?php echo $this->getBaseUrl().'marketplace/buyerseller/notification/order/'.$_order->getId()?>"> <?php echo $this->__(' Notification(s)') ?></a>
58
+ </td>
59
+ <td class="a-center">
60
+ <span class="nobr"><a href="<?php echo $this->getViewUrl($_order) ?>"><?php echo $this->__('View Order') ?></a>
61
+ <?php /*<span class="separator">|</span><a href="<?php echo $this->getTrackUrl($_order) ?>"><?php echo $this->__('Track Order') ?></a>&nbsp;*/ ?>
62
+ <?php if ($this->helper('sales/reorder')->canReorder($_order)) : ?>
63
+ <span class="separator">|</span> <a href="<?php echo $this->getReorderUrl($_order) ?>" class="link-reorder"><?php echo $this->__('Reorder') ?></a>
64
+ <?php endif ?>
65
+ </span>
66
+ </td>
67
+ </tr>
68
+ <?php endforeach; ?>
69
+ </tbody>
70
+ </table>
71
+ <script type="text/javascript">decorateTable('my-orders-table');</script>
72
+ <?php echo $this->getPagerHtml(); ?>
73
+ <?php else: ?>
74
+ <p><?php echo $this->__('You have placed no orders.'); ?></p>
75
+ <?php endif ?>
app/design/frontend/base/default/template/marketplace/catalog/product/askquestion/form.phtml ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <div class="page-title">
22
+ <h1><?php echo $this->__('Ask Question') ?></h1>
23
+ </div>
24
+ <?php if(Mage::getSingleton('customer/session')->isLoggedIn()){ ?>
25
+ <?php echo $this->getChildHtml('global_messages'); ?>
26
+ <form id="product_ask_question_form" method="post" action="<?php echo $this->getUrl("marketplace/productquestion/submit"); ?>" >
27
+ <div class="fieldset">
28
+ <h8 class="legend">
29
+ <?php echo $this->__('Ask question about ' . Mage::getModel('catalog/product')->load($this->getRequest()->getParam('id'))->getName()); ?> below:
30
+ </h8>
31
+ <ul class="form-list">
32
+ <li class="wide">
33
+ <label for="comment" class=""><?php echo $this->__('Question') ?><span class="required">*</span></label>
34
+ <div class="input-box">
35
+ <textarea name="question" id="question" title="<?php echo $this->__('Question') ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
36
+ </div>
37
+ <!--div class="check-box">
38
+ <input type="checkbox" name="notify" value="Notify">Notify by email
39
+ </div-->
40
+ </li>
41
+ </ul>
42
+ </div>
43
+ <div class="buttons-set">
44
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
45
+ <button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><?php echo $this->__('Submit') ?></span></button>
46
+ </div>
47
+ <input type="hidden" name="product_id" value="<?php echo $this->getRequest()->getParam('id'); ?>"/>
48
+ </form>
49
+ <div id="loading-mask" style="display:none;">
50
+ <p class="loader" id="loading_mask_loader"><img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif'); ?>" alt="Submitting form data..."><br>Submitting form data...</p>
51
+ </div>
52
+ <div id="formSuccess" style="display:none;">&nbsp;</div>
53
+ <script type="text/javascript">
54
+ //<![CDATA[
55
+ var formId = 'product_ask_question_form';
56
+ var myForm = new VarienForm(formId, true);
57
+ var postUrl = '<?php echo $this->getUrl("marketplace/productquestion/submit") ?>';
58
+ function doAjax() {
59
+ if (myForm.validator.validate()) {
60
+ new Ajax.Updater(
61
+ { success:'formSuccess' }, postUrl, {
62
+ method:'post',
63
+ asynchronous:true,
64
+ evalScripts:false,
65
+ onComplete:function(request, json) {
66
+ Element.hide(formId);
67
+ Element.show('formSuccess');
68
+ Element.hide('loading-mask');
69
+ $.fancybox.resize();
70
+ $.fancybox.center();
71
+
72
+ },
73
+ onLoading:function(request, json){
74
+ Element.show('loading-mask');
75
+
76
+ },
77
+ parameters: $(formId).serialize(true),
78
+ }
79
+ );
80
+ }
81
+ }
82
+
83
+ new Event.observe(formId, 'submit', function(e){
84
+ e.stop();
85
+ doAjax();
86
+ });
87
+ //]]>
88
+ </script>
89
+ <?php }else{ ?>
90
+ <p class="required"><?php echo $this->__('Please login to ask the product question') ?></p>
91
+ <?php } ?>
app/design/frontend/base/default/template/marketplace/catalog/product/askquestion/link.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ if ($this->getData('url') != '')
22
+ echo '<a id="askquestion" href="' . $this->getData('url') . '">Ask Question</a>';
23
+ ?>
24
+ <script type="text/javascript">
25
+ jQuery(document).ready(function() {
26
+ jQuery("#askquestion").fancybox({
27
+ maxWidth : '70%',
28
+ maxHeight : 365,
29
+ fitToView : true,
30
+ width : '70%',
31
+ height : 365,
32
+ autoSize : true,
33
+ closeClick : true,
34
+ openEffect : 'elastic',
35
+ closeEffect : 'elastic',
36
+ autoDimensions : true,
37
+ scrolling : 'no'
38
+ });
39
+ });
40
+ </script>
app/design/frontend/base/default/template/marketplace/catalog/product/askquestion/myquestions.phtml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ echo $this->getMessagesBlock()->getGroupedHtml();
21
+ ?>
22
+ <?php $collection = $this->getCollection(); ?>
23
+ <div class="page-title">
24
+ <h1><?php echo $this->__('My Questions') ?></h1>
25
+ </div>
26
+ <?php echo $this->getPagerHtml(); ?>
27
+ <?php if ($collection->getSize()): ?>
28
+ <table class="data-table" id="my-question-table">
29
+ <col width="1" />
30
+ <col width="1" />
31
+ <col />
32
+ <col width="1" />
33
+ <col width="1" />
34
+ <col width="1" />
35
+ <thead>
36
+ <tr>
37
+ <th style="width: 40px;"><?php echo $this->__('SKU#') ?></th>
38
+ <th style="width: auto;"><?php echo $this->__('Question') ?></th>
39
+ <th style="width: 80px;"><?php echo $this->__('Product Name') ?></th>
40
+ <th style="width: 75px;"><?php echo $this->__('Created At') ?></th>
41
+ <th style="width: 70px;"><?php echo $this->__('Action') ?></th>
42
+ </tr>
43
+ </thead>
44
+ <tbody>
45
+ <?php $_odd = ''; ?>
46
+ <?php foreach ($collection as $row): ?>
47
+ <tr>
48
+ <td><?php echo $this->helper('marketplace/data')->getSku($row->getProductId()) ?></td>
49
+ <td><span class="nobr"><?php echo $row->getQuestion(); ?></span></td>
50
+ <td><?php echo $this->helper('marketplace/data')->getProductName($row->getProductId()) ?></td>
51
+ <td><?php echo $this->formatDate($row->getCreatedTime()) ?></td>
52
+ <td><a href="<?php echo Mage::getBaseUrl() . 'marketplace/productquestion/reply/id/' . $row->getProductId() . '/q_id/' . $row->getEntityId(); ?>"><?php echo $this->__('View / Reply') ?>
53
+ </a></td>
54
+ </tr>
55
+ <?php endforeach; ?>
56
+ </tbody>
57
+ </table>
58
+ <script type="text/javascript">decorateTable('my-question-table');</script>
59
+ <?php echo $this->getPagerHtml(); ?>
60
+ <?php else: ?>
61
+ <p><?php echo $this->__('There are no questions.'); ?></p>
62
+ <?php endif ?>
app/design/frontend/base/default/template/marketplace/catalog/product/askquestion/productquestions.phtml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ if(Mage::helper('marketplace')->isMarketplaceActiveSellar()):
21
+ ?>
22
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
23
+ <?php $collection = $this->getCollection(); ?>
24
+ <div class="page-title">
25
+ <h1><?php echo $this->__('Questions on your product(s):') ?></h1>
26
+ </div>
27
+ <?php echo $this->getPagerHtml(); ?>
28
+ <?php if ($collection->getSize()): ?>
29
+ <table class="data-table" id="my-question-table">
30
+ <col width="1" />
31
+ <col width="1" />
32
+ <col />
33
+ <col width="1" />
34
+ <col width="1" />
35
+ <col width="1" />
36
+ <thead>
37
+ <tr>
38
+ <th style="width: 40px;"><?php echo $this->__('SKU#') ?></th>
39
+ <th style="width: auto;"><?php echo $this->__('Question') ?></th>
40
+ <th style="width: 80px;"><?php echo $this->__('Product Name') ?></th>
41
+ <th style="width: 75px;"><?php echo $this->__('Created At') ?></th>
42
+ <th style="width: 70px;"><?php echo $this->__('Action') ?></th>
43
+ </tr>
44
+ </thead>
45
+ <tbody>
46
+ <?php $_odd = ''; ?>
47
+ <?php foreach ($collection as $row): ?>
48
+ <tr>
49
+ <td><?php echo $this->helper('marketplace/data')->getSku($row->getProductId()) ?></td>
50
+ <td><span class="nobr"><?php echo $row->getQuestion(); ?></span></td>
51
+ <td><?php echo $this->helper('marketplace/data')->getProductName($row->getProductId()) ?></td>
52
+ <td><?php echo $this->formatDate($row->getCreatedTime()) ?></td>
53
+ <td><a href="<?php echo Mage::getBaseUrl() . 'marketplace/productquestion/reply/id/' . $row->getProductId() . '/q_id/' . $row->getEntityId(); ?>"><?php echo $this->__('View / Reply') ?>
54
+ </a></td>
55
+ </tr>
56
+ <?php endforeach; ?>
57
+ </tbody>
58
+ </table>
59
+ <script type="text/javascript">decorateTable('my-question-table');</script>
60
+ <?php echo $this->getPagerHtml(); ?>
61
+ <?php else: ?>
62
+ <p><?php echo $this->__('There are no questions.'); ?></p>
63
+ <?php endif ?>
64
+ <?php endif ?>
app/design/frontend/base/default/template/marketplace/catalog/product/askquestion/reply_form.phtml ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ $parent_id = $this->getRequest()->getParam('q_id');
21
+ $data = $this->displayThread($parent_id);
22
+ ?>
23
+ <div class="page-title">
24
+ <h1><?php echo $this->__('Send Reply') ?></h1>
25
+ </div>
26
+ <form id="quest" method="post" action="<?php echo $this->getBaseUrl(); ?>marketplace/productquestion/replied" >
27
+ <h8 class="legend"> <?php echo $this->__('Question : ') ?></h8>
28
+ <?php
29
+ $temp = Mage::getModel('marketplace/question')->getCollection()->addFieldToFilter('entity_id', $this->getRequest()->getParam('q_id'))->getData();
30
+ echo $temp[0]['question'];
31
+ ?>
32
+ <h8 class="legend"> <?php echo $this->__('<br/>By : ') ?></h8>
33
+ <?php
34
+ echo Mage::getModel('customer/customer')->load($temp[0]['customer_id'])->getName();
35
+ ?>
36
+ <br/><br/>
37
+ <div class="fieldset">
38
+ <ul class="form-list">
39
+ <li class="wide">
40
+ <label for="reply" class=""><?php echo $this->__('Reply') ?><span class="required">*</span></label>
41
+ <div class="input-box">
42
+ <textarea name="reply" id="reply" title="<?php echo $this->__('Reply') ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
43
+ </div>
44
+ </li>
45
+ </ul>
46
+ </div>
47
+ <div class="buttons-set">
48
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
49
+ <button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><?php echo $this->__('Submit') ?></span></button>
50
+ </div>
51
+ <input type="hidden" name="parent_id" value="<?php echo $parent_id ?>"/>
52
+ </form>
53
+ <div class="buttons-set">
54
+ <p class="back-link"><a href="<?php echo $this->getBaseUrl() ?>marketplace/productquestion/"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
55
+ </div>
56
+ <br/><br/><br/>
57
+ <h8 class="legend"><?php echo $this->__('Conversation History: '); ?></h8>
58
+ <?php
59
+ if (count($data) > 0) :
60
+ ?>
61
+ <table class="data-table" id="replies-table">
62
+ <thead>
63
+ <tr>
64
+ <th style="width: auto;"><?php echo $this->__('Reply') ?></th>
65
+ <th style="width: 100px;"><?php echo $this->__('Replied By') ?></th>
66
+ <th style="width: 75px;"><?php echo $this->__('Created At') ?></th>
67
+ </tr>
68
+ </thead>
69
+ <tbody>
70
+ <?php foreach ($data as $row) {
71
+ ?>
72
+ <tr>
73
+ <td><?php echo nl2br($row->getReply()) ?></td>
74
+ <td><?php echo Mage::getModel('customer/customer')->load($row->getCustomerId())->getName() ?></td>
75
+ <td><?php echo $this->formatDate($row->getCreatedAt(), 'medium', true) ?></td>
76
+ </tr>
77
+ <?php } ?>
78
+ </tbody>
79
+ </table>
80
+ <?php else: ?>
81
+ <p>
82
+ <?php echo $this->__('No previous replies.') ?>
83
+ </p>
84
+ <?php endif; ?>
85
+ <script type="text/javascript">
86
+ //<![CDATA[
87
+ var quest = new VarienForm('quest', true);
88
+ //]]>
89
+ </script>
app/design/frontend/base/default/template/marketplace/catalog/product/view.phtml ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <?php $_helper = $this->helper('catalog/output'); ?>
22
+ <?php $_product = $this->getProduct(); ?>
23
+ <script type="text/javascript">
24
+ var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);
25
+ </script>
26
+ <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
27
+ <div class="product-view">
28
+ <div class="product-essential">
29
+ <form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
30
+ <div class="no-display">
31
+ <input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
32
+ <input type="hidden" name="related_product" id="related-products-field" value="" />
33
+ </div>
34
+ <div class="product-shop">
35
+ <div class="product-name">
36
+ <h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
37
+ </div>
38
+ <?php if ($this->canEmailToFriend()): ?>
39
+ <p class="email-friend"><a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?></a></p>
40
+ <?php endif; ?>
41
+ <?php echo $this->getReviewsSummaryHtml($_product, false, true)?>
42
+ <?php echo $this->getChildHtml('alert_urls') ?>
43
+ <?php echo $this->getChildHtml('product_type_data') ?>
44
+ <?php echo $this->getTierPriceHtml() ?>
45
+ <?php echo $this->getChildHtml('extrahint') ?>
46
+ <?php echo $this->getChildHtml('product_askquestion_link') ?>
47
+ <?php if (!$this->hasOptions()):?>
48
+ <div class="add-to-box">
49
+ <?php if($_product->isSaleable()): ?>
50
+ <?php echo $this->getChildHtml('addtocart') ?>
51
+ <?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
52
+ <span class="or"><?php echo $this->__('OR') ?></span>
53
+ <?php endif; ?>
54
+ <?php endif; ?>
55
+ <?php echo $this->getChildHtml('addto') ?>
56
+ </div>
57
+ <?php echo $this->getChildHtml('extra_buttons') ?>
58
+ <?php elseif (!$_product->isSaleable()): ?>
59
+ <div class="add-to-box">
60
+ <?php echo $this->getChildHtml('addto') ?>
61
+ </div>
62
+ <?php endif; ?>
63
+ <?php if ($_product->getShortDescription()):?>
64
+ <div class="short-description">
65
+ <h2><?php echo $this->__('Quick Overview') ?></h2>
66
+ <div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
67
+ </div>
68
+ <?php endif;?>
69
+ <?php echo $this->getChildHtml('catalog_product_view_sellerinfo');?>
70
+ <?php echo $this->getChildHtml('other');?>
71
+ <?php if ($_product->isSaleable() && $this->hasOptions()):?>
72
+ <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
73
+ <?php endif;?>
74
+ </div>
75
+ <div class="product-img-box">
76
+ <?php echo $this->getChildHtml('media') ?>
77
+ </div>
78
+ <div class="clearer"></div>
79
+ <?php if ($_product->isSaleable() && $this->hasOptions()):?>
80
+ <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
81
+ <?php endif;?>
82
+ </form>
83
+ <script type="text/javascript">
84
+ //<![CDATA[
85
+ var productAddToCartForm = new VarienForm('product_addtocart_form');
86
+ productAddToCartForm.submit = function(button, url) {
87
+ if (this.validator.validate()) {
88
+ var form = this.form;
89
+ var oldUrl = form.action;
90
+
91
+ if (url) {
92
+ form.action = url;
93
+ }
94
+ var e = null;
95
+ try {
96
+ this.form.submit();
97
+ } catch (e) {
98
+ }
99
+ this.form.action = oldUrl;
100
+ if (e) {
101
+ throw e;
102
+ }
103
+
104
+ if (button && button != 'undefined') {
105
+ button.disabled = true;
106
+ }
107
+ }
108
+ }.bind(productAddToCartForm);
109
+
110
+ productAddToCartForm.submitLight = function(button, url){
111
+ if(this.validator) {
112
+ var nv = Validation.methods;
113
+ delete Validation.methods['required-entry'];
114
+ delete Validation.methods['validate-one-required'];
115
+ delete Validation.methods['validate-one-required-by-name'];
116
+ // Remove custom datetime validators
117
+ for (var methodName in Validation.methods) {
118
+ if (methodName.match(/^validate-datetime-.*/i)) {
119
+ delete Validation.methods[methodName];
120
+ }
121
+ }
122
+
123
+ if (this.validator.validate()) {
124
+ if (url) {
125
+ this.form.action = url;
126
+ }
127
+ this.form.submit();
128
+ }
129
+ Object.extend(Validation.methods, nv);
130
+ }
131
+ }.bind(productAddToCartForm);
132
+ //]]>
133
+ </script>
134
+ </div>
135
+ <div class="product-collateral">
136
+ <?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
137
+ <div class="box-collateral <?php echo "box-{$alias}"?>">
138
+ <?php if ($title = $this->getChildData($alias, 'title')):?>
139
+ <h2><?php echo $this->escapeHtml($title); ?></h2>
140
+ <?php endif;?>
141
+ <?php echo $html; ?>
142
+ </div>
143
+ <?php endforeach;?>
144
+ <?php echo $this->getChildHtml('upsell_products') ?>
145
+ <?php echo $this->getChildHtml('product_additional_data') ?>
146
+ </div>
147
+ </div>
app/design/frontend/base/default/template/marketplace/catalog/product/view/sellerinfo.phtml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ $_helper = $this->helper('catalog/output');
21
+ ?>
22
+ <?php $_product = $this->getProduct(); ?>
23
+ <?php if ($_product->getSellerId()): ?>
24
+ <h2><?php echo $this->__('Seller') ?></h2>
25
+ <?php $sellerId = $_product->getSellerId() ?>
26
+ <?php
27
+ //$sellerName = $this->getSellerName($sellerId);
28
+ $sellerCompany = $this->getSellerCompany($sellerId);
29
+ $sellerUrl = $this->getBaseUrl() . "marketplace/" . str_replace(' ', '-', $sellerCompany) . ".html";
30
+ ?>
31
+ <a href="<?php echo $sellerUrl; ?>" title="<?php echo $sellerCompany; ?>"><?php echo $sellerCompany; ?></a>
32
+ <?php endif; ?>
app/design/frontend/base/default/template/marketplace/checkout/cart/item/default.phtml ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <?php
22
+ $_item = $this->getItem();
23
+ $isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();
24
+ $canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_BEFORE_ORDER_CONFIRM);
25
+ ?>
26
+ <tr>
27
+ <td><?php if ($this->hasProductUrl()):?><a href="<?php echo $this->getProductUrl() ?>" title="<?php echo $this->escapeHtml($this->getProductName()) ?>" class="product-image"><?php endif;?><img src="<?php echo $this->getProductThumbnail()->resize(75); ?>" width="75" height="75" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" /><?php if ($this->hasProductUrl()):?></a><?php endif;?></td>
28
+ <td>
29
+ <h2 class="product-name">
30
+ <?php if ($this->hasProductUrl()):?>
31
+ <a href="<?php echo $this->getProductUrl() ?>"><?php echo $this->escapeHtml($this->getProductName()) ?></a>
32
+ <?php else: ?>
33
+ <?php echo $this->escapeHtml($this->getProductName()) ?>
34
+ <?php endif; ?>
35
+ </h2>
36
+ <?php if ($_item->getSellerId()) echo 'Seller : '.Mage::helper('marketplace')->getSellerName($_item->getSellerId());?>
37
+ <?php if ($_options = $this->getOptionList()):?>
38
+ <dl class="item-options">
39
+ <?php foreach ($_options as $_option) : ?>
40
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
41
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
42
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
43
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
44
+ <div class="truncated_full_value">
45
+ <dl class="item-options">
46
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
47
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
48
+ </dl>
49
+ </div>
50
+ <?php endif; ?>
51
+ </dd>
52
+ <?php endforeach; ?>
53
+ </dl>
54
+ <?php endif;?>
55
+ <?php if ($messages = $this->getMessages()): ?>
56
+ <?php foreach ($messages as $message): ?>
57
+ <p class="item-msg <?php echo $message['type'] ?>">* <?php echo $this->escapeHtml($message['text']) ?></p>
58
+ <?php endforeach; ?>
59
+ <?php endif; ?>
60
+ <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
61
+ <?php if ($addInfoBlock): ?>
62
+ <?php echo $addInfoBlock->setItem($_item)->toHtml() ?>
63
+ <?php endif;?>
64
+ </td>
65
+ <td class="a-center">
66
+ <?php if ($isVisibleProduct): ?>
67
+ <a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo $this->__('Edit item parameters') ?>"><?php echo $this->__('Edit') ?></a>
68
+ <?php endif ?>
69
+ </td>
70
+ <?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
71
+ <td class="a-center">
72
+ <?php if ($isVisibleProduct): ?>
73
+ <a href="<?php echo $this->helper('wishlist')->getMoveFromCartUrl($_item->getId()); ?>" class="link-wishlist use-ajax"><?php echo $this->__('Move'); ?></a>
74
+ <?php endif ?>
75
+ </td>
76
+ <?php endif ?>
77
+
78
+ <?php if ($canApplyMsrp): ?>
79
+ <td class="a-right"<?php if ($this->helper('tax')->displayCartBothPrices()): ?> colspan="2"<?php endif; ?>>
80
+ <span class="cart-price">
81
+ <span class="cart-msrp-unit"><?php echo $this->__('See price before order confirmation.'); ?></span>
82
+ <?php $helpLinkId = 'cart-msrp-help-' . $_item->getId(); ?>
83
+ <a id="<?php echo $helpLinkId ?>" href="#" class="map-help-link"><?php echo $this->__("What's this?"); ?></a>
84
+ <script type="text/javascript">
85
+ Catalog.Map.addHelpLink($('<?php echo $helpLinkId ?>'), "<?php echo $this->__("What's this?") ?>");
86
+ </script>
87
+ </span>
88
+ </td>
89
+ <?php else: ?>
90
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
91
+ <td class="a-right">
92
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
93
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
94
+ <?php else: ?>
95
+ <span class="cart-price">
96
+ <?php endif; ?>
97
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
98
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
99
+ <?php else: ?>
100
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
101
+ <?php endif; ?>
102
+ </span>
103
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
104
+ <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
105
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
106
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
107
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
108
+ <?php endforeach; ?>
109
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
110
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
111
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
112
+ <?php endforeach; ?>
113
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
114
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
115
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
116
+ <?php endforeach; ?>
117
+ <?php endif; ?>
118
+ </div>
119
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
120
+ <div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
121
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total'); ?>: <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
122
+ </div>
123
+ <?php endif; ?>
124
+ <?php endif; ?>
125
+ </td>
126
+ <?php endif; ?>
127
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
128
+ <td>
129
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
130
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
131
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
132
+ <?php else: ?>
133
+ <span class="cart-price">
134
+ <?php endif; ?>
135
+
136
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
137
+ <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?>
138
+ <?php else: ?>
139
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
140
+ <?php endif; ?>
141
+ </span>
142
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
143
+ <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
144
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
145
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
146
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
147
+ <?php endforeach; ?>
148
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
149
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
150
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
151
+ <?php endforeach; ?>
152
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
153
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
154
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
155
+ <?php endforeach; ?>
156
+ <?php endif; ?>
157
+ </div>
158
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
159
+ <div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
160
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>: <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
161
+ </div>
162
+ <?php endif; ?>
163
+ <?php endif; ?>
164
+ </td>
165
+ <?php endif; ?>
166
+ <?php endif; ?>
167
+ <td class="a-center">
168
+ <input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4" title="<?php echo $this->__('Qty') ?>" class="input-text qty" maxlength="12" />
169
+ </td>
170
+ <?php if (($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?>
171
+ <td class="a-right">
172
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
173
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
174
+ <?php else: ?>
175
+ <span class="cart-price">
176
+ <?php endif; ?>
177
+ <?php if ($canApplyMsrp): ?>
178
+ <span class="cart-msrp-subtotal">--</span>
179
+ <?php else: ?>
180
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
181
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
182
+ <?php else: ?>
183
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()) ?>
184
+ <?php endif; ?>
185
+ <?php endif; ?>
186
+ </span>
187
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
188
+ <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
189
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
190
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
191
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
192
+ <?php endforeach; ?>
193
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
194
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
195
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
196
+ <?php endforeach; ?>
197
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
198
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
199
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
200
+ <?php endforeach; ?>
201
+ <?php endif; ?>
202
+ </div>
203
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
204
+ <div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
205
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total'); ?>: <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
206
+ </div>
207
+ <?php endif; ?>
208
+ <?php endif; ?>
209
+ </td>
210
+ <?php endif; ?>
211
+ <?php if (($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) && !$_item->getNoSubtotal()): ?>
212
+ <td>
213
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
214
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
215
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
216
+ <?php else: ?>
217
+ <span class="cart-price">
218
+ <?php endif; ?>
219
+
220
+ <?php if ($canApplyMsrp): ?>
221
+ <span class="cart-msrp-subtotal">--</span>
222
+ <?php else: ?>
223
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
224
+ <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
225
+ <?php else: ?>
226
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
227
+ <?php endif; ?>
228
+ <?php endif; ?>
229
+ </span>
230
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
231
+ <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
232
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
233
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
234
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
235
+ <?php endforeach; ?>
236
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
237
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
238
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
239
+ <?php endforeach; ?>
240
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
241
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
242
+ <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
243
+ <?php endforeach; ?>
244
+ <?php endif; ?>
245
+ </div>
246
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
247
+ <div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
248
+ <span class="weee"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>: <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
249
+ </div>
250
+ <?php endif; ?>
251
+ <?php endif; ?>
252
+ </td>
253
+ <?php endif; ?>
254
+ <td class="a-center"><a href="<?php echo $this->getDeleteUrl()?>" title="<?php echo $this->__('Remove item')?>" class="btn-remove btn-remove2"><?php echo $this->__('Remove item')?></a></td>
255
+ </tr>
app/design/frontend/base/default/template/marketplace/checkout/multishipping/item/default.phtml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <?php $_item = $this->getItem()?>
22
+ <h3 class="product-name"><a href="<?php echo $this->getProductUrl() ?>"><?php echo $this->escapeHtml($this->getProductName()) ?></a></h3>
23
+ <?php if ($_item->getSellerId()) echo 'Seller : '.Mage::helper('marketplace')->getSellerName($_item->getSellerId());?>
24
+ <?php if ($_options = $this->getOptionList()):?>
25
+ <dl class="item-options">
26
+ <?php foreach ($_options as $_option) : ?>
27
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
28
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
29
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
30
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
31
+ <div class="truncated_full_value">
32
+ <dl class="item-options">
33
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
34
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
35
+ </dl>
36
+ </div>
37
+ <?php endif; ?>
38
+ </dd>
39
+ <?php endforeach; ?>
40
+ </dl>
41
+ <?php endif; ?>
app/design/frontend/base/default/template/marketplace/checkout/onepage/review/item.phtml ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <?php $_item = $this->getItem()?>
22
+ <tr>
23
+ <td><h3 class="product-name"><?php echo $this->escapeHtml($this->getProductName()) ?></h3>
24
+ <?php if ($_item->getSellerId()) echo 'Seller : '.Mage::helper('marketplace')->getSellerName($_item->getSellerId());?>
25
+ <?php if ($_options = $this->getOptionList()):?>
26
+ <dl class="item-options">
27
+ <?php foreach ($_options as $_option) : ?>
28
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
29
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
30
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
31
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
32
+ <div class="truncated_full_value">
33
+ <dl class="item-options">
34
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
35
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
36
+ </dl>
37
+ </div>
38
+ <?php endif; ?>
39
+ </dd>
40
+ <?php endforeach; ?>
41
+ </dl>
42
+ <?php endif;?>
43
+ <?php if ($addtInfoBlock = $this->getProductAdditionalInformationBlock()):?>
44
+ <?php echo $addtInfoBlock->setItem($_item)->toHtml() ?>
45
+ <?php endif;?>
46
+ </td>
47
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
48
+ <td class="a-right">
49
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
50
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
51
+ <?php else: ?>
52
+ <span class="cart-price">
53
+ <?php endif; ?>
54
+
55
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
56
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
57
+ <?php else: ?>
58
+ <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
59
+ <?php endif; ?>
60
+ </span>
61
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
62
+ <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
63
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
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') && $_item->getWeeeTaxAppliedAmount()): ?>
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') && $_item->getWeeeTaxAppliedAmount()): ?>
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
+ </div>
81
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
82
+ <div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
83
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
84
+ </div>
85
+ <?php endif; ?>
86
+ <?php endif; ?>
87
+ </td>
88
+ <?php endif; ?>
89
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
90
+ <td>
91
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
92
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
93
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
94
+ <?php else: ?>
95
+ <span class="cart-price">
96
+ <?php endif; ?>
97
+
98
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
99
+ <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?>
100
+ <?php else: ?>
101
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
102
+ <?php endif; ?>
103
+ </span>
104
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
105
+ <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
106
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
107
+ <small>
108
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
109
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
110
+ <?php endforeach; ?>
111
+ </small>
112
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
113
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
114
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
115
+ <?php endforeach; ?>
116
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
117
+ <small>
118
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
119
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
120
+ <?php endforeach; ?>
121
+ </small>
122
+ <?php endif; ?>
123
+ </div>
124
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
125
+ <div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
126
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
127
+ </div>
128
+ <?php endif; ?>
129
+ <?php endif; ?>
130
+ </td>
131
+ <?php endif; ?>
132
+ <td class="a-center"><?php echo $_item->getQty() ?></td>
133
+ <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
134
+ <td class="a-right">
135
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
136
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
137
+ <?php else: ?>
138
+ <span class="cart-price">
139
+ <?php endif; ?>
140
+
141
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
142
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
143
+ <?php else: ?>
144
+ <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()) ?>
145
+ <?php endif; ?>
146
+ </span>
147
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
148
+ <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
149
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
150
+ <small>
151
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
152
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span><br />
153
+ <?php endforeach; ?>
154
+ </small>
155
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
156
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
157
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
158
+ <?php endforeach; ?>
159
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
160
+ <small>
161
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
162
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
163
+ <?php endforeach; ?>
164
+ </small>
165
+ <?php endif; ?>
166
+ </div>
167
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
168
+ <div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
169
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
170
+ </div>
171
+ <?php endif; ?>
172
+ <?php endif; ?>
173
+ </td>
174
+ <?php endif; ?>
175
+ <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
176
+ <td>
177
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
178
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
179
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
180
+ <?php else: ?>
181
+ <span class="cart-price">
182
+ <?php endif; ?>
183
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
184
+ <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
185
+ <?php else: ?>
186
+ <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
187
+ <?php endif; ?>
188
+ </span>
189
+ <?php if (Mage::helper('weee')->getApplied($_item)): ?>
190
+ <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
191
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
192
+ <small>
193
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
194
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span><br />
195
+ <?php endforeach; ?>
196
+ </small>
197
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
198
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
199
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
200
+ <?php endforeach; ?>
201
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
202
+ <small>
203
+ <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
204
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
205
+ <?php endforeach; ?>
206
+ </small>
207
+ <?php endif; ?>
208
+ </div>
209
+ <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
210
+ <div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
211
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
212
+ </div>
213
+ <?php endif; ?>
214
+ <?php endif; ?>
215
+ </td>
216
+ <?php endif; ?>
217
+ </tr>
app/design/frontend/base/default/template/marketplace/customer/account/myorders/items.phtml ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ $orderId = '';
21
+ $orderId = $this->getRequest()->getParam('order_id');
22
+ $marketPlaceModel = Mage::getModel('marketplace/order');
23
+ $marketPlaceOrderObj = $marketPlaceModel->load($orderId);
24
+ $orderItemCollection = $marketPlaceModel->getOrderDetails($orderId);
25
+ ?>
26
+ <table class="data-table" id="my-orders-table" summary="<?php echo $this->__('Items Ordered') ?>">
27
+ <col />
28
+ <col width="1" />
29
+ <col width="1" />
30
+ <col width="1" />
31
+ <col width="1" />
32
+ <thead>
33
+ <tr>
34
+ <th><?php echo $this->__('Product Name') ?></th>
35
+ <th><?php echo $this->__('SKU') ?></th>
36
+ <th class="a-center"><?php echo $this->__('Price') ?></th>
37
+ <th class="a-center"><?php echo $this->__('Qty') ?></th>
38
+ <th class="a-center"><?php echo $this->__('Subtotal') ?></th>
39
+ <th class="a-center"><?php echo $this->__('Notification') ?></th>
40
+ </tr>
41
+ </thead>
42
+ <?php $_count = $subtotal = $shippingCharge = $grandTotal = 0; ?>
43
+ <?php $_count = count($orderItemCollection); ?>
44
+ <?php if($_count > 0):?>
45
+ <?php foreach ($orderItemCollection as $_item): ?>
46
+ <?php if ($_item->getParentItem()) continue; ?>
47
+ <tbody>
48
+ <?php echo $this->getItemHtml($_item) ?>
49
+ </tbody>
50
+ <?php endforeach; ?>
51
+
52
+ <!--Calculate subtotal,shipping charge and grandtotal-->
53
+ <tfoot>
54
+ <tr>
55
+ <td colspan="4" style="text-align: right;"><?php echo $this->__('Subtotal') ?></td>
56
+ <td style="text-align: right;">
57
+ <?php echo Mage::helper('core')->currency($marketPlaceOrderObj->getSubtotal(), true, false);?>
58
+ </td>
59
+ </tr>
60
+ <tr>
61
+ <td colspan="4" style="text-align: right;"><?php echo $this->__('Shipping & Handling') ?></td>
62
+ <td style="text-align: right;">
63
+ <?php echo Mage::helper('core')->currency($marketPlaceOrderObj->getShippingAmount(), true, false);?>
64
+ </td>
65
+ </tr>
66
+ <?php if ($discountAmount = $marketPlaceOrderObj->getDiscountAmount() > 0) {
67
+ if ($marketPlaceOrderObj->getDiscountDescription()) {
68
+ $discountLabel = $this->__('Discount (%s)', $marketPlaceOrderObj->getDiscountDescription());
69
+ } else {
70
+ $discountLabel = $this->__('Discount');
71
+ }
72
+ ?>
73
+ <tr>
74
+ <td colspan="4" style="text-align: right;"><?php echo $this->__($discountLabel) ?></td>
75
+ <td style="text-align: right;">
76
+ <?php echo Mage::helper('core')->currency($discountAmount, true, false);?>
77
+ </td>
78
+ </tr>
79
+ <?php }?>
80
+ <tr>
81
+ <td colspan="4" style="text-align: right;"> <strong> <?php echo $this->__('Grandtotal') ?> </strong> </td>
82
+ <td style="text-align: right;">
83
+ <strong> <?php echo Mage::helper('core')->currency($marketPlaceOrderObj->getGrandTotal(), true, false);?></strong>
84
+ </td>
85
+ </tr>
86
+ </tfoot>
87
+ <!--Calculate subtotal,shipping charge and grandtotal-->
88
+ <?php endif;?>
89
+ </table>
app/design/frontend/base/default/template/marketplace/customer/account/myorders/shipitems.phtml ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ $orderId = '';
21
+ $orderId = $this->getRequest()->getParam('order_id');
22
+ $marketPlaceModel = Mage::getModel('marketplace/order');
23
+ $orderItemCollection = $marketPlaceModel->getOrderDetails($orderId);
24
+ ?>
25
+ <table class="data-table" id="my-orders-table" summary="<?php echo $this->__('Items Ordered') ?>">
26
+ <col />
27
+ <col width="1" />
28
+ <col width="1" />
29
+ <col width="1" />
30
+ <col width="1" />
31
+ <thead>
32
+ <tr>
33
+ <th><?php echo $this->__('Product Name') ?></th>
34
+ <th><?php echo $this->__('SKU') ?></th>
35
+ <th class="a-right"><?php echo $this->__('Price') ?></th>
36
+ <th class="a-center"><?php echo $this->__('Qty') ?></th>
37
+ <th class="a-center"><?php echo $this->__('Qty To Ship') ?></th>
38
+ <th class="a-right"><?php echo $this->__('Subtotal') ?></th>
39
+ </tr>
40
+ </thead>
41
+ <?php $_count = $subtotal = $shippingCharge = $grandTotal = 0; ?>
42
+ <?php $_count = count($orderItemCollection); ?>
43
+ <?php if($_count > 0):?>
44
+ <?php foreach ($orderItemCollection as $_item): ?>
45
+ <?php if ($_item->getParentItem()) continue; ?>
46
+ <tbody>
47
+ <?php echo $this->getItemHtml($_item) ?>
48
+ </tbody>
49
+ <?php $subtotal += (float)$_item->getRowTotal();?>
50
+ <?php $shippingCharge += (float)$_item->getShippingCharges();?>
51
+ <?php endforeach; ?>
52
+
53
+ <!--Calculate subtotal,shipping charge and grandtotal-->
54
+ <tfoot>
55
+ <tr>
56
+ <td style="text-align: right;" colspan="5"><?php echo $this->__('Subtotal') ?></td>
57
+ <td style="text-align: right;">
58
+ <?php echo $fomattedSubtotal = Mage::helper('core')->currency($subtotal, true, false);?>
59
+ </td>
60
+ </tr>
61
+ <tr>
62
+ <td style="text-align: right;" colspan="5"><?php echo $this->__('Shipping & Handling') ?></td>
63
+ <td style="text-align: right;">
64
+ <?php echo $formtattedShipCharge = Mage::helper('core')->currency($shippingCharge, true, false);?>
65
+ </td>
66
+ </tr>
67
+ <tr>
68
+ <?php if($subtotal || $shiipingCharge):?>
69
+ <td style="text-align: right;" colspan="5"><?php echo $this->__('Grandtotal') ?></td>
70
+ <td style="text-align: right;">
71
+ <?php $grandTotal = $subtotal + $shippingCharge;?>
72
+ <?php echo $grandTotal = Mage::helper('core')->currency($grandTotal, true, false);?>
73
+ </td>
74
+ <?php endif;?>
75
+
76
+ </tr>
77
+ </tfoot>
78
+ <!--Calculate subtotal,shipping charge and grandtotal-->
79
+ <?php endif;?>
80
+ </table>
app/design/frontend/base/default/template/marketplace/customer/account/navigation.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <div class="block block-account">
22
+ <div class="block-title">
23
+ <strong><span><?php echo $this->__('My Account'); ?></span></strong>
24
+ </div>
25
+ <div class="block-content">
26
+ <ul>
27
+ <?php $_links = $this->getLinks(); ?>
28
+ <?php $_index = 1; ?>
29
+ <?php $_count = count($_links); ?>
30
+
31
+ <?php if(!Mage::helper('marketplace')->isMarketplaceActiveSellar()): ?>
32
+ <?php unset($_links['marketplace']); ?>
33
+ <?php unset($_links['marketplace_orders']); ?>
34
+ <?php unset($_links['marketplace_product']); ?>
35
+ <?php unset($_links['marketplace_product_add']); ?>
36
+ <?php unset($_links['marketplace_product_import']); ?>
37
+ <?php endif; ?>
38
+
39
+ <?php foreach ($_links as $_link): ?>
40
+ <?php $_last = ($_index++ >= $_count); ?>
41
+ <?php if ($this->isActive($_link)): ?>
42
+ <li class="current<?php echo ($_last ? ' last' : '') ?>"><strong><?php echo $_link->getLabel() ?></strong></li>
43
+ <?php else: ?>
44
+ <li<?php echo ($_last ? ' class="last"' : '') ?>><a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?></a></li>
45
+ <?php endif; ?>
46
+ <?php endforeach; ?>
47
+ </ul>
48
+ </div>
49
+ </div>
app/design/frontend/base/default/template/marketplace/customer/account/print.phtml ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ $orderId = '';
21
+ $orderId = $this->getRequest()->getParam('order_id');
22
+ $_order = Mage::getModel("sales/order")->load($orderId);
23
+ ?>
24
+ <h1><?php echo $this->__('Order #%s', $_order->getRealOrderId()) ?></h1>
25
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
26
+ <div class="col2-set">
27
+ <?php if (!$_order->getIsVirtual()): ?>
28
+ <div class="col-1">
29
+ <h2><?php echo $this->__('Shipping Address') ?></h2>
30
+ <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
31
+ </div>
32
+ <div class="col-2">
33
+ <?php else: ?>
34
+ <div class="col-1">
35
+ <?php endif; ?>
36
+ <h2><?php echo $this->__('Billing Address') ?></h2>
37
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
38
+ </div>
39
+ <?php if (!$_order->getIsVirtual()): ?>
40
+ </div>
41
+ <div class="col2-set">
42
+ <div class="col-1">
43
+ <h2><?php echo $this->__('Shipping Method') ?></h2>
44
+ <?php echo $this->escapeHtml($_order->getShippingDescription()) ?>
45
+ </div>
46
+ <?php endif; ?>
47
+ <div class="col-2">
48
+ <h2><?php echo $this->__('Payment Method') ?></h2>
49
+ <?php echo $_order->getPayment()->getMethodInstance()->getTitle(); ?>
50
+ </div>
51
+ </div>
52
+ <h2><?php echo $this->__('Items Ordered') ?></h2>
53
+ <table class="data-table" id="my-orders-table">
54
+ <col />
55
+ <col width="1" />
56
+ <col width="1" />
57
+ <col width="1" />
58
+ <col width="1" />
59
+ <thead>
60
+ <tr>
61
+ <th><?php echo $this->__('Product Name') ?></th>
62
+ <th><?php echo $this->__('SKU') ?></th>
63
+ <th class="a-right"><?php echo $this->__('Price') ?></th>
64
+ <th class="a-center"><?php echo $this->__('Qty') ?></th>
65
+ <th class="a-right"><?php echo $this->__('Subtotal') ?></th>
66
+ </tr>
67
+ </thead>
68
+ <?php
69
+ $orderItemCollection = $_order->getOrderDetails($orderId);
70
+ $_count = $orderItemCollection->count();
71
+ foreach ($orderItemCollection as $_item):
72
+ if ($_item->getParentItem()) continue;
73
+ ?>
74
+ <tbody>
75
+ <?php echo $this->getItemHtml($_item) ?>
76
+ </tbody>
77
+ <?php endforeach; ?>
78
+ <tfoot>
79
+ <tr>
80
+ <td colspan="4" style="text-align: right;"><?php echo $this->__('Subtotal') ?></td>
81
+ <td style="text-align: right;">
82
+ <?php echo Mage::helper('core')->currency($_order->getSubtotal(), true, false);?>
83
+ </td>
84
+ </tr>
85
+ <tr>
86
+ <td colspan="4" style="text-align: right;"><?php echo $this->__('Shipping & Handling') ?></td>
87
+ <td style="text-align: right;">
88
+ <?php echo Mage::helper('core')->currency($_order->getShippingAmount(), true, false);?>
89
+ </td>
90
+ </tr>
91
+ <?php if ($discountAmount = $_order->getDiscountAmount() > 0) {
92
+ if ($_order->getDiscountDescription()) {
93
+ $discountLabel = $this->__('Discount (%s)', $_order->getDiscountDescription());
94
+ } else {
95
+ $discountLabel = $this->__('Discount');
96
+ }
97
+ ?>
98
+ <tr>
99
+ <td colspan="4" style="text-align: right;"><?php echo $this->__($discountLabel) ?></td>
100
+ <td style="text-align: right;">
101
+ <?php echo Mage::helper('core')->currency($discountAmount, true, false);?>
102
+ </td>
103
+ </tr>
104
+ <?php }?>
105
+ <tr>
106
+ <td colspan="4" style="text-align: right;"> <strong> <?php echo $this->__('Grandtotal') ?> </strong> </td>
107
+ <td style="text-align: right;">
108
+ <strong> <?php echo Mage::helper('core')->currency($_order->getGrandTotal(), true, false);?></strong>
109
+ </td>
110
+ </tr>
111
+ </tfoot>
112
+ </table>
113
+ <div class="buttons-set">
114
+ <button onclick="window.close();" class="button" title="Close Window" type="button"><span><span>Close Window</span></span></button>
115
+ </div>
116
+ <script type="text/javascript">decorateTable('my-orders-table', {'tbody' : ['odd', 'even'], 'tbody tr' : ['first', 'last']})</script>
117
+ <script type="text/javascript">window.print();</script>
app/design/frontend/base/default/template/marketplace/customer/account/selleroptions.phtml ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ $orderId = $this->getRequest()->getParam('order_id');
21
+ $status = array();
22
+ $status = $this->selectAction($orderId);
23
+ ?>
24
+ <form id="seller_form" name="seller_form" method="post" action="<?php echo $this->getUrl('marketplace/order/addcomment/') ?>order_id/<?php echo $orderId?>">
25
+ <?php if($status) {?>
26
+ <div class="col-1">
27
+ <div class="box">
28
+ <div class="box-title">
29
+ <h2>Seller Options</h2>
30
+ </div>
31
+ <div class="box-content">
32
+ <div class="commentbox">
33
+ <div><b>Comment</b></div>
34
+ <div>
35
+ <textarea name="sellerform_comment" id="sellerform_comment" class="required-entry" rows="2" cols="50"></textarea>
36
+ </div>
37
+ </div>
38
+ <div class="trackingbox">
39
+ <div><b>Track Order</b></div>
40
+ <div>
41
+ <input type="text" name="trackin_no" id="trackin_no" value=""/>
42
+ </div>
43
+ </div>
44
+ <div class="notify">
45
+ <div>
46
+ <input type="checkbox" id="is_customer_notified" name="is_customer_notified" value="1"/><label class="normal" for="notifyemail"> <?php echo $this->__('Notify Customer by Email') ?></label>
47
+ </div>
48
+ </div>
49
+ <div class="status">
50
+ <div>
51
+ <b><?php echo $this->__('Status') ?></b>
52
+ </div>
53
+ <div>
54
+ <select name="status" id="showstatus">
55
+ <?php foreach ($status as $value) { ?>
56
+ <option value="<?php echo $value ?>"><?php echo $value ?></option>
57
+ <?php } ?>
58
+ </select>
59
+ </div>
60
+ </div>
61
+ <div class="buttons-set">
62
+ <button class="button" title="Save" type="submit"><span><?php echo $this->__('Save') ?></span></button>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ </div>
67
+ <?php }?>
68
+ <div>
69
+ <?php
70
+ $history = array();
71
+ foreach (Mage::getModel('sales/order')->load($orderId)->getVisibleStatusHistory() as $orderComment) {
72
+ $history[] = array(
73
+ 'comment' => $orderComment->getComment(),
74
+ 'created_at' => $orderComment->getCreatedAtDate()
75
+ );
76
+ }
77
+
78
+ if (count($history) > 0):
79
+ ?>
80
+ <h2><?php echo $this->__('Past Comments') ?></h2>
81
+ <table id="comments-table" class="data-table">
82
+ <thead>
83
+ <tr>
84
+ <th style="width:23%">Date</th>
85
+ <th style="width:77%">Comments</th>
86
+ </tr>
87
+ </thead>
88
+ <tbody>
89
+ <?php foreach ($history as $historyItem):?>
90
+ <tr id="order-item-row-1" class="border">
91
+ <td><?php echo $this->formatDate($historyItem['created-at'], 'medium', true)?></td>
92
+ <td><?php echo $this->escapeHtml($historyItem['comment'])?></td>
93
+ </tr>
94
+ <?php endforeach; ?>
95
+ </tbody>
96
+ </table>
97
+ <?php endif?>
98
+ </div>
99
+ </form>
100
+ <!--Show/hide tracking no. filed.-->
101
+ <script type="text/javascript">
102
+ jQuery.noConflict();
103
+ jQuery(document).ready(function() {
104
+ jQuery('#showstatus').change(function(){
105
+ var status = jQuery(this).val();
106
+
107
+ if( status != 'processing'){
108
+ jQuery('.trackingbox').hide();
109
+ }else{
110
+ jQuery('.trackingbox').show();
111
+ }
112
+
113
+ });
114
+ });
115
+ </script>
app/design/frontend/base/default/template/marketplace/customer/account/shiporder.phtml ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ $orderId = $this->getRequest()->getParam('order_id');
21
+ $marketPlaceModel = Mage::getModel('marketplace/marketplace');
22
+ $orderDetails = $marketPlaceModel->getOrderDetails($orderId);
23
+ $seller_id = Mage::getSingleton('customer/session')->getId();
24
+ ?>
25
+ <?php $_order = Mage::getModel("sales/order")->load($orderId); ?>
26
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
27
+ <?php echo $this->getStatusHistoryRssUrl($_order) ?>
28
+ <dl class="order-info">
29
+ <dt><?php echo $this->__('About This Order:') ?></dt>
30
+ </dl>
31
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
32
+ <?php if (!$_order->getIsVirtual()): ?>
33
+ <form method="post" name="shipment" action="<?php echo $this->getBaseUrl()."marketplace/order/save"?>">
34
+ <input type="hidden" name ="order_id" value="<?php echo $orderId?>" />
35
+ <div class="col2-set order-info-box">
36
+ <div class="col-1">
37
+ <div class="box">
38
+ <div class="box-title">
39
+ <h2><?php echo $this->__('Shipping Address') ?></h2>
40
+ </div>
41
+ <div class="box-content">
42
+ <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ <div class="col-2">
47
+ <div class="box">
48
+ <div class="box-title">
49
+ <h2><?php echo $this->__('Shipping Method') ?></h2>
50
+ </div>
51
+ <div class="box-content">
52
+ <?php if ($_order->getShippingDescription()): ?>
53
+ <?php echo $this->escapeHtml($_order->getShippingDescription()) ?>
54
+ <?php else: ?>
55
+ <p><?php echo $this->helper('sales')->__('No shipping information available'); ?></p>
56
+ <?php endif; ?>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ <?php endif; ?>
62
+ <div class="col2-set order-info-box">
63
+ <div class="col-1">
64
+ <div class="box">
65
+ <div class="box-title">
66
+ <h2><?php echo $this->__('Billing Address') ?></h2>
67
+ </div>
68
+ <div class="box-content">
69
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
70
+ </div>
71
+ </div>
72
+ </div>
73
+ <div class="col-2">
74
+ <div class="box box-payment">
75
+ <div class="box-title">
76
+ <h2><?php echo $this->__('Payment Method') ?></h2>
77
+ </div>
78
+ <div class="box-content">
79
+ <?php echo $_order->getPayment()->getMethodInstance()->getTitle(); ?>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ </div>
84
+ <div class="col2-set order-info-box">
85
+ <?php echo $this->getChildHtml('items');?>
86
+ </div>
87
+ <div class="col2-set order-info-box">
88
+ <div class="">
89
+ <div class="box">
90
+ <div class="box-title">
91
+ <h2><?php echo $this->__('Shipping Information') ?></h2>
92
+ </div>
93
+ <div class="box-content">
94
+ <div class="grid">
95
+ <table cellspacing="0" class="data" id="tracking_numbers_table">
96
+ <colgroup><col width="100">
97
+ <col>
98
+ <col>
99
+ <col width="80">
100
+ </colgroup><thead>
101
+ <tr class="headings">
102
+ <th><?php echo Mage::helper('sales')->__("Carrier"); ?></th>
103
+ <th><?php echo Mage::helper('sales')->__("Title"); ?></th>
104
+ <th><?php echo Mage::helper('sales')->__("Number "); ?><span class="required">*</span></th>
105
+
106
+ </tr>
107
+ </thead>
108
+ <tbody id="track_row_container">
109
+
110
+ <tr>
111
+ <td>
112
+ <?php $carrierInstances = Mage::getSingleton('shipping/config')->getAllCarriers();?>
113
+ <?php $carriers['custom'] = Mage::helper('sales')->__('Custom Value');?>
114
+ <select onchange="selectorid(this)" name="tracking[1][carrier_code]" id="trackingC1" class="select carrier" style="width:110px;">
115
+ <option value="custom"><?php echo Mage::helper('sales')->__('Custom Value'); ?></option>
116
+ <?php foreach ($carrierInstances as $code => $carrier) { ?>
117
+ <?php if ($carrier->isTrackingAvailable()) { ?>
118
+ <option value="<?php echo $code; ?>"><?php echo $carrier->getConfigData('title') ?></option>
119
+ <?php } ?>
120
+ <?php } ?>
121
+ </select>
122
+ </td>
123
+ <td><input class="input-text number-title" type="text" name="tracking[1][title]" id="trackingT1" value=""></td>
124
+ <td><input class="input-text required-entry" type="text" name="tracking[1][number]" id="trackingN1" value=""></td>
125
+
126
+ </tr></tbody>
127
+ </table>
128
+ </div>
129
+ </div>
130
+ </div>
131
+ </div>
132
+ </div>
133
+ <div class="col2-set order-info-box">
134
+ <div class="box-left entry-edit">
135
+ <div class="entry-edit-head"><h4><?php echo $this->__('Shipment Comments') ?></h4></div>
136
+ <fieldset>
137
+ <div id="order-history_form">
138
+ <span class="field-row">
139
+ <label class="normal" for="shipment_comment_text"><?php echo Mage::helper('sales')->__('Shipment Comments') ?></label>
140
+ <textarea id="shipment_comment_text" name="shipment[comment_text]" rows="3" cols="5" style="height:6em; width:99%;"><?php //echo $this->getShipment()->getCommentText(); ?></textarea>
141
+ </span>
142
+ <div class="clear"></div>
143
+ </div>
144
+ </fieldset>
145
+ </div>
146
+ </div>
147
+ <div class="col2-set order-info-box">
148
+ <div class="col-1">
149
+ <div class="box">
150
+ <div class="box-title">
151
+ <input type="submit" name="submit" />
152
+ </div>
153
+
154
+ </div>
155
+ </div>
156
+ </div>
157
+ </form>
app/design/frontend/base/default/template/marketplace/customer/account/vieworder.phtml ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ $orderId = '';
21
+ $orderId = $this->getRequest()->getParam('order_id');
22
+ $marketPlaceModel = Mage::getModel('marketplace/marketplace');
23
+ $orderDetails = $marketPlaceModel->getOrderDetails($orderId);
24
+ $seller_id = Mage::getSingleton('customer/session')->getId();
25
+ ?>
26
+ <?php $_order = Mage::getModel("sales/order")->load($orderId); ?>
27
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
28
+ <div class="page-title title-buttons">
29
+ <?php if($_order->getStatus() == 'processing') {?>
30
+ <a href="<?php echo $this->getUrl('marketplace/order/ship',$arguement=array('order_id' => $orderId)) ?>" class="link-print" ><?php echo $this->__('Ship Order') ?></a>
31
+ <?php }?>
32
+ <h1><?php echo $this->__('Order #%s - %s', $_order->getRealOrderId(), $_order->getStatusLabel()) ?></h1>
33
+ <a href="<?php echo $this->getUrl('marketplace/order/printorder',$arguement=array('order_id' => $orderId,'seller_id' => $seller_id)) ?>" class="link-print" onclick="this.target='_blank';"><?php echo $this->__('Print Order') ?></a>
34
+ </div>
35
+ <?php echo $this->getStatusHistoryRssUrl($_order) ?>
36
+ <dl class="order-info">
37
+ <dt><?php echo $this->__('About This Order:') ?></dt>
38
+ </dl>
39
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
40
+ <?php if (!$_order->getIsVirtual()): ?>
41
+ <div class="col2-set order-info-box">
42
+ <div class="col-1">
43
+ <div class="box">
44
+ <div class="box-title">
45
+ <h2><?php echo $this->__('Shipping Address') ?></h2>
46
+ </div>
47
+ <div class="box-content">
48
+ <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ <div class="col-2">
53
+ <div class="box">
54
+ <div class="box-title">
55
+ <h2><?php echo $this->__('Shipping Method') ?></h2>
56
+ </div>
57
+ <div class="box-content">
58
+ <?php if ($_order->getShippingDescription()): ?>
59
+ <?php echo $this->escapeHtml($_order->getShippingDescription()) ?>
60
+ <?php else: ?>
61
+ <p><?php echo $this->helper('sales')->__('No shipping information available'); ?></p>
62
+ <?php endif; ?>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ </div>
67
+ <?php endif; ?>
68
+ <div class="col2-set order-info-box">
69
+ <div class="col-1">
70
+ <div class="box">
71
+ <div class="box-title">
72
+ <h2><?php echo $this->__('Billing Address') ?></h2>
73
+ </div>
74
+ <div class="box-content">
75
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ <div class="col-2">
80
+ <div class="box box-payment">
81
+ <div class="box-title">
82
+ <h2><?php echo $this->__('Payment Method') ?></h2>
83
+ </div>
84
+ <div class="box-content">
85
+ <?php echo $_order->getPayment()->getMethodInstance()->getTitle(); ?>
86
+ </div>
87
+ </div>
88
+ </div>
89
+ </div>
90
+ <?php echo $this->getChildHtml('items');?>
91
+
92
+ <?php if($_order->hasShipments())
93
+ {
94
+ $trackingData = $this->getShippingInfo($_order);
95
+ ?>
96
+ <div class="col2-set order-info-box">
97
+ <div class="col-1" style="width:100% !important">
98
+ <div class="box" >
99
+ <div class="box-title">
100
+ <h2><?php echo $this->__('Tracking Information') ?></h2>
101
+ </div>
102
+ <div class="box-content">
103
+ <?php foreach($trackingData as $track): ?>
104
+ <div style="float:left">
105
+ <table class="tracking-table-popup data-table">
106
+ <tbody>
107
+ <tr>
108
+ <th class="label"><?php echo $this->__('Tracking Number:'); ?></th>
109
+ <td class="value"><?php echo $track->getNumber(); ?></td>
110
+ </tr>
111
+ <!--tr>
112
+ <th class="label"><?php //echo $this->__('Carrier:'); ?></th>
113
+ <td class="value"><?php //echo $track->getCarrierCode(); ?></td>
114
+ </tr>
115
+
116
+ <tr>
117
+ <th class="label"><?php //echo $this->__('Title:'); ?></th>
118
+ <td class="value"><?php //echo $track->getTitle() ?></td>
119
+ </tr-->
120
+ </tbody>
121
+ </table>
122
+ </div>
123
+ <?php
124
+ $comments = Mage::getResourceModel('sales/order_shipment_comment_collection')
125
+ ->setShipmentFilter($track->getParentId())
126
+ ?>
127
+ <div style="float:right">
128
+ <table class="tracking-table-popup data-table">
129
+ <?php foreach($comments as $_comments): ?>
130
+ <tbody>
131
+ <tr>
132
+ <th class="label"><?php echo $this->__('Comment:'); ?></th>
133
+ <td class="value"><?php echo $_comments->getComment(); ?></td>
134
+ </tr>
135
+ <tr>
136
+ <th class="label"><?php echo $this->__('Date:'); ?></th>
137
+ <td class="value"><?php echo $_comments->getcreated_at(); ?></td>
138
+ </tr>
139
+ </tbody>
140
+ <?php endforeach; ?>
141
+ </table>
142
+ </div>
143
+ <?php endforeach; ?>
144
+ </div>
145
+ </div>
146
+ </div>
147
+ </div>
148
+ <?php } ?>
149
+ <?php echo $this->getChildHtml('selleroptions');?>
app/design/frontend/base/default/template/marketplace/customer/form/edit.phtml ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>
22
+ <div class="page-title">
23
+ <h1><?php echo $this->__('Edit Account Information') ?></h1>
24
+ </div>
25
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
26
+ <form action="<?php echo $this->getUrl('customer/account/editPost') ?>" method="post" enctype="multipart/form-data" id="form-validate" autocomplete="off">
27
+ <div class="fieldset">
28
+ <?php echo $this->getBlockHtml('formkey')?>
29
+ <h2 class="legend"><?php echo $this->__('Account Information') ?></h2>
30
+ <ul class="form-list">
31
+ <li class="fields">
32
+ <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getCustomer())->toHtml() ?>
33
+ </li>
34
+ <li>
35
+ <label for="email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
36
+ <div class="input-box">
37
+ <input type="text" name="email" id="email" value="<?php echo $this->escapeHtml($this->getCustomer()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text required-entry validate-email" />
38
+ </div>
39
+ </li>
40
+ <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
41
+ <?php if ($_dob->isEnabled()): ?>
42
+ <li><?php echo $_dob->setDate($this->getCustomer()->getDob())->toHtml() ?></li>
43
+ <?php endif ?>
44
+ <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
45
+ <?php if ($_taxvat->isEnabled()): ?>
46
+ <li><?php echo $_taxvat->setTaxvat($this->getCustomer()->getTaxvat())->toHtml() ?></li>
47
+ <?php endif ?>
48
+ <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
49
+ <?php if ($_gender->isEnabled()): ?>
50
+ <li><?php echo $_gender->setGender($this->getCustomer()->getGender())->toHtml() ?></li>
51
+ <?php endif ?>
52
+ <li class="control">
53
+ <input type="checkbox" name="change_password" id="change_password" value="1" onclick="setPasswordForm(this.checked)" title="<?php echo $this->__('Change Password') ?>"<?php if($this->getCustomer()->getChangePassword()==1): ?> checked="checked"<?php endif; ?> class="checkbox" /><label for="change_password"><?php echo $this->__('Change Password') ?></label>
54
+ </li>
55
+ <?php $isMarketplaceEnabled=Mage::Helper("marketplace")->isMarketplaceEnabled(); ?>
56
+ <?php if($isMarketplaceEnabled):?>
57
+ <!--begining of Add seller profile form-->
58
+ <?php $isSeller = $this->getCustomer()->getSellerSubscriber(); ?>
59
+
60
+ <?php if($isSeller == 0):?>
61
+ <li class="control">
62
+ <input type="checkbox" name="check_seller_form" id="check_seller_form" onclick="checkSellerFormRequired(this.checked)" title="<?php echo $this->__('Want To Sell Products?') ?>" class="checkbox" />
63
+ <label for="check_seller_form"><?php echo $this->__('Want To Sell Products?') ?></label>
64
+ </li>
65
+ <?php else:?>
66
+ <li class="control">
67
+ <input type="checkbox" name="check_seller_form" id="check_seller_form" onclick="checkSellerFormRequired(this.checked)" title="<?php echo $this->__('Want To Edit Seller Profile?') ?>" class="checkbox" checked/>
68
+ <label for="check_seller_form"><?php echo $this->__('Want To Edit Seller Profile?') ?></label>
69
+ <input type="hidden" name="is_seller_subscribe" value="<?php echo $isSeller; ?>" id="is_seller_subscribe">
70
+ </li>
71
+ <?php endif;?>
72
+ <?php endif;?>
73
+ </ul>
74
+ </div>
75
+ <?php if($isMarketplaceEnabled):?>
76
+ <!-- add/edit seller form -->
77
+ <div id="seller_form" class="fieldset" style="<?php if($isSeller == 1): echo 'display:blobk'; else: echo 'display:none'; endif;?>">
78
+ <h2 class="legend"><?php if($isSeller == 1): echo $this->__('Edit Seller Profile'); else: echo $this->__('Add Seller Profile'); endif; ?></h2>
79
+ <ul class="form-list">
80
+ <li>
81
+ <label class="required"><?php echo $this->__('Company Banner').' ('. Mage::getStoreConfig('marketplace/marketplace/default_width'). $this->__('pixel'). ' X '. Mage::getStoreConfig('marketplace/marketplace/default_height') . $this->__('pixel') . ')'; ?></label>
82
+ <div class="input-box">
83
+ <?php $banner = $this->getCustomer()->getCompanyBanner(); ?>
84
+ <img src="<?php echo $banner; ?>" />
85
+ <input type="file" id="company_banner" size="20" name="company_banner">
86
+ <input type="hidden" name="old_banner" value="<?php echo $banner; ?>" id="old_banner">
87
+ </div>
88
+ </li>
89
+ <li>
90
+ <label class="required"><?php echo $this->__('Company Logo').' ('. Mage::getStoreConfig('marketplace/marketplace/default_logo_width'). $this->__('pixel'). ' X '. Mage::getStoreConfig('marketplace/marketplace/default_logo_height'). $this->__('pixel') . ')'; ?></label>
91
+ <div class="input-box">
92
+ <?php $logo = $this->getCustomer()->getCompanyLogo(); ?>
93
+ <img src="<?php echo $logo; ?>" />
94
+ <input type="file" id="company_logo" size="20" name="company_logo">
95
+ <input type="hidden" name="old_logo" value="<?php echo $logo; ?>" id="old_logo">
96
+ </div>
97
+ </li>
98
+ <li>
99
+ <label class="required"> <em>*</em><?php echo $this->__('Company Name') ?></label>
100
+ <div class="input-box">
101
+ <input type="text" name="company_name" id="company_name" value="<?php echo $this->htmlEscape($this->getCustomer()->getCompanyName()) ?>" title="<?php echo $this->__('Company Name') ?>" class="input-text required-entry" />
102
+ </div>
103
+ </li>
104
+ <li>
105
+ <label class="required"><em>*</em><?php echo $this->__('Company Locality') ?></label>
106
+ <div class="input-box">
107
+ <input type="text" name="company_locality" id="company_locality" value="<?php echo $this->htmlEscape($this->getCustomer()->getCompanyLocality()) ?>" title="<?php echo $this->__('Company Locality') ?>" class="input-text required-entry" />
108
+ </div>
109
+ </li>
110
+ <li>
111
+ <label class="required"><?php echo $this->__('Company Description') ?></label>
112
+ <div class="input-box">
113
+ <textarea name="company_description" cols="40" id="company_description" title="<?php echo $this->__('Company Description') ?>"><?php echo $this->htmlEscape($this->getCustomer()->getCompanyDescription()) ?>
114
+ </textarea>
115
+ </div>
116
+ </li>
117
+ </ul>
118
+ </div>
119
+ <?php endif;?>
120
+ <!-- End of edit seller form -->
121
+ <div class="fieldset" style="display:none;">
122
+ <h2 class="legend"><?php echo $this->__('Change Password') ?></h2>
123
+ <ul class="form-list">
124
+ <li>
125
+ <label for="current_password" class="required"><em>*</em><?php echo $this->__('Current Password') ?></label>
126
+ <div class="input-box">
127
+ <!-- This is a dummy hidden field to trick firefox from auto filling the password -->
128
+ <input type="text" class="input-text no-display" name="dummy" id="dummy" />
129
+ <input type="password" title="<?php echo $this->__('Current Password') ?>" class="input-text" name="current_password" id="current_password" />
130
+ </div>
131
+ </li>
132
+ <li class="fields">
133
+ <div class="field">
134
+ <label for="password" class="required"><em>*</em><?php echo $this->__('New Password') ?></label>
135
+ <div class="input-box">
136
+ <input type="password" title="<?php echo $this->__('New Password') ?>" class="input-text validate-password" name="password" id="password" />
137
+ </div>
138
+ </div>
139
+ <div class="field">
140
+ <label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm New Password') ?></label>
141
+ <div class="input-box">
142
+ <input type="password" title="<?php echo $this->__('Confirm New Password') ?>" class="input-text validate-cpassword" name="confirmation" id="confirmation" />
143
+ </div>
144
+ </div>
145
+ </li>
146
+ </ul>
147
+ </div>
148
+ <div class="buttons-set">
149
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
150
+ <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
151
+ <button type="submit" title="<?php echo $this->__('Save') ?>" class="button"><span><span><?php echo $this->__('Save') ?></span></span></button>
152
+ </div>
153
+ </form>
154
+ <script type="text/javascript">
155
+ //<![CDATA[
156
+ var dataForm = new VarienForm('form-validate', true);
157
+ function setPasswordForm(arg){
158
+ if(arg){
159
+ $('current_password').up(3).show();
160
+ $('current_password').addClassName('required-entry');
161
+ $('password').addClassName('required-entry');
162
+ $('confirmation').addClassName('required-entry');
163
+
164
+ }else{
165
+ $('current_password').up(3).hide();
166
+ $('current_password').removeClassName('required-entry');
167
+ $('password').removeClassName('required-entry');
168
+ $('confirmation').removeClassName('required-entry');
169
+ }
170
+ }
171
+
172
+ /**
173
+ *Check checkbox is cheked or no,if yes then display seller form
174
+ *else hide form and remove validations
175
+ **/
176
+ function checkSellerFormRequired(arg){
177
+ if(arg){
178
+ $('seller_form').show();
179
+ $('company_name').addClassName('required-entry');
180
+ $('company_locality').addClassName('required-entry');
181
+
182
+ }else{
183
+ $('seller_form').hide();
184
+ $('current_password').removeClassName('required-entry');
185
+ $('company_name').removeClassName('required-entry');
186
+ $('company_locality').removeClassName('required-entry');
187
+ }
188
+ }
189
+ <?php if($this->getCustomer()->getChangePassword()): ?>
190
+ setPasswordForm(true);
191
+ <?php endif; ?>
192
+ //]]>
193
+ </script>
app/design/frontend/base/default/template/marketplace/dashboard/bestseller.phtml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ echo $this->getMessagesBlock()->getGroupedHtml();
21
+ ?>
22
+ <?php $_productCollection = Mage::getModel('marketplace/marketplace')->getBestSellerProducts();?>
23
+ <div class="dashboard">
24
+ <div class="marketplace-account box-recent">
25
+ <h2><?php echo $this->__('Best Selling Products') ?></h2>
26
+ <?php if($_productCollection->getSize()): ?>
27
+ <table class="data-table">
28
+ <thead>
29
+ <th><?php echo $this->__('Product name') ?></th>
30
+ <th><?php echo $this->__('Quantity Ordered') ?></th>
31
+ <th><?php echo $this->__('Price') ?></th>
32
+ </tr>
33
+ </thead>
34
+ <tbody>
35
+ <?php foreach($_productCollection as $product): ?>
36
+ <tr>
37
+ <td>
38
+ <a href="<?php echo $product->getProductUrl();?>">
39
+ <span class="nobr"><?php echo $product->getOrderItemsName(); ?></span>
40
+ </a>
41
+ </td>
42
+ <td><span class="nobr"><?php echo $product->getOrderedQty()*1; ?></span></td>
43
+ <td><span class="nobr"><?php echo round($product->getPrice(),2); ?></span></td>
44
+ </tr>
45
+ <?php endforeach; ?>
46
+ </tbody>
47
+ </table>
48
+ <?php else: ?>
49
+ <p>
50
+ <?php echo $this->__('You have no products.'); ?>
51
+ </p>
52
+ <?php endif ?>
53
+ </div>
54
+ </div>
55
+ <div class="page-title">
56
+ </div>
app/design/frontend/base/default/template/marketplace/dashboard/dashboard.phtml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <div class="page-title">
22
+ <h1><?php echo $this->__('Marketplace Dashboard') ?></h1>
23
+ </div>
app/design/frontend/base/default/template/marketplace/dashboard/myorders.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ echo $this->getMessagesBlock()->getGroupedHtml();
21
+ ?>
22
+ <?php $_orderCollection = Mage::getModel('marketplace/marketplace')->getLastFewOrder();?>
23
+ <div class="dashboard">
24
+ <div class="marketplace-account box-recent">
25
+ <h2><?php echo $this->__('Products Ordered') ?></h2>
26
+ <?php if($_orderCollection->getSize()): ?>
27
+ <table class="data-table">
28
+ <thead>
29
+ <tr>
30
+ <th><?php echo $this->__('Product name') ?></th>
31
+ <th><?php echo $this->__('Quantity Ordered') ?></th>
32
+ </tr>
33
+ </thead>
34
+ <tbody>
35
+ <?php foreach($_orderCollection as $order): ?>
36
+ <tr>
37
+ <td><span class="nobr"><?php echo $order->getName(); ?></span></td>
38
+ <td><span class="nobr"><?php echo $order->getQtyOrdered()*1;?></span></td>
39
+ </tr>
40
+ <?php endforeach; ?>
41
+ </tbody>
42
+ </table>
43
+ <?php else: ?>
44
+ <p>
45
+ <?php echo $this->__('You have no products.'); ?>
46
+ </p>
47
+ <?php endif?>
48
+ </div>
49
+ </div>
app/design/frontend/base/default/template/marketplace/dashboard/notificationcount.phtml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ echo $this->getMessagesBlock()->getGroupedHtml();
21
+ ?>
22
+ <?php $_notificationCount = 0;?>
23
+ <?php $_notificationCount = Mage::getModel('marketplace/buyerseller')->getTotalNotificationCount();?>
24
+ <div class="dashboard" style="padding-top:30px;">
25
+ <div class="marketplace-account box-recent">
26
+ <h2><?php echo $this->__('Notifications') ?></h2>
27
+ <div><?php echo $this->__("Notifications pending");?></div>
28
+ <?php if($_notificationCount > 0):?>
29
+ <p><a href="<?php echo $this->getUrl('marketplace/order/history/')?>" title="" alt=""><?php echo $this->__("You have $_notificationCount notifications for orders");?></a></p>
30
+ <?php endif;?>
31
+ </div>
32
+ </div>
app/design/frontend/base/default/template/marketplace/dashboard/questioncount.phtml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ echo $this->getMessagesBlock()->getGroupedHtml();
21
+ ?>
22
+ <?php $_questionCount = Mage::getModel('marketplace/marketplace')->getUnrepliedQueCount();?>
23
+ <div class="dashboard" style="padding-top:30px;">
24
+ <div class="marketplace-account box-recent">
25
+ <h2><?php echo $this->__('Questions') ?></h2>
26
+ <?php if($_questionCount > 0):?>
27
+ <p><a href="<?php echo $this->getUrl('marketplace/productquestion/')?>" title="" alt=""><?php echo $this->__("You have $_questionCount new questions for your products");?></a></p>
28
+ <?php else:?>
29
+ <p><?php echo $this->__("You have no Question(s) for products.");?></p>
30
+ <?php endif;?>
31
+ </div>
32
+ </div>
app/design/frontend/base/default/template/marketplace/persistent/customer/form/register.phtml ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <div class="account-create">
22
+ <div class="page-title">
23
+ <h1><?php echo $this->__('Create an Account') ?></h1>
24
+ </div>
25
+ <?php echo $this->getChildHtml('form_fields_before')?>
26
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
27
+ <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate" enctype="multipart/form-data">
28
+ <div class="fieldset">
29
+ <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
30
+ <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
31
+ <h2 class="legend"><?php echo $this->__('Personal Information') ?></h2>
32
+ <ul class="form-list">
33
+ <li class="fields">
34
+ <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?>
35
+ </li>
36
+ <li>
37
+ <label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
38
+ <div class="input-box">
39
+ <input type="text" name="email" id="email_address" value="<?php echo $this->escapeHtml($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
40
+ </div>
41
+ </li>
42
+ <?php if ($this->isNewsletterEnabled()): ?>
43
+ <li class="control">
44
+ <div class="input-box">
45
+ <input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />
46
+ </div>
47
+ <label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
48
+ </li>
49
+ <?php endif ?>
50
+ <?php $isMarketplaceEnabled=Mage::Helper("marketplace")->isMarketplaceEnabled(); ?>
51
+ <?php if($isMarketplaceEnabled):?>
52
+ <li class="control">
53
+ <input type="checkbox" name="check_seller_form" id="check_seller_form" onclick="checkSellerFormRequired(this.checked)" title="<?php echo $this->__('Want To Sell Products?') ?>" class="checkbox" <?php if ($this->escapeHtml($this->getFormData()->getCheckSellerForm())) { echo 'checked'; } ?> />
54
+ <label for="check_seller_form"><?php echo $this->__('Want To Sell Products?') ?></label>
55
+ </li>
56
+ <?php endif;?>
57
+ <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
58
+ <?php if ($_dob->isEnabled()): ?>
59
+ <li><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></li>
60
+ <?php endif ?>
61
+ <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
62
+ <?php if ($_taxvat->isEnabled()): ?>
63
+ <li><?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?></li>
64
+ <?php endif ?>
65
+ <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
66
+ <?php if ($_gender->isEnabled()): ?>
67
+ <li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li>
68
+ <?php endif ?>
69
+ </ul>
70
+ </div>
71
+ <?php if($isMarketplaceEnabled):?>
72
+ <!--End of Add seller profile form-->
73
+ <div id="seller_form" class="fieldset" style="<?php if ($this->escapeHtml($this->getFormData()->getCheckSellerForm())) { echo 'display:block;'; } else { echo 'display:none;'; } ?>">
74
+ <h2 class="legend"><?php echo $this->__('Seller Profile') ?></h2>
75
+ <ul class="form-list">
76
+ <li>
77
+ <label class="required"><?php echo $this->__('Company Banner').' ('.Mage::getStoreConfig('marketplace/marketplace/default_width').' pixel X '.Mage::getStoreConfig('marketplace/marketplace/default_height').' pixel)'; ?></label>
78
+ <div class="input-box">
79
+ <input type="file" id="company_banner" size="20" name="company_banner">
80
+ </div>
81
+ </li>
82
+ <li>
83
+ <label class="required"><?php echo $this->__('Company Logo').' ('. Mage::getStoreConfig('marketplace/marketplace/default_logo_width'). $this->__('pixel'). ' X '. Mage::getStoreConfig('marketplace/marketplace/default_logo_height'). $this->__('pixel') . ')'; ?></label>
84
+ <div class="input-box">
85
+ <input type="file" id="company_logo" size="20" name="company_logo">
86
+ </div>
87
+ </li>
88
+ <li>
89
+ <label class="required"> <em>*</em><?php echo $this->__('Company Name') ?></label>
90
+ <div class="input-box">
91
+ <input type="text" name="company_name" id="company_name" title="<?php echo $this->__('Company Name') ?>" class="input-text required-entry" value="<?php echo $this->escapeHtml($this->getFormData()->getCompanyName()) ?>" />
92
+ </div>
93
+ </li>
94
+ <li>
95
+ <label class="required"><em>*</em><?php echo $this->__('Company Locality') ?></label>
96
+ <div class="input-box">
97
+ <input type="text" name="company_locality" id="company_locality" title="<?php echo $this->__('Company Locality') ?>" class="input-text required-entry" value="<?php echo $this->escapeHtml($this->getFormData()->getCompanyLocality()) ?>" />
98
+ </div>
99
+ </li>
100
+ <li>
101
+ <label class="required"><?php echo $this->__('Company Description') ?></label>
102
+ <div class="input-box">
103
+ <textarea name="company_description" cols="40" id="company_description" title="<?php echo $this->__('Company Description') ?>">
104
+ <?php echo $this->escapeHtml($this->getFormData()->getCompanyDescription()) ?>
105
+ </textarea>
106
+ </div>
107
+ </li>
108
+ </ul>
109
+ </div>
110
+ <?php endif;?>
111
+ <?php if($this->getShowAddressFields()): ?>
112
+ <div class="fieldset">
113
+ <input type="hidden" name="create_address" value="1" />
114
+ <h2 class="legend"><?php echo $this->__('Address Information') ?></h2>
115
+ <ul class="form-list">
116
+ <li class="fields">
117
+ <div class="field">
118
+ <label for="company"><?php echo $this->__('Company') ?></label>
119
+ <div class="input-box">
120
+ <input type="text" name="company" id="company" value="<?php echo $this->escapeHtml($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
121
+ </div>
122
+ </div>
123
+ <div class="field">
124
+ <label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
125
+ <div class="input-box">
126
+ <input type="text" name="telephone" id="telephone" value="<?php echo $this->escapeHtml($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" />
127
+ </div>
128
+ </div>
129
+ </li>
130
+ <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
131
+ <li class="wide">
132
+ <label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
133
+ <div class="input-box">
134
+ <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" />
135
+ </div>
136
+ </li>
137
+ <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
138
+ <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
139
+ <li class="wide">
140
+ <div class="input-box">
141
+ <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet($_i)) ?>" title="<?php echo $this->__('Street Address %s', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" />
142
+ </div>
143
+ </li>
144
+ <?php endfor; ?>
145
+ <li class="fields">
146
+ <div class="field">
147
+ <label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
148
+ <div class="input-box">
149
+ <input type="text" name="city" value="<?php echo $this->escapeHtml($this->getFormData()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="city" />
150
+ </div>
151
+ </div>
152
+ <div class="field">
153
+ <label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
154
+ <div class="input-box">
155
+ <select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
156
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
157
+ </select>
158
+ <script type="text/javascript">
159
+ //<![CDATA[
160
+ $('region_id').setAttribute('defaultValue', "<?php echo $this->getFormData()->getRegionId() ?>");
161
+ //]]>
162
+ </script>
163
+ <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
164
+ </div>
165
+ </div>
166
+ </li>
167
+ <li class="fields">
168
+ <div class="field">
169
+ <label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
170
+ <div class="input-box">
171
+ <input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
172
+ </div>
173
+ </div>
174
+ <div class="field">
175
+ <label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
176
+ <div class="input-box">
177
+ <?php echo $this->getCountryHtmlSelect() ?>
178
+ </div>
179
+ </div>
180
+ </li>
181
+ </ul>
182
+ <input type="hidden" name="default_billing" value="1" />
183
+ <input type="hidden" name="default_shipping" value="1" />
184
+ </div>
185
+ <?php endif; ?>
186
+ <div class="fieldset">
187
+ <h2 class="legend"><?php echo $this->__('Login Information') ?></h2>
188
+ <ul class="form-list">
189
+ <li class="fields">
190
+ <div class="field">
191
+ <label for="password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
192
+ <div class="input-box">
193
+ <input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
194
+ </div>
195
+ </div>
196
+ <div class="field">
197
+ <label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
198
+ <div class="input-box">
199
+ <input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" />
200
+ </div>
201
+ </div>
202
+ </li>
203
+ <?php echo $this->getChildHtml('form.additional.info'); ?>
204
+ <?php echo $this->getChildHtml('persistent.remember.me'); ?>
205
+ </ul>
206
+ <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
207
+ </div>
208
+ <div class="buttons-set">
209
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
210
+ <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="back-link"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
211
+ <button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
212
+ </div>
213
+ <?php if (Mage::helper('checkout')->isContextCheckout()): ?>
214
+ <input name="context" type="hidden" value="checkout" />
215
+ <?php endif; ?>
216
+ </form>
217
+ <script type="text/javascript">
218
+ //<![CDATA[
219
+ var dataForm = new VarienForm('form-validate', true);
220
+
221
+ /**
222
+ * Check checkbox is cheked or no,if yes then display seller form
223
+ * else hide form and remove validations
224
+ **/
225
+ function checkSellerFormRequired(arg){
226
+ if(arg){
227
+ $('seller_form').show();
228
+ $('company_name').addClassName('required-entry');
229
+ $('company_locality').addClassName('required-entry');
230
+ }else{
231
+ $('seller_form').hide();
232
+ $('current_password').removeClassName('required-entry');
233
+ $('company_name').removeClassName('required-entry');
234
+ $('company_locality').removeClassName('required-entry');
235
+ }
236
+ }
237
+ <?php if($this->getShowAddressFields()): ?>
238
+ new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
239
+ <?php endif; ?>
240
+ //]]>
241
+ </script>
242
+ </div>
app/design/frontend/base/default/template/marketplace/product/add.phtml ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <div class="page-title">
22
+ <h1><?php echo $this->__('My Product - Add') ?></h1>
23
+ </div>
24
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
25
+ <form action="<?php echo $this->getUrl('*/*/save') ?>" method="post" id="form-validate" enctype="multipart/form-data">
26
+ <div class="fieldset">
27
+ <?php echo $this->getBlockHtml('formkey') ?>
28
+ <h2 class="legend"><?php echo $this->__('Product Information') ?></h2>
29
+ <ul class="form-list">
30
+ <li>
31
+ <div class="field">
32
+ <label for="category" class="required"><em>*</em><?php echo $this->__('Product Category') ?></label>
33
+ <div class="input-box">
34
+ <select name="product[category_ids][]" id="category" class="required-entry select multiselect" multiple="multiple">
35
+ <option value="" selected="selected"><?php echo $this->__('Please Select Category--'); ?></option>
36
+ <?php $category = Mage::helper('marketplace')->getCategoryCollection(); ?>
37
+ <?php foreach ($category as $cat) : ?>
38
+ <?php $currentCategory = Mage::getModel("catalog/category")->load($cat->getEntityId()); ?>
39
+ <option
40
+ <?php
41
+ if (in_array($currentCategory->getId(), $this->getFormData()->getCategoryIds())) {
42
+ echo "selected=selected";
43
+ }
44
+ ?>
45
+ value="<?php echo $currentCategory->getId(); ?>"><?php echo $currentCategory->getName(); ?></option>
46
+ <?php endforeach; ?>
47
+ </select>
48
+ </div>
49
+ </div>
50
+ <div class="field">
51
+ <label for="name" class="required"><em>*</em><?php echo $this->__('Product Name') ?></label>
52
+ <div class="input-box">
53
+ <input type="text" name="product[name]" id="name" value="<?php echo $this->getFormData()->getName(); ?>" title="<?php echo $this->__('Product Name') ?>" class="input-text required-entry" />
54
+ </div>
55
+ </div>
56
+ </li>
57
+ <li>
58
+ <div class="field">
59
+ <label for="description" class="required"><em>*</em><?php echo $this->__('Description') ?></label>
60
+ <div class="input-box">
61
+ <textarea name="product[description]" id="description" class="input-text required-entry" title="<?php echo $this->__('Description') ?>" rows="4" ><?php echo $this->getFormData()->getDescription(); ?></textarea>
62
+ </div>
63
+ </div>
64
+ </li>
65
+ <li>
66
+ <div class="field">
67
+ <label for="short_description" class="required"><em>*</em><?php echo $this->__('Short Description') ?></label>
68
+ <div class="input-box">
69
+ <textarea name="product[short_description]" id="short_description" class="input-text required-entry" title="<?php echo $this->__('Short Description') ?>" rows="4" ><?php echo $this->getFormData()->getDescription();?></textarea>
70
+ </div>
71
+ </div>
72
+ </li>
73
+ <li>
74
+ <div class="field">
75
+ <label for="delivery_time"><?php echo $this->__('Delivery Time') ?></label>
76
+ <div class="input-box">
77
+ <input type="text" name="product[delivery_time]" id="delivery_time" value="<?php echo $this->getFormData()->getDeliveryTime(); ?>" title="<?php echo $this->__('Delivery Time') ?>" class="input-text" />
78
+ </div>
79
+ </div>
80
+ <!--<div class="field">
81
+ <label for="shipping_charges"><?php //echo $this->__('Shipping Charges') ?></label>
82
+ <div class="input-box">
83
+ <input type="text" name="product[shipping_charges]" id="shipping_charges" value="<?php echo $this->getFormData()->getShippingCharges(); ?>" title="<?php echo $this->__('Shipping Charges') ?>" class="input-text" />
84
+ </div>
85
+ </div>-->
86
+ </li>
87
+ <li>
88
+ <div class="field">
89
+ <label for="sku" class="required"><em>*</em><?php echo $this->__('SKU') ?></label>
90
+ <div class="input-box">
91
+ <input type="text" name="product[sku]" id="sku" value="<?php echo $this->getFormData()->getSku(); ?>" title="<?php echo $this->__('SKU') ?>" class="input-text required-entry" />
92
+ </div>
93
+ </div>
94
+ <div class="field">
95
+ <label for="price" class="required"><em>*</em><?php echo $this->__('Price') ?></label>
96
+ <div class="input-box">
97
+ <input type="text" name="product[price]" id="price" value="<?php echo $this->getFormData()->getPrice(); ?>" title="<?php echo $this->__('Price') ?>" class="input-text required-entry" />
98
+ </div>
99
+ </div>
100
+ </li>
101
+ <li>
102
+ <div class="field">
103
+ <label for="stock" class="required"><em>*</em><?php echo $this->__('Stock') ?></label>
104
+ <div class="input-box">
105
+ <input type="text" name="product[qty]" id="qty" value="<?php echo $this->getFormData()->getQty(); ?>" title="<?php echo $this->__('Stock') ?>" class="input-text required-entry" />
106
+ </div>
107
+ </div>
108
+ <div class="field">
109
+ <label for="weight" class="required"><em>*</em><?php echo $this->__('Weight') ?></label>
110
+ <div class="input-box">
111
+ <input type="text" name="product[weight]" id="weight" value="<?php echo $this->getFormData()->getWeight(); ?>" title="<?php echo $this->__('Weight') ?>" class="input-text required-entry" />
112
+ </div>
113
+ </div>
114
+ </li>
115
+ </ul>
116
+ </div>
117
+ <div class="field">
118
+ <div class="upload-head">
119
+ <label for="image" class="required"><?php echo $this->__('Upload Image') ?></label>
120
+ </div>
121
+ <div class="input-box">
122
+ <input type="hidden" name = "product[image][new]" value="1"/>
123
+ <table class="marketplace-image data-table">
124
+ <tr>
125
+ <th><?php echo $this->__('Base Image') ?></th>
126
+ <td><input type="file" id="product-image" name="image" title="<?php echo $this->__('Image') ?>" class="input-text" /></td>
127
+ </tr>
128
+ <tr>
129
+ <th><?php echo $this->__('Small Image') ?></th>
130
+ <td><input type="file" id="product-image" name="small_image" title="<?php echo $this->__('Small Image') ?>" class="input-text" /></td>
131
+ </tr>
132
+ <tr>
133
+ <th><?php echo $this->__('Thumbnail Image') ?></th>
134
+ <td><input type="file" id="product-image" name="thumbnail" title="<?php echo $this->__('Thumbnail Image') ?>" class="input-text" /></td>
135
+ </tr>
136
+ </table>
137
+ <b><span class="img-format"><?php echo $this->__('(Small Image / Thumbnail Image : Allowed upto '.Mage::helper('marketplace')->getNewProductUploadImageSize().' bytes and jpg, jpeg, png & gif format)') ?></span></b>
138
+ </div>
139
+ </div>
140
+ <div class="buttons-set">
141
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
142
+ <p class="back-link">
143
+ <a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>">
144
+ <small>&laquo; </small>
145
+ <?php echo $this->__('Back') ?>
146
+ </a>
147
+ </p>
148
+ <button type="submit" title="<?php echo $this->__('Save') ?>" class="button"><span><span><?php echo $this->__('Save') ?></span></span></button>
149
+ </div>
150
+ </form>
151
+ <?php echo $this->helper('core/js')->getTranslatorScript() ?>
152
+
153
+ <script language="javascript" type="text/javascript">
154
+ window.onload = function() {
155
+ if(document.getElementById('page_content')){
156
+ if(document.getElementById('page_content').value == ''){
157
+ document.getElementById('page_content').value = "<p>Page Content</p>";
158
+ }
159
+ }
160
+ }
161
+ </script>
162
+ <script type="text/javascript">
163
+ //<![CDATA[
164
+ var productForm = new VarienForm('form-validate', true);
165
+
166
+ /* Event.observe(window, 'load', function() {
167
+ if(document.getElementById('description')){
168
+ if(document.getElementById('description').value == ''){
169
+ document.getElementById('description').value = "<p>Enter description</p>";
170
+ document.getElementById('short_description').value = "<p>Enter short description</p>";
171
+ }
172
+ }
173
+ tinyMCE.init({
174
+ mode : "exact",
175
+ theme : "advanced",
176
+ strict_loading_mode : true,
177
+ elements : "description,short_description",
178
+ theme_advanced_toolbar_location : "top",
179
+ theme_advanced_toolbar_align : "left",
180
+ theme_advanced_path_location : "bottom",
181
+ extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
182
+ theme_advanced_resize_horizontal : "true",
183
+ theme_advanced_resizing : "true",
184
+ apply_source_formatting : "true",
185
+ convert_urls : "false",
186
+ force_br_newlines : "true",
187
+ doctype : '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;'
188
+ });
189
+ });
190
+ */
191
+ //]]>
192
+ </script>
app/design/frontend/base/default/template/marketplace/product/edit.phtml ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <div class="page-title">
22
+ <h1><?php echo $this->__('My Product - Edit') ?></h1>
23
+ </div>
24
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
25
+ <form action="<?php echo $this->getUrl('*/*/save') ?>" method="post" id="form-validate" enctype="multipart/form-data">
26
+ <input type="hidden" value="<?php echo $this->getFormData()->getEntityId(); ?>" name="product[id]"/>
27
+ <div class="fieldset">
28
+ <?php echo $this->getBlockHtml('formkey') ?>
29
+ <h2 class="legend"><?php echo $this->__('Product Information') ?></h2>
30
+ <ul class="form-list">
31
+ <li>
32
+ <div class="field">
33
+ <label for="category" class="required"><em>*</em><?php echo $this->__('Product Category') ?></label>
34
+ <div class="input-box">
35
+ <select name="product[category_ids][]" id="category" class="required-entry select multiselect" multiple="multiple">
36
+ <option value=""><?php echo $this->__('Please Select Category--'); ?></option>
37
+ <?php $category = Mage::helper('marketplace')->getCategoryCollection(); ?>
38
+ <?php foreach ($category as $cat) : ?>
39
+ <?php $currentCategory = Mage::getModel("catalog/category")->load($cat->getEntityId()); ?>
40
+ <option
41
+ <?php
42
+ if (in_array($currentCategory->getId(), $this->getFormData()->getCategoriesIds())) {
43
+ echo "selected=selected";
44
+ }
45
+ ?>
46
+ value="<?php echo $currentCategory->getId(); ?>"><?php echo $currentCategory->getName(); ?></option>
47
+ <?php endforeach; ?>
48
+ </select>
49
+ </div>
50
+ </div>
51
+ <div class="field">
52
+ <label for="name" class="required"><em>*</em><?php echo $this->__('Product Name') ?></label>
53
+ <div class="input-box">
54
+ <input type="text" name="product[name]" id="name" value="<?php echo $this->getFormData()->getName(); ?>" title="<?php echo $this->__('Product Name') ?>" class="input-text required-entry" />
55
+ </div>
56
+ </div>
57
+ </li>
58
+ <li>
59
+ <div class="field">
60
+ <label for="description" class="required"><em>*</em><?php echo $this->__('Description') ?></label>
61
+ <div class="input-box">
62
+ <textarea name="product[description]" id="description" class="input-text required-entry" title="<?php echo $this->__('Description') ?>" rows="4" ><?php echo $this->getFormData()->getDescription(); ?></textarea>
63
+ </div>
64
+ </div>
65
+ </li>
66
+ <li>
67
+ <div class="field">
68
+ <label for="short_description" class="required"><em>*</em><?php echo $this->__('Short Description') ?></label>
69
+ <div class="input-box">
70
+ <textarea name="product[short_description]" id="short_description" class="input-text required-entry" title="<?php echo $this->__('Short Description') ?>" rows="4" ><?php echo $this->getFormData()->getDescription(); ?></textarea>
71
+ </div>
72
+ </div>
73
+ </li>
74
+ <li>
75
+ <div class="field">
76
+ <label for="delivery_time"><?php echo $this->__('Delivery Time') ?></label>
77
+ <div class="input-box">
78
+ <input type="text" name="product[delivery_time]" id="delivery_time" value="<?php echo $this->getFormData()->getDeliveryTime(); ?>" title="<?php echo $this->__('Delivery Time') ?>" class="input-text" />
79
+ </div>
80
+ </div>
81
+ <!--<div class="field">
82
+ <label for="shipping_charges"><?php //echo $this->__('Shipping Charges') ?></label>
83
+ <div class="input-box">
84
+ <input type="text" name="product[shipping_charges]" id="shipping_charges" value="<?php echo $this->getFormData()->getShippingCharges(); ?>" title="<?php echo $this->__('Shipping Charges') ?>" class="input-text" />
85
+ </div>
86
+ </div>-->
87
+ </li>
88
+ <li>
89
+ <div class="field">
90
+ <label for="sku" class="required"><em>*</em><?php echo $this->__('SKU') ?></label>
91
+ <div class="input-box">
92
+ <input type="text" name="product[sku]" id="sku" value="<?php echo $this->getFormData()->getSku(); ?>" title="<?php echo $this->__('SKU') ?>" class="input-text required-entry" />
93
+ </div>
94
+ </div>
95
+ <div class="field">
96
+ <label for="price" class="required"><em>*</em><?php echo $this->__('Price') ?></label>
97
+ <div class="input-box">
98
+ <input type="text" name="product[price]" id="price" value="<?php echo $this->getFormData()->getPrice(); ?>" title="<?php echo $this->__('Price') ?>" class="input-text required-entry" />
99
+ </div>
100
+ </div>
101
+ </li>
102
+ <li>
103
+ <div class="field">
104
+ <label for="stock" class="required"><em>*</em><?php echo $this->__('Stock') ?></label>
105
+ <div class="input-box">
106
+ <input type="text" name="product[qty]" id="qty" value="<?php echo round($this->getFormData()->getStockItem()->getQty()); ?>" title="<?php echo $this->__('Stock') ?>" class="input-text required-entry" />
107
+ </div>
108
+ </div>
109
+ <div class="field">
110
+ <label for="weight" class="required"><em>*</em><?php echo $this->__('Weight') ?></label>
111
+ <div class="input-box">
112
+ <input type="text" name="product[weight]" id="weight" value="<?php echo $this->getFormData()->getWeight(); ?>" title="<?php echo $this->__('Weight') ?>" class="input-text required-entry" />
113
+ </div>
114
+ </div>
115
+ </li>
116
+ </ul>
117
+ </div>
118
+ <div class="field">
119
+ <div class="upload-head">
120
+ <label for="image" class="required"><?php echo $this->__('Upload Image') ?></label>
121
+ </div>
122
+ <div class="input-box">
123
+ <input type="hidden" name = "product[image][edit]" value="1"/>
124
+ <?php $mediaUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>
125
+ <?php $productId=$this->getRequest()->getParam('id');?>
126
+ <?php $product = Mage::getModel('catalog/product')->load($productId);?>
127
+ <table class="marketplace-image data-table">
128
+ <tr>
129
+ <?php $image = Mage::getBaseDir('media') . DS . 'catalog' . DS . 'product' . DS . $product->getImage(); ?>
130
+ <th><?php echo $this->__('Base Image') ?></th>
131
+ <?php if ($product->getImage() != null && $product->getImage() != "no_selection" && file_exists($image)) : ?>
132
+ <td><img src="<?php echo $mediaUrl . "catalog/product" . $product->getImage(); ?>" width="75"/></td>
133
+ <td><a style="margin: 10px;" href="<?php echo $this->getImageDeleteUrl('image') ?>" title="<?php echo $this->__('Remove This Base Image') ?>" onclick="return confirm('<?php echo $this->__('Are you sure you want to delete this image?') ?>');" class="btn-remove"><?php echo $this->__('Remove This Base Image') ?></a></td>
134
+ <?php else: ?>
135
+ <td colspan="2" ><input type="file" id="product-image" name="image" title="<?php echo $this->__('Image') ?>" class="input-text" /></td>
136
+
137
+ <?php endif; ?>
138
+ </tr>
139
+ <tr>
140
+ <?php $image = Mage::getBaseDir('media') . DS . 'catalog' . DS . 'product' . DS . $product->getSmallImage(); ?>
141
+ <th><?php echo $this->__('Small Image') ?></th>
142
+ <?php if ($product->getSmallImage() != null && $product->getSmallImage() != "no_selection" && file_exists($image)) : ?>
143
+ <td><img src="<?php echo $mediaUrl . "catalog/product" . $product->getSmallImage(); ?>" width="75"/></td>
144
+ <td><a style="margin: 10px;" href="<?php echo $this->getImageDeleteUrl('small_image') ?>" title="<?php echo $this->__('Remove This Small Image') ?>" onclick="return confirm('<?php echo $this->__('Are you sure you want to delete this image?') ?>');" class="btn-remove"><?php echo $this->__('Remove This Small Image') ?></a></td>
145
+ <?php else: ?>
146
+ <td colspan="2" ><input type="file" id="product-image" name="small_image" title="<?php echo $this->__('Image') ?>" class="input-text" /></td>
147
+
148
+ <?php endif; ?>
149
+ </tr>
150
+ <tr>
151
+ <?php $image = Mage::getBaseDir('media') . DS . 'catalog' . DS . 'product' . DS . $product->getThumbnail(); ?>
152
+ <th><?php echo $this->__('Thumbnail Image') ?></th>
153
+ <?php if ($product->getThumbnail() != null && $product->getThumbnail() != "no_selection" && file_exists($image) ) : ?>
154
+ <td><img src="<?php echo $mediaUrl . "catalog/product" . $product->getThumbnail(); ?>" width="75"/></td>
155
+ <td><a style="margin: 10px;" href="<?php echo $this->getImageDeleteUrl('thumbnail') ?>" title="<?php echo $this->__('Remove This Thumbnail Image') ?>" onclick="return confirm('<?php echo $this->__('Are you sure you want to delete this image?') ?>');" class="btn-remove"><?php echo $this->__('Remove This Thumbnail Image') ?></a></td>
156
+ <?php else: ?>
157
+ <td colspan="2" ><input type="file" id="product-image" name="thumbnail" title="<?php echo $this->__('Image') ?>" class="input-text" /></td>
158
+
159
+ <?php endif; ?>
160
+ </tr>
161
+ </table>
162
+ <b><span class="img-format"><?php echo $this->__('(Small Image / Thumbnail Image : Allowed upto '.Mage::helper('marketplace')->getNewProductUploadImageSize().' bytes and jpg, jpeg, png & gif format)') ?></span></b>
163
+ </div>
164
+ </div>
165
+ <div class="buttons-set">
166
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
167
+ <p class="back-link">
168
+ <a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>">
169
+ <small>&laquo; </small>
170
+ <?php echo $this->__('Back') ?>
171
+ </a>
172
+ </p>
173
+ <button type="submit" title="<?php echo $this->__('Save') ?>" class="button"><span><span><?php echo $this->__('Save') ?></span></span></button>
174
+ </div>
175
+ </form>
176
+ <?php echo $this->helper('core/js')->getTranslatorScript() ?>
177
+
178
+ <script language="javascript" type="text/javascript">
179
+ window.onload = function() {
180
+ if(document.getElementById('page_content')){
181
+ if(document.getElementById('page_content').value == ''){
182
+ document.getElementById('page_content').value = "<p>Page Content</p>";
183
+ }
184
+ }
185
+ }
186
+ </script>
187
+ <script type="text/javascript">
188
+ //<![CDATA[
189
+ var productForm = new VarienForm('form-validate', true);
190
+
191
+ /* Event.observe(window, 'load', function() {
192
+ if(document.getElementById('description')){
193
+ if(document.getElementById('description').value == ''){
194
+ document.getElementById('description').value = "<p>Enter description</p>";
195
+ document.getElementById('short_description').value = "<p>Enter short description</p>";
196
+ }
197
+ }
198
+ tinyMCE.init({
199
+ mode : "exact",
200
+ theme : "advanced",
201
+ strict_loading_mode : true,
202
+ elements : "description,short_description",
203
+ theme_advanced_toolbar_location : "top",
204
+ theme_advanced_toolbar_align : "left",
205
+ theme_advanced_path_location : "bottom",
206
+ extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
207
+ theme_advanced_resize_horizontal : "true",
208
+ theme_advanced_resizing : "true",
209
+ apply_source_formatting : "true",
210
+ convert_urls : "false",
211
+ force_br_newlines : "true",
212
+ doctype : '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;'
213
+ });
214
+ });
215
+ */
216
+ //]]>
217
+ </script>
app/design/frontend/base/default/template/marketplace/product/grid.phtml ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
22
+ <?php $collection = $this->getCollection(); ?>
23
+ <div class="dashboard">
24
+ <div class="page-title">
25
+ <h1><?php echo $this->__('Marketplace - My Products') ?></h1>
26
+ </div>
27
+ <div class="marketplace-account box-recent">
28
+ <div class="marketplace-head page-title">
29
+ <h2><?php echo $this->__('Product List') ?></h2>
30
+ <a href="<?php echo $this->getUrl('marketplace/product/add') ?>" class="common-orange-button btn-add-product"><?php echo $this->__('Add Product') ?></a>
31
+ <div class="clear"></div>
32
+ </div>
33
+ <div style="clear:both"></div>
34
+ <div class="marketplace-account box-recent">
35
+ <?php echo $this->getPagerHtml(); ?>
36
+ <?php if($collection->getSize()): ?>
37
+ <table class="data-table" id="my-custom-table">
38
+ <col width="1" />
39
+ <col width="1" />
40
+ <col />
41
+ <col width="1" />
42
+ <col width="1" />
43
+ <col width="1" />
44
+ <thead>
45
+ <tr>
46
+ <th><?php echo $this->__('ID #') ?></th>
47
+ <th><?php echo $this->__('SKU') ?></th>
48
+ <th><?php echo $this->__('Product name') ?></th>
49
+ <th><?php echo $this->__('Price') ?></th>
50
+ <th><?php echo $this->__('Status') ?></th>
51
+ <th><?php echo $this->__('Created at') ?></th>
52
+ <th><?php echo $this->__('Action') ?></th>
53
+ </tr>
54
+ </thead>
55
+ <?php $productModel = Mage::getModel('catalog/product'); // Project object
56
+ $mstatusAttribute = $productModel->getResource()->getAttribute("marketplace_state"); // Selected attribute object
57
+ ?>
58
+ <tbody>
59
+ <?php $_odd = ''; ?>
60
+ <?php foreach ($collection as $productData): ?>
61
+ <?php $productStatus = $mstatusAttribute->getSource()->getOptionText($productData->getMarketplaceState()); // Label of the status ?>
62
+ <?php $createdDate = @explode(" ",$productData->getCreatedAt()); ?>
63
+
64
+ <tr> <?php $productId=$productData->getEntityId(); ?>
65
+ <td><a href="<?php echo $this->getUrl()."marketplace/product/edit/id/".$productId; ?>"><?php echo $productId ?></a></td>
66
+ <td><span><?php echo $productData->getSku(); ?></span></td>
67
+ <td><span><?php echo $productData->getName(); ?></span></td>
68
+ <td><span><?php echo Mage::helper('core')->currency($productData->getPrice(),true, false); ?></span></td>
69
+ <td><span><?php echo $productStatus; ?></span></td>
70
+ <td><span><?php echo $createdDate[0] ?></span></td>
71
+ <td><a href="<?php echo $this->getUrl()."marketplace/product/edit/id/".$productId; ?>"> <?php echo $this->__('Edit') ?></a>&nbsp;|&nbsp;<a href="#" onClick="deleteConfirm('<?php echo $this->getUrl()."marketplace/product/softDelete/id/".$productId;?>')"><?php echo $this->__('Delete') ?></a></td>
72
+ </tr>
73
+ <?php endforeach; ?>
74
+ </tbody>
75
+ </table>
76
+ <script type="text/javascript">
77
+ decorateTable('my-custom-table');
78
+ function deleteConfirm(location){
79
+ if(confirm("Are you sure you want to delete this product?")){
80
+ window.location.href = location;
81
+ }
82
+ }
83
+ </script>
84
+ <?php echo $this->getPagerHtml(); ?>
85
+ <?php else: ?>
86
+ <p><?php echo $this->__('You have no products.'); ?></p>
87
+ <?php endif ?>
88
+ </div>
89
+ </div>
90
+ </div>
app/design/frontend/base/default/template/marketplace/product/import.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <form action="<?php echo $this->getUrl('*/*/importvalidate') ?>" method="post" id="form-validate" enctype="multipart/form-data">
22
+ <input type="hidden" name="entity" value="catalog_product" />
23
+ <input type="hidden" name="behavior" value="append" />
24
+ <?php echo $this->getBlockHtml('formkey') ?>
25
+ <div class="field">
26
+ <div class="marketplace-head page-title">
27
+ <h2><?php echo $this->__('Product Import') ?></h2>
28
+ <a href="<?php echo $this->getUrl('marketplace/product/samplecsv') ?>" class="common-orange-button btn-add-product"><?php echo $this->__('Download Sample CSV') ?></a>
29
+ <div class="clear"></div>
30
+ </div>
31
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
32
+ <div class="input-box">
33
+ <table class="data-table">
34
+ <tr>
35
+ <th><label for="category" class="required"><?php echo $this->__('Select Images to Import') ?></label></th>
36
+ <td><input type="file" class="required-entry" title="Select Images to Import" value="" name="import_image" id="import_image"></td>
37
+ </tr>
38
+ <tr>
39
+ <th><label for="category" class="required"><?php echo $this->__('Select File to Import') ?></label></th>
40
+ <td><input type="file" class="required-entry" title="Select File to Import" value="" name="import_file" id="import_file"></td>
41
+ </tr>
42
+ </table>
43
+ <b><span class="img-format"><?php echo $this->__('Total size of uploadable files must not exceed %s', Mage::helper('importexport')->getMaxUploadSize().'. Only new products will be added, existing products will be ignore.');?></span></b>
44
+ </div>
45
+ </div>
46
+ <div class="buttons-set">
47
+ <button type="submit" title="<?php echo $this->__('Check Data') ?>" class="button"><span><span><?php echo $this->__('Save') ?></span></span></button>
48
+ </div>
49
+ </form>
app/design/frontend/base/default/template/marketplace/review/product/view/list.phtml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $_items = $this->getReviewsCollection();
22
+ ?>
23
+ <div class="box-collateral box-reviews" id="customer-reviews">
24
+ <?php if (count($_items)):?>
25
+ <h2><?php echo $this->__('Customer Reviews') ?></h2>
26
+ <?php echo $this->getPagerHtml() ?>
27
+ <dl>
28
+ <?php foreach ($_items as $_review):?>
29
+ <dt>
30
+ <a href="<?php echo $this->getReviewUrl($_review->getId()) ?>"><?php echo $this->htmlEscape($_review->getTitle()) ?></a> <?php echo $this->__('Review by <span>%s</span>', $this->htmlEscape($_review->getNickname())) ?>
31
+ </dt>
32
+ <div class="review_product_name">
33
+ <?php $catalogModel = Mage::getModel('catalog/product')->load($_review->getEntityPkValue());
34
+ echo $this->__('Product Name :').'&nbsp &nbsp '.$this->__($catalogModel->getName());
35
+ ?>
36
+ </div>
37
+ <dd>
38
+ <?php
39
+ $_votes = $this->getRatingInfo($_review);
40
+ ?>
41
+ <?php if (count($_votes)): ?>
42
+ <table class="ratings-table">
43
+ <col width="1" />
44
+ <col />
45
+ <tbody>
46
+ <?php foreach ($_votes as $_vote): ?>
47
+ <tr>
48
+ <th><?php echo $this->escapeHtml($_vote->getRatingCode()) ?></th>
49
+ <td>
50
+ <div class="rating-box">
51
+ <div class="rating" style="width:<?php echo $_vote->getPercent() ?>%;"></div>
52
+ </div>
53
+ </td>
54
+ </tr>
55
+ <?php endforeach; ?>
56
+ </tbody>
57
+ </table>
58
+ <?php endif; ?>
59
+ <?php echo nl2br($this->htmlEscape($_review->getDetail())) ?>
60
+ <small class="date"><?php echo $this->__('(Posted on %s)', $this->formatDate($_review->getCreatedAt()), 'long') ?></small>
61
+ </dd>
62
+ <?php endforeach; ?>
63
+ </dl>
64
+ <?php echo $this->getPagerHtml() ?>
65
+ <?php else:?>
66
+ <?php $sellerId = $this->getRequest()->getParam('seller_id'); ?>
67
+ <?php if(!empty($sellerId)): ?>
68
+ <div><?php echo $this->__('Reviews not found'); ?></div>
69
+ <?php else:?>
70
+ <div><?php echo $this->__('Seller id is null'); ?></div>
71
+ <?php endif;?>
72
+ <?php endif;?>
73
+ </div>
app/design/frontend/base/default/template/marketplace/sales/myorder/items/renderer/default.phtml ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $_item = $this->getItem();
22
+ $prod_id = $_item->getProductId();
23
+ $order_id = $this->getRequest()->getParam('order_id');
24
+ ?>
25
+ <tr class="border" id="order-item-row-<?php echo $_item->getId() ?>">
26
+ <td><h3 class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></h3>
27
+ <?php if($_options = $this->getItemOptions()): ?>
28
+ <dl class="item-options">
29
+ <?php foreach ($_options as $_option) : ?>
30
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
31
+ <?php if (!$this->getPrintStatus()): ?>
32
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
33
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>>
34
+ <?php echo $_formatedOptionValue['value'] ?>
35
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
36
+ <div class="truncated_full_value">
37
+ <dl class="item-options">
38
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
39
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
40
+ </dl>
41
+ </div>
42
+ <?php endif; ?>
43
+ </dd>
44
+ <?php else: ?>
45
+ <dd>
46
+ <?php echo nl2br($this->escapeHtml( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) )) ?>
47
+ </dd>
48
+ <?php endif; ?>
49
+ <?php endforeach; ?>
50
+ </dl>
51
+ <?php endif; ?>
52
+ <?php $addtInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
53
+ <?php if ($addtInfoBlock) :?>
54
+ <?php echo $addtInfoBlock->setItem($_item)->toHtml(); ?>
55
+ <?php endif; ?>
56
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
57
+ <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?>
58
+ <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>
59
+ <?php endif; ?>
60
+ </td>
61
+ <td><?php echo $this->escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
62
+ <td class="a-right">
63
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
64
+ <span class="price-excl-tax">
65
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
66
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
67
+ <span class="cart-price">
68
+ <?php endif; ?>
69
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
70
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
71
+ </span>
72
+ <?php endif; ?>
73
+ <?php endif; ?>
74
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
75
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
76
+ <?php else: ?>
77
+ <span class="cart-price">
78
+ <?php endif; ?>
79
+
80
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
81
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?>
82
+ <?php else: ?>
83
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?>
84
+ <?php endif; ?>
85
+ </span>
86
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
87
+ <span class="cart-tax-info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
88
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
89
+ <small>
90
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
91
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
92
+ <?php endforeach; ?>
93
+ </small>
94
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
95
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
96
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
97
+ <?php endforeach; ?>
98
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
99
+ <small>
100
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
101
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
102
+ <?php endforeach; ?>
103
+ </small>
104
+ <?php endif; ?>
105
+ </span>
106
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
107
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
108
+ <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>
109
+ </span>
110
+ <?php endif; ?>
111
+ <?php endif; ?>
112
+ </span>
113
+ <br />
114
+ <?php endif; ?>
115
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
116
+ <span class="price-incl-tax">
117
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
118
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
119
+ <span class="cart-price">
120
+ <?php endif; ?>
121
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
122
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
123
+ </span>
124
+ <?php endif; ?>
125
+ <?php endif; ?>
126
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($this->getItem()); ?>
127
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
128
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
129
+ <?php else: ?>
130
+ <span class="cart-price">
131
+ <?php endif; ?>
132
+
133
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
134
+ <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?>
135
+ <?php else: ?>
136
+ <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?>
137
+ <?php endif; ?>
138
+ </span>
139
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
140
+ <span class="cart-tax-info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
141
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
142
+ <small>
143
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
144
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
145
+ <?php endforeach; ?>
146
+ </small>
147
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
148
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
149
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
150
+ <?php endforeach; ?>
151
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
152
+ <small>
153
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
154
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
155
+ <?php endforeach; ?>
156
+ </small>
157
+ <?php endif; ?>
158
+ </span>
159
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
160
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
161
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?></span>
162
+ </span>
163
+ <?php endif; ?>
164
+ <?php endif; ?>
165
+ </span>
166
+ <?php endif; ?>
167
+ </td>
168
+ <td class="a-right">
169
+ <span class="nobr">
170
+ <?php if ($this->getItem()->getQtyOrdered() > 0): ?>
171
+ <?php echo $this->__('Ordered'); ?>: <strong><?php echo $this->getItem()->getQtyOrdered()*1 ?></strong><br />
172
+ <?php endif; ?>
173
+ <?php if ($this->getItem()->getQtyShipped() > 0): ?>
174
+ <?php echo $this->__('Shipped'); ?>: <strong><?php echo $this->getItem()->getQtyShipped()*1 ?></strong><br />
175
+ <?php endif; ?>
176
+ <?php if ($this->getItem()->getQtyCanceled() > 0): ?>
177
+ <?php echo $this->__('Canceled'); ?>: <strong><?php echo $this->getItem()->getQtyCanceled()*1 ?></strong><br />
178
+ <?php endif; ?>
179
+ <?php if ($this->getItem()->getQtyRefunded() > 0): ?>
180
+ <?php echo $this->__('Refunded'); ?>: <strong><?php echo $this->getItem()->getQtyRefunded()*1 ?></strong><br />
181
+ <?php endif; ?>
182
+ </span>
183
+ </td>
184
+ <td class="a-right">
185
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
186
+ <span class="price-excl-tax">
187
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
188
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
189
+ <span class="cart-price">
190
+ <?php endif; ?>
191
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
192
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
193
+ </span>
194
+ <?php endif; ?>
195
+ <?php endif; ?>
196
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
197
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
198
+ <?php else: ?>
199
+ <span class="cart-price">
200
+ <?php endif; ?>
201
+
202
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
203
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?>
204
+ <?php else: ?>
205
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?>
206
+ <?php endif; ?>
207
+ </span>
208
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
209
+ <span class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
210
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
211
+ <small>
212
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
213
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
214
+ <?php endforeach; ?>
215
+ </small>
216
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
217
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
218
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
219
+ <?php endforeach; ?>
220
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
221
+ <small>
222
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
223
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
224
+ <?php endforeach; ?>
225
+ </small>
226
+ <?php endif; ?>
227
+ </span>
228
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, '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
+ <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>
231
+ </span>
232
+ <?php endif; ?>
233
+ <?php endif; ?>
234
+ </span>
235
+ <br />
236
+ <?php endif; ?>
237
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
238
+ <span class="price-incl-tax">
239
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
240
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
241
+ <span class="cart-price">
242
+ <?php endif; ?>
243
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
244
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
245
+ </span>
246
+ <?php endif; ?>
247
+ <?php endif; ?>
248
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($this->getItem()); ?>
249
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
250
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
251
+ <?php else: ?>
252
+ <span class="cart-price">
253
+ <?php endif; ?>
254
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
255
+ <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?>
256
+ <?php else: ?>
257
+ <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?>
258
+ <?php endif; ?>
259
+ </span>
260
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
261
+ <span class="cart-tax-info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
262
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
263
+ <small>
264
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
265
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
266
+ <?php endforeach; ?>
267
+ </small>
268
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
269
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
270
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
271
+ <?php endforeach; ?>
272
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
273
+ <small>
274
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
275
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
276
+ <?php endforeach; ?>
277
+ </small>
278
+ <?php endif; ?>
279
+ </span>
280
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
281
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
282
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?></span>
283
+ </span>
284
+ <?php endif; ?>
285
+ <?php endif; ?>
286
+ </span>
287
+ <?php endif; ?>
288
+ </td>
289
+ <!--
290
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
291
+ <th class="a-right"><?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?></th>
292
+ <?php endif; ?>
293
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
294
+ <th class="a-right"><?php echo $this->getOrder()->formatPrice($this->helper('checkout')->getSubtotalInclTax($this->getItem())); ?></th>
295
+ <?php endif; ?>
296
+ -->
297
+ <td>
298
+ <?php
299
+ $cnt = Mage::getModel("marketplace/buyerseller")->getActiveNotificationForOrder($order_id,$prod_id);
300
+ if($cnt>0) {
301
+ ?>
302
+ <p><?php echo $cnt;?><?php echo $this->__('Notification(s)')?><br/><a href="<?php echo $this->getBaseUrl().'marketplace/buyerseller/reply/order/'.$order_id.'/product/'.$prod_id.'/'?>"><?php echo $this->__('Reply To Questions')?></a></p>
303
+ <?php } ?>
304
+ </td>
305
+ </tr>
app/design/frontend/base/default/template/marketplace/sales/myorder/items/renderer/ship/default.phtml ADDED
@@ -0,0 +1,307 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $_item = $this->getItem();
22
+ $prod_id = $_item->getProductId();
23
+ $order_id = $this->getRequest()->getParam('order_id');
24
+ ?>
25
+ <tr class="border" id="order-item-row-<?php echo $_item->getId() ?>">
26
+ <td><h3 class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></h3>
27
+ <?php if($_options = $this->getItemOptions()): ?>
28
+ <dl class="item-options">
29
+ <?php foreach ($_options as $_option) : ?>
30
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
31
+ <?php if (!$this->getPrintStatus()): ?>
32
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
33
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>>
34
+ <?php echo $_formatedOptionValue['value'] ?>
35
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
36
+ <div class="truncated_full_value">
37
+ <dl class="item-options">
38
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
39
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
40
+ </dl>
41
+ </div>
42
+ <?php endif; ?>
43
+ </dd>
44
+ <?php else: ?>
45
+ <dd>
46
+ <?php echo nl2br($this->escapeHtml( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) )) ?>
47
+ </dd>
48
+ <?php endif; ?>
49
+ <?php endforeach; ?>
50
+ </dl>
51
+ <?php endif; ?>
52
+ <?php $addtInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
53
+ <?php if ($addtInfoBlock) :?>
54
+ <?php echo $addtInfoBlock->setItem($_item)->toHtml(); ?>
55
+ <?php endif; ?>
56
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
57
+ <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?>
58
+ <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>
59
+ <?php endif; ?>
60
+ </td>
61
+ <td><?php echo $this->escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
62
+ <td class="a-right">
63
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
64
+ <span class="price-excl-tax">
65
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
66
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
67
+ <span class="cart-price">
68
+ <?php endif; ?>
69
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
70
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
71
+ </span>
72
+ <?php endif; ?>
73
+ <?php endif; ?>
74
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
75
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
76
+ <?php else: ?>
77
+ <span class="cart-price">
78
+ <?php endif; ?>
79
+
80
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
81
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?>
82
+ <?php else: ?>
83
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?>
84
+ <?php endif; ?>
85
+ </span>
86
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
87
+ <span class="cart-tax-info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
88
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
89
+ <small>
90
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
91
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
92
+ <?php endforeach; ?>
93
+ </small>
94
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
95
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
96
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
97
+ <?php endforeach; ?>
98
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
99
+ <small>
100
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
101
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
102
+ <?php endforeach; ?>
103
+ </small>
104
+ <?php endif; ?>
105
+ </span>
106
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
107
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
108
+ <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>
109
+ </span>
110
+ <?php endif; ?>
111
+ <?php endif; ?>
112
+ </span>
113
+ <br />
114
+ <?php endif; ?>
115
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
116
+ <span class="price-incl-tax">
117
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
118
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
119
+ <span class="cart-price">
120
+ <?php endif; ?>
121
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
122
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
123
+ </span>
124
+ <?php endif; ?>
125
+ <?php endif; ?>
126
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($this->getItem()); ?>
127
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
128
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
129
+ <?php else: ?>
130
+ <span class="cart-price">
131
+ <?php endif; ?>
132
+
133
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
134
+ <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?>
135
+ <?php else: ?>
136
+ <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?>
137
+ <?php endif; ?>
138
+ </span>
139
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
140
+ <span class="cart-tax-info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
141
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
142
+ <small>
143
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
144
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
145
+ <?php endforeach; ?>
146
+ </small>
147
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
148
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
149
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
150
+ <?php endforeach; ?>
151
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
152
+ <small>
153
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
154
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
155
+ <?php endforeach; ?>
156
+ </small>
157
+ <?php endif; ?>
158
+ </span>
159
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
160
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
161
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?></span>
162
+ </span>
163
+ <?php endif; ?>
164
+ <?php endif; ?>
165
+ </span>
166
+ <?php endif; ?>
167
+ </td>
168
+ <td class="a-right">
169
+ <span class="nobr">
170
+ <?php if ($this->getItem()->getQtyOrdered() > 0): ?>
171
+ <?php echo $this->__('Ordered'); ?>: <strong><?php echo $this->getItem()->getQtyOrdered()*1 ?></strong><br />
172
+ <?php endif; ?>
173
+ <?php if ($this->getItem()->getQtyShipped() > 0): ?>
174
+ <?php echo $this->__('Shipped'); ?>: <strong><?php echo $this->getItem()->getQtyShipped()*1 ?></strong><br />
175
+ <?php endif; ?>
176
+ <?php if ($this->getItem()->getQtyCanceled() > 0): ?>
177
+ <?php echo $this->__('Canceled'); ?>: <strong><?php echo $this->getItem()->getQtyCanceled()*1 ?></strong><br />
178
+ <?php endif; ?>
179
+ <?php if ($this->getItem()->getQtyRefunded() > 0): ?>
180
+ <?php echo $this->__('Refunded'); ?>: <strong><?php echo $this->getItem()->getQtyRefunded()*1 ?></strong><br />
181
+ <?php endif; ?>
182
+ </span>
183
+ </td>
184
+ <td>
185
+ <input type="text" value="<?php echo number_format($this->getItem()->getQtyOrdered(),0) ?>" name="shipment[items][<?php echo $order_id;?>]" class="input-text"></td>
186
+ <td class="a-right">
187
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
188
+ <span class="price-excl-tax">
189
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
190
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
191
+ <span class="cart-price">
192
+ <?php endif; ?>
193
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
194
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
195
+ </span>
196
+ <?php endif; ?>
197
+ <?php endif; ?>
198
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
199
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
200
+ <?php else: ?>
201
+ <span class="cart-price">
202
+ <?php endif; ?>
203
+
204
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
205
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?>
206
+ <?php else: ?>
207
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?>
208
+ <?php endif; ?>
209
+ </span>
210
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
211
+ <span class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
212
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
213
+ <small>
214
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
215
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
216
+ <?php endforeach; ?>
217
+ </small>
218
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
219
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
220
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
221
+ <?php endforeach; ?>
222
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
223
+ <small>
224
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
225
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
226
+ <?php endforeach; ?>
227
+ </small>
228
+ <?php endif; ?>
229
+ </span>
230
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
231
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
232
+ <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>
233
+ </span>
234
+ <?php endif; ?>
235
+ <?php endif; ?>
236
+ </span>
237
+ <br />
238
+ <?php endif; ?>
239
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
240
+ <span class="price-incl-tax">
241
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
242
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
243
+ <span class="cart-price">
244
+ <?php endif; ?>
245
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
246
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
247
+ </span>
248
+ <?php endif; ?>
249
+ <?php endif; ?>
250
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($this->getItem()); ?>
251
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
252
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
253
+ <?php else: ?>
254
+ <span class="cart-price">
255
+ <?php endif; ?>
256
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
257
+ <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?>
258
+ <?php else: ?>
259
+ <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?>
260
+ <?php endif; ?>
261
+ </span>
262
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
263
+ <span class="cart-tax-info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
264
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
265
+ <small>
266
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
267
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
268
+ <?php endforeach; ?>
269
+ </small>
270
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
271
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
272
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
273
+ <?php endforeach; ?>
274
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
275
+ <small>
276
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
277
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
278
+ <?php endforeach; ?>
279
+ </small>
280
+ <?php endif; ?>
281
+ </span>
282
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
283
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
284
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?></span>
285
+ </span>
286
+ <?php endif; ?>
287
+ <?php endif; ?>
288
+ </span>
289
+ <?php endif; ?>
290
+ </td>
291
+ <!--
292
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
293
+ <th class="a-right"><?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?></th>
294
+ <?php endif; ?>
295
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
296
+ <th class="a-right"><?php echo $this->getOrder()->formatPrice($this->helper('checkout')->getSubtotalInclTax($this->getItem())); ?></th>
297
+ <?php endif; ?>
298
+ -->
299
+ <td>
300
+ <?php
301
+ $cnt = Mage::getModel("marketplace/buyerseller")->getActiveNotificationForOrder($order_id,$prod_id);
302
+ if($cnt>0) {
303
+ ?>
304
+ <p><?php echo $cnt;?><?php echo $this->__('Notification(s)')?> <a href="<?php echo $this->getBaseUrl().'marketplace/buyerseller/reply/order/'.$order_id.'/product/'.$prod_id.'/'?>"><?php echo $this->__('Reply To Questions')?></a></p>
305
+ <?php } ?>
306
+ </td>
307
+ </tr>
app/design/frontend/base/default/template/marketplace/sales/order/form.phtml ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <div class="page-title">
22
+ <h1><?php echo $this->__('Ask Question') ?></h1>
23
+ </div>
24
+ <?php echo $this->getChildHtml('global_messages');
25
+ $params = $this->getRequest()->getParams();
26
+ ?>
27
+ <form id="product_ask_question_form" method="post" action="<?php echo $this->getUrl("marketplace/buyserller/save"); ?>" >
28
+ <input type="hidden" name="order_id" value="<?php echo $params['oid']?>" />
29
+ <input type="hidden" name="customer_id" value="<?php echo $params['cid']?>" />
30
+ <input type="hidden" name="product_id" value="<?php echo $params['pid']?>" />
31
+ <div class="fieldset">
32
+ <h8 class="legend">
33
+ <?php echo $this->__('Ask question about ' . Mage::getModel('catalog/product')->load($this->getRequest()->getParam('id'))->getName()); ?> below:
34
+ </h8>
35
+ <ul class="form-list">
36
+ <li class="wide">
37
+ <label for="comment" class=""><?php echo $this->__('Question') ?><span class="required">*</span></label>
38
+ <div class="input-box">
39
+ <textarea name="question" id="question" title="<?php echo $this->__('Question') ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
40
+ </div>
41
+ <div class="check-box">
42
+ <input type="checkbox" name="notify" value="Notify">Notify by email
43
+ </div>
44
+ </li>
45
+ </ul>
46
+ </div>
47
+ <div class="buttons-set">
48
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
49
+ <button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><?php echo $this->__('Submit') ?></span></button>
50
+ </div>
51
+ </form>
52
+ <div id="loading-mask" style="display:none;">
53
+ <p class="loader" id="loading_mask_loader"><img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif'); ?>" alt="Submitting form data..."><br>Submitting form data...</p>
54
+ </div>
55
+ <div id="formSuccess" style="display:none;">&nbsp;</div>
56
+ <script type="text/javascript">
57
+ //<![CDATA[
58
+ var formId = 'product_ask_question_form';
59
+ var myForm = new VarienForm(formId, true);
60
+ var postUrl = '<?php echo $this->getUrl("marketplace/buyerseller/save") ?>';
61
+ function doAjax() {
62
+ if (myForm.validator.validate()) {
63
+ new Ajax.Updater(
64
+ { success:'formSuccess' }, postUrl, {
65
+ method:'post',
66
+ asynchronous:true,
67
+ evalScripts:false,
68
+ onComplete:function(request, json) {
69
+ Element.hide(formId);
70
+ Element.show('formSuccess');
71
+ Element.hide('loading-mask');
72
+ $.fancybox.resize();
73
+ $.fancybox.center();
74
+
75
+ },
76
+ onLoading:function(request, json){
77
+ Element.show('loading-mask');
78
+
79
+ },
80
+ parameters: $(formId).serialize(true)
81
+ }
82
+ );
83
+ }
84
+ }
85
+
86
+ new Event.observe(formId, 'submit', function(e){
87
+ e.stop();
88
+ doAjax();
89
+ });
90
+ //]]>
91
+ </script>
app/design/frontend/base/default/template/marketplace/sales/order/history.phtml ADDED
@@ -0,0 +1,284 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $url = Mage:: getBaseUrl();
22
+ ?>
23
+ <script lang="javascript">
24
+ function getvalue()
25
+ {
26
+ jQuery.noConflict();
27
+ (function($) {
28
+ var name = $("#droplink option:selected").val();
29
+ if(name=="Csv") {
30
+ $(".export_link").attr("href","<?php echo $url; ?>marketplace/order/expo/");
31
+ } else if (name=="Excel") {
32
+ $(".export_link").attr("href","<?php echo $url; ?>marketplace/order/expoXml");
33
+ }
34
+ })(jQuery);
35
+ }
36
+ </script>
37
+ <div><table cellspacing="0" class="actions" style="width: 100%;">
38
+ <tbody><tr>
39
+ <td>
40
+ <form id="reset-order-data" method="POST" action="<?php echo $this->getUrl('marketplace/order/history/'); ?>">
41
+
42
+ <label>From :</label><input type="text" readonly="readonly" class="input-text validate-date " name="date_from" id="date_from" value="<?php echo Mage::getSingleton('core/session')->getDateFrom() ?>" />
43
+ <label>To :</label><input type="text" readonly="readonly" class="input-text validate-date " name="date_to" id="date_to" value="<?php echo Mage::getSingleton('core/session')->getDateTo() ?>" />
44
+
45
+ <script type="text/javascript">// <![CDATA[
46
+ Calendar.setup({
47
+ inputField : 'date_from',
48
+ ifFormat : '%m/%e/%Y',
49
+ button : 'date_from_trig',
50
+ align : 'Bl',
51
+ singleClick : true
52
+ });
53
+
54
+ Calendar.setup({
55
+ inputField : 'date_to',
56
+ ifFormat : '%m/%e/%Y',
57
+ button : 'date_to_trig',
58
+ align : 'Bl',
59
+ singleClick : true
60
+ });
61
+ // ]]></script>
62
+ <?php $ordSt = Mage::getSingleton('core/session')->getSalesOrderSatus(); ?>
63
+ <label>Status:</label>
64
+
65
+ <select id="orderstatus" name="orderstatus">
66
+ <option value="" <?php
67
+ if (!isset($ordSt)) {
68
+ echo ' selected="selected" ';
69
+ }
70
+ ?>></option>
71
+ <?php
72
+ $orderStatusInfo =Mage::getModel('sales/order_status')->getResourceCollection()->getData();
73
+ foreach ($orderStatusInfo as $key => $statusValue) {
74
+ ?>
75
+ <option value="<?php echo $statusValue['status']; ?>" <?php
76
+ if ($ordSt == $statusValue['status']) {
77
+ echo ' selected="selected" ';
78
+ }
79
+ ?>><?php echo $statusValue['label']; ?></option>
80
+ <?php } //end foreach ?>
81
+ </select>
82
+ <button type="submit" onclick="return validatedate(); " class="button"><span>Submit</span></button>
83
+ <button type="button" onclick="resetdate(); return false;" class="button"><span>Reset</span></button>
84
+ </form>
85
+ </td>
86
+ </tr>
87
+ <tr>
88
+ <td>
89
+ <div style="margin:0 0 10px 0;">
90
+ <div style="float: left; padding-top: 8px;">
91
+ <img class="v-middle" alt="" src="<?php echo $this->getSkinUrl('images/marketplace/icon_export.gif')?>">&nbsp; Export to:
92
+ <select id="droplink" onchange="getvalue()" >
93
+ <option value="Csv">CSV</option>
94
+ <option value="Excel">Excel XML</option>
95
+ </select> &nbsp;</div>
96
+ <a class="export_link sales-order-button" href="<?php echo $url ?>marketplace/order/expo" style="padding-top: 8px;display: block;">Export</a>
97
+ </div>
98
+ </td>
99
+ </tr>
100
+ </tbody>
101
+ </table>
102
+ </div>
103
+ <div style="clear:both"></div>
104
+ <script type="text/javascript">
105
+ function resetdate()
106
+ {
107
+
108
+ var date1 = document.getElementById('date_to').value;
109
+ var date2 = document.getElementById('date_from').value;
110
+ date1 = '';
111
+ date2 = ''
112
+ var redirecturl = '<?php echo $this->getUrl('marketplace/order/history/') ; ?>';
113
+ window.location.href = redirecturl;
114
+ }
115
+
116
+ function validatedate()
117
+ {
118
+ var date2 = document.getElementById('date_from').value;
119
+ var date1 = document.getElementById('date_to').value;
120
+
121
+ if(date2!='')
122
+ {
123
+ // Date_from
124
+ dateFrom = new Date(date2);
125
+ var f_dd = dateFrom.getDate();
126
+ var f_mm = dateFrom.getMonth()+1;
127
+ var f_yyyy = dateFrom.getFullYear();
128
+
129
+ // Current Date
130
+ var today = new Date();
131
+ var dd = today.getDate();
132
+ var mm = today.getMonth()+1;
133
+ var yyyy = today.getFullYear();
134
+
135
+ // set from date validator
136
+ var from_date_flag = false;
137
+
138
+ if (dd<10) {
139
+ dd='0'+dd;
140
+ }
141
+ if (mm<10) {
142
+ mm='0'+mm;
143
+ }
144
+
145
+ /* To check From Date is greater than current date */
146
+ if ( f_yyyy > yyyy ) {
147
+ from_date_flag = true;
148
+ }
149
+ else if (f_yyyy == yyyy ) {
150
+ if (f_mm > mm ) {
151
+ from_date_flag = true;
152
+ }
153
+ else if ( f_mm == mm ) {
154
+ if ( f_dd > dd ) {
155
+ from_date_flag = true;
156
+ }
157
+ }
158
+ }
159
+ // When from date selected
160
+ if ( from_date_flag == true ) {
161
+ alert("Please Enter valid From date");
162
+ return false;
163
+ }
164
+
165
+ }
166
+
167
+ if(date1!='')
168
+ {
169
+ dateto = new Date(date1);
170
+ var f_dd = dateto.getDate();
171
+ var f_mm = dateto.getMonth()+1;
172
+ var f_yyyy = dateto.getFullYear();
173
+
174
+ // Current Date
175
+ var today = new Date();
176
+ var dd = today.getDate();
177
+ var mm = today.getMonth()+1;
178
+ var yyyy = today.getFullYear();
179
+
180
+ dateFrom = new Date(date2);
181
+ var f_dd1 = dateFrom.getDate();
182
+ var f_mm1 = dateFrom.getMonth()+1;
183
+ var f_yyyy1 = dateFrom.getFullYear();
184
+ // set from date validator
185
+ var to_date_flag = false;
186
+
187
+ if (dd<10) {
188
+ dd='0'+dd;
189
+ }
190
+ if (mm<10) {
191
+ mm='0'+mm;
192
+ }
193
+
194
+ /* To check From Date is lesser than current date */
195
+
196
+ if ( f_yyyy > yyyy ) {
197
+ to_date_flag = true;
198
+ }
199
+ else if (f_yyyy == yyyy ) {
200
+ if (f_mm > mm ) {
201
+ to_date_flag = true;
202
+ }
203
+ else if ( f_mm == mm ) {
204
+ if ( f_dd > dd ) {
205
+
206
+ to_date_flag = true;
207
+ }
208
+ }
209
+ }
210
+ /* To check From Date is greater than from date */
211
+ if(f_yyyy < f_yyyy1)
212
+ {
213
+ to_date_flag = true;
214
+ }
215
+ else if (f_yyyy == f_yyyy1 ) {
216
+ if (f_mm < f_mm1 ) {
217
+ to_date_flag = true;
218
+ }
219
+ else if ( f_mm == f_mm1 ) {
220
+ if ( f_dd < f_dd1 ) {
221
+ to_date_flag = true;
222
+ }
223
+ }
224
+ }
225
+ if ( to_date_flag == true ) {
226
+ alert("Please Enter valid To date");
227
+ return false;
228
+ }
229
+ }
230
+ }
231
+ </script>
232
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
233
+ <?php $_orders = $this->getOrders(); ?>
234
+ <div class="page-title">
235
+ <h1><?php echo $this->__('Marketplace Orders') ?></h1>
236
+ </div>
237
+ <?php echo $this->getPagerHtml(); ?>
238
+ <?php if($_orders->getSize()): ?>
239
+ <table class="data-table" id="my-orders-table">
240
+ <col width="1" />
241
+ <col width="1" />
242
+ <col />
243
+ <col width="1" />
244
+ <col width="1" />
245
+ <col width="1" />
246
+ <thead>
247
+ <tr>
248
+ <th><?php echo $this->__('Order #') ?></th>
249
+ <th><?php echo $this->__('Date') ?></th>
250
+ <th><?php echo $this->__('Ship To') ?></th>
251
+ <th><span class="nobr"><?php echo $this->__('Order Total') ?></span></th>
252
+ <th><span class="nobr"><?php echo $this->__('Order Status') ?></span></th>
253
+ <th><span class="nobr"><?php echo $this->__('Notification') ?></span></th>
254
+ <th>&nbsp;</th>
255
+ </tr>
256
+ </thead>
257
+ <tbody>
258
+ <?php $_odd = ''; ?>
259
+ <?php foreach ($_orders as $_order): ?>
260
+ <tr>
261
+ <td><?php echo $_order->getRealOrderId() ?></td>
262
+ <td><span class="nobr"><?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?></span></td>
263
+ <td><?php echo $_order->getShippingAddress() ? $this->htmlEscape($_order->getShippingAddress()->getName()) : '&nbsp;' ?></td>
264
+
265
+ <?php $orderTotals = Mage::helper('marketplace')->getOrderTotals($_order->getId());?>
266
+ <td> <?php echo Mage::helper('core')->currency($orderTotals['grandtotal'], true, false);?></td>
267
+
268
+ <td><em><?php echo $_order->getStatusLabel() ?></em></td>
269
+ <td class="a-center">
270
+ <?php echo Mage::getModel("marketplace/buyerseller")->getActiveNotificationForOrder($_order->getId());?>
271
+ <a href="<?php echo $this->getBaseUrl().'marketplace/buyerseller/notification/order/'.$_order->getId()?>"> <?php echo $this->__(' Notification(s)') ?></a>
272
+ </td>
273
+ <td class="a-center">
274
+ <span class="nobr"><a href="<?php echo $this->getViewUrl($_order) ?>"><?php echo $this->__('View Order') ?></a></span>
275
+ </td>
276
+ </tr>
277
+ <?php endforeach; ?>
278
+ </tbody>
279
+ </table>
280
+ <script type="text/javascript">decorateTable('my-orders-table');</script>
281
+ <?php echo $this->getPagerHtml(); ?>
282
+ <?php else: ?>
283
+ <p><?php echo $this->__('You have received no orders comments.'); ?></p>
284
+ <?php endif ?>
app/design/frontend/base/default/template/marketplace/sales/order/items.phtml ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $orderId = '';
22
+ $orderId = $this->getRequest()->getParam('order_id');
23
+ $marketPlaceModel = Mage::getModel('marketplace/order');
24
+ $_order = $this->getOrder();
25
+ $orderItemCollection = $_order->getItemsCollection();
26
+ ?>
27
+ <table class="data-table" id="my-orders-table" summary="<?php echo $this->__('Items Ordered') ?>">
28
+ <col />
29
+ <col width="1" />
30
+ <col width="1" />
31
+ <col width="1" />
32
+ <col width="1" />
33
+ <thead>
34
+ <tr>
35
+ <th><?php echo $this->__('Product Name') ?></th>
36
+ <th><?php echo $this->__('SKU') ?></th>
37
+ <th class="a-right"><?php echo $this->__('Price') ?></th>
38
+ <th class="a-center"><?php echo $this->__('Qty') ?></th>
39
+ <th class="a-right"><?php echo $this->__('Subtotal') ?></th>
40
+ <th class="a-right"><?php echo $this->__('Queries') ?></th>
41
+ </tr>
42
+ </thead>
43
+ <?php $_count = $subtotal = $shippingCharge = $grandTotal = 0; ?>
44
+ <?php $_count = count($orderItemCollection); ?>
45
+ <?php if($_count > 0):?>
46
+ <?php foreach ($orderItemCollection as $_item): ?>
47
+ <?php if ($_item->getParentItem()) continue; ?>
48
+ <tbody>
49
+ <?php echo $this->getItemHtml($_item) ?>
50
+ </tbody>
51
+ <?php endforeach; ?>
52
+
53
+ <?php $orderTotals = $marketPlaceModel->load($orderId);?>
54
+ <!--Calculate subtotal,shipping charge and grandtotal-->
55
+ <tfoot>
56
+ <tr>
57
+ <td colspan="4" style="text-align: right;"><?php echo $this->__('Subtotal') ?></td>
58
+ <td style="text-align: right;"><?php echo Mage::helper('core')->currency($orderTotals->getSubtotal(), true, false);?></td>
59
+ </tr>
60
+ <tr>
61
+ <td colspan="4" style="text-align: right;"><?php echo $this->__('Shipping & Handling') ?></td>
62
+ <td style="text-align: right;"><?php echo Mage::helper('core')->currency($orderTotals->getShippingAmount(), true, false);?></td>
63
+ </tr>
64
+ <?php if ($orderTotals->getDiscountAmount()!=0) {
65
+ if ($orderTotals->getDiscountDescription()) {
66
+ $discountLabel = $this->__('Discount (%s)', $orderTotals->getDiscountDescription());
67
+ } else {
68
+ $discountLabel = $this->__('Discount');
69
+ }
70
+ ?>
71
+ <tr>
72
+ <td colspan="4" style="text-align: right;"><?php echo $this->__($discountLabel) ?></td>
73
+ <td style="text-align: right;">
74
+ <?php echo Mage::helper('core')->currency($orderTotals->getDiscountAmount(), true, false);?>
75
+ </td>
76
+ </tr>
77
+ <?php }?>
78
+ <tr>
79
+ <td colspan="4" style="text-align: right;"><strong><?php echo $this->__('Grandtotal') ?></strong></td>
80
+ <td style="text-align: right;"><strong><?php echo Mage::helper('core')->currency($orderTotals->getGrandTotal(), true, false);?></strong></td>
81
+ </tr>
82
+ </tfoot>
83
+ <!--Calculate subtotal,shipping charge and grandtotal-->
84
+ <?php endif;?>
85
+ </table>
86
+
87
+ <script type="text/javascript">decorateTable('my-orders-table', {'tbody' : ['odd', 'even'], 'tbody tr' : ['first', 'last']})</script>
88
+ <script type="text/javascript">
89
+ jQuery(document).ready(function() {
90
+ jQuery(".buyer-seller-communication").fancybox({
91
+ maxWidth : '70%',
92
+ maxHeight : 365,
93
+ fitToView : true,
94
+ width : '70%',
95
+ height : 365,
96
+ autoSize : true,
97
+ closeClick : true,
98
+ openEffect : 'elastic',
99
+ closeEffect : 'elastic',
100
+ autoDimensions : true,
101
+ scrolling : 'no'
102
+ });
103
+
104
+ });
105
+ </script>
app/design/frontend/base/default/template/marketplace/sales/order/items/renderer/default.phtml ADDED
@@ -0,0 +1,308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $_item = $this->getItem();
22
+ ?>
23
+ <tr class="border" id="order-item-row-<?php echo $_item->getId() ?>">
24
+ <td><h3 class="product-name"><?php echo $this->escapeHtml($_item->getName()) ?></h3>
25
+ <?php if ($_item->getSellerId()) echo 'Seller : '.Mage::helper('marketplace')->getSellerName($_item->getSellerId());?>
26
+ <?php if($_options = $this->getItemOptions()): ?>
27
+ <dl class="item-options">
28
+ <?php foreach ($_options as $_option) : ?>
29
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
30
+ <?php if (!$this->getPrintStatus()): ?>
31
+ <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
32
+ <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>>
33
+ <?php echo $_formatedOptionValue['value'] ?>
34
+ <?php if (isset($_formatedOptionValue['full_view'])): ?>
35
+ <div class="truncated_full_value">
36
+ <dl class="item-options">
37
+ <dt><?php echo $this->escapeHtml($_option['label']) ?></dt>
38
+ <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
39
+ </dl>
40
+ </div>
41
+ <?php endif; ?>
42
+ </dd>
43
+ <?php else: ?>
44
+ <dd>
45
+ <?php echo nl2br($this->escapeHtml( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) )) ?>
46
+ </dd>
47
+ <?php endif; ?>
48
+ <?php endforeach; ?>
49
+ </dl>
50
+ <?php endif; ?>
51
+ <?php $addtInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
52
+ <?php if ($addtInfoBlock) :?>
53
+ <?php echo $addtInfoBlock->setItem($_item)->toHtml(); ?>
54
+ <?php endif; ?>
55
+ <?php echo $this->escapeHtml($_item->getDescription()) ?>
56
+ <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?>
57
+ <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>
58
+ <?php endif; ?>
59
+ </td>
60
+ <td><?php echo $this->escapeHtml(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
61
+ <td class="a-right">
62
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
63
+ <span class="price-excl-tax">
64
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
65
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
66
+ <span class="cart-price">
67
+ <?php endif; ?>
68
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
69
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
70
+ </span>
71
+ <?php endif; ?>
72
+ <?php endif; ?>
73
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
74
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
75
+ <?php else: ?>
76
+ <span class="cart-price">
77
+ <?php endif; ?>
78
+
79
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
80
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()+$this->getItem()->getWeeeTaxAppliedAmount()+$this->getItem()->getWeeeTaxDisposition()); ?>
81
+ <?php else: ?>
82
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getPrice()) ?>
83
+ <?php endif; ?>
84
+ </span>
85
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
86
+
87
+ <span class="cart-tax-info" id="eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
88
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
89
+ <small>
90
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
91
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
92
+ <?php endforeach; ?>
93
+ </small>
94
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
95
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
96
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
97
+ <?php endforeach; ?>
98
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
99
+ <small>
100
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
101
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
102
+ <?php endforeach; ?>
103
+ </small>
104
+ <?php endif; ?>
105
+ </span>
106
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
107
+ <span class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
108
+ <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>
109
+ </span>
110
+ <?php endif; ?>
111
+ <?php endif; ?>
112
+ </span>
113
+ <br />
114
+ <?php endif; ?>
115
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
116
+ <span class="price-incl-tax">
117
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
118
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
119
+ <span class="cart-price">
120
+ <?php endif; ?>
121
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
122
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
123
+ </span>
124
+ <?php endif; ?>
125
+ <?php endif; ?>
126
+ <?php $_incl = $this->helper('checkout')->getPriceInclTax($this->getItem()); ?>
127
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
128
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
129
+ <?php else: ?>
130
+ <span class="cart-price">
131
+ <?php endif; ?>
132
+
133
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
134
+ <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?>
135
+ <?php else: ?>
136
+ <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxDisposition()) ?>
137
+ <?php endif; ?>
138
+ </span>
139
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
140
+ <span class="cart-tax-info" id="unit-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
141
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
142
+ <small>
143
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
144
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount']); ?></span>
145
+ <?php endforeach; ?>
146
+ </small>
147
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
148
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
149
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></small></span>
150
+ <?php endforeach; ?>
151
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
152
+ <small>
153
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
154
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['amount_incl_tax']); ?></span>
155
+ <?php endforeach; ?>
156
+ </small>
157
+ <?php endif; ?>
158
+ </span>
159
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
160
+ <span class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
161
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedAmount()); ?></span>
162
+ </span>
163
+ <?php endif; ?>
164
+ <?php endif; ?>
165
+ </span>
166
+ <?php endif; ?>
167
+ </td>
168
+ <td class="a-right">
169
+ <span class="nobr">
170
+ <?php if ($this->getItem()->getQtyOrdered() > 0): ?>
171
+ <?php echo $this->__('Ordered'); ?>: <strong><?php echo $this->getItem()->getQtyOrdered()*1 ?></strong><br />
172
+ <?php endif; ?>
173
+ <?php if ($this->getItem()->getQtyShipped() > 0): ?>
174
+ <?php echo $this->__('Shipped'); ?>: <strong><?php echo $this->getItem()->getQtyShipped()*1 ?></strong><br />
175
+ <?php endif; ?>
176
+ <?php if ($this->getItem()->getQtyCanceled() > 0): ?>
177
+ <?php echo $this->__('Canceled'); ?>: <strong><?php echo $this->getItem()->getQtyCanceled()*1 ?></strong><br />
178
+ <?php endif; ?>
179
+ <?php if ($this->getItem()->getQtyRefunded() > 0): ?>
180
+ <?php echo $this->__('Refunded'); ?>: <strong><?php echo $this->getItem()->getQtyRefunded()*1 ?></strong><br />
181
+ <?php endif; ?>
182
+ </span>
183
+ </td>
184
+ <td class="a-right">
185
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
186
+ <span class="price-excl-tax">
187
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
188
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
189
+ <span class="cart-price">
190
+ <?php endif; ?>
191
+ <span class="label"><?php echo $this->__('Excl. Tax'); ?>:</span>
192
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
193
+ </span>
194
+ <?php endif; ?>
195
+ <?php endif; ?>
196
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
197
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
198
+ <?php else: ?>
199
+ <span class="cart-price">
200
+ <?php endif; ?>
201
+
202
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
203
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()+$this->getItem()->getWeeeTaxAppliedRowAmount()+$this->getItem()->getWeeeTaxRowDisposition()); ?>
204
+ <?php else: ?>
205
+ <?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?>
206
+ <?php endif; ?>
207
+ </span>
208
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
209
+
210
+ <span class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
211
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
212
+ <small>
213
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
214
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
215
+ <?php endforeach; ?>
216
+ </small>
217
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
218
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
219
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
220
+ <?php endforeach; ?>
221
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
222
+ <small>
223
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
224
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
225
+ <?php endforeach; ?>
226
+ </small>
227
+ <?php endif; ?>
228
+ </span>
229
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
230
+ <span class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
231
+ <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>
232
+ </span>
233
+ <?php endif; ?>
234
+ <?php endif; ?>
235
+ </span>
236
+ <br />
237
+ <?php endif; ?>
238
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
239
+ <span class="price-incl-tax">
240
+ <?php if ($this->helper('tax')->displaySalesBothPrices()): ?>
241
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
242
+ <span class="cart-price">
243
+ <?php endif; ?>
244
+ <span class="label"><?php echo $this->__('Incl. Tax'); ?>:</span>
245
+ <?php if (!Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
246
+ </span>
247
+ <?php endif; ?>
248
+ <?php endif; ?>
249
+ <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($this->getItem()); ?>
250
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
251
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
252
+ <?php else: ?>
253
+ <span class="cart-price">
254
+ <?php endif; ?>
255
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), array(0, 1, 4), 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
256
+ <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?>
257
+ <?php else: ?>
258
+ <?php echo $this->getOrder()->formatPrice($_incl-$this->getItem()->getWeeeTaxRowDisposition()) ?>
259
+ <?php endif; ?>
260
+ </span>
261
+ <?php if (Mage::helper('weee')->getApplied($this->getItem())): ?>
262
+ <span class="cart-tax-info" id="subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>" style="display:none;">
263
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 1, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
264
+ <small>
265
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
266
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount']); ?></span>
267
+ <?php endforeach; ?>
268
+ </small>
269
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
270
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
271
+ <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></small></span>
272
+ <?php endforeach; ?>
273
+ <?php elseif (Mage::helper('weee')->typeOfDisplay($this->getItem(), 4, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
274
+ <small>
275
+ <?php foreach (Mage::helper('weee')->getApplied($this->getItem()) as $tax): ?>
276
+ <span class="nobr"><?php echo $tax['title']; ?>: <?php echo $this->getOrder()->formatPrice($tax['row_amount_incl_tax']); ?></span>
277
+ <?php endforeach; ?>
278
+ </small>
279
+ <?php endif; ?>
280
+ </span>
281
+ <?php if (Mage::helper('weee')->typeOfDisplay($this->getItem(), 2, 'sales') && (float)$this->getItem()->getWeeeTaxAppliedAmount()): ?>
282
+ <span class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $this->getItem()->getId(); ?>', this, 'cart-tax-total-expanded');">
283
+ <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->getOrder()->formatPrice($_incl+$this->getItem()->getWeeeTaxAppliedRowAmount()); ?></span>
284
+ </span>
285
+ <?php endif; ?>
286
+ <?php endif; ?>
287
+ </span>
288
+ <?php endif; ?>
289
+ </td>
290
+ <!--
291
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceExclTax()): ?>
292
+ <th class="a-right"><?php echo $this->getOrder()->formatPrice($this->getItem()->getRowTotal()) ?></th>
293
+ <?php endif; ?>
294
+ <?php if ($this->helper('tax')->displaySalesBothPrices() || $this->helper('tax')->displaySalesPriceInclTax()): ?>
295
+ <th class="a-right"><?php echo $this->getOrder()->formatPrice($this->helper('checkout')->getSubtotalInclTax($this->getItem())); ?></th>
296
+ <?php endif; ?>
297
+ -->
298
+ <?php if(!Mage::helper('marketplace')->isMarketplaceActiveSellar()):?>
299
+ <td>
300
+ <?php
301
+ $oid = $this->getRequest()->getParam('order_id');
302
+ $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
303
+ $url = $this->getBaseUrl()."marketplace/buyerseller/comment/cid/".$customerId."/pid/".$_item->getProductId()."/oid/".$oid."/";
304
+ ?>
305
+ <a class="buyer-seller-communication" href="<?php echo $url;?>"> Ask Question</a>
306
+ </td>
307
+ <?php endif;?>
308
+ </tr>
app/design/frontend/base/default/template/marketplace/sales/print.phtml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $orderId = '';
22
+ $orderId = $this->getRequest()->getParam('order_id');
23
+ $_order = Mage::getModel("sales/order")->load($orderId);
24
+ ?>
25
+ <h1><?php echo $this->__('Order #%s', $_order->getRealOrderId()) ?></h1>
26
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
27
+ <div class="col2-set">
28
+ <?php if (!$_order->getIsVirtual()): ?>
29
+ <div class="col-1">
30
+ <h2><?php echo $this->__('Shipping Address') ?></h2>
31
+ <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
32
+ </div>
33
+ <div class="col-2">
34
+ <?php else: ?>
35
+ <div class="col-1">
36
+ <?php endif; ?>
37
+ <h2><?php echo $this->__('Billing Address') ?></h2>
38
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
39
+ </div>
40
+ <?php if (!$_order->getIsVirtual()): ?>
41
+ </div>
42
+ <div class="col2-set">
43
+ <div class="col-1">
44
+ <h2><?php echo $this->__('Shipping Method') ?></h2>
45
+ <?php echo $this->escapeHtml($_order->getShippingDescription()) ?>
46
+ </div>
47
+ <?php endif; ?>
48
+ <div class="col-2">
49
+ <h2><?php echo $this->__('Payment Method') ?></h2>
50
+ <?php echo $_order->getPayment()->getMethodInstance()->getTitle(); ?>
51
+ </div>
52
+ </div>
53
+ <h2><?php echo $this->__('Items Ordered') ?></h2>
54
+ <table class="data-table" id="my-orders-table">
55
+ <col />
56
+ <col width="1" />
57
+ <col width="1" />
58
+ <col width="1" />
59
+ <col width="1" />
60
+ <thead>
61
+ <tr>
62
+ <th><?php echo $this->__('Product Name') ?></th>
63
+ <th><?php echo $this->__('SKU') ?></th>
64
+ <th class="a-right"><?php echo $this->__('Price') ?></th>
65
+ <th class="a-center"><?php echo $this->__('Qty') ?></th>
66
+ <th class="a-right"><?php echo $this->__('Subtotal') ?></th>
67
+ </tr>
68
+ </thead>
69
+ <?php
70
+ $_count = $subtotal = $shippingCharge = $grandTotal = 0;
71
+ $orderId = '';
72
+ $orderId = $this->getRequest()->getParam('order_id');
73
+ $marketPlaceModel = Mage::getModel('marketplace/order');
74
+ $orderItemCollection = $marketPlaceModel->getOrderDetails($orderId);
75
+ ?>
76
+ <?php //$_items = $_order->getItemsCollection(); ?>
77
+ <?php $_count = $orderItemCollection->count();?>
78
+ <?php foreach ($orderItemCollection as $_item):?>
79
+ <?php if ($_item->getParentItem()) continue; ?>
80
+ <tbody>
81
+ <?php echo $this->getItemHtml($_item) ?>
82
+ <?php $subtotal += (float)$_item->getRowTotal();?>
83
+ <?php $shippingCharge += (float)$_item->getShippingCharges();?>
84
+ </tbody>
85
+ <?php endforeach; ?>
86
+ <tfoot>
87
+ <!--Calculate subtotal,shipping charge and grandtotal-->
88
+ <tfoot>
89
+ <tr>
90
+ <td><?php echo $this->__('Subtotal') ?></td>
91
+ <td>
92
+ <?php echo $fomattedSubtotal = Mage::helper('core')->currency($subtotal, true, false);?>
93
+ </td>
94
+ </tr>
95
+ <tr>
96
+ <td><?php echo $this->__('Shipping & Handling') ?></td>
97
+ <td>
98
+ <?php echo $formtattedShipCharge = Mage::helper('core')->currency($shippingCharge, true, false);?>
99
+ </td>
100
+ </tr>
101
+ <tr>
102
+ <?php if($subtotal || $shiipingCharge):?>
103
+ <td><?php echo $this->__('Grandtotal') ?></td>
104
+ <td>
105
+ <?php $grandTotal = $subtotal + $shippingCharge;?>
106
+ <?php echo $grandTotal = Mage::helper('core')->currency($grandTotal, true, false);?>
107
+ </td>
108
+ <?php endif;?>
109
+ </tr>
110
+ </tfoot>
111
+ <!--Calculate subtotal,shipping charge and grandtotal-->
112
+ </tfoot>
113
+ </table>
114
+ <div class="buttons-set">
115
+ <button onclick="window.close();" class="button" title="Close Window" type="button"><span><span>Close Window</span></span></button>
116
+ </div>
117
+ <script type="text/javascript">decorateTable('my-orders-table', {'tbody' : ['odd', 'even'], 'tbody tr' : ['first', 'last']})</script>
118
+ <script type="text/javascript">window.print();</script>
app/design/frontend/base/default/template/marketplace/sales/selleroptions.phtml ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $_history = $orderId = '';
22
+ $orderId = $this->getRequest()->getParam('order_id');
23
+ ?>
24
+ <form id="seller_form" name="seller_form" method="post" style="float: left;" action="<?php echo $this->getUrl('marketplace/order/addcomment/') ?>order_id/<?php echo $orderId?>">
25
+ <table>
26
+ <tr>
27
+ <td>&nbsp;</td>
28
+ </tr>
29
+ <tr>
30
+ <td colspan="2" width="100%"><h8 class="heading1">Seller Options</h8></td>
31
+ </tr>
32
+ <tr>
33
+ <td>&nbsp;</td>
34
+ </tr>
35
+ <tr><input type="hidden" name="orderid" id="orderid" value="<?php echo $orderId?>"/></tr>
36
+ <?php
37
+ $status = array();
38
+ $status = $this->selectAction($orderId);
39
+ $itemsShipmentStatus = $this->getItemsShipmentStatus();
40
+ ?>
41
+ <!--Hide status dropdown if all items for specific seller are shipped-->
42
+ <?php if($itemsShipmentStatus):?>
43
+ <?php if(count($status)):?>
44
+ <tr>
45
+ <td width="75"><b><?php echo $this->__('Status') ?></b></td>
46
+ <td>
47
+ <select name="status" id="showstatus">
48
+ <?php foreach ($status as $value) { ?>
49
+ <option value="<?php echo $value ?>"><?php echo $value ?></option>
50
+ <?php } ?>
51
+ </select>
52
+ </td>
53
+ </tr>
54
+ <?php endif;?>
55
+ <?php endif;?>
56
+ <tr>
57
+ <td>&nbsp;</td>
58
+ </tr>
59
+ <tr>
60
+ <td width="75"><b><?php echo $this->__('Comment') ?></td>
61
+ <td><textarea name="sellerform_comment" id="sellerform_comment" class="required-entry" rows="2" cols="50"></textarea></td>
62
+ </tr>
63
+ <tr>
64
+ <td>&nbsp;</td>
65
+ </tr>
66
+ <tr id="trackno" style="display:block;">
67
+ <td width="75" ><b><?php echo $this->__('Tracking number') ?></td>
68
+ <td><input type="text" name="trackin_no" id="trackin_no" value=""/></td>
69
+ </tr>
70
+ <tr>
71
+ <td>&nbsp;</td>
72
+ </tr>
73
+ <tr>
74
+ <td>&nbsp;</td>
75
+ <td><input type="checkbox" id="is_customer_notified" name="is_customer_notified" value="1"/><label class="normal" for="notifyemail"> <?php echo $this->__('Notify Customer by Email') ?></label></td>
76
+ </tr>
77
+ <tr>
78
+ <td><div class="buttons-set">
79
+ <button class="button" title="Save" type="submit"><span><?php echo $this->__('Save') ?></span></button>
80
+ </div>
81
+ </td>
82
+ </tr>
83
+ </table>
84
+ </form>
85
+ <!--Show order comments listing-->
86
+ <div>
87
+ <?php $collection = array();?>
88
+ <?php $collection = $this->getCollection();?>
89
+
90
+ <?php if($collection->getSize() > 1): ?>
91
+ <?php echo $this->getPagerHtml(); ?>
92
+ <div><?php echo $this->__('Past Comments') ?></div>
93
+ <table id="comments-table" class="data-table">
94
+ <thead>
95
+ <tr>
96
+ <th style="width:75%"><?php echo $this->__('Comments') ?></th>
97
+ <th style="width:15%"><?php echo $this->__('Date') ?></th>
98
+ </tr>
99
+ </thead>
100
+ <tbody>
101
+ <?php foreach ($collection as $_historyItem): ?>
102
+ <tr id="order-item-row-1" class="border">
103
+ <?php if($_historyItem['comment']):?>
104
+ <td><?php echo $_historyItem->getComment();?></td>
105
+ <td><?php echo $_historyItem->getCreatedAt();?></td>
106
+ <?php endif;?>
107
+ </tr>
108
+ <?php endforeach; ?>
109
+ </tbody>
110
+ </table>
111
+ <?php echo $this->getPagerHtml(); ?>
112
+ <?php endif?>
113
+ </div>
114
+ <!--Show order comments listing-->
115
+
116
+ <!--Show/hide tracking no. filed.-->
117
+ <script type="text/javascript">
118
+ jQuery.noConflict();
119
+ jQuery(document).ready(function() {
120
+ jQuery('#showstatus').change(function(){
121
+ var status = jQuery(this).val();
122
+
123
+ if( status != 'processing'){
124
+ jQuery('#trackno').hide();
125
+ }else{
126
+ jQuery('#trackno').show();
127
+ }
128
+ });
129
+ });
130
+ </script>
app/design/frontend/base/default/template/marketplace/sales/vieworder.phtml ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $orderId = '';
22
+ $orderId = $this->getRequest()->getParam('order_id');
23
+ $marketPlaceModel = Mage::getModel('marketplace/marketplace');
24
+ $orderDetails = $marketPlaceModel->getOrderDetails($orderId);
25
+ $seller_id = Mage::getSingleton('customer/session')->getId();
26
+ ?>
27
+ <?php $_order = Mage::getModel("sales/order")->load($orderId); ?>
28
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
29
+ <div class="page-title title-buttons">
30
+ <h1><?php echo $this->__('Order #%s - %s', $_order->getRealOrderId(), $_order->getStatusLabel()) ?></h1>
31
+ <a href="<?php echo $this->getUrl('marketplace/order/printorder',$arguement=array('order_id' => $orderId,'seller_id' => $seller_id)) ?>" class="link-print" onclick="this.target='_blank';"><?php echo $this->__('Print Order') ?></a>
32
+ </div>
33
+ <?php echo $this->getStatusHistoryRssUrl($_order) ?>
34
+ <dl class="order-info">
35
+ <dt><?php echo $this->__('About This Order:') ?></dt>
36
+ </dl>
37
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
38
+ <?php if (!$_order->getIsVirtual()): ?>
39
+ <div class="col2-set order-info-box">
40
+ <div class="col-1">
41
+ <div class="box">
42
+ <div class="box-title">
43
+ <h2><?php echo $this->__('Shipping Address') ?></h2>
44
+ </div>
45
+ <div class="box-content">
46
+ <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ <div class="col-2">
51
+ <div class="box">
52
+ <div class="box-title">
53
+ <h2><?php echo $this->__('Shipping Method') ?></h2>
54
+ </div>
55
+ <div class="box-content">
56
+ <?php if ($_order->getShippingDescription()): ?>
57
+ <?php echo $this->escapeHtml($_order->getShippingDescription()) ?>
58
+ <?php else: ?>
59
+ <p><?php echo $this->helper('sales')->__('No shipping information available'); ?></p>
60
+ <?php endif; ?>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ <?php endif; ?>
66
+ <div class="col2-set order-info-box">
67
+ <div class="col-1">
68
+ <div class="box">
69
+ <div class="box-title">
70
+ <h2><?php echo $this->__('Billing Address') ?></h2>
71
+ </div>
72
+ <div class="box-content">
73
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ <div class="col-2">
78
+ <div class="box box-payment">
79
+ <div class="box-title">
80
+ <h2><?php echo $this->__('Payment Method') ?></h2>
81
+ </div>
82
+ <div class="box-content">
83
+ <?php echo $_order->getPayment()->getMethodInstance()->getTitle(); ?>
84
+ </div>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ <?php echo $this->getChildHtml('items');?>
89
+ <?php echo $this->getChildHtml('selleroptions');?>
app/design/frontend/base/default/template/marketplace/seller/account/myorders.phtml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $customerId = Mage::getSingleton('customer/session')->getId();
22
+ $customer = Mage::getModel('customer/customer')->load($customerId);
23
+ $ordersCollection = Mage::getResourceModel('sales/order_collection')
24
+ ->addAttributeToSelect('entity_id');
25
+ ?>
26
+ <table class="data-table" id="my-orders-table">
27
+ <col width="1" />
28
+ <col width="1" />
29
+ <col />
30
+ <col width="1" />
31
+ <col width="1" />
32
+ <col width="1" />
33
+ <thead>
34
+ <tr>
35
+ <th><?php echo $this->__('Order #') ?></th>
36
+ <th><?php echo $this->__('Date') ?></th>
37
+ <th><?php echo $this->__('Ship To') ?></th>
38
+ <th><span class="nobr"><?php echo $this->__('Order Total') ?></span></th>
39
+ <th><span class="nobr"><?php echo $this->__('Order Status') ?></span></th>
40
+ <th>&nbsp;</th>
41
+ </tr>
42
+ </thead> <tbody>
43
+ <?php foreach($ordersCollection as $order): ?>
44
+ <?php $_order = Mage::getModel("sales/order")->load($order->getEntityId()); //echo "<pre>"; print_r($order->getData()); exit;?>
45
+ <tr>
46
+ <td><?php echo $_order->getRealOrderId() ?></td>
47
+ <td><span class="nobr"><?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?></span></td>
48
+ <td><?php echo $_order->getShippingAddress() ? $this->escapeHtml($_order->getShippingAddress()->getName()) : '&nbsp;' ?></td>
49
+ <td><?php echo $_order->formatPrice($_order->getGrandTotal()) ?></td>
50
+ <td><em><?php echo $_order->getStatusLabel() ?></em></td>
51
+ <td class="a-center">
52
+ <span class="nobr"><a href="<?php echo $this->getUrl('sales/order/view/') ?>order_id/<?php echo $_order->getEntityId();?>"><?php echo $this->__('View Order') ?></a>
53
+ <?php /*<span class="separator">|</span><a href="<?php echo $this->getTrackUrl($_order) ?>"><?php echo $this->__('Track Order') ?></a>&nbsp;*/ ?>
54
+
55
+ </span>
56
+ </td>
57
+ </tr>
58
+ <?php endforeach;?></tbody>
59
+ </table>
app/design/frontend/base/default/template/marketplace/seller/info.phtml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+ ?>
21
+ <?php $seller = $this->getSellerData();?>
22
+ <?php if (!empty($seller)):?>
23
+ <div class="page-title">
24
+ <h1><?php echo $seller['firstname']." ".$seller['lastname'].$this->__(" store's Profile Page") ?></h1>
25
+ </div>
26
+ <div class="store-details">
27
+ <div class="sub-heading"><h5><?php echo $this->__('About ').$seller['company_name']?></h5></div>
28
+ <?php if($seller['company_banner']):?>
29
+ <div class="company-banner">
30
+ <img src="<?php echo $seller['company_banner']?>" width="<?php echo Mage::getStoreConfig('marketplace/marketplace/default_width').'px'?>" height="<?php echo Mage::getStoreConfig('marketplace/marketplace/default_height').'px'?>" />
31
+ </div>
32
+ <?php endif;?>
33
+ <table class="data-table">
34
+ <?php if ($seller['company_locality']):?>
35
+ <tr>
36
+ <th width="30%"><?php echo $this->__('Locality:')?></th>
37
+ <td width="80%"><?php echo $seller['company_locality']?></td>
38
+ </tr>
39
+ <?php endif;?>
40
+ <?php if ($seller['company_description']):?>
41
+ <tr>
42
+ <th width="30%"><?php echo $this->__('Company description:')?></th>
43
+ <td width="80%"><?php echo $seller['company_description']?></td>
44
+ </tr>
45
+ <?php endif;?>
46
+ </table>
47
+ </div>
48
+ <?php else:?>
49
+ <h5><?php echo $this->__("This customer doesn't exist.")?></h5>
50
+ <?php endif; ?>
app/design/frontend/base/default/template/marketplace/seller/logo.phtml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $seller = $this->getSellerData();
22
+ ?>
23
+ <?php if ($seller['company_logo']):?>
24
+ <div class="customer-logo">
25
+ <img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."/".$seller['company_logo']?>" width ="195px" height="225px"/>
26
+ </div>
27
+ <?php endif;?>
app/design/frontend/base/default/template/marketplace/seller/ratings.phtml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $sellerReviewData = Mage::getModel('marketplace/selleroptions')->getSellerRatingsAggregate();
22
+ $sellerCompName = urldecode(Mage::registry('seller_company'));
23
+ $avgRating = $sellerReviewData['avgrating'];
24
+ $reviewCount = $sellerReviewData['reviewcount'];
25
+ $sellerId = $sellerReviewData['seller_id'];
26
+ $cururl = $this->getUrl('marketplace/seller/rating');
27
+ ?>
28
+ <div class="block block-subscribe">
29
+ <div class="block-title">
30
+ <strong><span>Feedback</span></strong>
31
+ </div>
32
+ <div class="block-content">
33
+ <div class="form-subscribe-header">
34
+ <input type="hidden" name="company_name" value="<?php echo $sellerCompName;?>" id="company_name"/>
35
+ <a href="<?php echo $cururl.'?seller_id='.$sellerId ;?>" title="" alt=""><label><?php echo round($avgRating);?>% (<?php echo $reviewCount;?>)</label></a>
36
+ </div>
37
+ </div>
38
+ </div>
app/design/frontend/base/default/template/marketplace/seller/seller_ratings.phtml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cybage Marketplace Plugin
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * It is available on the World Wide Web at:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to access it on the World Wide Web, please send an email
11
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
12
+ *
13
+ * @category Marketplace Plugin
14
+ * @package Cybage_Marketplace
15
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
16
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
19
+ */
20
+
21
+ $sellerId = $this->getRequest()->getParam('seller_id');
22
+ $sellerReviewData = Mage::getModel('marketplace/selleroptions')->getSellerAllRatingsAggregate($sellerId);
23
+ $avgRating = $sellerReviewData['avgrating'];
24
+ $reviewCount = $sellerReviewData['reviewcount'];
25
+ ?>
26
+ <div class="block block-subscribe">
27
+ <div class="block-title">
28
+ <strong><span>Feedback</span></strong>
29
+ </div>
30
+ <div class="block-content">
31
+ <div class="form-subscribe-header">
32
+ <label for="newsletter"><?php echo round($avgRating);?>% (<?php echo $reviewCount;?>)</label>
33
+ </div>
34
+ </div>
35
+ </div>
app/etc/modules/Cybage_Marketplace.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * Cybage Marketplace Plugin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * It is available on the World Wide Web at:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you are unable to access it on the World Wide Web, please send an email
12
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
13
+ *
14
+ * @category Marketplace Plugin
15
+ * @package Cybage_Marketplace
16
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
17
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
20
+ */
21
+ -->
22
+ <config>
23
+ <modules>
24
+ <Cybage_Marketplace>
25
+ <active>true</active>
26
+ <codePool>community</codePool>
27
+ </Cybage_Marketplace>
28
+ </modules>
29
+ </config>
app/locale/en_US/template/email/newseller_account.html ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Welcome, {{var customer.name}}! @-->
2
+ <!--@vars
3
+ {"store url=\"\"":"Store Url",
4
+ "var logo_url":"Email Logo Image Url",
5
+ "htmlescape var=$customer.name":"Customer Name",
6
+ "store url=\"customer/account/\"":"Customer Account Url",
7
+ "var customer.email":"Customer Email",
8
+ "htmlescape var=$customer.password":"Customer Password"}
9
+ @-->
10
+
11
+ <!--@styles
12
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
13
+ @-->
14
+
15
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
16
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
17
+ <table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
18
+ <tr>
19
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
20
+ <!-- [ header starts here] -->
21
+ <table bgcolor="FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
22
+ <tr>
23
+ <td valign="top">
24
+ <a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
25
+ </tr>
26
+ <!-- [ middle starts here] -->
27
+ <tr>
28
+ <td valign="top">
29
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Dear {{htmlescape var=$customer.name}},</h1>
30
+ <p style="font-size:12px; line-height:16px; margin:0 0 16px 0;">Seller Account Welcome to {{var store.getFrontendName()}}. To log in when visiting our site just click <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">Login</a> or <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">My Account</a> at the top of every page, and then enter your e-mail address and password.</p>
31
+ <p style="border:1px solid #E0E0E0; font-size:12px; line-height:16px; margin:0; padding:13px 18px; background:#f9f9f9;">
32
+ Use the following values when prompted to log in:<br/>
33
+ <strong>E-mail</strong>: {{var customer.email}}<br/>
34
+ <strong>Password</strong>: {{htmlescape var=$customer.password}}<p>
35
+ <p style="font-size:12px; line-height:16px; margin:0 0 8px 0;">When you log in to your account, you will be able to do the following:</p>
36
+ <ul style="font-size:12px; line-height:16px; margin:0 0 16px 0; padding:0;">
37
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Proceed through checkout faster when making a purchase</li>
38
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Check the status of orders</li>
39
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; View past orders</li>
40
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Make changes to your account information</li>
41
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Change your password</li>
42
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Store alternative addresses (for shipping to multiple family members and friends!)</li>
43
+ </ul>
44
+ <p style="font-size:12px; line-height:16px; margin:0;">If you have any questions about your account or any other matter, please feel free to contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or by phone at {{config path='general/store_information/phone'}}.</p>
45
+ </td>
46
+ </tr>
47
+ <tr>
48
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you again, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
49
+ </tr>
50
+ </table>
51
+ </td>
52
+ </tr>
53
+ </table>
54
+ </div>
55
+ </body>
app/locale/en_US/template/email/pendingorder_reminder.html ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Welcome, {{var customer.name}}! @-->
2
+ <!--@vars
3
+ {"store url=\"\"":"Store Url",
4
+ "var logo_url":"Email Logo Image Url",
5
+ "htmlescape var=$customer.name":"Customer Name",
6
+ "store url=\"customer/account/\"":"Customer Account Url",
7
+ "var customer.email":"Customer Email",
8
+ "htmlescape var=$customer.password":"Customer Password"}
9
+ @-->
10
+
11
+ <!--@styles
12
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
13
+ @-->
14
+
15
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
16
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
17
+ <table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
18
+ <tr>
19
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
20
+ <!-- [ header starts here] -->
21
+ <table bgcolor="FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
22
+ <tr>
23
+ <td valign="top">
24
+ <a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
25
+ </tr>
26
+ <!-- [ middle starts here] -->
27
+ <tr>
28
+ <td valign="top">
29
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Dear {{htmlescape var=$customer.name}},</h1>
30
+ <p style="font-size:12px; line-height:16px; margin:0 0 16px 0;">Pending order reminder mail Order Count:{{var ordercount}} Order Ids : {{var orderids}}{{var store.getFrontendName()}}. To log in when visiting our site just click <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">Login</a> or <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">My Account</a> at the top of every page, and then enter your e-mail address and password.</p>
31
+ <p style="border:1px solid #E0E0E0; font-size:12px; line-height:16px; margin:0; padding:13px 18px; background:#f9f9f9;">
32
+ Use the following values when prompted to log in:<br/>
33
+ <strong>E-mail</strong>: {{var customer.email}}<br/>
34
+ <strong>Password</strong>: {{htmlescape var=$customer.password}}<p>
35
+ <p style="font-size:12px; line-height:16px; margin:0 0 8px 0;">When you log in to your account, you will be able to do the following:</p>
36
+ <ul style="font-size:12px; line-height:16px; margin:0 0 16px 0; padding:0;">
37
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Proceed through checkout faster when making a purchase</li>
38
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Check the status of orders</li>
39
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; View past orders</li>
40
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Make changes to your account information</li>
41
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Change your password</li>
42
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Store alternative addresses (for shipping to multiple family members and friends!)</li>
43
+ </ul>
44
+ <p style="font-size:12px; line-height:16px; margin:0;">If you have any questions about your account or any other matter, please feel free to contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or by phone at {{config path='general/store_information/phone'}}.</p>
45
+ </td>
46
+ </tr>
47
+ <tr>
48
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you again, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
49
+ </tr>
50
+ </table>
51
+ </td>
52
+ </tr>
53
+ </table>
54
+ </div>
55
+ </body>
app/locale/en_US/template/email/sales/customer_cancelled_new.html ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Order #{{var order_id}} Cancellation : From Seller @-->
2
+ <!--@vars
3
+ {"var name":"Customer Name",
4
+ "var date_time":"Current Date Time",
5
+ "var comment":"Seller Comment",
6
+ "var order_id":"Order Id"
7
+ }
8
+ -->
9
+
10
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
11
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
12
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
13
+ <tr>
14
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
15
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
16
+ <!-- [ header starts here] -->
17
+ <tr>
18
+ <td valign="top">
19
+ <p>
20
+ <a href="{{store url=""}}" style="color:#1E7EC8;"><img src="{{var logo_url}}" alt="COS" border="0"/></a>
21
+ </p>
22
+ </td>
23
+ </tr>
24
+ <tr>
25
+ <td>
26
+ <h2 style="font-size:19px; font-weight:normal; margin:0;">Your Order Id #{{var order_id}}</h2>
27
+ </td>
28
+ </tr>
29
+ <!-- [ middle starts here] -->
30
+ <tr>
31
+ <td valign="top">
32
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello {{var name}}</h1>
33
+ <p style="font-size:15px; line-height:19px; margin:0;">
34
+ Your order is cancelled by {{var seller_name}}.
35
+ </p>
36
+ <br/>
37
+ <p style="font-size:15px; line-height:19px; margin:0;">Comments from Seller:<br/>{{var comment}}</p>
38
+ <br/>
39
+ <p style="font-size:15px; line-height:19px; margin:0;">We apologize for the inconvenience.Thank you again for your business.</p>
40
+ </td>
41
+ </tr>
42
+ <tr>
43
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:18px; margin:0;">Thank you, <strong>Cybage Online Store</strong></p></center></td>
44
+ </tr>
45
+ </table>
46
+ </td>
47
+ </tr>
48
+ </table>
49
+ </div>
50
+ </body>
app/locale/en_US/template/email/sales/customer_completed_new.html ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Order #{{var order_id}} Completion : From Seller @-->
2
+ <!--@vars
3
+ {"var name":"Customer Name",
4
+ "var date_time":"Current Date Time",
5
+ "var comment":"Seller Comment",
6
+ "var order_id":"Order Id"
7
+ }
8
+ -->
9
+
10
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
11
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
12
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
13
+ <tr>
14
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
15
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
16
+ <!-- [ header starts here] -->
17
+ <tr>
18
+ <td valign="top">
19
+ <p>
20
+ <a href="{{store url=""}}" style="color:#1E7EC8;"><img src="{{var logo_url}}" alt="COS" border="0"/></a>
21
+ </p>
22
+ </td>
23
+ </tr>
24
+ <tr>
25
+ <td>
26
+ <h2 style="font-size:19px; font-weight:normal; margin:0;">Your Order Id #{{var order_id}}</h2>
27
+ </td>
28
+ </tr>
29
+ <!-- [ middle starts here] -->
30
+ <tr>
31
+ <td valign="top">
32
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello {{var name}}</h1>
33
+ <p style="font-size:15px; line-height:19px; margin:0;">
34
+ Thank you for your order from Cybage Online Store.
35
+ If you have any questions about your order please contact the seller at <a href="mailto:{{var seller_email}}" style="color:#1E7EC8;">{{var seller_email}}</a>.
36
+ </p>
37
+
38
+ <br />
39
+ <p style="font-size:15px; line-height:19px; margin:0;">
40
+ Your order has been sent on {{var date_time}}.
41
+ Please make the payment According to policy if applicable.
42
+ </p>
43
+ <br />
44
+ <p style="font-size:15px; line-height:19px; margin:0;">Comments from Seller:<br/>{{var comment}}</p>
45
+ <br />
46
+ <p style="font-size:15px; line-height:19px; margin:0;">Thank you again for your business.</p>
47
+ </td>
48
+ </tr>
49
+ <tr>
50
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:18px; margin:0;">Thank you, <strong>Cybage Online Store</strong></p></center></td>
51
+ </tr>
52
+ </table>
53
+ </td>
54
+ </tr>
55
+ </table>
56
+ </div>
57
+ </body>
app/locale/en_US/template/email/sales/customer_processing_new.html ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Order #{{var order_id}} Processing : From Seller @-->
2
+ <!--@vars
3
+ {"var name":"Customer Name",
4
+ "var comment":"Seller Comment",
5
+ "var order_id":"Order Id"
6
+ }
7
+ -->
8
+
9
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
10
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
11
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
12
+ <tr>
13
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
14
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
15
+ <!-- [ header starts here] -->
16
+ <tr>
17
+ <td valign="top">
18
+ <p>
19
+ <a href="{{store url=""}}" style="color:#1E7EC8;"><img src="{{var logo_url}}" alt="COS" border="0"/></a>
20
+ </p>
21
+ </td>
22
+ </tr>
23
+ <tr>
24
+ <td>
25
+ <h2 style="font-size:19px; font-weight:normal; margin:0;">Your Order Id #{{var order_id}}</h2>
26
+ </td>
27
+ </tr>
28
+ <!-- [ middle starts here] -->
29
+ <tr>
30
+ <td valign="top">
31
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello {{var name}}</h1>
32
+ <p style="font-size:15px; line-height:19px; margin:0;">
33
+ Thank you for your order from Cybage Online Store.
34
+ If you have any questions about your order please contact the seller at <a href="mailto:{{var seller_email}}" style="color:#1E7EC8;">{{var seller_email}}</a>.You can also ask questions from my accounts section.
35
+ </p>
36
+ <br/>
37
+ <p style="font-size:15px; line-height:19px; margin:0;">Currently your order is under processing. Please get in touch with seller on how to receive the product. </p>
38
+ <br/>
39
+ <p style="font-size:15px; line-height:19px; margin:0;">Comments from Seller:<br/>{{var comment}}</p>
40
+ <p style="font-size:15px; line-height:19px; margin:0;">Thank you again for your business.</p>
41
+ </td>
42
+ </tr>
43
+ <tr>
44
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:18px; margin:0;">Thank you, <strong>Cybage Online Store</strong></p></center></td>
45
+ </tr>
46
+ </table>
47
+ </td>
48
+ </tr>
49
+ </table>
50
+ </div>
51
+ </body>
52
+ </body>
app/locale/en_US/template/email/sales/product_comment.html ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject {{var store.getFrontendName()}}: Credit Memo # {{var creditmemo.increment_id}} for Order # {{var order.increment_id}} @-->
2
+ <!--@vars
3
+ {"store url=\"\"":"Store Url",
4
+ "var logo_url":"Email Logo Image Url",
5
+ "var logo_alt":"Email Logo Image Alt",
6
+ "var name" : "Name",
7
+ "var comment" : "Comment",
8
+ "var product" : "Product",
9
+ "var order_id" : "Order Id",
10
+ "var seller_email" : "Seller Email",
11
+ "var seller_name" : "Seller Name",
12
+ }
13
+ @-->
14
+ <!--@styles
15
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
16
+ @-->
17
+
18
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
19
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
20
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
21
+ <tr>
22
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
23
+ <!-- [ header starts here] -->
24
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
25
+ <tr>
26
+ <td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
27
+ </tr>
28
+ <!-- [ middle starts here] -->
29
+ <tr>
30
+ <td valign="top">
31
+ <p>
32
+ Dear {{var name}}.
33
+ Thank you for your order {{var order_id}}.<br>
34
+ You have received following comment from {{var seller_name}} for product {{var product}}<br>
35
+ If you have any questions about your order please contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or call us at <span class="nobr">{{config path='general/store_information/phone'}}</span> Monday - Friday, 8am - 5pm PST.
36
+ </p>
37
+ <p>
38
+ {{var comment}}
39
+ </p>
40
+ <p>From
41
+ {{var seller_name}}
42
+ Email: {{var seller_email }}
43
+ </p>
44
+ </td>
45
+ </tr>
46
+
47
+
48
+ <tr>
49
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
50
+ </tr>
51
+ </table>
52
+ </td>
53
+ </tr>
54
+ </table>
55
+ </div>
56
+ </body>
app/locale/en_US/template/email/seller_payment.html ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Welcome, {{var customer.name}}! @-->
2
+ <!--@vars
3
+ {"store url=\"\"":"Store Url",
4
+ "var logo_url":"Email Logo Image Url",
5
+ "htmlescape var=$customer.name":"Customer Name",
6
+ "store url=\"customer/account/\"":"Customer Account Url",
7
+ "var customer.email":"Customer Email",
8
+ "htmlescape var=$customer.password":"Customer Password"}
9
+ @-->
10
+
11
+ <!--@styles
12
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
13
+ @-->
14
+
15
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
16
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
17
+ <table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
18
+ <tr>
19
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
20
+ <!-- [ header starts here] -->
21
+ <table bgcolor="FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
22
+ <tr>
23
+ <td valign="top">
24
+ <a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
25
+ </tr>
26
+ <!-- [ middle starts here] -->
27
+ <tr>
28
+ <td valign="top">
29
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Dear {{htmlescape var=$customer.name}},</h1>
30
+ <p style="font-size:12px; line-height:16px; margin:0 0 16px 0;">Seller Payment {{htmlescape var=$customer.commission}} {{var store.getFrontendName()}}. To log in when visiting our site just click <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">Login</a> or <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">My Account</a> at the top of every page, and then enter your e-mail address and password.</p>
31
+ <p style="border:1px solid #E0E0E0; font-size:12px; line-height:16px; margin:0; padding:13px 18px; background:#f9f9f9;">
32
+ Use the following values when prompted to log in:<br/>
33
+ <strong>E-mail</strong>: {{var customer.email}}<br/>
34
+ <strong>Password</strong>: {{htmlescape var=$customer.password}}<p>
35
+ <p style="font-size:12px; line-height:16px; margin:0 0 8px 0;">When you log in to your account, you will be able to do the following:</p>
36
+ <ul style="font-size:12px; line-height:16px; margin:0 0 16px 0; padding:0;">
37
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Proceed through checkout faster when making a purchase</li>
38
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Check the status of orders</li>
39
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; View past orders</li>
40
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Make changes to your account information</li>
41
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Change your password</li>
42
+ <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Store alternative addresses (for shipping to multiple family members and friends!)</li>
43
+ </ul>
44
+ <p style="font-size:12px; line-height:16px; margin:0;">If you have any questions about your account or any other matter, please feel free to contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or by phone at {{config path='general/store_information/phone'}}.</p>
45
+ </td>
46
+ </tr>
47
+ <tr>
48
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you again, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
49
+ </tr>
50
+ </table>
51
+ </td>
52
+ </tr>
53
+ </table>
54
+ </div>
55
+ </body>
app/locale/en_US/template/email/seller_status.html ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Welcome, {{var customer.name}}! @-->
2
+ <!--@vars
3
+ {"store url=\"\"":"Store Url",
4
+ "htmlescape var=$status" : "status",
5
+ "var logo_url":"Email Logo Image Url",
6
+ "htmlescape var=$customer.name":"Customer Name",
7
+ "store url=\"customer/account/\"":"Customer Account Url"}
8
+ @-->
9
+
10
+ <!--@styles
11
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
12
+ @-->
13
+
14
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
15
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
16
+ <table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
17
+ <tr>
18
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
19
+ <!-- [ header starts here] -->
20
+ <table bgcolor="FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
21
+ <tr>
22
+ <td valign="top">
23
+ <a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
24
+ </tr>
25
+ <!-- [ middle starts here] -->
26
+ <tr>
27
+ <td valign="top">
28
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Dear {{htmlescape var=$customer.name}},</h1>
29
+ <p style="font-size:12px; line-height:16px; margin:0 0 16px 0;">Your Seller Status change to : {{htmlescape var=$status}}.</p>
30
+ <p style="font-size:12px; line-height:16px; margin:0 0 16px 0;">
31
+ To log in when visiting our site just click <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">Login</a> or <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">My Account</a> at the top of every page, and then enter your e-mail address and password.</p>
32
+ <p style="font-size:12px; line-height:16px; margin:0;">If you have any questions about your account or any other matter, please feel free to contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or by phone at {{config path='general/store_information/phone'}}.</p>
33
+ </td>
34
+ </tr>
35
+ <tr>
36
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you again</p></center></td>
37
+ </tr>
38
+ </table>
39
+ </td>
40
+ </tr>
41
+ </table>
42
+ </div>
43
+ </body>
js/jquery/jquery-1.9.1.min.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
2
+ //@ sourceMappingURL=jquery.min.map
3
+ */(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;
4
+ return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a><div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&&gt(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l)
5
+ }b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(b.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,b.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={},p,f;u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||o.documentElement;while(e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position"))e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window);;jQuery.noConflict();
js/marketplace/fancybox/jquery-1.7.2.min.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ /*! jQuery v1.7.2 jquery.com | jquery.org/license */
2
+ if(!window.jQuery) {
3
+ (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test("�")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
4
+ a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
5
+ .clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
6
+ }
js/marketplace/fancybox/jquery.fancybox-1.3.4.pack.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * FancyBox - jQuery Plugin
3
+ * Simple and fancy lightbox alternative
4
+ *
5
+ * Examples and documentation at: http://fancybox.net
6
+ *
7
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
8
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
+ *
10
+ * Version: 1.3.4 (11/11/2010)
11
+ * Requires: jQuery v1.3+
12
+ *
13
+ * Dual licensed under the MIT and GPL licenses:
14
+ * http://www.opensource.org/licenses/mit-license.php
15
+ * http://www.gnu.org/licenses/gpl.html
16
+ */
17
+
18
+ ;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
19
+ F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
20
+ c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
21
+ false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
22
+ function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
23
+ '"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
24
+ "function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
25
+ ";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
26
+ opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
27
+ d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
28
+ y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
29
+ i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
30
+ f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
31
+ 37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
32
+ s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
33
+ f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
34
+ j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
35
+ "image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
36
+ 10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
37
+ b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
38
+ 0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
39
+ 1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
40
+ true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
41
+ b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
42
+ d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
43
+ D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
44
+ b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
45
+ b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
46
+ easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
js/marketplace/fancybox/jquery.mousewheel-3.0.4.pack.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
2
+ * Licensed under the MIT License (LICENSE.txt).
3
+ *
4
+ * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
5
+ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
6
+ * Thanks to: Seamus Leahy for adding deltaX and deltaY
7
+ *
8
+ * Version: 3.0.4
9
+ *
10
+ * Requires: 1.2.2+
11
+ */
12
+
13
+ (function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=
14
+ f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
js/marketplace/fancybox/jquery.noconflict.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.noConflict();
js/marketplace/nicEdit-latest.js.js ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* NicEdit - Micro Inline WYSIWYG
2
+ * Copyright 2007-2008 Brian Kirchoff
3
+ *
4
+ * NicEdit is distributed under the terms of the MIT license
5
+ * For more information visit http://nicedit.com/
6
+ * Do not remove this copyright message
7
+ */
8
+ var bkExtend=function(){var A=arguments;if(A.length==1){A=[this,A[0]]}for(var B in A[1]){A[0][B]=A[1][B]}return A[0]};function bkClass(){}bkClass.prototype.construct=function(){};bkClass.extend=function(C){var A=function(){if(arguments[0]!==bkClass){return this.construct.apply(this,arguments)}};var B=new this(bkClass);bkExtend(B,C);A.prototype=B;A.extend=this.extend;return A};var bkElement=bkClass.extend({construct:function(B,A){if(typeof (B)=="string"){B=(A||document).createElement(B)}B=$BK(B);return B},appendTo:function(A){A.appendChild(this);return this},appendBefore:function(A){A.parentNode.insertBefore(this,A);return this},addEvent:function(B,A){bkLib.addEvent(this,B,A);return this},setContent:function(A){this.innerHTML=A;return this},pos:function(){var C=curtop=0;var B=obj=this;if(obj.offsetParent){do{C+=obj.offsetLeft;curtop+=obj.offsetTop}while(obj=obj.offsetParent)}var A=(!window.opera)?parseInt(this.getStyle("border-width")||this.style.border)||0:0;return[C+A,curtop+A+this.offsetHeight]},noSelect:function(){bkLib.noSelect(this);return this},parentTag:function(A){var B=this;do{if(B&&B.nodeName&&B.nodeName.toUpperCase()==A){return B}B=B.parentNode}while(B);return false},hasClass:function(A){return this.className.match(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)"))},addClass:function(A){if(!this.hasClass(A)){this.className+=" nicEdit-"+A}return this},removeClass:function(A){if(this.hasClass(A)){this.className=this.className.replace(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)")," ")}return this},setStyle:function(A){var B=this.style;for(var C in A){switch(C){case"float":B.cssFloat=B.styleFloat=A[C];break;case"opacity":B.opacity=A[C];B.filter="alpha(opacity="+Math.round(A[C]*100)+")";break;case"className":this.className=A[C];break;default:B[C]=A[C]}}return this},getStyle:function(A,C){var B=(!C)?document.defaultView:C;if(this.nodeType==1){return(B&&B.getComputedStyle)?B.getComputedStyle(this,null).getPropertyValue(A):this.currentStyle[bkLib.camelize(A)]}},remove:function(){this.parentNode.removeChild(this);return this},setAttributes:function(A){for(var B in A){this[B]=A[B]}return this}});var bkLib={isMSIE:(navigator.appVersion.indexOf("MSIE")!=-1),addEvent:function(C,B,A){(C.addEventListener)?C.addEventListener(B,A,false):C.attachEvent("on"+B,A)},toArray:function(C){var B=C.length,A=new Array(B);while(B--){A[B]=C[B]}return A},noSelect:function(B){if(B.setAttribute&&B.nodeName.toLowerCase()!="input"&&B.nodeName.toLowerCase()!="textarea"){B.setAttribute("unselectable","on")}for(var A=0;A<B.childNodes.length;A++){bkLib.noSelect(B.childNodes[A])}},camelize:function(A){return A.replace(/\-(.)/g,function(B,C){return C.toUpperCase()})},inArray:function(A,B){return(bkLib.search(A,B)!=null)},search:function(A,C){for(var B=0;B<A.length;B++){if(A[B]==C){return B}}return null},cancelEvent:function(A){A=A||window.event;if(A.preventDefault&&A.stopPropagation){A.preventDefault();A.stopPropagation()}return false},domLoad:[],domLoaded:function(){if(arguments.callee.done){return }arguments.callee.done=true;for(i=0;i<bkLib.domLoad.length;i++){bkLib.domLoad[i]()}},onDomLoaded:function(A){this.domLoad.push(A);if(document.addEventListener){document.addEventListener("DOMContentLoaded",bkLib.domLoaded,null)}else{if(bkLib.isMSIE){document.write("<style>.nicEdit-main p { margin: 0; }</style><script id=__ie_onload defer "+((location.protocol=="https:")?"src='javascript:void(0)'":"src=//0")+"><\/script>");$BK("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){bkLib.domLoaded()}}}}window.onload=bkLib.domLoaded}};function $BK(A){if(typeof (A)=="string"){A=document.getElementById(A)}return(A&&!A.appendTo)?bkExtend(A,bkElement.prototype):A}var bkEvent={addEvent:function(A,B){if(B){this.eventList=this.eventList||{};this.eventList[A]=this.eventList[A]||[];this.eventList[A].push(B)}return this},fireEvent:function(){var A=bkLib.toArray(arguments),C=A.shift();if(this.eventList&&this.eventList[C]){for(var B=0;B<this.eventList[C].length;B++){this.eventList[C][B].apply(this,A)}}}};function __(A){return A}Function.prototype.closure=function(){var A=this,B=bkLib.toArray(arguments),C=B.shift();return function(){if(typeof (bkLib)!="undefined"){return A.apply(C,B.concat(bkLib.toArray(arguments)))}}};Function.prototype.closureListener=function(){var A=this,C=bkLib.toArray(arguments),B=C.shift();return function(E){E=E||window.event;if(E.target){var D=E.target}else{var D=E.srcElement}return A.apply(B,[E,D].concat(C))}};
9
+
10
+
11
+
12
+ var nicEditorConfig = bkClass.extend({
13
+ buttons : {
14
+ 'bold' : {name : __('Click to Bold'), command : 'Bold', tags : ['B','STRONG'], css : {'font-weight' : 'bold'}, key : 'b'},
15
+ 'italic' : {name : __('Click to Italic'), command : 'Italic', tags : ['EM','I'], css : {'font-style' : 'italic'}, key : 'i'},
16
+ 'underline' : {name : __('Click to Underline'), command : 'Underline', tags : ['U'], css : {'text-decoration' : 'underline'}, key : 'u'},
17
+ 'left' : {name : __('Left Align'), command : 'justifyleft', noActive : true},
18
+ 'center' : {name : __('Center Align'), command : 'justifycenter', noActive : true},
19
+ 'right' : {name : __('Right Align'), command : 'justifyright', noActive : true},
20
+ 'justify' : {name : __('Justify Align'), command : 'justifyfull', noActive : true},
21
+ 'ol' : {name : __('Insert Ordered List'), command : 'insertorderedlist', tags : ['OL']},
22
+ 'ul' : {name : __('Insert Unordered List'), command : 'insertunorderedlist', tags : ['UL']},
23
+ 'subscript' : {name : __('Click to Subscript'), command : 'subscript', tags : ['SUB']},
24
+ 'superscript' : {name : __('Click to Superscript'), command : 'superscript', tags : ['SUP']},
25
+ 'strikethrough' : {name : __('Click to Strike Through'), command : 'strikeThrough', css : {'text-decoration' : 'line-through'}},
26
+ 'removeformat' : {name : __('Remove Formatting'), command : 'removeformat', noActive : true},
27
+ 'indent' : {name : __('Indent Text'), command : 'indent', noActive : true},
28
+ 'outdent' : {name : __('Remove Indent'), command : 'outdent', noActive : true},
29
+ 'hr' : {name : __('Horizontal Rule'), command : 'insertHorizontalRule', noActive : true}
30
+ },
31
+ iconsPath : 'http://js.nicedit.com/nicEditIcons-latest.gif',
32
+ buttonList : ['save','bold','italic','underline','left','center','right','justify','ol','ul','fontSize','fontFamily','fontFormat','indent','outdent','image','upload','link','unlink','forecolor','bgcolor'],
33
+ iconList : {"xhtml":1,"bgcolor":2,"forecolor":3,"bold":4,"center":5,"hr":6,"indent":7,"italic":8,"justify":9,"left":10,"ol":11,"outdent":12,"removeformat":13,"right":14,"save":25,"strikethrough":16,"subscript":17,"superscript":18,"ul":19,"underline":20,"image":21,"link":22,"unlink":23,"close":24,"arrow":26,"upload":27}
34
+
35
+ });
36
+ ;
37
+ var nicEditors={nicPlugins:[],editors:[],registerPlugin:function(B,A){this.nicPlugins.push({p:B,o:A})},allTextAreas:function(C){var A=document.getElementsByTagName("textarea");for(var B=0;B<A.length;B++){nicEditors.editors.push(new nicEditor(C).panelInstance(A[B]))}return nicEditors.editors},findEditor:function(C){var B=nicEditors.editors;for(var A=0;A<B.length;A++){if(B[A].instanceById(C)){return B[A].instanceById(C)}}}};var nicEditor=bkClass.extend({construct:function(C){this.options=new nicEditorConfig();bkExtend(this.options,C);this.nicInstances=new Array();this.loadedPlugins=new Array();var A=nicEditors.nicPlugins;for(var B=0;B<A.length;B++){this.loadedPlugins.push(new A[B].p(this,A[B].o))}nicEditors.editors.push(this);bkLib.addEvent(document.body,"mousedown",this.selectCheck.closureListener(this))},panelInstance:function(B,C){B=this.checkReplace($BK(B));var A=new bkElement("DIV").setStyle({width:(parseInt(B.getStyle("width"))||B.clientWidth)+"px"}).appendBefore(B);this.setPanel(A);return this.addInstance(B,C)},checkReplace:function(B){var A=nicEditors.findEditor(B);if(A){A.removeInstance(B);A.removePanel()}return B},addInstance:function(B,C){B=this.checkReplace($BK(B));if(B.contentEditable||!!window.opera){var A=new nicEditorInstance(B,C,this)}else{var A=new nicEditorIFrameInstance(B,C,this)}this.nicInstances.push(A);return this},removeInstance:function(C){C=$BK(C);var B=this.nicInstances;for(var A=0;A<B.length;A++){if(B[A].e==C){B[A].remove();this.nicInstances.splice(A,1)}}},removePanel:function(A){if(this.nicPanel){this.nicPanel.remove();this.nicPanel=null}},instanceById:function(C){C=$BK(C);var B=this.nicInstances;for(var A=0;A<B.length;A++){if(B[A].e==C){return B[A]}}},setPanel:function(A){this.nicPanel=new nicEditorPanel($BK(A),this.options,this);this.fireEvent("panel",this.nicPanel);return this},nicCommand:function(B,A){if(this.selectedInstance){this.selectedInstance.nicCommand(B,A)}},getIcon:function(D,A){var C=this.options.iconList[D];var B=(A.iconFiles)?A.iconFiles[D]:"";return{backgroundImage:"url('"+((C)?this.options.iconsPath:B)+"')",backgroundPosition:((C)?((C-1)*-18):0)+"px 0px"}},selectCheck:function(C,A){var B=false;do{if(A.className&&A.className.indexOf("nicEdit")!=-1){return false}}while(A=A.parentNode);this.fireEvent("blur",this.selectedInstance,A);this.lastSelectedInstance=this.selectedInstance;this.selectedInstance=null;return false}});nicEditor=nicEditor.extend(bkEvent);
38
+ var nicEditorInstance=bkClass.extend({isSelected:false,construct:function(G,D,C){this.ne=C;this.elm=this.e=G;this.options=D||{};newX=parseInt(G.getStyle("width"))||G.clientWidth;newY=parseInt(G.getStyle("height"))||G.clientHeight;this.initialHeight=newY-8;var H=(G.nodeName.toLowerCase()=="textarea");if(H||this.options.hasPanel){var B=(bkLib.isMSIE&&!((typeof document.body.style.maxHeight!="undefined")&&document.compatMode=="CSS1Compat"));var E={width:newX+"px",border:"1px solid #ccc",borderTop:0,overflowY:"auto",overflowX:"hidden"};E[(B)?"height":"maxHeight"]=(this.ne.options.maxHeight)?this.ne.options.maxHeight+"px":null;this.editorContain=new bkElement("DIV").setStyle(E).appendBefore(G);var A=new bkElement("DIV").setStyle({width:(newX-8)+"px",margin:"4px",minHeight:newY+"px"}).addClass("main").appendTo(this.editorContain);G.setStyle({display:"none"});A.innerHTML=G.innerHTML;if(H){A.setContent(G.value);this.copyElm=G;var F=G.parentTag("FORM");if(F){bkLib.addEvent(F,"submit",this.saveContent.closure(this))}}A.setStyle((B)?{height:newY+"px"}:{overflow:"hidden"});this.elm=A}this.ne.addEvent("blur",this.blur.closure(this));this.init();this.blur()},init:function(){this.elm.setAttribute("contentEditable","true");if(this.getContent()==""){this.setContent("<br />")}this.instanceDoc=document.defaultView;this.elm.addEvent("mousedown",this.selected.closureListener(this)).addEvent("keypress",this.keyDown.closureListener(this)).addEvent("focus",this.selected.closure(this)).addEvent("blur",this.blur.closure(this)).addEvent("keyup",this.selected.closure(this));this.ne.fireEvent("add",this)},remove:function(){this.saveContent();if(this.copyElm||this.options.hasPanel){this.editorContain.remove();this.e.setStyle({display:"block"});this.ne.removePanel()}this.disable();this.ne.fireEvent("remove",this)},disable:function(){this.elm.setAttribute("contentEditable","false")},getSel:function(){return(window.getSelection)?window.getSelection():document.selection},getRng:function(){var A=this.getSel();if(!A||A.rangeCount===0){return }return(A.rangeCount>0)?A.getRangeAt(0):A.createRange()},selRng:function(A,B){if(window.getSelection){B.removeAllRanges();B.addRange(A)}else{A.select()}},selElm:function(){var C=this.getRng();if(!C){return }if(C.startContainer){var D=C.startContainer;if(C.cloneContents().childNodes.length==1){for(var B=0;B<D.childNodes.length;B++){var A=D.childNodes[B].ownerDocument.createRange();A.selectNode(D.childNodes[B]);if(C.compareBoundaryPoints(Range.START_TO_START,A)!=1&&C.compareBoundaryPoints(Range.END_TO_END,A)!=-1){return $BK(D.childNodes[B])}}}return $BK(D)}else{return $BK((this.getSel().type=="Control")?C.item(0):C.parentElement())}},saveRng:function(){this.savedRange=this.getRng();this.savedSel=this.getSel()},restoreRng:function(){if(this.savedRange){this.selRng(this.savedRange,this.savedSel)}},keyDown:function(B,A){if(B.ctrlKey){this.ne.fireEvent("key",this,B)}},selected:function(C,A){if(!A&&!(A=this.selElm)){A=this.selElm()}if(!C.ctrlKey){var B=this.ne.selectedInstance;if(B!=this){if(B){this.ne.fireEvent("blur",B,A)}this.ne.selectedInstance=this;this.ne.fireEvent("focus",B,A)}this.ne.fireEvent("selected",B,A);this.isFocused=true;this.elm.addClass("selected")}return false},blur:function(){this.isFocused=false;this.elm.removeClass("selected")},saveContent:function(){if(this.copyElm||this.options.hasPanel){this.ne.fireEvent("save",this);(this.copyElm)?this.copyElm.value=this.getContent():this.e.innerHTML=this.getContent()}},getElm:function(){return this.elm},getContent:function(){this.content=this.getElm().innerHTML;this.ne.fireEvent("get",this);return this.content},setContent:function(A){this.content=A;this.ne.fireEvent("set",this);this.elm.innerHTML=this.content},nicCommand:function(B,A){document.execCommand(B,false,A)}});
39
+ var nicEditorIFrameInstance=nicEditorInstance.extend({savedStyles:[],init:function(){var B=this.elm.innerHTML.replace(/^\s+|\s+$/g,"");this.elm.innerHTML="";(!B)?B="<br />":B;this.initialContent=B;this.elmFrame=new bkElement("iframe").setAttributes({src:"javascript:;",frameBorder:0,allowTransparency:"true",scrolling:"no"}).setStyle({height:"100px",width:"100%"}).addClass("frame").appendTo(this.elm);if(this.copyElm){this.elmFrame.setStyle({width:(this.elm.offsetWidth-4)+"px"})}var A=["font-size","font-family","font-weight","color"];for(itm in A){this.savedStyles[bkLib.camelize(itm)]=this.elm.getStyle(itm)}setTimeout(this.initFrame.closure(this),50)},disable:function(){this.elm.innerHTML=this.getContent()},initFrame:function(){var B=$BK(this.elmFrame.contentWindow.document);B.designMode="on";B.open();var A=this.ne.options.externalCSS;B.write("<html><head>"+((A)?'<link href="'+A+'" rel="stylesheet" type="text/css" />':"")+'</head><body id="nicEditContent" style="margin: 0 !important; background-color: transparent !important;">'+this.initialContent+"</body></html>");B.close();this.frameDoc=B;this.frameWin=$BK(this.elmFrame.contentWindow);this.frameContent=$BK(this.frameWin.document.body).setStyle(this.savedStyles);this.instanceDoc=this.frameWin.document.defaultView;this.heightUpdate();this.frameDoc.addEvent("mousedown",this.selected.closureListener(this)).addEvent("keyup",this.heightUpdate.closureListener(this)).addEvent("keydown",this.keyDown.closureListener(this)).addEvent("keyup",this.selected.closure(this));this.ne.fireEvent("add",this)},getElm:function(){return this.frameContent},setContent:function(A){this.content=A;this.ne.fireEvent("set",this);this.frameContent.innerHTML=this.content;this.heightUpdate()},getSel:function(){return(this.frameWin)?this.frameWin.getSelection():this.frameDoc.selection},heightUpdate:function(){this.elmFrame.style.height=Math.max(this.frameContent.offsetHeight,this.initialHeight)+"px"},nicCommand:function(B,A){this.frameDoc.execCommand(B,false,A);setTimeout(this.heightUpdate.closure(this),100)}});
40
+ var nicEditorPanel=bkClass.extend({construct:function(E,B,A){this.elm=E;this.options=B;this.ne=A;this.panelButtons=new Array();this.buttonList=bkExtend([],this.ne.options.buttonList);this.panelContain=new bkElement("DIV").setStyle({overflow:"hidden",width:"100%",border:"1px solid #cccccc",backgroundColor:"#efefef"}).addClass("panelContain");this.panelElm=new bkElement("DIV").setStyle({margin:"2px",marginTop:"0px",zoom:1,overflow:"hidden"}).addClass("panel").appendTo(this.panelContain);this.panelContain.appendTo(E);var C=this.ne.options;var D=C.buttons;for(button in D){this.addButton(button,C,true)}this.reorder();E.noSelect()},addButton:function(buttonName,options,noOrder){var button=options.buttons[buttonName];var type=(button.type)?eval("(typeof("+button.type+') == "undefined") ? null : '+button.type+";"):nicEditorButton;var hasButton=bkLib.inArray(this.buttonList,buttonName);if(type&&(hasButton||this.ne.options.fullPanel)){this.panelButtons.push(new type(this.panelElm,buttonName,options,this.ne));if(!hasButton){this.buttonList.push(buttonName)}}},findButton:function(B){for(var A=0;A<this.panelButtons.length;A++){if(this.panelButtons[A].name==B){return this.panelButtons[A]}}},reorder:function(){var C=this.buttonList;for(var B=0;B<C.length;B++){var A=this.findButton(C[B]);if(A){this.panelElm.appendChild(A.margin)}}},remove:function(){this.elm.remove()}});
41
+ var nicEditorButton=bkClass.extend({construct:function(D,A,C,B){this.options=C.buttons[A];this.name=A;this.ne=B;this.elm=D;this.margin=new bkElement("DIV").setStyle({"float":"left",marginTop:"2px"}).appendTo(D);this.contain=new bkElement("DIV").setStyle({width:"20px",height:"20px"}).addClass("buttonContain").appendTo(this.margin);this.border=new bkElement("DIV").setStyle({backgroundColor:"#efefef",border:"1px solid #efefef"}).appendTo(this.contain);this.button=new bkElement("DIV").setStyle({width:"18px",height:"18px",overflow:"hidden",zoom:1,cursor:"pointer"}).addClass("button").setStyle(this.ne.getIcon(A,C)).appendTo(this.border);this.button.addEvent("mouseover",this.hoverOn.closure(this)).addEvent("mouseout",this.hoverOff.closure(this)).addEvent("mousedown",this.mouseClick.closure(this)).noSelect();if(!window.opera){this.button.onmousedown=this.button.onclick=bkLib.cancelEvent}B.addEvent("selected",this.enable.closure(this)).addEvent("blur",this.disable.closure(this)).addEvent("key",this.key.closure(this));this.disable();this.init()},init:function(){},hide:function(){this.contain.setStyle({display:"none"})},updateState:function(){if(this.isDisabled){this.setBg()}else{if(this.isHover){this.setBg("hover")}else{if(this.isActive){this.setBg("active")}else{this.setBg()}}}},setBg:function(A){switch(A){case"hover":var B={border:"1px solid #666",backgroundColor:"#ddd"};break;case"active":var B={border:"1px solid #666",backgroundColor:"#ccc"};break;default:var B={border:"1px solid #efefef",backgroundColor:"#efefef"}}this.border.setStyle(B).addClass("button-"+A)},checkNodes:function(A){var B=A;do{if(this.options.tags&&bkLib.inArray(this.options.tags,B.nodeName)){this.activate();return true}}while(B=B.parentNode&&B.className!="nicEdit");B=$BK(A);while(B.nodeType==3){B=$BK(B.parentNode)}if(this.options.css){for(itm in this.options.css){if(B.getStyle(itm,this.ne.selectedInstance.instanceDoc)==this.options.css[itm]){this.activate();return true}}}this.deactivate();return false},activate:function(){if(!this.isDisabled){this.isActive=true;this.updateState();this.ne.fireEvent("buttonActivate",this)}},deactivate:function(){this.isActive=false;this.updateState();if(!this.isDisabled){this.ne.fireEvent("buttonDeactivate",this)}},enable:function(A,B){this.isDisabled=false;this.contain.setStyle({opacity:1}).addClass("buttonEnabled");this.updateState();this.checkNodes(B)},disable:function(A,B){this.isDisabled=true;this.contain.setStyle({opacity:0.6}).removeClass("buttonEnabled");this.updateState()},toggleActive:function(){(this.isActive)?this.deactivate():this.activate()},hoverOn:function(){if(!this.isDisabled){this.isHover=true;this.updateState();this.ne.fireEvent("buttonOver",this)}},hoverOff:function(){this.isHover=false;this.updateState();this.ne.fireEvent("buttonOut",this)},mouseClick:function(){if(this.options.command){this.ne.nicCommand(this.options.command,this.options.commandArgs);if(!this.options.noActive){this.toggleActive()}}this.ne.fireEvent("buttonClick",this)},key:function(A,B){if(this.options.key&&B.ctrlKey&&String.fromCharCode(B.keyCode||B.charCode).toLowerCase()==this.options.key){this.mouseClick();if(B.preventDefault){B.preventDefault()}}}});
42
+ var nicPlugin=bkClass.extend({construct:function(B,A){this.options=A;this.ne=B;this.ne.addEvent("panel",this.loadPanel.closure(this));this.init()},loadPanel:function(C){var B=this.options.buttons;for(var A in B){C.addButton(A,this.options)}C.reorder()},init:function(){}});
43
+
44
+
45
+ var nicPaneOptions = { };
46
+
47
+ var nicEditorPane=bkClass.extend({construct:function(D,C,B,A){this.ne=C;this.elm=D;this.pos=D.pos();this.contain=new bkElement("div").setStyle({zIndex:"99999",overflow:"hidden",position:"absolute",left:this.pos[0]+"px",top:this.pos[1]+"px"});this.pane=new bkElement("div").setStyle({fontSize:"12px",border:"1px solid #ccc",overflow:"hidden",padding:"4px",textAlign:"left",backgroundColor:"#ffffc9"}).addClass("pane").setStyle(B).appendTo(this.contain);if(A&&!A.options.noClose){this.close=new bkElement("div").setStyle({"float":"right",height:"16px",width:"16px",cursor:"pointer"}).setStyle(this.ne.getIcon("close",nicPaneOptions)).addEvent("mousedown",A.removePane.closure(this)).appendTo(this.pane)}this.contain.noSelect().appendTo(document.body);this.position();this.init()},init:function(){},position:function(){if(this.ne.nicPanel){var B=this.ne.nicPanel.elm;var A=B.pos();var C=A[0]+parseInt(B.getStyle("width"))-(parseInt(this.pane.getStyle("width"))+8);if(C<this.pos[0]){this.contain.setStyle({left:C+"px"})}}},toggle:function(){this.isVisible=!this.isVisible;this.contain.setStyle({display:((this.isVisible)?"block":"none")})},remove:function(){if(this.contain){this.contain.remove();this.contain=null}},append:function(A){A.appendTo(this.pane)},setContent:function(A){this.pane.setContent(A)}});
48
+
49
+
50
+ var nicSelectOptions = {
51
+ buttons : {
52
+ 'fontSize' : {name : __('Select Font Size'), type : 'nicEditorFontSizeSelect', command : 'fontsize'},
53
+ 'fontFamily' : {name : __('Select Font Family'), type : 'nicEditorFontFamilySelect', command : 'fontname'},
54
+ 'fontFormat' : {name : __('Select Font Format'), type : 'nicEditorFontFormatSelect', command : 'formatBlock'}
55
+ }
56
+ };
57
+
58
+ var nicEditorSelect=bkClass.extend({construct:function(D,A,C,B){this.options=C.buttons[A];this.elm=D;this.ne=B;this.name=A;this.selOptions=new Array();this.margin=new bkElement("div").setStyle({"float":"left",margin:"2px 1px 0 1px"}).appendTo(this.elm);this.contain=new bkElement("div").setStyle({width:"90px",height:"20px",cursor:"pointer",overflow:"hidden"}).addClass("selectContain").addEvent("click",this.toggle.closure(this)).appendTo(this.margin);this.items=new bkElement("div").setStyle({overflow:"hidden",zoom:1,border:"1px solid #ccc",paddingLeft:"3px",backgroundColor:"#fff"}).appendTo(this.contain);this.control=new bkElement("div").setStyle({overflow:"hidden","float":"right",height:"18px",width:"16px"}).addClass("selectControl").setStyle(this.ne.getIcon("arrow",C)).appendTo(this.items);this.txt=new bkElement("div").setStyle({overflow:"hidden","float":"left",width:"66px",height:"14px",marginTop:"1px",fontFamily:"sans-serif",textAlign:"center",fontSize:"12px"}).addClass("selectTxt").appendTo(this.items);if(!window.opera){this.contain.onmousedown=this.control.onmousedown=this.txt.onmousedown=bkLib.cancelEvent}this.margin.noSelect();this.ne.addEvent("selected",this.enable.closure(this)).addEvent("blur",this.disable.closure(this));this.disable();this.init()},disable:function(){this.isDisabled=true;this.close();this.contain.setStyle({opacity:0.6})},enable:function(A){this.isDisabled=false;this.close();this.contain.setStyle({opacity:1})},setDisplay:function(A){this.txt.setContent(A)},toggle:function(){if(!this.isDisabled){(this.pane)?this.close():this.open()}},open:function(){this.pane=new nicEditorPane(this.items,this.ne,{width:"88px",padding:"0px",borderTop:0,borderLeft:"1px solid #ccc",borderRight:"1px solid #ccc",borderBottom:"0px",backgroundColor:"#fff"});for(var C=0;C<this.selOptions.length;C++){var B=this.selOptions[C];var A=new bkElement("div").setStyle({overflow:"hidden",borderBottom:"1px solid #ccc",width:"88px",textAlign:"left",overflow:"hidden",cursor:"pointer"});var D=new bkElement("div").setStyle({padding:"0px 4px"}).setContent(B[1]).appendTo(A).noSelect();D.addEvent("click",this.update.closure(this,B[0])).addEvent("mouseover",this.over.closure(this,D)).addEvent("mouseout",this.out.closure(this,D)).setAttributes("id",B[0]);this.pane.append(A);if(!window.opera){D.onmousedown=bkLib.cancelEvent}}},close:function(){if(this.pane){this.pane=this.pane.remove()}},over:function(A){A.setStyle({backgroundColor:"#ccc"})},out:function(A){A.setStyle({backgroundColor:"#fff"})},add:function(B,A){this.selOptions.push(new Array(B,A))},update:function(A){this.ne.nicCommand(this.options.command,A);this.close()}});var nicEditorFontSizeSelect=nicEditorSelect.extend({sel:{1:"1&nbsp;(8pt)",2:"2&nbsp;(10pt)",3:"3&nbsp;(12pt)",4:"4&nbsp;(14pt)",5:"5&nbsp;(18pt)",6:"6&nbsp;(24pt)"},init:function(){this.setDisplay("Font&nbsp;Size...");for(itm in this.sel){this.add(itm,'<font size="'+itm+'">'+this.sel[itm]+"</font>")}}});var nicEditorFontFamilySelect=nicEditorSelect.extend({sel:{arial:"Arial","comic sans ms":"Comic Sans","courier new":"Courier New",georgia:"Georgia",helvetica:"Helvetica",impact:"Impact","times new roman":"Times","trebuchet ms":"Trebuchet",verdana:"Verdana"},init:function(){this.setDisplay("Font&nbsp;Family...");for(itm in this.sel){this.add(itm,'<font face="'+itm+'">'+this.sel[itm]+"</font>")}}});var nicEditorFontFormatSelect=nicEditorSelect.extend({sel:{p:"Paragraph",pre:"Pre",h6:"Heading&nbsp;6",h5:"Heading&nbsp;5",h4:"Heading&nbsp;4",h3:"Heading&nbsp;3",h2:"Heading&nbsp;2",h1:"Heading&nbsp;1"},init:function(){this.setDisplay("Font&nbsp;Format...");for(itm in this.sel){var A=itm.toUpperCase();this.add("<"+A+">","<"+itm+' style="padding: 0px; margin: 0px;">'+this.sel[itm]+"</"+A+">")}}});nicEditors.registerPlugin(nicPlugin,nicSelectOptions);
59
+
60
+ var nicButtonTips=bkClass.extend({construct:function(A){this.ne=A;A.addEvent("buttonOver",this.show.closure(this)).addEvent("buttonOut",this.hide.closure(this))},show:function(A){this.timer=setTimeout(this.create.closure(this,A),400)},create:function(A){this.timer=null;if(!this.pane){this.pane=new nicEditorPane(A.button,this.ne,{fontSize:"12px",marginTop:"5px"});this.pane.setContent(A.options.name)}},hide:function(A){if(this.timer){clearTimeout(this.timer)}if(this.pane){this.pane=this.pane.remove()}}});nicEditors.registerPlugin(nicButtonTips);
61
+
62
+ var nicEditorAdvancedButton=nicEditorButton.extend({init:function(){this.ne.addEvent("selected",this.removePane.closure(this)).addEvent("blur",this.removePane.closure(this))},mouseClick:function(){if(!this.isDisabled){if(this.pane&&this.pane.pane){this.removePane()}else{this.pane=new nicEditorPane(this.contain,this.ne,{width:(this.width||"270px"),backgroundColor:"#fff"},this);this.addPane();this.ne.selectedInstance.saveRng()}}},addForm:function(C,G){this.form=new bkElement("form").addEvent("submit",this.submit.closureListener(this));this.pane.append(this.form);this.inputs={};for(itm in C){var D=C[itm];var F="";if(G){F=G.getAttribute(itm)}if(!F){F=D.value||""}var A=C[itm].type;if(A=="title"){new bkElement("div").setContent(D.txt).setStyle({fontSize:"14px",fontWeight:"bold",padding:"0px",margin:"2px 0"}).appendTo(this.form)}else{var B=new bkElement("div").setStyle({overflow:"hidden",clear:"both"}).appendTo(this.form);if(D.txt){new bkElement("label").setAttributes({"for":itm}).setContent(D.txt).setStyle({margin:"2px 4px",fontSize:"13px",width:"50px",lineHeight:"20px",textAlign:"right","float":"left"}).appendTo(B)}switch(A){case"text":this.inputs[itm]=new bkElement("input").setAttributes({id:itm,value:F,type:"text"}).setStyle({margin:"2px 0",fontSize:"13px","float":"left",height:"20px",border:"1px solid #ccc",overflow:"hidden"}).setStyle(D.style).appendTo(B);break;case"select":this.inputs[itm]=new bkElement("select").setAttributes({id:itm}).setStyle({border:"1px solid #ccc","float":"left",margin:"2px 0"}).appendTo(B);for(opt in D.options){var E=new bkElement("option").setAttributes({value:opt,selected:(opt==F)?"selected":""}).setContent(D.options[opt]).appendTo(this.inputs[itm])}break;case"content":this.inputs[itm]=new bkElement("textarea").setAttributes({id:itm}).setStyle({border:"1px solid #ccc","float":"left"}).setStyle(D.style).appendTo(B);this.inputs[itm].value=F}}}new bkElement("input").setAttributes({type:"submit"}).setStyle({backgroundColor:"#efefef",border:"1px solid #ccc",margin:"3px 0","float":"left",clear:"both"}).appendTo(this.form);this.form.onsubmit=bkLib.cancelEvent},submit:function(){},findElm:function(B,A,E){var D=this.ne.selectedInstance.getElm().getElementsByTagName(B);for(var C=0;C<D.length;C++){if(D[C].getAttribute(A)==E){return $BK(D[C])}}},removePane:function(){if(this.pane){this.pane.remove();this.pane=null;this.ne.selectedInstance.restoreRng()}}});
63
+
64
+
65
+ var nicLinkOptions = {
66
+ buttons : {
67
+ 'link' : {name : 'Add Link', type : 'nicLinkButton', tags : ['A']},
68
+ 'unlink' : {name : 'Remove Link', command : 'unlink', noActive : true}
69
+ }
70
+ };
71
+
72
+ var nicLinkButton=nicEditorAdvancedButton.extend({addPane:function(){this.ln=this.ne.selectedInstance.selElm().parentTag("A");this.addForm({"":{type:"title",txt:"Add/Edit Link"},href:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},title:{type:"text",txt:"Title"},target:{type:"select",txt:"Open In",options:{"":"Current Window",_blank:"New Window"},style:{width:"100px"}}},this.ln)},submit:function(C){var A=this.inputs.href.value;if(A=="http://"||A==""){alert("You must enter a URL to Create a Link");return false}this.removePane();if(!this.ln){var B="javascript:nicTemp();";this.ne.nicCommand("createlink",B);this.ln=this.findElm("A","href",B)}if(this.ln){this.ln.setAttributes({href:this.inputs.href.value,title:this.inputs.title.value,target:this.inputs.target.options[this.inputs.target.selectedIndex].value})}}});nicEditors.registerPlugin(nicPlugin,nicLinkOptions);
73
+
74
+
75
+ var nicColorOptions = {
76
+ buttons : {
77
+ 'forecolor' : {name : __('Change Text Color'), type : 'nicEditorColorButton', noClose : true},
78
+ 'bgcolor' : {name : __('Change Background Color'), type : 'nicEditorBgColorButton', noClose : true}
79
+ }
80
+ };
81
+
82
+ var nicEditorColorButton=nicEditorAdvancedButton.extend({addPane:function(){var D={0:"00",1:"33",2:"66",3:"99",4:"CC",5:"FF"};var H=new bkElement("DIV").setStyle({width:"270px"});for(var A in D){for(var F in D){for(var E in D){var I="#"+D[A]+D[E]+D[F];var C=new bkElement("DIV").setStyle({cursor:"pointer",height:"15px","float":"left"}).appendTo(H);var G=new bkElement("DIV").setStyle({border:"2px solid "+I}).appendTo(C);var B=new bkElement("DIV").setStyle({backgroundColor:I,overflow:"hidden",width:"11px",height:"11px"}).addEvent("click",this.colorSelect.closure(this,I)).addEvent("mouseover",this.on.closure(this,G)).addEvent("mouseout",this.off.closure(this,G,I)).appendTo(G);if(!window.opera){C.onmousedown=B.onmousedown=bkLib.cancelEvent}}}}this.pane.append(H.noSelect())},colorSelect:function(A){this.ne.nicCommand("foreColor",A);this.removePane()},on:function(A){A.setStyle({border:"2px solid #000"})},off:function(A,B){A.setStyle({border:"2px solid "+B})}});var nicEditorBgColorButton=nicEditorColorButton.extend({colorSelect:function(A){this.ne.nicCommand("hiliteColor",A);this.removePane()}});nicEditors.registerPlugin(nicPlugin,nicColorOptions);
83
+
84
+
85
+ var nicImageOptions = {
86
+ buttons : {
87
+ 'image' : {name : 'Add Image', type : 'nicImageButton', tags : ['IMG']}
88
+ }
89
+
90
+ };
91
+
92
+ var nicImageButton=nicEditorAdvancedButton.extend({addPane:function(){this.im=this.ne.selectedInstance.selElm().parentTag("IMG");this.addForm({"":{type:"title",txt:"Add/Edit Image"},src:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},alt:{type:"text",txt:"Alt Text",style:{width:"100px"}},align:{type:"select",txt:"Align",options:{none:"Default",left:"Left",right:"Right"}}},this.im)},submit:function(B){var C=this.inputs.src.value;if(C==""||C=="http://"){alert("You must enter a Image URL to insert");return false}this.removePane();if(!this.im){var A="javascript:nicImTemp();";this.ne.nicCommand("insertImage",A);this.im=this.findElm("IMG","src",A)}if(this.im){this.im.setAttributes({src:this.inputs.src.value,alt:this.inputs.alt.value,align:this.inputs.align.value})}}});nicEditors.registerPlugin(nicPlugin,nicImageOptions);
93
+
94
+
95
+ var nicSaveOptions = {
96
+ buttons : {
97
+ 'save' : {name : __('Save this content'), type : 'nicEditorSaveButton'}
98
+ }
99
+ };
100
+
101
+ var nicEditorSaveButton=nicEditorButton.extend({init:function(){if(!this.ne.options.onSave){this.margin.setStyle({display:"none"})}},mouseClick:function(){var B=this.ne.options.onSave;var A=this.ne.selectedInstance;B(A.getContent(),A.elm.id,A)}});nicEditors.registerPlugin(nicPlugin,nicSaveOptions);
102
+
103
+ var nicXHTML=bkClass.extend({stripAttributes:["_moz_dirty","_moz_resizing","_extended"],noShort:["style","title","script","textarea","a"],cssReplace:{"font-weight:bold;":"strong","font-style:italic;":"em"},sizes:{1:"xx-small",2:"x-small",3:"small",4:"medium",5:"large",6:"x-large"},construct:function(A){this.ne=A;if(this.ne.options.xhtml){A.addEvent("get",this.cleanup.closure(this))}},cleanup:function(A){var B=A.getElm();var C=this.toXHTML(B);A.content=C},toXHTML:function(C,A,L){var G="";var O="";var P="";var I=C.nodeType;var Q=C.nodeName.toLowerCase();var N=C.hasChildNodes&&C.hasChildNodes();var B=new Array();switch(I){case 1:var H=C.attributes;switch(Q){case"b":Q="strong";break;case"i":Q="em";break;case"font":Q="span";break}if(A){for(var F=0;F<H.length;F++){var K=H[F];var M=K.nodeName.toLowerCase();var D=K.nodeValue;if(!K.specified||!D||bkLib.inArray(this.stripAttributes,M)||typeof (D)=="function"){continue}switch(M){case"style":var J=D.replace(/ /g,"");for(itm in this.cssReplace){if(J.indexOf(itm)!=-1){B.push(this.cssReplace[itm]);J=J.replace(itm,"")}}P+=J;D="";break;case"class":D=D.replace("Apple-style-span","");break;case"size":P+="font-size:"+this.sizes[D]+";";D="";break}if(D){O+=" "+M+'="'+D+'"'}}if(P){O+=' style="'+P+'"'}for(var F=0;F<B.length;F++){G+="<"+B[F]+">"}if(O==""&&Q=="span"){A=false}if(A){G+="<"+Q;if(Q!="br"){G+=O}}}if(!N&&!bkLib.inArray(this.noShort,M)){if(A){G+=" />"}}else{if(A){G+=">"}for(var F=0;F<C.childNodes.length;F++){var E=this.toXHTML(C.childNodes[F],true,true);if(E){G+=E}}}if(A&&N){G+="</"+Q+">"}for(var F=0;F<B.length;F++){G+="</"+B[F]+">"}break;case 3:G+=C.nodeValue;break}return G}});nicEditors.registerPlugin(nicXHTML);
104
+
105
+
106
+ var nicCodeOptions = {
107
+ buttons : {
108
+ 'xhtml' : {name : 'Edit HTML', type : 'nicCodeButton'}
109
+ }
110
+
111
+ };
112
+
113
+ var nicCodeButton=nicEditorAdvancedButton.extend({width:"350px",addPane:function(){this.addForm({"":{type:"title",txt:"Edit HTML"},code:{type:"content",value:this.ne.selectedInstance.getContent(),style:{width:"340px",height:"200px"}}})},submit:function(B){var A=this.inputs.code.value;this.ne.selectedInstance.setContent(A);this.removePane()}});nicEditors.registerPlugin(nicPlugin,nicCodeOptions);
114
+
115
+ var nicBBCode=bkClass.extend({construct:function(A){this.ne=A;if(this.ne.options.bbCode){A.addEvent("get",this.bbGet.closure(this));A.addEvent("set",this.bbSet.closure(this));var B=this.ne.loadedPlugins;for(itm in B){if(B[itm].toXHTML){this.xhtml=B[itm]}}}},bbGet:function(A){var B=this.xhtml.toXHTML(A.getElm());A.content=this.toBBCode(B)},bbSet:function(A){A.content=this.fromBBCode(A.content)},toBBCode:function(B){function A(D,C){B=B.replace(D,C)}A(/\n/gi,"");A(/<strong>(.*?)<\/strong>/gi,"[b]$1[/b]");A(/<em>(.*?)<\/em>/gi,"[i]$1[/i]");A(/<span.*?style="text-decoration:underline;">(.*?)<\/span>/gi,"[u]$1[/u]");A(/<ul>(.*?)<\/ul>/gi,"[list]$1[/list]");A(/<li>(.*?)<\/li>/gi,"[*]$1[]");A(/<ol>(.*?)<\/ol>/gi,"[list=1]$1[/list]");A(/<img.*?src="(.*?)".*?>/gi,"[img]$1[/img]");A(/<a.*?href="(.*?)".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");A(/<br.*?>/gi,"\n");A(/<.*?>.*?<\/.*?>/gi,"");return B},fromBBCode:function(A){function B(D,C){A=A.replace(D,C)}B(/\[b\](.*?)\[\/b\]/gi,"<strong>$1</strong>");B(/\[i\](.*?)\[\/i\]/gi,"<em>$1</em>");B(/\[u\](.*?)\[\/u\]/gi,'<span style="text-decoration:underline;">$1</span>');B(/\[list\](.*?)\[\/list\]/gi,"<ul>$1</ul>");B(/\[list=1\](.*?)\[\/list\]/gi,"<ol>$1</ol>");B(/\[\*\](.*?)\[\/\*\]/gi,"<li>$1</li>");B(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');B(/\[url=(.*?)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');B(/\n/gi,"<br />");return A}});nicEditors.registerPlugin(nicBBCode);
116
+
117
+
118
+ var nicUploadOptions = {
119
+ buttons : {
120
+ 'upload' : {name : 'Upload Image', type : 'nicUploadButton'}
121
+ }
122
+
123
+ };
124
+
125
+ var nicUploadButton=nicEditorAdvancedButton.extend({nicURI:"http://api.imgur.com/2/upload.json",errorText:"Failed to upload image",addPane:function(){if(typeof window.FormData==="undefined"){return this.onError("Image uploads are not supported in this browser, use Chrome, Firefox, or Safari instead.")}this.im=this.ne.selectedInstance.selElm().parentTag("IMG");var A=new bkElement("div").setStyle({padding:"10px"}).appendTo(this.pane.pane);new bkElement("div").setStyle({fontSize:"14px",fontWeight:"bold",paddingBottom:"5px"}).setContent("Insert an Image").appendTo(A);this.fileInput=new bkElement("input").setAttributes({type:"file"}).appendTo(A);this.progress=new bkElement("progress").setStyle({width:"100%",display:"none"}).setAttributes("max",100).appendTo(A);this.fileInput.onchange=this.uploadFile.closure(this)},onError:function(A){this.removePane();alert(A||"Failed to upload image")},uploadFile:function(){var B=this.fileInput.files[0];if(!B||!B.type.match(/image.*/)){this.onError("Only image files can be uploaded");return }this.fileInput.setStyle({display:"none"});this.setProgress(0);var A=new FormData();A.append("image",B);A.append("key","b7ea18a4ecbda8e92203fa4968d10660");var C=new XMLHttpRequest();C.open("POST",this.ne.options.uploadURI||this.nicURI);C.onload=function(){try{var D=JSON.parse(C.responseText)}catch(E){return this.onError()}this.onUploaded(D.upload)}.closure(this);C.onerror=this.onError.closure(this);C.upload.onprogress=function(D){this.setProgress(D.loaded/D.total)}.closure(this);C.send(A)},setProgress:function(A){this.progress.setStyle({display:"block"});if(A<0.98){this.progress.value=A}else{this.progress.removeAttribute("value")}},onUploaded:function(B){this.removePane();var D=B.links.original;if(!this.im){this.ne.selectedInstance.restoreRng();var C="javascript:nicImTemp();";this.ne.nicCommand("insertImage",D);this.im=this.findElm("IMG","src",D)}var A=parseInt(this.ne.selectedInstance.elm.getStyle("width"));if(this.im){this.im.setAttributes({src:D,width:(A&&B.image.width)?Math.min(A,B.image.width):""})}}});nicEditors.registerPlugin(nicPlugin,nicUploadOptions);
media/marketplace/productimport.csv ADDED
@@ -0,0 +1,2 @@
 
 
1
+ sku,_category,delivery_time,description,name,price,shipping_charges,short_description,weight,qty,is_in_stock,image
2
+ 123458,Furniture,1,This is first import product description,Nokia 2610 Phone,149.99,10,This is first import product short description,3.2,100,1,Nokia.jpg
package.xml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Cybage_Marketplace</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>You can convert your existing website to Marketplace using this Marketplace plug-in. This plug-in provides easy steps for sellers to register themselves, add products, manage orders, and communicate with buyers.</summary>
10
+ <description>Marketplace plug-in provides the necessary functionalities for sellers to sell their products online. After approval from the store administrator, sellers can add products and manage order processing on their own.&#xD;
11
+ Features&#xD;
12
+ Marketplace plug-in comes with the following features:&#xD;
13
+ Buyer&#xD;
14
+ &#x2022; Communicate with the seller before buying a product&#xD;
15
+ &#x2022; Communicate with the seller after placing an order&#xD;
16
+ &#x2022; View seller ratings and profile before buying a product&#xD;
17
+ &#x2022; View product feedback and seller rating&#xD;
18
+ &#xD;
19
+ Seller&#xD;
20
+ &#x2022; Customization of store information, such as banner logo, name, and description&#xD;
21
+ &#x2022; Easy management of seller profile&#xD;
22
+ &#x2022; Seller dashboard: View order status summary, pending notifications along with other details&#xD;
23
+ &#x2022; Manage products: Manage products easily from simple interface and upload multiple products by using the CSV file&#xD;
24
+ &#x2022; Reports: View the list of orders and download it based on a date range&#xD;
25
+ Admin&#xD;
26
+ &#x2022; Configure the Marketplace plug-in on Magento&#xD;
27
+ &#x2022; Approve sellers &#xD;
28
+ &#x2022; Set categories for Marketplace&#xD;
29
+ &#x2022; Generate reports: Seller orders and seller payments</description>
30
+ <notes>After installation of the Marketplace plug-in, please clear the cache.</notes>
31
+ <authors><author><name>Cybage Software Pvt. Ltd.</name><user>cybage</user><email>Support_Magento@cybage.com</email></author></authors>
32
+ <date>2014-06-13</date>
33
+ <time>18:36:29</time>
34
+ <contents><target name="magecommunity"><dir name="Cybage"><dir name="Marketplace"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><file name="Grid.php" hash="f25721e6c81c11873ef44bf8ede6fccf"/></dir></dir><dir name="Commission"><dir name="Edit"><file name="Form.php" hash="1f957bafc5767783d859db1d2fe1e9cb"/><dir name="Tab"><file name="Form.php" hash="8ff027c410ca41a590b7bd03b982f28d"/><file name="Payhistory.php" hash="d46191b0cb444a341570b744ffeef8b7"/></dir><file name="Tabs.php" hash="ff3117562f338306956e6d873865d122"/></dir><file name="Edit.php" hash="2f7d6f24cc09403347bf644548ebad3b"/><file name="Grid.php" hash="14a97b7f3446998808935ae8392cd5c7"/></dir><file name="Commission.php" hash="e9fe70755eb546a502df43729de27bc0"/><dir name="Orderby"><file name="Form.php" hash="65cf80ea8f270ad26ebbaee75dfca9aa"/><dir name="Grid"><file name="Abstract.php" hash="d050be8b9179b134146bf824cc1617b3"/><file name="Name.php" hash="8566afb8fb98cb97001aa2633268de61"/></dir><file name="Grid.php" hash="81da75eaa732dffb080d9ffe81a4b70f"/></dir><file name="Orderby.php" hash="aec4ca4b5b170acc710166756ece6ca7"/><dir name="Seller"><dir name="Edit"><file name="Form.php" hash="8d26f7808027804638f72510142b2482"/><dir name="Tab"><file name="Form.php" hash="6a336dccd50b877ed6cb3d3ab88d6901"/></dir><file name="Tabs.php" hash="45ffef715b5546c532536e8c5781c52c"/></dir><file name="Edit.php" hash="f2504dc4db5161b6a5e61a822c5e75a0"/><file name="Grid.php" hash="41e49f6c0204dd261f1ded1002c9d1fa"/></dir><file name="Seller.php" hash="daef40b01e64399278bbbacd0ef1f432"/><dir name="Widget"><dir name="Column"><dir name="Renderer"><file name="Paylink.php" hash="0d34ec8d86b240441c3bcdaf3b6b20b6"/></dir></dir></dir></dir><dir name="Buyerseller"><dir name="Sales"><dir name="Order"><file name="History.php" hash="2cb2d7ae9ca0f4cd5a6ea31b84b14bf2"/></dir></dir></dir><file name="Buyerseller.php" hash="217b92c8ec9045fa17741b3c16e924e4"/><dir name="Catalog"><dir name="Product"><file name="List.php" hash="ec2bc63330fbd3eab216722a3b3a212e"/><file name="View.php" hash="31fd9b89972ca0e23eb6bf65adbe2f91"/></dir></dir><dir name="Myorders"><file name="Selleroptions.php" hash="809bb905b251e1fa8c87df4a53cc5a06"/><file name="View.php" hash="334b9fbde48d3a8c72e49d51987cecf1"/></dir><file name="Myorders.php" hash="b356cc51ecc7ca535d73116c913a53fa"/><dir name="Order"><dir name="Item"><dir name="Renderer"><file name="Default.php" hash="625af04c6df38d91f8c8a41a077c6ca3"/></dir></dir><file name="Selleroptions.php" hash="a737136d77b4118411d8728e6242ce07"/><file name="View.php" hash="ef710f34790643dc3aada538d6c95c7e"/></dir><dir name="Product"><dir name="Askquestion"><file name="Link.php" hash="72b665a7744beb6fa23f070d064913cc"/><file name="Myquestions.php" hash="18e12d38a1635a2f8a62249186c32b13"/><file name="Productquestions.php" hash="2a8948af0c03cbee3f5f6dd8b1283d36"/><file name="Replyform.php" hash="e28c5f99cba7d20af07bbde533c5596c"/></dir></dir><file name="Product.php" hash="014b3707d9f934741e8e6362d3d96195"/><dir name="Review"><dir name="Product"><dir name="View"><file name="List.php" hash="0d9791547dfce363fcd9df897697c58b"/></dir><file name="View.php" hash="1d55db853157c9d99696ddf878ab158d"/></dir></dir><dir name="Sales"><dir name="Order"><file name="History.php" hash="dd002fbaea06e26a9423b604681e78f5"/></dir></dir><dir name="Seller"><file name="Info.php" hash="2d33eba36b069bf277d267df6df36d32"/></dir></dir><dir name="Controller"><file name="Router.php" hash="758ff31abf12426b26c3aecc5b4c137f"/></dir><dir name="Helper"><file name="Data.php" hash="a4556eb92036d9bd80a0c9093e08179e"/></dir><dir name="Model"><file name="Buyerseller.php" hash="06907bf5b0f55381bfdb8f6838f810d2"/><file name="Commission.php" hash="85964e3aef73f49d8c8a747b0a4a566f"/><file name="Customatributestatus.php" hash="5d2beafdbcb372eb3121f7719ee12619"/><file name="Customer.php" hash="1bae3ab500041cff629ffbc1997737ac"/><file name="Image.php" hash="fcf0be7f58f6511fde2c118a8d4ea597"/><file name="Logging.php" hash="bf8622cce3d8e2d0fb17567556c4738e"/><file name="Marketplace.php" hash="ba2fd4ff8f1ad92eb97b421ea9b3dfea"/><file name="Observer.php" hash="12d1711256c7a0aecd8db133e124c966"/><file name="Order.php" hash="72ef039c78491f2eecac02a23d1890cf"/><dir name="Product"><file name="Action.php" hash="6cc115390b3c2dea31d815734fdbd877"/></dir><file name="Question.php" hash="70c5328aaa0000e47da324224b0bcfc7"/><file name="Reply.php" hash="f5120fa047fee4c6309f9fd6134e0a66"/><dir name="Resource"><dir name="Buyerseller"><file name="Collection.php" hash="171123b4b345c8797d32656d5b10b0f4"/></dir><file name="Buyerseller.php" hash="af96d782600d62e16c0414b3e7b6b77c"/><dir name="Commission"><file name="Collection.php" hash="8831b90ceeba929aba53678661f1a4d0"/></dir><file name="Commission.php" hash="6174e0aa3de188e08e64c3eac8d30aae"/><file name="Customer.php" hash="d7eec6f62d2fe8df426e05a86fe3c87b"/><file name="Logging.php" hash="236c0ed167e1a51587c3c646cc87035b"/><dir name="Orderby"><file name="Collection.php" hash="b95af010b544db77453899f2c35fbc93"/></dir><dir name="Question"><file name="Collection.php" hash="ceaa1c3157d23db44b21367a07d29e2f"/></dir><file name="Question.php" hash="3b7da7902de11b74fd89a1c60ec3123a"/><dir name="Reply"><file name="Collection.php" hash="7f3d5dc190082a5464968f01133dc7fe"/></dir><file name="Reply.php" hash="a805231e4378b46ff6411590ad97f73c"/></dir><dir name="Seller"><dir name="Attribute"><dir name="Source"><dir name="Product"><file name="State.php" hash="f509894d6b3dc464d336231f0d029e4f"/><file name="Status.php" hash="ef3d748a92c4f9e779a96c27c54323a8"/></dir></dir></dir></dir><file name="Selleroptions.php" hash="988809c7376316bc220ca61ad6fdac6b"/><file name="Session.php" hash="fbaed1c6fe6b81e52ff52908144ed85f"/><dir name="Source"><file name="Option.php" hash="ceb28daee1e7b9b06c8c97286ceef513"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Product"><file name="State.php" hash="a459bf4e69b6e0cc8f9541879416a67c"/><file name="Status.php" hash="4885e5c457b55db3e77a9986901003bd"/><file name="Visibility.php" hash="920e27fdced9b2a1e104cf03b4ec9a21"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="AccountController.php" hash="3c52ac83e901eecfa701beef0d539fbc"/><dir name="Adminhtml"><dir name="Catalog"><file name="ProductController.php" hash="f104170160b914b2e0294e3adb4111b6"/></dir><file name="CommissionController.php" hash="76cb41bff619281f41a9b813fffbd491"/><file name="OrderbyController.php" hash="2d0f4ceec5edd61d71da1d58edd6258c"/><file name="SellerController.php" hash="dffe7c1f7465f0b13b0c6eab21dc2625"/></dir><file name="BuyersellerController.php" hash="1a48a933f0a2a793bf2b4fd3d6dce450"/><file name="DashboardController.php" hash="75715494f2f9c98586dc1207c1d1eb77"/><file name="OrderController.php" hash="9df4e21f147009f9385b4c1ac86acf72"/><file name="ProductController.php" hash="ce61ece09aa10d8eb422343250fc395e"/><file name="ProductquestionController.php" hash="a19c97e9f32009f0de3378c5c88c91ab"/><file name="SellerController.php" hash="d09843f2530b04beb4de6dda9fc9f913"/></dir><dir name="etc"><file name="adminhtml.xml" hash="a22533c081f75a33107bf413a5c126d2"/><file name="config.xml" hash="21ccf276778b2826e5ea71795abb599c"/><file name="system.xml" hash="c57321b1080cf5173c4abf84aa7089f7"/></dir><dir name="sql"><dir name="marketplace_setup"><file name="mysql4-install-0.1.0.php" hash="ea04496ea153372066413f594956d036"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="a6e712b4022636be2e6151d9e94303da"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="c930ac0f1591306c00a164f27e5fe465"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="9e212704951bf888dc2839c3802a4e6b"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="4e10d00e95f99efd9bdb4861770470f2"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="f3edd8e5643e3b46cc1793f0ceb0e02e"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="ea02b85b9dccde25899e4da9a1855e88"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="marketplace.xml" hash="f3ef021f0d374ff7cdd9d8871acaeca5"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="marketplace.xml" hash="d102088dd679a3935f1f3f1a770193a3"/></dir><dir name="template"><dir name="marketplace"><dir name="buyerseller"><file name="notify.phtml" hash="5b8972392844f0eee4c1cea3dade7a5b"/><file name="reply.phtml" hash="1bb6802be4b15c643f669cc2e93a5fc6"/><dir name="sales"><dir name="order"><file name="history.phtml" hash="e388f18c4e7ec27fa353a1761cf41494"/></dir></dir></dir><dir name="catalog"><dir name="product"><dir name="askquestion"><file name="form.phtml" hash="9e35a0dc033b0862c4f902568001598b"/><file name="link.phtml" hash="fe3de6946afa9f678786204ef6d9db29"/><file name="myquestions.phtml" hash="c466cd90d4151602ab3584d66cfcf0cd"/><file name="productquestions.phtml" hash="049c183e424e7898f4591f6720812409"/><file name="reply_form.phtml" hash="a57fb90ed343e54f10ddfae954bdb242"/></dir><dir name="view"><file name="sellerinfo.phtml" hash="a7f48203c66bca6989ea63a8f84dce44"/></dir><file name="view.phtml" hash="e0a332aaf00bf9d9bf5f26b412cd44e2"/></dir></dir><dir name="checkout"><dir name="cart"><dir name="item"><file name="default.phtml" hash="26da86d5981c83c4a029778b532eba34"/></dir></dir><dir name="multishipping"><dir name="item"><file name="default.phtml" hash="74ca10032cb2292f2a03c43d86815720"/></dir></dir><dir name="onepage"><dir name="review"><file name="item.phtml" hash="ad81267ad4a3f2ce54d273d4f4682e5d"/></dir></dir></dir><dir name="customer"><dir name="account"><dir name="myorders"><file name="items.phtml" hash="196d4801ccf3ecb8029bda3f331c1243"/><file name="shipitems.phtml" hash="6dae69b37e69e45c6f585f5f75502964"/></dir><file name="navigation.phtml" hash="2089d2c11c17fd4e20a395a3e36e453b"/><file name="print.phtml" hash="c1dad6031ce6703bfbfc8a4ff9194120"/><file name="selleroptions.phtml" hash="12242dc9e8a0fb537dbe2b96ed29d494"/><file name="shiporder.phtml" hash="bb391f6798bab85bba8780bf7f634a47"/><file name="vieworder.phtml" hash="69d2e1c041bf6d8db7fb744e8bce91cb"/></dir><dir name="form"><file name="edit.phtml" hash="2216870784f292873d25636253d344e0"/></dir></dir><dir name="dashboard"><file name="bestseller.phtml" hash="87352d5b3a90761aa26cb3ee6a0ea04e"/><file name="dashboard.phtml" hash="e3b228c43357fb121c920185fe837434"/><file name="myorders.phtml" hash="d6863530100ff501090f08407c104a1f"/><file name="notificationcount.phtml" hash="2253183ccf44910b769552c4427eab90"/><file name="questioncount.phtml" hash="a0c237a252be2264ec3c966106798771"/></dir><dir name="persistent"><dir name="customer"><dir name="form"><file name="register.phtml" hash="ffc7b0f318ae41515446d30928f50195"/></dir></dir></dir><dir name="product"><file name="add.phtml" hash="0923a8bbb0c1238eb7db33f43d20c889"/><file name="edit.phtml" hash="6cb3278a52abcc9fc4bc90440c319d3b"/><file name="grid.phtml" hash="fe28b864ce6c469dfa8e190da8357e43"/><file name="import.phtml" hash="3a923be5fea4d0f6eddd3b25e0cff1cc"/></dir><dir name="review"><dir name="product"><dir name="view"><file name="list.phtml" hash="b9d8091752efa906328a4a3f0a21e847"/></dir></dir></dir><dir name="sales"><dir name="myorder"><dir name="items"><dir name="renderer"><file name="default.phtml" hash="b61198dff58c6a5aa3e5e46578c0cbbe"/><dir name="ship"><file name="default.phtml" hash="0a0f509431c4a903ee060cacb3a43353"/></dir></dir></dir></dir><dir name="order"><file name="form.phtml" hash="71772f95673836ad608deacf58bdaf34"/><file name="history.phtml" hash="25427e4315e98427065bf3edc82217ef"/><dir name="items"><dir name="renderer"><file name="default.phtml" hash="8a7556035d32a504f270498c1d9e1aa3"/></dir></dir><file name="items.phtml" hash="2b0a0054f065f420ce8bdc24433ab94e"/></dir><file name="print.phtml" hash="50f7d2ff531b61a678a4d65123fbae91"/><file name="selleroptions.phtml" hash="389508e5804161be886069959a8770f2"/><file name="vieworder.phtml" hash="ef9810ecf4160961d139d9dab847a9b0"/></dir><dir name="seller"><dir name="account"><file name="myorders.phtml" hash="51696ea86d20d3306b2ef8be2fb5e8b0"/></dir><file name="info.phtml" hash="be6fb550752965d8bc44469acf92e75d"/><file name="logo.phtml" hash="e5755bd0399be0f3b16cfe8725e4341f"/><file name="ratings.phtml" hash="885779d8e85ff3fb8e3f1fe50cd18c7d"/><file name="seller_ratings.phtml" hash="7307d70ae60465825fc2a31fe9b2d4ad"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cybage_Marketplace.xml" hash="655674c415c4a30754d292b1b585f959"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="newseller_account.html" hash="298a277968587aa17dab9571d37f1116"/><file name="pendingorder_reminder.html" hash="7698d6a043afb5d2a52571a8e373b968"/><file name="seller_payment.html" hash="1b6350fdebfe1b496d03a164f616d415"/><file name="seller_status.html" hash="8b01d0a683d8fe1d4774fc32cdfb09a7"/><dir name="sales"><file name="customer_cancelled_new.html" hash="cbfe7cfa8307995aff1d35cadb62b910"/><file name="customer_completed_new.html" hash="afd8b01955854d0235aaa4e94a41dc87"/><file name="customer_processing_new.html" hash="3521f931be71816a0a6bc81d56d0961f"/><file name="product_comment.html" hash="e251a719323814263e9f84b12601b892"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="jquery"><file name="jquery-1.9.1.min.js" hash="993baffc269ef5414ec40f3d2de19294"/></dir><dir name="marketplace"><dir name="fancybox"><file name="jquery-1.7.2.min.js" hash="09bf7cb5fd333ee8c1c6be7475f85026"/><file name="jquery.fancybox-1.3.4.pack.js" hash="0b714d85fd5a4fe7625801f8d6e7ad57"/><file name="jquery.mousewheel-3.0.4.pack.js" hash="8ed7eaa3ff4d601639bfc1d594713957"/><file name="jquery.noconflict.js" hash="3179f2255b046d5f2e9a71e365287bef"/></dir><file name="nicEdit-latest.js.js" hash="46134bdf90c2e6279bb5efe7874a0ebc"/></dir></dir></target><target name="magemedia"><dir name="marketplace"><file name="productimport.csv" hash="7b0c8a1c0d5392371a49bda7badc1298"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="marketplace"><file name="jquery.fancybox-1.3.4.css" hash="0233ba7e3d8418cebf47fc9983f65e60"/><file name="styles.css" hash="30d9bc46cec97d7627b3fce3e595c009"/></dir></dir><dir name="images"><dir name="marketplace"><dir name="fancybox"><file name="blank.gif" hash="325472601571f31e1bf00674c368d335"/><file name="fancy_close.png" hash="6e2879a324a76e9972ebc98201aae1d8"/><file name="fancy_loading.png" hash="b1d54c240cf06e7f41e372d56919b738"/><file name="fancy_nav_left.png" hash="3f3e406102152cd8236383568a40ba35"/><file name="fancy_nav_right.png" hash="216e4bde5bddeeaa60dc3d692890a68e"/><file name="fancy_shadow_e.png" hash="fd4f491080d29fade5080877f1ba4c8b"/><file name="fancy_shadow_n.png" hash="18cde16379b2ceadef714d9b346d09ec"/><file name="fancy_shadow_ne.png" hash="63adf788acf193d4e4f3642d7d793125"/><file name="fancy_shadow_nw.png" hash="c820c878aedb7a7f9ebd7135a58e7c65"/><file name="fancy_shadow_s.png" hash="9b9e5c888028aaef40fe5b6a363f1e29"/><file name="fancy_shadow_se.png" hash="a8afd5a008884380ee712d177105268f"/><file name="fancy_shadow_sw.png" hash="f81cc0fee5581d76ad3cebe47e7e791b"/><file name="fancy_shadow_w.png" hash="59b0e63eb059e58d932cfd53da4d87e6"/><file name="fancy_title_left.png" hash="1582ac2d3bef6a6445bf02ceca2741cd"/><file name="fancy_title_main.png" hash="38dad6c1ed4bdc81c0bec721b2deb8c2"/><file name="fancy_title_over.png" hash="b886fd165d4b7ac77d41fb52d87ffc60"/><file name="fancy_title_right.png" hash="6cbe0c935511e7f9a2555ccb6a7324c4"/><file name="fancybox-x.png" hash="168696d8a694214090ef90e029cdf393"/><file name="fancybox-y.png" hash="36a58859beb9a6b19322a37466b9f78e"/><file name="fancybox.png" hash="11e57e492ee0311540967cc7a1e6e3e2"/></dir><file name="icon_export.gif" hash="9a13f20c6a17b41b9c357545c2da5636"/></dir></dir></dir></dir></dir></target></contents>
35
+ <compatible/>
36
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
37
+ </package>
skin/frontend/base/default/css/marketplace/jquery.fancybox-1.3.4.css ADDED
@@ -0,0 +1,506 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #fancybox-loading-overlay {
2
+ display: none;
3
+ background: none repeat scroll 0 0 #fff;
4
+ cursor: pointer;
5
+ height: 100%;
6
+ margin: 0 auto;
7
+ opacity: 0.7;
8
+ overflow: hidden;
9
+ position: fixed;
10
+ text-align: justify;
11
+ top: 0;
12
+ left: 0;
13
+ width: 100%;
14
+ z-index: 1103;
15
+ -moz-opacity:0.4;
16
+ filter:alpha(opacity=40);
17
+ }
18
+ #fancybox-loading {
19
+ background-image: url("../../images/marketplace/fancybox/fancy_loading.png");
20
+ cursor: pointer;
21
+ height: 39px;
22
+ left: 50%;
23
+ margin: 0 auto;
24
+ overflow: hidden;
25
+ position: fixed;
26
+ text-align: center;
27
+ top: 50%;
28
+ width: 38px;
29
+ z-index: 1104;
30
+ display: none;
31
+
32
+
33
+ box-shadow: 3px 3px 5px #666666;
34
+
35
+
36
+ }
37
+
38
+ #fancybox-loading span {
39
+ background-image: url("../../images/marketplace/fancybox/fancy_loading.png");
40
+ height: 29px;
41
+ left: 47%;
42
+ margin: 0 auto;
43
+ position: absolute;
44
+ top: 38%;
45
+ width: 35px;
46
+ }
47
+
48
+ #fancybox-overlay {
49
+ position: absolute;
50
+ top: 0;
51
+ left: 0;
52
+ width: 100%;
53
+ z-index: 1100;
54
+ display: none;
55
+ }
56
+
57
+ #fancybox-tmp {
58
+ padding: 0;
59
+ margin: 0;
60
+ border: 0;
61
+ overflow: auto;
62
+ display: none;
63
+ }
64
+
65
+ #fancybox-wrap {
66
+ position: absolute;
67
+ top: 0;
68
+ left: 0;
69
+ padding: 20px;
70
+ z-index: 1101;
71
+ outline: none;
72
+ display: none;
73
+ }
74
+
75
+ #fancybox-outer {
76
+ position: relative;
77
+ width: 100%;
78
+ height: 100%;
79
+ background: #fff;
80
+ }
81
+
82
+ #fancybox-content {
83
+ /* width: 0;
84
+ height: 0; */
85
+ padding: 0;
86
+ outline: none;
87
+ position: relative;
88
+ overflow: hidden;
89
+ z-index: 1102;
90
+ background: none repeat scroll 0 0 #FFFFFF;
91
+ border: 1px solid #999999;
92
+ border-radius: 5px 5px 5px 5px;
93
+ box-shadow: 3px 3px 5px #666666;
94
+ color: #333333;
95
+ font-size: 12px;
96
+ }
97
+
98
+
99
+
100
+ #fancybox-hide-sel-frame {
101
+ position: absolute;
102
+ top: 0;
103
+ left: 0;
104
+ width: 100%;
105
+ height: 100%;
106
+ background: transparent;
107
+ z-index: 1101;
108
+ }
109
+
110
+ #fancybox-close {
111
+ position: absolute;
112
+ top: 10px;
113
+ right: 10px;
114
+ width: 30px;
115
+ height: 30px;
116
+ background: transparent url('../../images/marketplace/fancybox/fancybox.png') -40px 0px;
117
+ cursor: pointer;
118
+ z-index: 1103;
119
+ display: none;
120
+ }
121
+
122
+ #fancybox-error {
123
+ color: #444;
124
+ font: normal 12px/20px Arial;
125
+ padding: 14px;
126
+ margin: 0;
127
+ }
128
+
129
+ #fancybox-img {
130
+ width: 100%;
131
+ height: 100%;
132
+ padding: 0;
133
+ margin: 0;
134
+ border: none;
135
+ outline: none;
136
+ line-height: 0;
137
+ vertical-align: top;
138
+ }
139
+
140
+ #fancybox-frame {
141
+ width: 100%;
142
+ height: 100%;
143
+ border: none;
144
+ display: block;
145
+ }
146
+
147
+ #fancybox-left, #fancybox-right {
148
+ position: absolute;
149
+ bottom: 0px;
150
+ height: 100%;
151
+ width: 35%;
152
+ cursor: pointer;
153
+ outline: none;
154
+ background: transparent url('../../images/marketplace/fancybox/blank.gif');
155
+ z-index: 1102;
156
+ display: none;
157
+ }
158
+
159
+ #fancybox-left {
160
+ left: 0px;
161
+ }
162
+
163
+ #fancybox-right {
164
+ right: 0px;
165
+ }
166
+
167
+ #fancybox-left-ico, #fancybox-right-ico {
168
+ position: absolute;
169
+ top: 50%;
170
+ left: -9999px;
171
+ width: 30px;
172
+ height: 30px;
173
+ margin-top: -15px;
174
+ cursor: pointer;
175
+ z-index: 1102;
176
+ display: block;
177
+ }
178
+
179
+ #fancybox-left-ico {
180
+ background-image: url('../../images/marketplace/fancybox/fancybox.png');
181
+ background-position: -40px -30px;
182
+ }
183
+
184
+ #fancybox-right-ico {
185
+ background-image: url('../../images/marketplace/fancybox/fancybox.png');
186
+ background-position: -40px -60px;
187
+ }
188
+
189
+ #fancybox-left:hover, #fancybox-right:hover {
190
+ visibility: visible; /* IE6 */
191
+ }
192
+
193
+ #fancybox-left:hover span {
194
+ left: 20px;
195
+ }
196
+
197
+ #fancybox-right:hover span {
198
+ left: auto;
199
+ right: 20px;
200
+ }
201
+
202
+ .fancybox-bg {
203
+ position: absolute;
204
+ padding: 0;
205
+ margin: 0;
206
+ border: 0;
207
+ width: 20px;
208
+ height: 20px;
209
+ z-index: 1001;
210
+ }
211
+
212
+ #fancybox-bg-n {
213
+ top: -20px;
214
+ left: 0;
215
+ width: 100%;
216
+ background-image: url('../../images/marketplace/fancybox/fancybox-x.png');
217
+ }
218
+
219
+ #fancybox-bg-ne {
220
+ top: -20px;
221
+ right: -20px;
222
+ background-image: url('../../images/marketplace/fancybox/fancybox.png');
223
+ background-position: -40px -162px;
224
+ }
225
+
226
+ #fancybox-bg-e {
227
+ top: 0;
228
+ right: -20px;
229
+ height: 100%;
230
+ background-image: url('../../images/marketplace/fancybox/fancybox-y.png');
231
+ background-position: -20px 0px;
232
+ }
233
+
234
+ #fancybox-bg-se {
235
+ bottom: -20px;
236
+ right: -20px;
237
+ background-image: url('../../images/marketplace/fancybox/fancybox.png');
238
+ background-position: -40px -182px;
239
+ }
240
+
241
+ #fancybox-bg-s {
242
+ bottom: -20px;
243
+ left: 0;
244
+ width: 100%;
245
+ background-image: url('../../images/marketplace/fancybox/fancybox-x.png');
246
+ background-position: 0px -20px;
247
+ }
248
+
249
+ #fancybox-bg-sw {
250
+ bottom: -20px;
251
+ left: -20px;
252
+ background-image: url('../../images/marketplace/fancybox/fancybox.png');
253
+ background-position: -40px -142px;
254
+ }
255
+
256
+ #fancybox-bg-w {
257
+ top: 0;
258
+ left: -20px;
259
+ height: 100%;
260
+ background-image: url('../../images/marketplace/fancybox/fancybox-y.png');
261
+ }
262
+
263
+ #fancybox-bg-nw {
264
+ top: -20px;
265
+ left: -20px;
266
+ background-image: url('../../images/marketplace/fancybox/fancybox.png');
267
+ background-position: -40px -122px;
268
+ }
269
+
270
+ #fancybox-title {
271
+ font-family: Helvetica;
272
+ font-size: 12px;
273
+ z-index: 1102;
274
+ }
275
+
276
+ .fancybox-title-inside {
277
+ padding-bottom: 10px;
278
+ text-align: center;
279
+ color: #333;
280
+ background: #fff;
281
+ position: relative;
282
+ }
283
+
284
+ .fancybox-title-outside {
285
+ padding-top: 10px;
286
+ color: #fff;
287
+ }
288
+
289
+ .fancybox-title-over {
290
+ position: absolute;
291
+ bottom: 0;
292
+ left: 0;
293
+ color: #FFF;
294
+ text-align: left;
295
+ }
296
+
297
+ #fancybox-title-over {
298
+ padding: 10px;
299
+ background-image: url('../../images/marketplace/fancybox/fancy_title_over.png');
300
+ display: block;
301
+ }
302
+
303
+ .fancybox-title-float {
304
+ position: absolute;
305
+ left: 0;
306
+ bottom: -20px;
307
+ height: 32px;
308
+ }
309
+
310
+ #fancybox-title-float-wrap {
311
+ border: none;
312
+ border-collapse: collapse;
313
+ width: auto;
314
+ }
315
+
316
+ #fancybox-title-float-wrap td {
317
+ border: none;
318
+ white-space: nowrap;
319
+ }
320
+
321
+ #fancybox-title-float-left {
322
+ padding: 0 0 0 15px;
323
+ background: url('../../images/marketplace/fancybox/fancybox.png') -40px -90px no-repeat;
324
+ }
325
+
326
+ #fancybox-title-float-main {
327
+ color: #FFF;
328
+ line-height: 29px;
329
+ font-weight: bold;
330
+ padding: 0 0 3px 0;
331
+ background: url('../../images/marketplace/fancybox/fancybox-x.png') 0px -40px;
332
+ }
333
+
334
+ #fancybox-title-float-right {
335
+ padding: 0 0 0 15px;
336
+ background: url('../../images/marketplace/fancybox/fancybox.png') -55px -90px no-repeat;
337
+ }
338
+
339
+ /* IE6 */
340
+
341
+ .fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_close.png', sizingMethod='scale'); }
342
+
343
+ .fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_nav_left.png', sizingMethod='scale'); }
344
+ .fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_nav_right.png', sizingMethod='scale'); }
345
+
346
+ .fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
347
+ .fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_title_left.png', sizingMethod='scale'); }
348
+ .fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_title_main.png', sizingMethod='scale'); }
349
+ .fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_title_right.png', sizingMethod='scale'); }
350
+
351
+ .fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
352
+ height: expression(this.parentNode.clientHeight + "px");
353
+ }
354
+
355
+ #fancybox-loading.fancybox-ie6 {
356
+ position: absolute; margin-top: 0;
357
+ top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
358
+ }
359
+
360
+ #fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_loading.png', sizingMethod='scale'); }
361
+
362
+ /* IE6, IE7, IE8 */
363
+ .fancybox-ie { width: 615px !important; height: auto;}
364
+ .fancybox-ie .fancybox-bg { background: transparent !important; }
365
+
366
+ .fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
367
+ .fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
368
+ .fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
369
+ .fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
370
+ .fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
371
+ .fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
372
+ .fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
373
+ .fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/marketplace/fancybox/fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }
374
+ .fancybox-ie #fancybox-content { width: 595px !important;}
375
+
376
+ #fancybox-content .quickview-index-view {
377
+ background: none repeat scroll 0 0 #FFFFFF;
378
+ }
379
+
380
+ /* zoom */
381
+ .cloud-zoom-lens {
382
+ border: 4px solid #888;
383
+ margin:-4px; /* Set this to minus the border thickness. */
384
+ background-color:#fff;
385
+ cursor:move;
386
+ z-index: 999999;
387
+ position:absolute !important;
388
+ width: 50px;
389
+ height: 50px;
390
+ }
391
+
392
+ /* This is for the title text. */
393
+ .cloud-zoom-title {
394
+ font-family:Arial, Helvetica, sans-serif;
395
+ position:absolute !important;
396
+ background-color:#000;
397
+ color:#fff;
398
+ padding:3px;
399
+ width:100%;
400
+ text-align:center;
401
+ font-weight:bold;
402
+ font-size:10px;
403
+ top:0px;
404
+ }
405
+
406
+ /* This is the zoom window. */
407
+ .cloud-zoom-big {
408
+ border: 5px solid white;
409
+ -moz-box-shadow: 1px 1px 3px #555;
410
+ -webkit-box-shadow: 1px 1px 3px #555;
411
+ box-shadow: 1px 1px 3px #555;
412
+ /* z-index: 9999999999999 !important;
413
+ position: fixed !important;
414
+ left: 417px !important;
415
+ top: 38px !important; */
416
+ }
417
+ /* This is the loading message. */
418
+ .cloud-zoom-loading { color:white; background:#222; padding:3px; border:1px solid #000;}
419
+
420
+ .mousetrap{ width: 265px !important; height: 265px !important;}
421
+ #fancybox-content .product-collateral { background: none repeat scroll 0 0 #FFFFFF;height: 0;width: 0;padding: 0;margin: 0;}
422
+ #fancybox-content .product-essentia