Version Notes
MineWhat magento plugin
Download this release
Release Info
Developer | MineWhat Inc. |
Extension | minewhat |
Version | 1.0.18 |
Comparing to | |
See all releases |
Code changes from version 1.0.16 to 1.0.18
- app/code/community/MineWhat/Insights/Block/Event/Checkout/Onepage/Success.php +76 -60
- app/code/community/MineWhat/Insights/controllers/ApiController.php +71 -31
- app/design/frontend/base/default/layout/minewhat_insights.xml +7 -4
- app/design/frontend/base/default/template/minewhat/insights/list.phtml +72 -0
- app/design/frontend/base/default/template/minewhat/insights/list/toolbar.phtml +99 -0
- app/design/frontend/base/default/template/minewhat/insights/view.phtml +42 -0
- app/design/frontend/base/default/template/minewhat/insights/view/featured.phtml +79 -0
- app/design/frontend/base/default/template/minewhat/insights/view/list.phtml +132 -0
- app/design/frontend/default/default/layout/minewhat_insights.xml +7 -4
- package.xml +4 -4
app/code/community/MineWhat/Insights/Block/Event/Checkout/Onepage/Success.php
CHANGED
@@ -14,89 +14,105 @@ class MineWhat_Insights_Block_Event_Checkout_Onepage_Success extends Mage_Core_B
|
|
14 |
}
|
15 |
|
16 |
public function getOrderInfo() {
|
17 |
-
|
|
|
18 |
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
|
23 |
-
if ($order && $order->getId()) {
|
24 |
-
|
25 |
-
$orderInfo['items'] = array();
|
26 |
|
27 |
-
|
28 |
|
29 |
-
|
30 |
|
31 |
-
|
32 |
|
33 |
-
|
34 |
-
'id' => $item->getProductId(),
|
35 |
-
'parentId' => '',
|
36 |
-
'sku' => $item->getSku(),
|
37 |
-
'qty' => $item->getQtyOrdered(),
|
38 |
-
'price' => $item->getPrice(),
|
39 |
-
'bundle' => array()
|
40 |
-
);
|
41 |
|
42 |
-
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
);
|
52 |
-
$bundleItems[] = $bundleItem;
|
53 |
-
$orderInfo['items'][$item->getParentItemId()]['bundle'] = $bundleItems;
|
54 |
-
|
55 |
-
} else {
|
56 |
-
|
57 |
-
$parentId = '';
|
58 |
-
$parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($item->getProductId());
|
59 |
-
if($parentIds != null && count($parentIds) > 0) {
|
60 |
-
$parentId = $parentIds[0];
|
61 |
-
}
|
62 |
-
$orderInfo['items'][] = array(
|
63 |
-
'id' => $item->getProductId(),
|
64 |
-
'parentId' => $parentId,
|
65 |
-
'sku' => $item->getSku(),
|
66 |
-
'qty' => $item->getQtyOrdered(),
|
67 |
-
'price' => $item->getPrice(),
|
68 |
-
'bundle' => array()
|
69 |
);
|
70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
}
|
73 |
-
|
74 |
-
}
|
75 |
|
76 |
-
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
|
89 |
-
|
90 |
-
|
|
|
|
|
91 |
|
92 |
return null;
|
93 |
}
|
94 |
|
95 |
protected function _toHtml() {
|
96 |
-
if (!$this->helper('minewhat_insights')->isModuleOutputEnabled()) {
|
97 |
return '';
|
98 |
}
|
99 |
return parent::_toHtml();
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
}
|
14 |
}
|
15 |
|
16 |
public function getOrderInfo() {
|
17 |
+
try {
|
18 |
+
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
19 |
|
20 |
+
$order = Mage::getSingleton('sales/order');
|
21 |
+
$order->load($lastOrderId);
|
22 |
|
|
|
|
|
|
|
|
|
23 |
|
24 |
+
if ($order && $order->getId()) {
|
25 |
|
26 |
+
$orderInfo['items'] = array();
|
27 |
|
28 |
+
$orderedItems = $order->getAllItems();
|
29 |
|
30 |
+
foreach($orderedItems as $item) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
+
if($item->getProductType() == "bundle") {
|
33 |
|
34 |
+
$orderInfo['items'][$item->getItemId()] = array(
|
35 |
+
'id' => $item->getProductId(),
|
36 |
+
'parentId' => '',
|
37 |
+
'sku' => $item->getSku(),
|
38 |
+
'qty' => $item->getQtyOrdered(),
|
39 |
+
'price' => $item->getPrice(),
|
40 |
+
'bundle' => array()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
);
|
42 |
|
43 |
+
} else if($item->getProductType() != "configurable") {
|
44 |
+
|
45 |
+
if($orderInfo['items'][$item->getParentItemId()] != null) {
|
46 |
+
$bundleItems = $orderInfo['items'][$item->getParentItemId()]['bundle'];
|
47 |
+
$bundleItem = array(
|
48 |
+
'pid' => $item->getProductId(),
|
49 |
+
'sku' => $item->getSku(),
|
50 |
+
'qty' => $item->getQtyOrdered(),
|
51 |
+
'price' => $item->getPrice()
|
52 |
+
);
|
53 |
+
$bundleItems[] = $bundleItem;
|
54 |
+
$orderInfo['items'][$item->getParentItemId()]['bundle'] = $bundleItems;
|
55 |
+
|
56 |
+
} else {
|
57 |
+
|
58 |
+
$parentId = '';
|
59 |
+
$parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($item->getProductId());
|
60 |
+
if($parentIds != null && count($parentIds) > 0) {
|
61 |
+
$parentId = $parentIds[0];
|
62 |
+
}
|
63 |
+
$orderInfo['items'][] = array(
|
64 |
+
'id' => $item->getProductId(),
|
65 |
+
'parentId' => $parentId,
|
66 |
+
'sku' => $item->getSku(),
|
67 |
+
'qty' => $item->getQtyOrdered(),
|
68 |
+
'price' => $item->getPrice(),
|
69 |
+
'bundle' => array()
|
70 |
+
);
|
71 |
+
|
72 |
+
|
73 |
+
}
|
74 |
|
75 |
}
|
|
|
|
|
76 |
|
77 |
+
}
|
78 |
|
79 |
+
$orderInfo['orderId'] = $order->getIncrementId();
|
80 |
+
$orderInfo['email'] = $order->getCustomerEmail();
|
81 |
+
$orderInfo['createdAt'] = $order->getCreatedAt();
|
82 |
|
83 |
+
$currency = $order->getOrderCurrency();
|
84 |
+
if (is_object($currency)) {
|
85 |
+
$orderInfo['currency'] = $currency->getCurrencyCode();
|
86 |
+
}
|
87 |
+
$paymentMethod = $order->getPayment()->getMethodInstance()->getTitle();
|
88 |
+
$orderInfo['paymentMethod'] = $paymentMethod;
|
89 |
|
90 |
+
return $orderInfo;
|
91 |
+
}
|
92 |
+
} catch (Exception $e) {}
|
93 |
+
|
94 |
|
95 |
return null;
|
96 |
}
|
97 |
|
98 |
protected function _toHtml() {
|
99 |
+
if (!$this->helper('minewhat_insights')->isModuleOutputEnabled() || !$this->isOrderConfirmation()) {
|
100 |
return '';
|
101 |
}
|
102 |
return parent::_toHtml();
|
103 |
+
}
|
104 |
+
|
105 |
+
protected function isOrderConfirmation() {
|
106 |
+
return strpos($this->_getRouteName(), 'checkout') !== false
|
107 |
+
&& $this->_getActionName() == 'success';
|
108 |
+
}
|
109 |
+
|
110 |
+
protected function _getRouteName() {
|
111 |
+
return $this->getRequest()->getRequestedRouteName();
|
112 |
+
}
|
113 |
+
|
114 |
+
protected function _getActionName() {
|
115 |
+
return $this->getRequest()->getRequestedActionName();
|
116 |
+
}
|
117 |
|
118 |
}
|
app/code/community/MineWhat/Insights/controllers/ApiController.php
CHANGED
@@ -52,7 +52,7 @@ class MineWhat_Insights_ApiController extends Mage_Core_Controller_Front_Action
|
|
52 |
}
|
53 |
|
54 |
return true;
|
55 |
-
|
56 |
}
|
57 |
|
58 |
public function ordersAction() {
|
@@ -65,31 +65,54 @@ class MineWhat_Insights_ApiController extends Mage_Core_Controller_Front_Action
|
|
65 |
|
66 |
$sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
|
67 |
|
68 |
-
|
69 |
if(isset($sections[3])) {
|
70 |
// Looking for a specific order
|
71 |
$orderId = $sections[3];
|
72 |
-
|
73 |
$order = Mage::getModel('sales/order')->load($orderId, 'increment_id');
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
$items = array();
|
76 |
-
|
77 |
$orderItems = $order->getItemsCollection()->load();
|
78 |
-
|
79 |
foreach($orderItems as $key => $orderItem) {
|
80 |
$items[] = array(
|
81 |
'name' => $orderItem->getName(),
|
82 |
'pid' => $orderItem->getProductId(),
|
83 |
'sku' => $orderItem->getSku(),
|
84 |
'qty' => $orderItem->getQtyOrdered(),
|
85 |
-
'price' => $orderItem->getPrice()
|
86 |
);
|
87 |
}
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
$this->getResponse()
|
90 |
-
->setBody(json_encode(
|
91 |
->setHttpResponseCode(200)
|
92 |
-
->setHeader('Content-type', 'application/json', true);
|
93 |
} else {
|
94 |
// Looking for a list of orders
|
95 |
$currentTime = time();
|
@@ -148,7 +171,7 @@ class MineWhat_Insights_ApiController extends Mage_Core_Controller_Front_Action
|
|
148 |
$attributes = array(
|
149 |
'name',
|
150 |
'sku',
|
151 |
-
'image',
|
152 |
'manufacturer',
|
153 |
'price',
|
154 |
'final_price',
|
@@ -157,7 +180,7 @@ class MineWhat_Insights_ApiController extends Mage_Core_Controller_Front_Action
|
|
157 |
);
|
158 |
|
159 |
$extras = $this->getRequest()->getParam('extras');
|
160 |
-
$
|
161 |
if($extras && strlen($extras)) {
|
162 |
$extras = explode(',', $extras);
|
163 |
for($i = 0;$i < sizeof($extras);$i++) {
|
@@ -172,7 +195,7 @@ class MineWhat_Insights_ApiController extends Mage_Core_Controller_Front_Action
|
|
172 |
|
173 |
$product = Mage::getModel('catalog/product')->load($productId);
|
174 |
|
175 |
-
$product = $this->getFormatedProduct($product, $extras, $
|
176 |
if($product !== null) {
|
177 |
$products[] = $product;
|
178 |
}
|
@@ -189,10 +212,10 @@ class MineWhat_Insights_ApiController extends Mage_Core_Controller_Front_Action
|
|
189 |
;
|
190 |
|
191 |
foreach($productsCollection as $product) {
|
192 |
-
$product = $this->getFormatedProduct($product, $extras, $
|
193 |
if($product !== null) {
|
194 |
$products[] = $product;
|
195 |
-
}
|
196 |
}
|
197 |
|
198 |
}
|
@@ -203,7 +226,7 @@ class MineWhat_Insights_ApiController extends Mage_Core_Controller_Front_Action
|
|
203 |
->setBody(json_encode(array('products' => $products, 'currency' => $currency)))
|
204 |
->setHttpResponseCode(200)
|
205 |
->setHeader('Content-type', 'application/json', true);
|
206 |
-
|
207 |
|
208 |
} catch(Exception $e) {
|
209 |
$this->getResponse()
|
@@ -211,7 +234,7 @@ class MineWhat_Insights_ApiController extends Mage_Core_Controller_Front_Action
|
|
211 |
->setHttpResponseCode(500)
|
212 |
->setHeader('Content-type', 'application/json', true);
|
213 |
}
|
214 |
-
|
215 |
return $this;
|
216 |
|
217 |
}
|
@@ -226,26 +249,41 @@ class MineWhat_Insights_ApiController extends Mage_Core_Controller_Front_Action
|
|
226 |
}
|
227 |
|
228 |
$productId = $this->getRequest()->getParam('pid');
|
229 |
-
|
|
|
230 |
|
231 |
if(!$productId || strlen($productId) <= 0) {
|
232 |
-
|
233 |
$this->getResponse()
|
234 |
->setBody(json_encode(array('status' => 'error', 'message' => 'product id required')))
|
235 |
->setHttpResponseCode(500)
|
236 |
-
->setHeader('Content-type', 'application/json', true);
|
237 |
|
238 |
} else {
|
239 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
// get stock info
|
241 |
$stockObj = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);
|
|
|
242 |
$stock = $stockObj->getQty();
|
243 |
-
|
244 |
$this->getResponse()
|
245 |
->setBody(json_encode(array('id' => $productId, 'stock' => $stock)))
|
246 |
->setHttpResponseCode(200)
|
247 |
-
->setHeader('Content-type', 'application/json', true);
|
248 |
-
|
249 |
}
|
250 |
|
251 |
} catch(Exception $e) {
|
@@ -254,13 +292,13 @@ class MineWhat_Insights_ApiController extends Mage_Core_Controller_Front_Action
|
|
254 |
->setHttpResponseCode(500)
|
255 |
->setHeader('Content-type', 'application/json', true);
|
256 |
}
|
257 |
-
|
258 |
return $this;
|
259 |
|
260 |
}
|
261 |
|
262 |
|
263 |
-
private function getFormatedProduct($product, $extras, $
|
264 |
|
265 |
$formatedProduct = null;
|
266 |
|
@@ -273,29 +311,31 @@ class MineWhat_Insights_ApiController extends Mage_Core_Controller_Front_Action
|
|
273 |
'manufacturer' => $product->getAttributeText('manufacturer'),
|
274 |
'price' => $product->getPrice(),
|
275 |
'final_price' => $product->getFinalPrice(),
|
276 |
-
'special_price' => $product->getSpecialPrice(),
|
277 |
'image' => $product->getImageUrl(),
|
278 |
'url' => $product->getProductUrl(),
|
279 |
'info' => $product->getShortDescription(),
|
280 |
'status' => $product->getStatus(),
|
281 |
-
|
|
|
|
|
282 |
);
|
283 |
if(!$formatedProduct['manufacturer'] || strlen($formatedProduct['manufacturer']) === 0) {
|
284 |
$product = Mage::getModel('catalog/product')->load($product->getId());
|
285 |
$formatedProduct['manufacturer'] = $product->getAttributeText('manufacturer');
|
286 |
}
|
287 |
|
288 |
-
|
289 |
// get associated product ids
|
290 |
$associatedProducts = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($formatedProduct['id']);
|
291 |
-
$formatedProduct['associated_products'] = $associatedProducts;
|
292 |
}
|
293 |
|
294 |
// get stock info
|
295 |
$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);
|
296 |
$formatedProduct['stock'] = $stock->getQty();
|
297 |
|
298 |
-
if($
|
299 |
$attributes = $product->getAttributes();
|
300 |
foreach($attributes as $key => $value) {
|
301 |
$formatedProduct['extras'][$key] = $product->getAttributeText($key);
|
@@ -309,11 +349,11 @@ class MineWhat_Insights_ApiController extends Mage_Core_Controller_Front_Action
|
|
309 |
$categories = $product->getCategoryCollection()->addAttributeToSelect('name');
|
310 |
foreach($categories as $category) {
|
311 |
$formatedProduct['cat'][] = $category->getName();
|
312 |
-
}
|
313 |
} catch(Exception $e) {}
|
314 |
|
315 |
return $formatedProduct;
|
316 |
|
317 |
}
|
318 |
-
|
319 |
}
|
52 |
}
|
53 |
|
54 |
return true;
|
55 |
+
|
56 |
}
|
57 |
|
58 |
public function ordersAction() {
|
65 |
|
66 |
$sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
|
67 |
|
|
|
68 |
if(isset($sections[3])) {
|
69 |
// Looking for a specific order
|
70 |
$orderId = $sections[3];
|
71 |
+
|
72 |
$order = Mage::getModel('sales/order')->load($orderId, 'increment_id');
|
73 |
+
|
74 |
+
$extras = $this->getRequest()->getParam('extras');
|
75 |
+
$debug = $this->getRequest()->getParam('debug', 'false') === 'true';
|
76 |
+
if($extras && strlen($extras)) {
|
77 |
+
$extras = explode(',', $extras);
|
78 |
+
for($i = 0;$i < sizeof($extras);$i++) {
|
79 |
+
$extras[$i] = trim($extras[$i]);
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
$items = array();
|
84 |
+
|
85 |
$orderItems = $order->getItemsCollection()->load();
|
86 |
+
|
87 |
foreach($orderItems as $key => $orderItem) {
|
88 |
$items[] = array(
|
89 |
'name' => $orderItem->getName(),
|
90 |
'pid' => $orderItem->getProductId(),
|
91 |
'sku' => $orderItem->getSku(),
|
92 |
'qty' => $orderItem->getQtyOrdered(),
|
93 |
+
'price' => $orderItem->getPrice()
|
94 |
);
|
95 |
}
|
96 |
|
97 |
+
$responseObj = array(
|
98 |
+
'order_id' => $orderId,
|
99 |
+
'items' => $items,
|
100 |
+
'ip' => $order->getRemoteIp()
|
101 |
+
);
|
102 |
+
|
103 |
+
$attributes = $order->debug();
|
104 |
+
if($debug) {
|
105 |
+
$responseObj['extras'] = $attributes;
|
106 |
+
} else {
|
107 |
+
foreach($extras as $key) {
|
108 |
+
$responseObj['extras'][$key] = $attributes[$key];
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
$this->getResponse()
|
113 |
+
->setBody(json_encode($responseObj))
|
114 |
->setHttpResponseCode(200)
|
115 |
+
->setHeader('Content-type', 'application/json', true);
|
116 |
} else {
|
117 |
// Looking for a list of orders
|
118 |
$currentTime = time();
|
171 |
$attributes = array(
|
172 |
'name',
|
173 |
'sku',
|
174 |
+
'image',
|
175 |
'manufacturer',
|
176 |
'price',
|
177 |
'final_price',
|
180 |
);
|
181 |
|
182 |
$extras = $this->getRequest()->getParam('extras');
|
183 |
+
$debug = $this->getRequest()->getParam('debug', 'false') === 'true';
|
184 |
if($extras && strlen($extras)) {
|
185 |
$extras = explode(',', $extras);
|
186 |
for($i = 0;$i < sizeof($extras);$i++) {
|
195 |
|
196 |
$product = Mage::getModel('catalog/product')->load($productId);
|
197 |
|
198 |
+
$product = $this->getFormatedProduct($product, $extras, $debug);
|
199 |
if($product !== null) {
|
200 |
$products[] = $product;
|
201 |
}
|
212 |
;
|
213 |
|
214 |
foreach($productsCollection as $product) {
|
215 |
+
$product = $this->getFormatedProduct($product, $extras, $debug);
|
216 |
if($product !== null) {
|
217 |
$products[] = $product;
|
218 |
+
}
|
219 |
}
|
220 |
|
221 |
}
|
226 |
->setBody(json_encode(array('products' => $products, 'currency' => $currency)))
|
227 |
->setHttpResponseCode(200)
|
228 |
->setHeader('Content-type', 'application/json', true);
|
229 |
+
|
230 |
|
231 |
} catch(Exception $e) {
|
232 |
$this->getResponse()
|
234 |
->setHttpResponseCode(500)
|
235 |
->setHeader('Content-type', 'application/json', true);
|
236 |
}
|
237 |
+
|
238 |
return $this;
|
239 |
|
240 |
}
|
249 |
}
|
250 |
|
251 |
$productId = $this->getRequest()->getParam('pid');
|
252 |
+
$sku = $this->getRequest()->getParam('sku', 'false') === 'true';
|
253 |
+
|
254 |
|
255 |
if(!$productId || strlen($productId) <= 0) {
|
256 |
+
|
257 |
$this->getResponse()
|
258 |
->setBody(json_encode(array('status' => 'error', 'message' => 'product id required')))
|
259 |
->setHttpResponseCode(500)
|
260 |
+
->setHeader('Content-type', 'application/json', true);
|
261 |
|
262 |
} else {
|
263 |
|
264 |
+
// load product if sku is given
|
265 |
+
if($sku) {
|
266 |
+
$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $productId);
|
267 |
+
if($product == null) {
|
268 |
+
$this->getResponse()
|
269 |
+
->setBody(json_encode(array('status' => 'error', 'message' => 'invalid sku')))
|
270 |
+
->setHttpResponseCode(500)
|
271 |
+
->setHeader('Content-type', 'application/json', true);
|
272 |
+
return $this;
|
273 |
+
}
|
274 |
+
$productId = $product->getId();
|
275 |
+
}
|
276 |
+
|
277 |
// get stock info
|
278 |
$stockObj = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);
|
279 |
+
|
280 |
$stock = $stockObj->getQty();
|
281 |
+
|
282 |
$this->getResponse()
|
283 |
->setBody(json_encode(array('id' => $productId, 'stock' => $stock)))
|
284 |
->setHttpResponseCode(200)
|
285 |
+
->setHeader('Content-type', 'application/json', true);
|
286 |
+
|
287 |
}
|
288 |
|
289 |
} catch(Exception $e) {
|
292 |
->setHttpResponseCode(500)
|
293 |
->setHeader('Content-type', 'application/json', true);
|
294 |
}
|
295 |
+
|
296 |
return $this;
|
297 |
|
298 |
}
|
299 |
|
300 |
|
301 |
+
private function getFormatedProduct($product, $extras, $debug) {
|
302 |
|
303 |
$formatedProduct = null;
|
304 |
|
311 |
'manufacturer' => $product->getAttributeText('manufacturer'),
|
312 |
'price' => $product->getPrice(),
|
313 |
'final_price' => $product->getFinalPrice(),
|
314 |
+
'special_price' => $product->getSpecialPrice(),
|
315 |
'image' => $product->getImageUrl(),
|
316 |
'url' => $product->getProductUrl(),
|
317 |
'info' => $product->getShortDescription(),
|
318 |
'status' => $product->getStatus(),
|
319 |
+
'type' => $product->getTypeId(),
|
320 |
+
'created_at' => $product->getCreatedAt(),
|
321 |
+
'updated_at' => $product->getUpdatedAt()
|
322 |
);
|
323 |
if(!$formatedProduct['manufacturer'] || strlen($formatedProduct['manufacturer']) === 0) {
|
324 |
$product = Mage::getModel('catalog/product')->load($product->getId());
|
325 |
$formatedProduct['manufacturer'] = $product->getAttributeText('manufacturer');
|
326 |
}
|
327 |
|
328 |
+
if($formatedProduct['type'] == "configurable") {
|
329 |
// get associated product ids
|
330 |
$associatedProducts = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($formatedProduct['id']);
|
331 |
+
$formatedProduct['associated_products'] = $associatedProducts;
|
332 |
}
|
333 |
|
334 |
// get stock info
|
335 |
$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);
|
336 |
$formatedProduct['stock'] = $stock->getQty();
|
337 |
|
338 |
+
if($debug) {
|
339 |
$attributes = $product->getAttributes();
|
340 |
foreach($attributes as $key => $value) {
|
341 |
$formatedProduct['extras'][$key] = $product->getAttributeText($key);
|
349 |
$categories = $product->getCategoryCollection()->addAttributeToSelect('name');
|
350 |
foreach($categories as $category) {
|
351 |
$formatedProduct['cat'][] = $category->getName();
|
352 |
+
}
|
353 |
} catch(Exception $e) {}
|
354 |
|
355 |
return $formatedProduct;
|
356 |
|
357 |
}
|
358 |
+
|
359 |
}
|
app/design/frontend/base/default/layout/minewhat_insights.xml
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
*/
|
9 |
-->
|
10 |
<layout version="0.1.0">
|
11 |
-
|
12 |
<catalog_product_view>
|
13 |
<reference name="head">
|
14 |
<block type="minewhat_insights/event_catalog_product_view" name="minewhat_insights_event_catalog_product_view" />
|
@@ -21,16 +21,19 @@
|
|
21 |
</reference>
|
22 |
</checkout_cart_index>
|
23 |
|
24 |
-
<checkout_onepage_success>
|
25 |
<reference name="head">
|
26 |
<block type="minewhat_insights/event_checkout_onepage_success" name="minewhat_insights_event_checkout_onepage_success" />
|
27 |
</reference>
|
28 |
-
</checkout_onepage_success>
|
29 |
|
30 |
<default>
|
31 |
<reference name="head">
|
32 |
<block type="minewhat_insights/base_script" name="minewhat_insights_base_script" />
|
33 |
</reference>
|
34 |
-
|
|
|
|
|
|
|
35 |
|
36 |
</layout>
|
8 |
*/
|
9 |
-->
|
10 |
<layout version="0.1.0">
|
11 |
+
|
12 |
<catalog_product_view>
|
13 |
<reference name="head">
|
14 |
<block type="minewhat_insights/event_catalog_product_view" name="minewhat_insights_event_catalog_product_view" />
|
21 |
</reference>
|
22 |
</checkout_cart_index>
|
23 |
|
24 |
+
<!-- <checkout_onepage_success>
|
25 |
<reference name="head">
|
26 |
<block type="minewhat_insights/event_checkout_onepage_success" name="minewhat_insights_event_checkout_onepage_success" />
|
27 |
</reference>
|
28 |
+
</checkout_onepage_success> -->
|
29 |
|
30 |
<default>
|
31 |
<reference name="head">
|
32 |
<block type="minewhat_insights/base_script" name="minewhat_insights_base_script" />
|
33 |
</reference>
|
34 |
+
<reference name="head">
|
35 |
+
<block type="minewhat_insights/event_checkout_onepage_success" name="minewhat_insights_event_checkout_onepage_success" />
|
36 |
+
</reference>
|
37 |
+
</default>
|
38 |
|
39 |
</layout>
|
app/design/frontend/base/default/template/minewhat/insights/list.phtml
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* zeonsolutions inc.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.zeonsolutions.com/shop/license-community.txt
|
11 |
+
*
|
12 |
+
* =================================================================
|
13 |
+
* MAGENTO EDITION USAGE NOTICE
|
14 |
+
* This package designed for Magento Community edition
|
15 |
+
* =================================================================
|
16 |
+
* zeonsolutions does not guarantee correct work of this extension
|
17 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
+
* zeonsolutions does not provide extension support in case of
|
19 |
+
* incorrect edition usage.
|
20 |
+
* =================================================================
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package base_default
|
24 |
+
* @version 0.0.1
|
25 |
+
* @copyright @copyright Copyright (c) 2013 zeonsolutions.Inc. (http://www.zeonsolutions.com)
|
26 |
+
* @license http://www.zeonsolutions.com/shop/license-community.txt
|
27 |
+
*/
|
28 |
+
?>
|
29 |
+
<?php
|
30 |
+
$_landingPages = $this->getLandingPageCollection();
|
31 |
+
$_helper = $this->helper('zeon_landingpage');
|
32 |
+
$processor = Mage::helper('zeon_landingpage')->getBlockTemplateProcessor();
|
33 |
+
$title = $_helper->getDefaultTitle() ? $_helper->getDefaultTitle() : $this->__('Bestsellers');
|
34 |
+
?>
|
35 |
+
<div class="page-title">
|
36 |
+
<h1><?php echo $title ?></h1>
|
37 |
+
</div>
|
38 |
+
<div class="std">
|
39 |
+
<?php if($_image = $_helper->getDefaultImage()): ?>
|
40 |
+
<p><img src="<?php echo $_image ?>" alt="<?php echo $title ?>" title="<?php echo $title ?>" /></p>
|
41 |
+
<?php endif; ?>
|
42 |
+
<?php if($_description = $_helper->getDefaultMetaDescription()): ?>
|
43 |
+
<p><?php echo $processor->filter($_description) ?></p>
|
44 |
+
<?php endif; ?>
|
45 |
+
</div>
|
46 |
+
<?php if(!$_landingPages->count()): ?>
|
47 |
+
<p class="note-msg"><?php echo $this->__('There are no landing page(s) matching the selection.') ?></p>
|
48 |
+
<?php else: ?>
|
49 |
+
<?php
|
50 |
+
$iterator = 1;
|
51 |
+
$column = 1;
|
52 |
+
$columns = $_helper->getColumnCount();
|
53 |
+
$count = $_landingPages->count();
|
54 |
+
$itemsPerColumn = ceil($count/$columns);
|
55 |
+
?>
|
56 |
+
<div class="landing-page page-sitemap">
|
57 |
+
<?php echo $this->getToolbarHtml() ?>
|
58 |
+
<div class="col<?php echo $columns ?>-set">
|
59 |
+
<ul class="sitemap">
|
60 |
+
<div class="col-<?php echo $column ?>">
|
61 |
+
<?php foreach ($_landingPages as $_landingPage): ?>
|
62 |
+
<li><a href="<?php echo $this->getItemUrl($_landingPage) ?>"><?php echo $_landingPage->getTitle() ?></a></li>
|
63 |
+
<?php if($iterator%$itemsPerColumn==0 && $iterator < $count): ?>
|
64 |
+
</div><div class="col-<?php echo ++$column ?>">
|
65 |
+
<?php endif; ?>
|
66 |
+
<?php $iterator++; endforeach; ?>
|
67 |
+
</div>
|
68 |
+
</ul>
|
69 |
+
</div>
|
70 |
+
<?php echo $this->getToolbarHtml() ?>
|
71 |
+
</div>
|
72 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/minewhat/insights/list/toolbar.phtml
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* zeonsolutions inc.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.zeonsolutions.com/shop/license-community.txt
|
11 |
+
*
|
12 |
+
* =================================================================
|
13 |
+
* MAGENTO EDITION USAGE NOTICE
|
14 |
+
* This package designed for Magento Community edition
|
15 |
+
* =================================================================
|
16 |
+
* zeonsolutions does not guarantee correct work of this extension
|
17 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
+
* zeonsolutions does not provide extension support in case of
|
19 |
+
* incorrect edition usage.
|
20 |
+
* =================================================================
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package base_default
|
24 |
+
* @version 0.0.1
|
25 |
+
* @copyright @copyright Copyright (c) 2013 zeonsolutions.Inc. (http://www.zeonsolutions.com)
|
26 |
+
* @license http://www.zeonsolutions.com/shop/license-community.txt
|
27 |
+
*/
|
28 |
+
?>
|
29 |
+
<?php if($this->getCollection()->getSize()): ?>
|
30 |
+
<div class="toolbar">
|
31 |
+
<?php if( $this->isExpanded() ): ?>
|
32 |
+
<div class="sorter">
|
33 |
+
<?php if( $this->isEnabledViewSwitcher() ): ?>
|
34 |
+
<p class="view-mode">
|
35 |
+
<?php $_modes = $this->getModes(); ?>
|
36 |
+
<?php if($_modes && count($_modes)>1): ?>
|
37 |
+
<label><?php echo $this->__('View as') ?>:</label>
|
38 |
+
<?php $_i=1; $_fix=''; foreach ($this->getModes() as $_code=>$_label): ?>
|
39 |
+
<?php if ($_i==1 && strtolower($_code)=='list') $_fix='-fix'; ?>
|
40 |
+
<?php if($this->isModeActive($_code)): ?>
|
41 |
+
<strong class="<?php echo strtolower($_code); echo $_fix; ?>" title="<?php echo $_label ?>">
|
42 |
+
<?php echo $_label ?></strong>
|
43 |
+
<?php else: ?>
|
44 |
+
<a class="<?php echo strtolower($_code); echo $_fix; ?>" title="<?php echo $_label ?>"
|
45 |
+
href="<?php echo $this->getModeUrl($_code) ?>"><?php echo $_label ?></a>
|
46 |
+
<?php endif; ?>
|
47 |
+
<?php $_i++; endforeach; ?>
|
48 |
+
<?php endif; ?>
|
49 |
+
</p>
|
50 |
+
<?php endif; ?>
|
51 |
+
<div class="sort-by">
|
52 |
+
<label><?php echo $this->__('Sort By') ?></label>
|
53 |
+
<select onchange="setLocation(this.value)">
|
54 |
+
<?php foreach($this->getAvailableOrders() as $_key=>$_order): ?>
|
55 |
+
<option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"
|
56 |
+
<?php if($this->isOrderCurrent($_key)): ?> selected="selected"<?php endif; ?>>
|
57 |
+
<?php echo $this->__($_order) ?>
|
58 |
+
</option>
|
59 |
+
<?php endforeach; ?>
|
60 |
+
</select>
|
61 |
+
<?php if($this->getCurrentDirection() == 'desc'): ?>
|
62 |
+
<a href="<?php echo $this->getOrderUrl(null, 'asc') ?>"><img src="
|
63 |
+
<?php echo $this->getSkinUrl('images/sort_desc_arrow.gif') ?>"
|
64 |
+
alt="<?php echo $this->__('Set Ascending Direction') ?>" class="v-middle" /></a>
|
65 |
+
<?php else: ?>
|
66 |
+
<a href="<?php echo $this->getOrderUrl(null, 'desc') ?>">
|
67 |
+
<img src="<?php echo $this->getSkinUrl('images/sort_asc_arrow.gif') ?>"
|
68 |
+
alt="<?php echo $this->__('Set Descending Direction') ?>" class="v-middle" /></a>
|
69 |
+
<?php endif; ?>
|
70 |
+
</div>
|
71 |
+
</div>
|
72 |
+
<?php endif; ?>
|
73 |
+
|
74 |
+
<div class="pager">
|
75 |
+
<p class="amount">
|
76 |
+
<?php if($this->getLastPageNum()>1): ?>
|
77 |
+
<?php echo $this->__('Items %s-%s of %s', $this->getFirstNum(), $this->getLastNum(), $this->getTotalNum()) ?>
|
78 |
+
<?php else: ?>
|
79 |
+
<?php echo $this->__('%s Item(s)', $this->getTotalNum()) ?>
|
80 |
+
<?php endif; ?>
|
81 |
+
</p>
|
82 |
+
|
83 |
+
<div class="limiter">
|
84 |
+
<label><?php echo $this->__('Show') ?></label>
|
85 |
+
<select onchange="setLocation(this.value)">
|
86 |
+
<?php foreach ($this->getAvailableLimit() as $_key=>$_limit): ?>
|
87 |
+
<option value="<?php echo $this->getLimitUrl($_key) ?>"<?php if($this->isLimitCurrent($_key)): ?>
|
88 |
+
selected="selected"<?php endif ?>>
|
89 |
+
<?php echo $_limit ?>
|
90 |
+
</option>
|
91 |
+
<?php endforeach; ?>
|
92 |
+
</select> <?php echo $this->__('per page') ?>
|
93 |
+
</div>
|
94 |
+
|
95 |
+
<?php echo $this->getPagerHtml() ?>
|
96 |
+
|
97 |
+
</div>
|
98 |
+
</div>
|
99 |
+
<?php endif ?>
|
app/design/frontend/base/default/template/minewhat/insights/view.phtml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* zeonsolutions inc.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.zeonsolutions.com/shop/license-community.txt
|
11 |
+
*
|
12 |
+
* =================================================================
|
13 |
+
* MAGENTO EDITION USAGE NOTICE
|
14 |
+
* This package designed for Magento Community edition
|
15 |
+
* =================================================================
|
16 |
+
* zeonsolutions does not guarantee correct work of this extension
|
17 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
+
* zeonsolutions does not provide extension support in case of
|
19 |
+
* incorrect edition usage.
|
20 |
+
* =================================================================
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package base_default
|
24 |
+
* @version 0.0.1
|
25 |
+
* @copyright @copyright Copyright (c) 2013 zeonsolutions.Inc. (http://www.zeonsolutions.com)
|
26 |
+
* @license http://www.zeonsolutions.com/shop/license-community.txt
|
27 |
+
*/
|
28 |
+
?>
|
29 |
+
<?php
|
30 |
+
$_landingPage = $this->getLandingPage();
|
31 |
+
$processor = Mage::helper('zeon_landingpage')->getBlockTemplateProcessor();
|
32 |
+
?>
|
33 |
+
<div id="messages_landingpage_view"><?php echo $this->getMessagesBlock()->toHtml() ?></div>
|
34 |
+
<div class="page-title">
|
35 |
+
<h1><?php echo $this->htmlEscape($_landingPage->getTitle()) ?></h1>
|
36 |
+
</div>
|
37 |
+
<div class="category-description std">
|
38 |
+
<p><?php echo $processor->filter($_landingPage->getShortDescription()) ?></p>
|
39 |
+
<p><?php echo $processor->filter($_landingPage->getDescription()) ?></p>
|
40 |
+
</div>
|
41 |
+
<?php echo $this->getChildHtml('featured_product_list') ?>
|
42 |
+
<?php echo $this->getChildHtml('product_list') ?>
|
app/design/frontend/base/default/template/minewhat/insights/view/featured.phtml
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* zeonsolutions inc.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.zeonsolutions.com/shop/license-community.txt
|
11 |
+
*
|
12 |
+
* =================================================================
|
13 |
+
* MAGENTO EDITION USAGE NOTICE
|
14 |
+
* This package designed for Magento Community edition
|
15 |
+
* =================================================================
|
16 |
+
* zeonsolutions does not guarantee correct work of this extension
|
17 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
+
* zeonsolutions does not provide extension support in case of
|
19 |
+
* incorrect edition usage.
|
20 |
+
* =================================================================
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package base_default
|
24 |
+
* @version 0.0.1
|
25 |
+
* @copyright @copyright Copyright (c) 2013 zeonsolutions.Inc. (http://www.zeonsolutions.com)
|
26 |
+
* @license http://www.zeonsolutions.com/shop/license-community.txt
|
27 |
+
*/
|
28 |
+
?>
|
29 |
+
<?php
|
30 |
+
$_featuredProductCollection=$this->getLoadedFeaturedProductCollection();
|
31 |
+
$_helper = $this->helper('catalog/output');
|
32 |
+
?>
|
33 |
+
<?php if(!$_featuredProductCollection->count()): ?>
|
34 |
+
<p class="note-msg"><?php echo $this->__('There are no featured products matching the selection.') ?></p>
|
35 |
+
<?php else: ?>
|
36 |
+
<div class="section-title">
|
37 |
+
<h2><?php echo Mage::helper('zeon_landingpage')->__('Featured Products'); ?></h2>
|
38 |
+
</div>
|
39 |
+
<div class="category-products">
|
40 |
+
<?php $_collectionSize = $_featuredProductCollection->count() ?>
|
41 |
+
<?php $_columnCount = $this->getColumnCount(); ?>
|
42 |
+
<?php $i=0; foreach ($_featuredProductCollection as $_product): ?>
|
43 |
+
<?php if ($i++%$_columnCount==0): ?>
|
44 |
+
<ul class="products-grid">
|
45 |
+
<?php endif ?>
|
46 |
+
<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>" style="width:156px;">
|
47 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
48 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
|
49 |
+
<?php if($_product->getRatingSummary()): ?>
|
50 |
+
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
|
51 |
+
<?php endif; ?>
|
52 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
53 |
+
<div class="actions">
|
54 |
+
<?php if($_product->isSaleable()): ?>
|
55 |
+
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
56 |
+
<?php else: ?>
|
57 |
+
<?php if ($_product->getIsSalable()): ?>
|
58 |
+
<p class="availability in-stock"><span><?php echo $this->__('In stock') ?></span></p>
|
59 |
+
<?php else: ?>
|
60 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
61 |
+
<?php endif; ?>
|
62 |
+
<?php endif; ?>
|
63 |
+
<ul class="add-to-links">
|
64 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
65 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
66 |
+
<?php endif; ?>
|
67 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
68 |
+
<li><a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
69 |
+
<?php endif; ?>
|
70 |
+
</ul>
|
71 |
+
</div>
|
72 |
+
</li>
|
73 |
+
<?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
|
74 |
+
</ul>
|
75 |
+
<?php endif ?>
|
76 |
+
<?php endforeach ?>
|
77 |
+
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
|
78 |
+
</div>
|
79 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/minewhat/insights/view/list.phtml
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* zeonsolutions inc.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.zeonsolutions.com/shop/license-community.txt
|
11 |
+
*
|
12 |
+
* =================================================================
|
13 |
+
* MAGENTO EDITION USAGE NOTICE
|
14 |
+
* This package designed for Magento Community edition
|
15 |
+
* =================================================================
|
16 |
+
* zeonsolutions does not guarantee correct work of this extension
|
17 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
+
* zeonsolutions does not provide extension support in case of
|
19 |
+
* incorrect edition usage.
|
20 |
+
* =================================================================
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package base_default
|
24 |
+
* @version 0.0.1
|
25 |
+
* @copyright @copyright Copyright (c) 2013 zeonsolutions.Inc. (http://www.zeonsolutions.com)
|
26 |
+
* @license http://www.zeonsolutions.com/shop/license-community.txt
|
27 |
+
*/
|
28 |
+
?>
|
29 |
+
<?php
|
30 |
+
$_productCollection=$this->getLoadedProductCollection();
|
31 |
+
$_helper = $this->helper('catalog/output');
|
32 |
+
?>
|
33 |
+
<?php if(!$_productCollection->count()): ?>
|
34 |
+
<p class="note-msg"><?php echo $this->__('There are no search result for this landing page.') ?></p>
|
35 |
+
<?php else: ?>
|
36 |
+
<?php echo $this->getToolbarHtml() ?>
|
37 |
+
<?php echo $this->getAdditionalHtml() ?>
|
38 |
+
<div class="category-products">
|
39 |
+
<?php // List mode ?>
|
40 |
+
<?php if($this->getMode()!='grid'): ?>
|
41 |
+
<?php $_iterator = 0; ?>
|
42 |
+
<ol class="products-list" id="products-list">
|
43 |
+
<?php foreach ($_productCollection as $_product): ?>
|
44 |
+
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
|
45 |
+
<?php // Product Image ?>
|
46 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(166); ?>" width="166" height="166" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
47 |
+
<?php // Product description ?>
|
48 |
+
<div class="product-shop">
|
49 |
+
<div class="f-fix">
|
50 |
+
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
|
51 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
|
52 |
+
<?php if($_product->getRatingSummary()): ?>
|
53 |
+
<?php echo $this->getReviewsSummaryHtml($_product) ?>
|
54 |
+
<?php endif; ?>
|
55 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
56 |
+
<div class="desc std">
|
57 |
+
<?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
|
58 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
|
59 |
+
</div>
|
60 |
+
<?php if($_product->isSaleable()): ?>
|
61 |
+
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
62 |
+
|
63 |
+
<?php else: ?>
|
64 |
+
<?php if ($_product->getIsSalable()): ?>
|
65 |
+
<p class="availability in-stock"><span><?php echo $this->__('In stock') ?></span></p>
|
66 |
+
<?php else: ?>
|
67 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
68 |
+
<?php endif; ?>
|
69 |
+
<?php endif; ?>
|
70 |
+
<ul class="add-to-links">
|
71 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
72 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
73 |
+
<?php endif; ?>
|
74 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
75 |
+
<li><a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
76 |
+
<?php endif; ?>
|
77 |
+
</ul>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
</li>
|
81 |
+
<?php endforeach; ?>
|
82 |
+
</ol>
|
83 |
+
<script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
|
84 |
+
|
85 |
+
<?php else: ?>
|
86 |
+
|
87 |
+
<?php // Grid Mode ?>
|
88 |
+
|
89 |
+
<?php $_collectionSize = $_productCollection->count() ?>
|
90 |
+
<?php $_columnCount = $this->getColumnCount(); ?>
|
91 |
+
<?php $i=0; foreach ($_productCollection as $_product): ?>
|
92 |
+
<?php if ($i++%$_columnCount==0): ?>
|
93 |
+
<ul class="products-grid">
|
94 |
+
<?php endif ?>
|
95 |
+
<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>" style="width:156px;">
|
96 |
+
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
97 |
+
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
|
98 |
+
<?php if($_product->getRatingSummary()): ?>
|
99 |
+
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
|
100 |
+
<?php endif; ?>
|
101 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
102 |
+
<div class="actions">
|
103 |
+
<?php if($_product->isSaleable()): ?>
|
104 |
+
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
105 |
+
<?php else: ?>
|
106 |
+
<?php if ($_product->getIsSalable()): ?>
|
107 |
+
<p class="availability in-stock"><span><?php echo $this->__('In stock') ?></span></p>
|
108 |
+
<?php else: ?>
|
109 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
110 |
+
<?php endif; ?>
|
111 |
+
<?php endif; ?>
|
112 |
+
<ul class="add-to-links">
|
113 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
114 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
115 |
+
<?php endif; ?>
|
116 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
117 |
+
<li><a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
118 |
+
<?php endif; ?>
|
119 |
+
</ul>
|
120 |
+
</div>
|
121 |
+
</li>
|
122 |
+
<?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
|
123 |
+
</ul>
|
124 |
+
<?php endif ?>
|
125 |
+
<?php endforeach ?>
|
126 |
+
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
|
127 |
+
<?php endif; ?>
|
128 |
+
</div>
|
129 |
+
<div class="toolbar-bottom">
|
130 |
+
<?php echo $this->getToolbarHtml() ?>
|
131 |
+
</div>
|
132 |
+
<?php endif; ?>
|
app/design/frontend/default/default/layout/minewhat_insights.xml
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
*/
|
9 |
-->
|
10 |
<layout version="0.1.0">
|
11 |
-
|
12 |
<catalog_product_view>
|
13 |
<reference name="head">
|
14 |
<block type="minewhat_insights/event_catalog_product_view" name="minewhat_insights_event_catalog_product_view" />
|
@@ -21,16 +21,19 @@
|
|
21 |
</reference>
|
22 |
</checkout_cart_index>
|
23 |
|
24 |
-
<checkout_onepage_success>
|
25 |
<reference name="head">
|
26 |
<block type="minewhat_insights/event_checkout_onepage_success" name="minewhat_insights_event_checkout_onepage_success" />
|
27 |
</reference>
|
28 |
-
</checkout_onepage_success>
|
29 |
|
30 |
<default>
|
31 |
<reference name="head">
|
32 |
<block type="minewhat_insights/base_script" name="minewhat_insights_base_script" />
|
33 |
</reference>
|
34 |
-
|
|
|
|
|
|
|
35 |
|
36 |
</layout>
|
8 |
*/
|
9 |
-->
|
10 |
<layout version="0.1.0">
|
11 |
+
|
12 |
<catalog_product_view>
|
13 |
<reference name="head">
|
14 |
<block type="minewhat_insights/event_catalog_product_view" name="minewhat_insights_event_catalog_product_view" />
|
21 |
</reference>
|
22 |
</checkout_cart_index>
|
23 |
|
24 |
+
<!-- <checkout_onepage_success>
|
25 |
<reference name="head">
|
26 |
<block type="minewhat_insights/event_checkout_onepage_success" name="minewhat_insights_event_checkout_onepage_success" />
|
27 |
</reference>
|
28 |
+
</checkout_onepage_success> -->
|
29 |
|
30 |
<default>
|
31 |
<reference name="head">
|
32 |
<block type="minewhat_insights/base_script" name="minewhat_insights_base_script" />
|
33 |
</reference>
|
34 |
+
<reference name="head">
|
35 |
+
<block type="minewhat_insights/event_checkout_onepage_success" name="minewhat_insights_event_checkout_onepage_success" />
|
36 |
+
</reference>
|
37 |
+
</default>
|
38 |
|
39 |
</layout>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>minewhat</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">osl</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>MineWhat Insights</description>
|
11 |
<notes>MineWhat magento plugin</notes>
|
12 |
<authors><author><name>MineWhat Inc.</name><user>MineWhat</user><email>plugins@minewhat.com</email></author></authors>
|
13 |
-
<date>2014-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="MineWhat"><dir name="Insights"><dir name="Block"><dir name="Base"><file name="Script.php" hash="dd44e43a5954e82cfa5cf47921642624"/></dir><dir name="Event"><dir name="Catalog"><dir name="Product"><file name="View.php" hash="41eb512f4f77a8e127253cf246587f0c"/></dir></dir><dir name="Checkout"><dir name="Cart"><file name="Index.php" hash="fafaf6953262ea2b0bc3092d538c30d1"/></dir><dir name="Onepage"><file name="Success.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.5</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>minewhat</name>
|
4 |
+
<version>1.0.18</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">osl</license>
|
7 |
<channel>community</channel>
|
10 |
<description>MineWhat Insights</description>
|
11 |
<notes>MineWhat magento plugin</notes>
|
12 |
<authors><author><name>MineWhat Inc.</name><user>MineWhat</user><email>plugins@minewhat.com</email></author></authors>
|
13 |
+
<date>2014-11-08</date>
|
14 |
+
<time>09:56:43</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="MineWhat"><dir name="Insights"><dir name="Block"><dir name="Base"><file name="Script.php" hash="dd44e43a5954e82cfa5cf47921642624"/></dir><dir name="Event"><dir name="Catalog"><dir name="Product"><file name="View.php" hash="41eb512f4f77a8e127253cf246587f0c"/></dir></dir><dir name="Checkout"><dir name="Cart"><file name="Index.php" hash="fafaf6953262ea2b0bc3092d538c30d1"/></dir><dir name="Onepage"><file name="Success.php" hash="779fa1bb799413b05fc111bdc8bc7023"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="c9284d372a18c6db27dec077c04296ff"/></dir><dir name="Model"><file name="Observer.php" hash="8f8ffe64147205aebc15670bc819ccb5"/></dir><dir name="controllers"><file name="ApiController.php" hash="eaeeb290dc1097a0d93f480f6312fe38"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f1fb655aac4dc7f71cadb6c7a7e816f8"/><file name="config.xml" hash="b4443479201149d5ee72c95ca6ffaae5"/><file name="system.xml" hash="8b5d2901cae5a3f65a06ce7fc65e440d"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="MineWhat_Insights.xml" hash="8d2f076cbfcc14688ed800f622869d4b"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="minewhat"><dir name="insights"><dir name="base"><file name="script.phtml" hash="fe16e289984308941fb830bc97e7cad2"/></dir><dir name="event"><dir name="catalog"><dir name="product"><file name="view.phtml" hash="f4a801140203b524d44a23ac83e5873a"/></dir></dir><dir name="checkout"><dir name="cart"><file name="index.phtml" hash="16cf404c9684e5839270fb0931e8fb3b"/></dir><dir name="onepage"><file name="success.phtml" hash="7868bd6e2b4bfe23972a1d6694a8b719"/></dir></dir></dir></dir></dir></dir><dir name="layout"><file name="minewhat_insights.xml" hash="bffb825f36d0a76fa1e5a1eee1e91b07"/></dir></dir></dir><dir name="base"><dir name="default"><dir name="template"><dir name="minewhat"><dir name="insights"><dir name="base"><file name="script.phtml" hash="fe16e289984308941fb830bc97e7cad2"/></dir><dir name="event"><dir name="catalog"><dir name="product"><file name="view.phtml" hash="f4a801140203b524d44a23ac83e5873a"/></dir></dir><dir name="checkout"><dir name="cart"><file name="index.phtml" hash="16cf404c9684e5839270fb0931e8fb3b"/></dir><dir name="onepage"><file name="success.phtml" hash="3a1d49f78428e4cfd41e8cdd8cedc863"/></dir></dir></dir><dir name="list"><file name="toolbar.phtml" hash="0d35ba1449c7ed24e040ff3a8242838d"/><file name=".DS_Store" hash="220a7ff2487261d1b60c8b2659878617"/></dir><file name="list.phtml" hash="aedc12d376fd394dea55e6dd7593d573"/><dir name="view"><file name="featured.phtml" hash="5ecd5a962cd7d460d96cf792b2ba8d42"/><file name="list.phtml" hash="045c9f03c610ac296ffc0fe998c9f774"/><file name=".DS_Store" hash="984ca461816e7a9ac20b6ee55374f870"/></dir><file name="view.phtml" hash="25359d701778fd130b5b0bc0af2f223e"/><file name=".DS_Store" hash="b0f57b625503b5c464300f483bbec82e"/></dir><file name=".DS_Store" hash="2edc75db2a6acc90e6fef43665df0ae4"/></dir></dir><dir name="layout"><file name="minewhat_insights.xml" hash="8ed857b2639ce2dcc48e5f0225982650"/></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.5</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|