Version Notes
Channable Connect
Download this release
Release Info
Developer | Magento Core Team |
Extension | Magmodules_Channable |
Version | 1.3.2 |
Comparing to | |
See all releases |
Code changes from version 1.3.0 to 1.3.2
- app/code/community/Magmodules/Channable/Helper/Data.php +75 -29
- app/code/community/Magmodules/Channable/Model/Channable.php +9 -5
- app/code/community/Magmodules/Channable/Model/Common.php +9 -7
- app/code/community/Magmodules/Channable/controllers/Adminhtml/ChannableController.php +5 -0
- app/code/community/Magmodules/Channable/etc/adminhtml.xml +11 -0
- app/code/community/Magmodules/Channable/etc/config.xml +1 -1
- app/code/community/Magmodules/Channable/etc/system.xml +14 -3
- package.xml +4 -4
app/code/community/Magmodules/Channable/Helper/Data.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
* @author Magmodules <info@magmodules.eu>
|
13 |
* @copyright Copyright (c) 2015 (http://www.magmodules.eu)
|
14 |
* @license http://www.magmodules.eu/license-agreement/
|
15 |
-
* @version
|
16 |
* =============================================================
|
17 |
*/
|
18 |
|
@@ -35,8 +35,8 @@ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
35 |
$fields = $config['field'];
|
36 |
$data = array();
|
37 |
|
38 |
-
if(!$this->validateProduct($product, $config)) { return false; }
|
39 |
if(!$this->validateParent($parent, $config, $product)) { $parent = ''; }
|
|
|
40 |
|
41 |
foreach($fields as $key => $field) {
|
42 |
$rows = $this->getAttributeValue($key, $product, $config, $field['action'], $parent);
|
@@ -66,7 +66,7 @@ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
66 |
|
67 |
switch($field) {
|
68 |
case 'product_url':
|
69 |
-
$value = $this->getProductUrl($
|
70 |
break;
|
71 |
case 'image_link':
|
72 |
$value = $this->getProductImage($product_data, $config);
|
@@ -94,16 +94,20 @@ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
94 |
break;
|
95 |
default:
|
96 |
if(!empty($data['source'])) {
|
97 |
-
$value = $this->getProductData($product_data, $data);
|
98 |
} else {
|
99 |
$value = '';
|
100 |
}
|
101 |
break;
|
102 |
}
|
103 |
|
104 |
-
if(
|
105 |
if(!empty($value)) {
|
106 |
-
$value
|
|
|
|
|
|
|
|
|
107 |
}
|
108 |
}
|
109 |
|
@@ -134,6 +138,12 @@ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
134 |
$st = $this->stripTags($st);
|
135 |
$st = trim($st);
|
136 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
if(in_array('rn', $actions)) {
|
138 |
$st = str_replace(array("\r", "\n"), "", $st);
|
139 |
}
|
@@ -153,17 +163,40 @@ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
153 |
return $st;
|
154 |
}
|
155 |
|
156 |
-
public function getProductUrl($product, $config)
|
157 |
{
|
158 |
-
if($
|
159 |
-
|
|
|
|
|
|
|
|
|
|
|
160 |
} else {
|
161 |
-
|
162 |
-
|
|
|
|
|
|
|
|
|
163 |
}
|
164 |
if(!empty($config['url_suffix'])) {
|
165 |
$url = $url . '?' . $config['url_suffix'];
|
166 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
return $url;
|
168 |
}
|
169 |
|
@@ -298,13 +331,18 @@ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
298 |
$source = $data['source'];
|
299 |
$value = '';
|
300 |
switch($type) {
|
301 |
-
case 'text':
|
302 |
-
case 'textarea':
|
303 |
-
$value = $product[$source];
|
304 |
-
break;
|
305 |
case 'select':
|
306 |
$value = $product->getAttributeText($source);
|
307 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
default:
|
309 |
if(!empty($product[$source])) {
|
310 |
$value = $product[$source];
|
@@ -314,7 +352,6 @@ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
314 |
return $value;
|
315 |
}
|
316 |
|
317 |
-
|
318 |
public function getProductPrice($product, $config)
|
319 |
{
|
320 |
$price_data = array();
|
@@ -336,7 +373,7 @@ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
336 |
$price = Mage::helper('tax')->getPrice($product, $price, $tax_param);
|
337 |
$price_data['regular_price'] = number_format(($price * $price_markup), 2, '.', '') . $currency;
|
338 |
$pricerule_price = Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), $tax_param);
|
339 |
-
|
340 |
$special_price = ''; $special_date = '';
|
341 |
if(($pricerule_price > 0) && ($pricerule_price < $product->getPrice())) {
|
342 |
$sales_price = $pricerule_price;
|
@@ -351,7 +388,6 @@ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
351 |
}
|
352 |
}
|
353 |
|
354 |
-
|
355 |
if(($product->getTypeId() == 'bundle') && ($price < 0.01)) {
|
356 |
$price = $this->getPriceBundle($product, $config['store_id']);
|
357 |
}
|
@@ -388,9 +424,10 @@ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
388 |
if(!empty($config['price_add_tax']) && !empty($config['price_add_tax_perc'])) {
|
389 |
$markup = 1 + ($config['price_add_tax_perc'] / 100);
|
390 |
}
|
391 |
-
if(
|
392 |
-
$
|
393 |
-
|
|
|
394 |
return $markup;
|
395 |
}
|
396 |
|
@@ -440,7 +477,7 @@ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
440 |
$attributes[] = $config['category_replace'];
|
441 |
}
|
442 |
|
443 |
-
$categories = Mage::getModel('catalog/category')->setStoreId($storeId)->getCollection()->addAttributeToSelect($attributes);
|
444 |
$_categories = array();
|
445 |
|
446 |
foreach($categories as $cat) {
|
@@ -490,14 +527,22 @@ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
490 |
}
|
491 |
}
|
492 |
|
493 |
-
public function validateProduct($product, $config)
|
494 |
{
|
495 |
if(empty($config['skip_validation'])) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
496 |
if(!empty($config['filter_exclude'])) {
|
497 |
if($product[$config['filter_exclude']] == 1) {
|
498 |
return false;
|
499 |
}
|
500 |
-
}
|
501 |
if(!empty($config['hide_no_stock'])) {
|
502 |
if($product->getUseConfigManageStock()) {
|
503 |
$manage_stock = $config['stock_manage'];
|
@@ -516,7 +561,7 @@ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
516 |
|
517 |
public function validateParent($parent, $config, $product)
|
518 |
{
|
519 |
-
return $this->validateProduct($product, $config);
|
520 |
}
|
521 |
|
522 |
public function getPriceBundle($product, $storeId)
|
@@ -553,12 +598,13 @@ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
553 |
$prices[] = $price_associated;
|
554 |
}
|
555 |
}
|
556 |
-
if(
|
557 |
-
|
558 |
-
|
|
|
|
|
559 |
}
|
560 |
|
561 |
-
|
562 |
public function checkOldVersion($dir)
|
563 |
{
|
564 |
if($dir) {
|
12 |
* @author Magmodules <info@magmodules.eu>
|
13 |
* @copyright Copyright (c) 2015 (http://www.magmodules.eu)
|
14 |
* @license http://www.magmodules.eu/license-agreement/
|
15 |
+
* @version 29-12-2015
|
16 |
* =============================================================
|
17 |
*/
|
18 |
|
35 |
$fields = $config['field'];
|
36 |
$data = array();
|
37 |
|
|
|
38 |
if(!$this->validateParent($parent, $config, $product)) { $parent = ''; }
|
39 |
+
if(!$this->validateProduct($product, $config, $parent)) { return false; }
|
40 |
|
41 |
foreach($fields as $key => $field) {
|
42 |
$rows = $this->getAttributeValue($key, $product, $config, $field['action'], $parent);
|
66 |
|
67 |
switch($field) {
|
68 |
case 'product_url':
|
69 |
+
$value = $this->getProductUrl($product, $config, $parent);
|
70 |
break;
|
71 |
case 'image_link':
|
72 |
$value = $this->getProductImage($product_data, $config);
|
94 |
break;
|
95 |
default:
|
96 |
if(!empty($data['source'])) {
|
97 |
+
$value = $this->getProductData($product_data, $data, $config);
|
98 |
} else {
|
99 |
$value = '';
|
100 |
}
|
101 |
break;
|
102 |
}
|
103 |
|
104 |
+
if($config['field'][$field]['type'] == 'media_image') {
|
105 |
if(!empty($value)) {
|
106 |
+
if($value != 'no_selection') {
|
107 |
+
$value = $config['media_url'] . 'catalog/product' . $value;
|
108 |
+
} else {
|
109 |
+
$value = '';
|
110 |
+
}
|
111 |
}
|
112 |
}
|
113 |
|
138 |
$st = $this->stripTags($st);
|
139 |
$st = trim($st);
|
140 |
}
|
141 |
+
if(in_array('replacetags', $actions)) {
|
142 |
+
$st = str_replace(array("\r", "\n"), "", $st);
|
143 |
+
$st = str_replace(array("<br>","<br/>", "<br />"), "\\n", $st);
|
144 |
+
$st = $this->stripTags($st);
|
145 |
+
$st = rtrim($st);
|
146 |
+
}
|
147 |
if(in_array('rn', $actions)) {
|
148 |
$st = str_replace(array("\r", "\n"), "", $st);
|
149 |
}
|
163 |
return $st;
|
164 |
}
|
165 |
|
166 |
+
public function getProductUrl($product, $config, $parent)
|
167 |
{
|
168 |
+
if(!empty($parent)) {
|
169 |
+
if($parent->getUrlPath()) {
|
170 |
+
$url = Mage::helper('core')->escapeHtml(trim($config['website_url'] . $parent->getUrlPath()));
|
171 |
+
} else {
|
172 |
+
$url = Mage::getModel('catalog/product')->setStoreId($config['store_id'])->load($parent->getId())->getProductUrl();
|
173 |
+
$url = preg_replace('/\?.*/', '', $url);
|
174 |
+
}
|
175 |
} else {
|
176 |
+
if($product->getUrlPath()) {
|
177 |
+
$url = Mage::helper('core')->escapeHtml(trim($config['website_url'] . $product->getUrlPath()));
|
178 |
+
} else {
|
179 |
+
$url = Mage::getModel('catalog/product')->setStoreId($config['store_id'])->load($product->getId())->getProductUrl();
|
180 |
+
$url = preg_replace('/\?.*/', '', $url);
|
181 |
+
}
|
182 |
}
|
183 |
if(!empty($config['url_suffix'])) {
|
184 |
$url = $url . '?' . $config['url_suffix'];
|
185 |
}
|
186 |
+
if(!empty($parent) && !empty($config['conf_switch_urls'])) {
|
187 |
+
if($parent->getTypeId() == 'configurable') {
|
188 |
+
$productAttributeOptions = $parent->getTypeInstance(true)->getConfigurableAttributesAsArray($parent);
|
189 |
+
$url_extra = '';
|
190 |
+
foreach ($productAttributeOptions as $productAttribute) {
|
191 |
+
if($id = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product->getId(), $productAttribute['attribute_code'], $config['store_id'])) {
|
192 |
+
$url_extra .= $productAttribute['attribute_id'] . '=' . $id . '&';
|
193 |
+
}
|
194 |
+
}
|
195 |
+
if(!empty($url_extra)) {
|
196 |
+
$url = $url . '#' . rtrim($url_extra, '&');
|
197 |
+
}
|
198 |
+
}
|
199 |
+
}
|
200 |
return $url;
|
201 |
}
|
202 |
|
331 |
$source = $data['source'];
|
332 |
$value = '';
|
333 |
switch($type) {
|
|
|
|
|
|
|
|
|
334 |
case 'select':
|
335 |
$value = $product->getAttributeText($source);
|
336 |
break;
|
337 |
+
case 'multiselect':
|
338 |
+
if(count($product->getAttributeText($source))) {
|
339 |
+
if(count($product->getAttributeText($source)) > 1) {
|
340 |
+
$value = implode(',', $product->getAttributeText($source));
|
341 |
+
} else {
|
342 |
+
$value = $product->getAttributeText($source);
|
343 |
+
}
|
344 |
+
}
|
345 |
+
break;
|
346 |
default:
|
347 |
if(!empty($product[$source])) {
|
348 |
$value = $product[$source];
|
352 |
return $value;
|
353 |
}
|
354 |
|
|
|
355 |
public function getProductPrice($product, $config)
|
356 |
{
|
357 |
$price_data = array();
|
373 |
$price = Mage::helper('tax')->getPrice($product, $price, $tax_param);
|
374 |
$price_data['regular_price'] = number_format(($price * $price_markup), 2, '.', '') . $currency;
|
375 |
$pricerule_price = Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), $tax_param);
|
376 |
+
|
377 |
$special_price = ''; $special_date = '';
|
378 |
if(($pricerule_price > 0) && ($pricerule_price < $product->getPrice())) {
|
379 |
$sales_price = $pricerule_price;
|
388 |
}
|
389 |
}
|
390 |
|
|
|
391 |
if(($product->getTypeId() == 'bundle') && ($price < 0.01)) {
|
392 |
$price = $this->getPriceBundle($product, $config['store_id']);
|
393 |
}
|
424 |
if(!empty($config['price_add_tax']) && !empty($config['price_add_tax_perc'])) {
|
425 |
$markup = 1 + ($config['price_add_tax_perc'] / 100);
|
426 |
}
|
427 |
+
if($config['base_currency_code'] != $config['currency']) {
|
428 |
+
$exchange_rate = Mage::helper('directory')->currencyConvert(1, $config['base_currency_code'], $config['currency']);
|
429 |
+
$markup = ($markup * $exchange_rate);
|
430 |
+
}
|
431 |
return $markup;
|
432 |
}
|
433 |
|
477 |
$attributes[] = $config['category_replace'];
|
478 |
}
|
479 |
|
480 |
+
$categories = Mage::getModel('catalog/category')->setStoreId($storeId)->getCollection()->addAttributeToSelect($attributes)->addFieldToFilter('include_in_menu', array('eq' => 1))->addFieldToFilter('is_active', array('eq' => 1));
|
481 |
$_categories = array();
|
482 |
|
483 |
foreach($categories as $cat) {
|
527 |
}
|
528 |
}
|
529 |
|
530 |
+
public function validateProduct($product, $config, $parent)
|
531 |
{
|
532 |
if(empty($config['skip_validation'])) {
|
533 |
+
if($product['visibility'] == 1) {
|
534 |
+
if(empty($parent)) {
|
535 |
+
return false;
|
536 |
+
}
|
537 |
+
if($parent['status'] != 1) {
|
538 |
+
return false;
|
539 |
+
}
|
540 |
+
}
|
541 |
if(!empty($config['filter_exclude'])) {
|
542 |
if($product[$config['filter_exclude']] == 1) {
|
543 |
return false;
|
544 |
}
|
545 |
+
}
|
546 |
if(!empty($config['hide_no_stock'])) {
|
547 |
if($product->getUseConfigManageStock()) {
|
548 |
$manage_stock = $config['stock_manage'];
|
561 |
|
562 |
public function validateParent($parent, $config, $product)
|
563 |
{
|
564 |
+
return $this->validateProduct($product, $config, $parent);
|
565 |
}
|
566 |
|
567 |
public function getPriceBundle($product, $storeId)
|
598 |
$prices[] = $price_associated;
|
599 |
}
|
600 |
}
|
601 |
+
if(!empty($prices)) {
|
602 |
+
if($pricemodel == 'min') { return min($prices); }
|
603 |
+
if($pricemodel == 'max') { return max($prices); }
|
604 |
+
if($pricemodel == 'total') { return array_sum($prices); }
|
605 |
+
}
|
606 |
}
|
607 |
|
|
|
608 |
public function checkOldVersion($dir)
|
609 |
{
|
610 |
if($dir) {
|
app/code/community/Magmodules/Channable/Model/Channable.php
CHANGED
@@ -81,6 +81,7 @@ class Magmodules_Channable_Model_Channable extends Magmodules_Channable_Model_Co
|
|
81 |
$config['hide_no_stock'] = Mage::getStoreConfig('channable/filter/stock', $storeId);
|
82 |
$config['conf_enabled'] = Mage::getStoreConfig('channable/data/conf_enabled', $storeId);
|
83 |
$config['conf_fields'] = Mage::getStoreConfig('channable/data/conf_fields', $storeId);
|
|
|
84 |
$config['stock_manage'] = Mage::getStoreConfig('cataloginventory/item_options/manage_stock');
|
85 |
$config['delivery'] = Mage::getStoreConfig('channable/data/delivery', $storeId);
|
86 |
$config['delivery_att'] = Mage::getStoreConfig('channable/data/delivery_att', $storeId);
|
@@ -120,7 +121,7 @@ class Magmodules_Channable_Model_Channable extends Magmodules_Channable_Model_Co
|
|
120 |
$attributes = array();
|
121 |
$attributes['id'] = array('label' => 'id', 'source' => 'entity_id');
|
122 |
$attributes['name'] = array('label' => 'name', 'source' => 'name');
|
123 |
-
$attributes['description'] = array('label' => 'description', 'source' => Mage::getStoreConfig('channable/data/description', $storeId), 'action' => '
|
124 |
$attributes['product_url'] = array('label' => 'url', 'source' => '');
|
125 |
$attributes['image_link'] = array('label' => 'image', 'source' => '');
|
126 |
$attributes['price'] = array('label' => 'price', 'source' => '');
|
@@ -229,9 +230,11 @@ class Magmodules_Channable_Model_Channable extends Magmodules_Channable_Model_Co
|
|
229 |
protected function getExtraDataFields($product_data, $config, $product)
|
230 |
{
|
231 |
$_extra = array();
|
232 |
-
if(
|
233 |
-
$
|
234 |
-
|
|
|
|
|
235 |
if($_shipping = $this->getShipping($product_data, $config, $product)) {
|
236 |
$_extra = array_merge($_extra, $_shipping);
|
237 |
}
|
@@ -241,7 +244,8 @@ class Magmodules_Channable_Model_Channable extends Magmodules_Channable_Model_Co
|
|
241 |
return $_extra;
|
242 |
}
|
243 |
|
244 |
-
protected function getFeedHeader($config, $count, $time_start, $product_count = 0)
|
|
|
245 |
$header = array();
|
246 |
$header['system'] = 'Magento';
|
247 |
$header['extension'] = 'Magmodules_Channable';
|
81 |
$config['hide_no_stock'] = Mage::getStoreConfig('channable/filter/stock', $storeId);
|
82 |
$config['conf_enabled'] = Mage::getStoreConfig('channable/data/conf_enabled', $storeId);
|
83 |
$config['conf_fields'] = Mage::getStoreConfig('channable/data/conf_fields', $storeId);
|
84 |
+
$config['conf_switch_urls'] = Mage::getStoreConfig('channable/data/conf_switch_urls', $storeId);
|
85 |
$config['stock_manage'] = Mage::getStoreConfig('cataloginventory/item_options/manage_stock');
|
86 |
$config['delivery'] = Mage::getStoreConfig('channable/data/delivery', $storeId);
|
87 |
$config['delivery_att'] = Mage::getStoreConfig('channable/data/delivery_att', $storeId);
|
121 |
$attributes = array();
|
122 |
$attributes['id'] = array('label' => 'id', 'source' => 'entity_id');
|
123 |
$attributes['name'] = array('label' => 'name', 'source' => 'name');
|
124 |
+
$attributes['description'] = array('label' => 'description', 'source' => Mage::getStoreConfig('channable/data/description', $storeId), 'action' => 'replacetags');
|
125 |
$attributes['product_url'] = array('label' => 'url', 'source' => '');
|
126 |
$attributes['image_link'] = array('label' => 'image', 'source' => '');
|
127 |
$attributes['price'] = array('label' => 'price', 'source' => '');
|
230 |
protected function getExtraDataFields($product_data, $config, $product)
|
231 |
{
|
232 |
$_extra = array();
|
233 |
+
if(!empty($product_data['price'])) {
|
234 |
+
if($_prices = $this->getPrices($product_data['price'])) {
|
235 |
+
$_extra = array_merge($_extra, $_prices);
|
236 |
+
}
|
237 |
+
}
|
238 |
if($_shipping = $this->getShipping($product_data, $config, $product)) {
|
239 |
$_extra = array_merge($_extra, $_shipping);
|
240 |
}
|
244 |
return $_extra;
|
245 |
}
|
246 |
|
247 |
+
protected function getFeedHeader($config, $count, $time_start, $product_count = 0)
|
248 |
+
{
|
249 |
$header = array();
|
250 |
$header['system'] = 'Magento';
|
251 |
$header['extension'] = 'Magmodules_Channable';
|
app/code/community/Magmodules/Channable/Model/Common.php
CHANGED
@@ -19,12 +19,12 @@ class Magmodules_Channable_Model_Common extends Mage_Core_Helper_Abstract {
|
|
19 |
|
20 |
public function getProducts($config, $limit = '', $page = 1, $type = '')
|
21 |
{
|
22 |
-
|
23 |
$store_id = $config['store_id'];
|
24 |
$collection = Mage::getResourceModel('catalog/product_collection');
|
25 |
$collection->setStore($store_id);
|
26 |
$collection->addStoreFilter($store_id);
|
27 |
-
|
|
|
28 |
if(!empty($config['filter_enabled'])) {
|
29 |
$type = $config['filter_type'];
|
30 |
$categories = $config['filter_cat'];
|
@@ -39,7 +39,13 @@ class Magmodules_Channable_Model_Common extends Mage_Core_Helper_Abstract {
|
|
39 |
}
|
40 |
}
|
41 |
}
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
if(!empty($config['filter_status'])) {
|
44 |
$visibility = $config['filter_status'];
|
45 |
if(strlen($visibility) > 1) {
|
@@ -59,10 +65,6 @@ class Magmodules_Channable_Model_Common extends Mage_Core_Helper_Abstract {
|
|
59 |
}
|
60 |
}
|
61 |
|
62 |
-
if(($limit) && ($type != 'count')) {
|
63 |
-
$collection->setPage($page, $limit)->getCurPage();
|
64 |
-
}
|
65 |
-
|
66 |
if($type != 'count') {
|
67 |
$attributes = array();
|
68 |
$attributes[] = 'url_path';
|
19 |
|
20 |
public function getProducts($config, $limit = '', $page = 1, $type = '')
|
21 |
{
|
|
|
22 |
$store_id = $config['store_id'];
|
23 |
$collection = Mage::getResourceModel('catalog/product_collection');
|
24 |
$collection->setStore($store_id);
|
25 |
$collection->addStoreFilter($store_id);
|
26 |
+
$collection->addFinalPrice();
|
27 |
+
|
28 |
if(!empty($config['filter_enabled'])) {
|
29 |
$type = $config['filter_type'];
|
30 |
$categories = $config['filter_cat'];
|
39 |
}
|
40 |
}
|
41 |
}
|
42 |
+
|
43 |
+
$collection->addAttributeToFilter('status', 1);
|
44 |
+
|
45 |
+
if(($limit) && ($type != 'count')) {
|
46 |
+
$collection->setPage($page, $limit)->getCurPage();
|
47 |
+
}
|
48 |
+
|
49 |
if(!empty($config['filter_status'])) {
|
50 |
$visibility = $config['filter_status'];
|
51 |
if(strlen($visibility) > 1) {
|
65 |
}
|
66 |
}
|
67 |
|
|
|
|
|
|
|
|
|
68 |
if($type != 'count') {
|
69 |
$attributes = array();
|
70 |
$attributes[] = 'url_path';
|
app/code/community/Magmodules/Channable/controllers/Adminhtml/ChannableController.php
CHANGED
@@ -26,5 +26,10 @@ class Magmodules_Channable_Adminhtml_ChannableController extends Mage_Adminhtml_
|
|
26 |
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('channable')->__('Attributes added to Flat Catalog, please reindex Product Flat Data.'));
|
27 |
$this->_redirect('adminhtml/system_config/edit/section/channable');
|
28 |
}
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
}
|
26 |
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('channable')->__('Attributes added to Flat Catalog, please reindex Product Flat Data.'));
|
27 |
$this->_redirect('adminhtml/system_config/edit/section/channable');
|
28 |
}
|
29 |
+
|
30 |
+
protected function _isAllowed()
|
31 |
+
{
|
32 |
+
return Mage::getSingleton('admin/session')->isAllowed('admin/channable/channable');
|
33 |
+
}
|
34 |
|
35 |
}
|
app/code/community/Magmodules/Channable/etc/adminhtml.xml
CHANGED
@@ -32,6 +32,17 @@
|
|
32 |
</config>
|
33 |
</children>
|
34 |
</system>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
</children>
|
36 |
</admin>
|
37 |
</resources>
|
32 |
</config>
|
33 |
</children>
|
34 |
</system>
|
35 |
+
<channable module="channable">
|
36 |
+
<title>Channable</title>
|
37 |
+
<sort_order>200</sort_order>
|
38 |
+
<children>
|
39 |
+
<channable module="channable">
|
40 |
+
<title>Channable</title>
|
41 |
+
<sort_order>100</sort_order>
|
42 |
+
<action>adminhtml/channable/</action>
|
43 |
+
</channable>
|
44 |
+
</children>
|
45 |
+
</channable>
|
46 |
</children>
|
47 |
</admin>
|
48 |
</resources>
|
app/code/community/Magmodules/Channable/etc/config.xml
CHANGED
@@ -19,7 +19,7 @@
|
|
19 |
<config>
|
20 |
<modules>
|
21 |
<Magmodules_Channable>
|
22 |
-
<version>1.3.
|
23 |
</Magmodules_Channable>
|
24 |
</modules>
|
25 |
<global>
|
19 |
<config>
|
20 |
<modules>
|
21 |
<Magmodules_Channable>
|
22 |
+
<version>1.3.2</version>
|
23 |
</Magmodules_Channable>
|
24 |
</modules>
|
25 |
<global>
|
app/code/community/Magmodules/Channable/etc/system.xml
CHANGED
@@ -371,15 +371,26 @@
|
|
371 |
<depends><conf_enabled>1</conf_enabled></depends>
|
372 |
<comment>Use parent data</comment>
|
373 |
</conf_fields>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
<grouped_price translate="label">
|
375 |
<label>Grouped Price</label>
|
376 |
<frontend_type>select</frontend_type>
|
377 |
<source_model>channable/adminhtml_system_config_source_pricemodel</source_model>
|
378 |
-
<sort_order>
|
379 |
<show_in_default>1</show_in_default>
|
380 |
<show_in_website>1</show_in_website>
|
381 |
<show_in_store>1</show_in_store>
|
382 |
-
</grouped_price>
|
383 |
</fields>
|
384 |
</data>
|
385 |
<advanced translate="label" module="channable">
|
@@ -445,7 +456,7 @@
|
|
445 |
<expanded>1</expanded>
|
446 |
<fields>
|
447 |
<note translate="label">
|
448 |
-
<label><![CDATA[This option allows you to include/exclude product from the
|
449 |
<frontend_model>channable/adminhtml_system_config_form_field_note</frontend_model>
|
450 |
<sort_order>1</sort_order>
|
451 |
<show_in_default>1</show_in_default>
|
371 |
<depends><conf_enabled>1</conf_enabled></depends>
|
372 |
<comment>Use parent data</comment>
|
373 |
</conf_fields>
|
374 |
+
<conf_switch_urls translate="label">
|
375 |
+
<label>Configurable Switch Urls</label>
|
376 |
+
<frontend_type>select</frontend_type>
|
377 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
378 |
+
<sort_order>93</sort_order>
|
379 |
+
<show_in_default>1</show_in_default>
|
380 |
+
<show_in_website>1</show_in_website>
|
381 |
+
<show_in_store>1</show_in_store>
|
382 |
+
<depends><conf_enabled>1</conf_enabled></depends>
|
383 |
+
<comment>Create a specific url for the simple products inside the configurable products to make sure the prices and information is correct.</comment>
|
384 |
+
</conf_switch_urls>
|
385 |
<grouped_price translate="label">
|
386 |
<label>Grouped Price</label>
|
387 |
<frontend_type>select</frontend_type>
|
388 |
<source_model>channable/adminhtml_system_config_source_pricemodel</source_model>
|
389 |
+
<sort_order>94</sort_order>
|
390 |
<show_in_default>1</show_in_default>
|
391 |
<show_in_website>1</show_in_website>
|
392 |
<show_in_store>1</show_in_store>
|
393 |
+
</grouped_price>
|
394 |
</fields>
|
395 |
</data>
|
396 |
<advanced translate="label" module="channable">
|
456 |
<expanded>1</expanded>
|
457 |
<fields>
|
458 |
<note translate="label">
|
459 |
+
<label><![CDATA[This option allows you to include/exclude product from the Channable feed. <br>]]></label>
|
460 |
<frontend_model>channable/adminhtml_system_config_form_field_note</frontend_model>
|
461 |
<sort_order>1</sort_order>
|
462 |
<show_in_default>1</show_in_default>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Magmodules_Channable</name>
|
4 |
-
<version>1.3.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.magmodules.eu/license-agreement/">Single Server License</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>Magmodules_Channable</description>
|
11 |
<notes>Channable Connect</notes>
|
12 |
<authors><author><name>Magmodules</name><user>auto-converted</user><email>info@magmodules.nl</email></author></authors>
|
13 |
-
<date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Magmodules"><dir name="Channable"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Extra.php" hash="9288e8a22a0134475bc44fd5c1240849"/><file name="Shipping.php" hash="0fa8d17c32c828a0d4f68d897c455f3b"/></dir><dir name="Renderer"><file name="Select.php" hash="2657667fe85d29ddf2a5080ff2ec5a50"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Feeds.php" hash="a52355d4909a425a0f4cbbfb137f6d04"/><file name="Heading.php" hash="633b7c330bcb5900c7feae34e95d9fda"/><file name="Note.php" hash="ad97b87c2e8a0692098fb667dde75331"/><file name="Token.php" hash="2776dfd599605df190c4cf21833751c1"/><file name="Version.php" hash="31ab0c3609ee145b551f0158268bc212"/></dir></dir></dir></dir><dir name="Widget"><dir name="Info"><file name="Info.php" hash="7ac9087428330d5fb6c46be612dda16d"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Magmodules_Channable</name>
|
4 |
+
<version>1.3.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.magmodules.eu/license-agreement/">Single Server License</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Magmodules_Channable</description>
|
11 |
<notes>Channable Connect</notes>
|
12 |
<authors><author><name>Magmodules</name><user>auto-converted</user><email>info@magmodules.nl</email></author></authors>
|
13 |
+
<date>2016-01-19</date>
|
14 |
+
<time>09:39:13</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Magmodules"><dir name="Channable"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Extra.php" hash="9288e8a22a0134475bc44fd5c1240849"/><file name="Shipping.php" hash="0fa8d17c32c828a0d4f68d897c455f3b"/></dir><dir name="Renderer"><file name="Select.php" hash="2657667fe85d29ddf2a5080ff2ec5a50"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Feeds.php" hash="a52355d4909a425a0f4cbbfb137f6d04"/><file name="Heading.php" hash="633b7c330bcb5900c7feae34e95d9fda"/><file name="Note.php" hash="ad97b87c2e8a0692098fb667dde75331"/><file name="Token.php" hash="2776dfd599605df190c4cf21833751c1"/><file name="Version.php" hash="31ab0c3609ee145b551f0158268bc212"/></dir></dir></dir></dir><dir name="Widget"><dir name="Info"><file name="Info.php" hash="7ac9087428330d5fb6c46be612dda16d"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="704c3de8f540f5641fb93f53b6115519"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Design"><file name="Extra.php" hash="eb3f7a890881c91e81cb77689f96d788"/><file name="Shipping.php" hash="adc990676f255344e267b91e194ec093"/></dir></dir><dir name="Source"><file name="Action.php" hash="51da5aa9c1bcfd691d4ed32e82f89541"/><file name="Attribute.php" hash="cd7715df0bda2432e304f7383349cefa"/><file name="Category.php" hash="9f4b9c7b0430bb9a454afec43d5a446b"/><file name="Categorytype.php" hash="e0438b44f2b29674456728145d1f4f9c"/><file name="Configurable.php" hash="225cbd8f3b9f1381136a3ef79be5dc9f"/><file name="Images.php" hash="7f0fc55582c25580fc230fb247a7fd86"/><file name="Pricemodel.php" hash="265f426b67355ed02fd4aad9179a8bf7"/><file name="Selectattribute.php" hash="c0fe15d0206bc7fd6ec2a39cd97f349d"/><file name="Tax.php" hash="534795c315765bc4ec23fdef8184ba31"/><file name="Textattribute.php" hash="8093b591bba8554936f5c84d9bfb11a6"/><file name="Type.php" hash="083a651459b0c0ca5fa939d2528fad87"/><file name="Visibility.php" hash="c2e80831d9d8b5fc6cd642a590812a56"/><file name="Weight.php" hash="ba1e3c862ea2779c275d3d267b819435"/></dir></dir></dir></dir><file name="Channable.php" hash="abcd0e86f7db4cf9cef9e895a68296b7"/><file name="Common.php" hash="70def4c29e590e26cbbd8097de7d0216"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ChannableController.php" hash="a60c879d83956e568f45bda580e8a1a8"/></dir><file name="FeedController.php" hash="473afd692bfff811fbe199ce39899e79"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d0343b3683cb40691a882015fd5a8341"/><file name="config.xml" hash="72c5acfedad919c5db066c349e623fb4"/><file name="system.xml" hash="957b3d52a16c1e5174bdd492d74cecff"/></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Magmodules_Channable.csv" hash="342ab8e5f81e36067a6129189ca72b6e"/></dir><dir name="nl_NL"><file name="Magmodules_Channable.csv" hash="462df316feb223708a2a104cd11d556c"/></dir></target><target name="mageetc"><dir name="modules"><file name="Magmodules_Channable.xml" hash="061032d718f1ddd64de211fc7133685c"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|