Version Notes
Advanced Promotions Magento Extension allows to significantly speed-up Admin's work with Shopping Cart Price Rules and Catalog Price Rules by adding some very useful features. With this extension you can import & export rules, mass-update status or mass delete from the grid, view and search coupon codes by order number, shopping cart rules, coupon usage, etc.
Download this release
Release Info
Developer | Plumrocket Team |
Extension | Plumrocket_AdvancedPromotions |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
- app/code/community/Plumrocket/AdvancedPromotions/Block/Adminhtml/Coupons/Grid.php +12 -28
- app/code/community/Plumrocket/AdvancedPromotions/Block/Adminhtml/Coupons/Grid/Renderer/Order.php +3 -3
- app/code/community/Plumrocket/AdvancedPromotions/Block/Adminhtml/Coupons/Grid/Renderer/Rule.php +1 -1
- app/code/community/Plumrocket/AdvancedPromotions/Helper/Data.php +2 -0
- app/code/community/Plumrocket/AdvancedPromotions/Model/Cron.php +24 -0
- app/code/community/Plumrocket/AdvancedPromotions/Model/{Resource/Grid/Collection.php → Index.php} +9 -8
- app/code/community/Plumrocket/AdvancedPromotions/Model/Mysql4/Grid/Collection.php +42 -0
- app/code/community/Plumrocket/AdvancedPromotions/Model/Mysql4/Index.php +61 -0
- app/code/community/Plumrocket/AdvancedPromotions/Model/Mysql4/Index/Collection.php +26 -0
- app/code/community/Plumrocket/AdvancedPromotions/controllers/Adminhtml/Prpromo/CouponsController.php +22 -0
- app/code/community/Plumrocket/AdvancedPromotions/etc/config.xml +38 -6
- app/code/community/Plumrocket/AdvancedPromotions/sql/pradvancedpromotions_setup/mysql4-upgrade-1.0.0-1.0.1.php +49 -0
- app/etc/modules/Plumrocket_AdvancedPromotions.xml +1 -1
- package.xml +6 -6
app/code/community/Plumrocket/AdvancedPromotions/Block/Adminhtml/Coupons/Grid.php
CHANGED
@@ -21,29 +21,13 @@ class Plumrocket_Advancedpromotions_Block_Adminhtml_Coupons_Grid extends Mage_Ad
|
|
21 |
{
|
22 |
parent::__construct();
|
23 |
$this->setId('coupons_and_orders_grid');
|
24 |
-
$this->setDefaultSort('
|
25 |
$this->setDefaultDir('DESC');
|
26 |
}
|
27 |
|
28 |
protected function _prepareCollection()
|
29 |
{
|
30 |
-
|
31 |
-
$resource = Mage::getSingleton('core/resource');
|
32 |
-
$collection = new Plumrocket_AdvancedPromotions_Model_Resource_Grid_Collection;
|
33 |
-
$collection->getSelect()
|
34 |
-
->joinLeft(array('cp' => $resource->getTableName('salesrule/coupon')),
|
35 |
-
'main_table.rule_id = cp.rule_id',
|
36 |
-
array('code')
|
37 |
-
)
|
38 |
-
->joinLeft(array('o' => $resource->getTableName('sales/order')),
|
39 |
-
'FIND_IN_SET(main_table.rule_id, o.applied_rule_ids) AND o.coupon_code IS NULL
|
40 |
-
or o.coupon_code = cp.code
|
41 |
-
',
|
42 |
-
array('entity_id', 'increment_id', 'base_grand_total')
|
43 |
-
)->where('cp.code IS NOT NULL OR o.increment_id IS NOT NULL');
|
44 |
-
|
45 |
-
$collection->addFilterToMap('code', 'cp.code');
|
46 |
-
|
47 |
$this->setCollection($collection);
|
48 |
|
49 |
return parent::_prepareCollection();
|
@@ -51,32 +35,32 @@ class Plumrocket_Advancedpromotions_Block_Adminhtml_Coupons_Grid extends Mage_Ad
|
|
51 |
|
52 |
protected function _prepareColumns()
|
53 |
{
|
54 |
-
$this->addColumn('
|
55 |
'header' => Mage::helper('salesrule')->__('Rule ID'),
|
56 |
'index' => 'rule_id',
|
57 |
'width' => '50'
|
58 |
));
|
59 |
|
60 |
-
$this->addColumn('
|
61 |
'header' => Mage::helper('salesrule')->__('Rule Name'),
|
62 |
-
'index' => '
|
63 |
'renderer' => 'pradvancedpromotions/adminhtml_coupons_grid_renderer_rule',
|
64 |
));
|
65 |
|
66 |
-
$this->addColumn('
|
67 |
'header' => Mage::helper('salesrule')->__('Coupon Code'),
|
68 |
-
'index' => '
|
69 |
));
|
70 |
|
71 |
-
$this->addColumn('
|
72 |
'header' => Mage::helper('sales')->__('Order #'),
|
73 |
-
'index' => '
|
74 |
'renderer' => 'pradvancedpromotions/adminhtml_coupons_grid_renderer_order',
|
75 |
));
|
76 |
|
77 |
-
$this->addColumn('
|
78 |
-
'header' => Mage::helper('sales')->__('
|
79 |
-
'index' => '
|
80 |
'type' => 'number'
|
81 |
));
|
82 |
|
21 |
{
|
22 |
parent::__construct();
|
23 |
$this->setId('coupons_and_orders_grid');
|
24 |
+
$this->setDefaultSort('rule_id');
|
25 |
$this->setDefaultDir('DESC');
|
26 |
}
|
27 |
|
28 |
protected function _prepareCollection()
|
29 |
{
|
30 |
+
$collection = Mage::getSingleton('pradvancedpromotions/index')->getCollection();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
$this->setCollection($collection);
|
32 |
|
33 |
return parent::_prepareCollection();
|
35 |
|
36 |
protected function _prepareColumns()
|
37 |
{
|
38 |
+
$this->addColumn('rule_id', array(
|
39 |
'header' => Mage::helper('salesrule')->__('Rule ID'),
|
40 |
'index' => 'rule_id',
|
41 |
'width' => '50'
|
42 |
));
|
43 |
|
44 |
+
$this->addColumn('rule_name', array(
|
45 |
'header' => Mage::helper('salesrule')->__('Rule Name'),
|
46 |
+
'index' => 'rule_name',
|
47 |
'renderer' => 'pradvancedpromotions/adminhtml_coupons_grid_renderer_rule',
|
48 |
));
|
49 |
|
50 |
+
$this->addColumn('coupon_code', array(
|
51 |
'header' => Mage::helper('salesrule')->__('Coupon Code'),
|
52 |
+
'index' => 'coupon_code'
|
53 |
));
|
54 |
|
55 |
+
$this->addColumn('order_increment_id', array(
|
56 |
'header' => Mage::helper('sales')->__('Order #'),
|
57 |
+
'index' => 'order_increment_id',
|
58 |
'renderer' => 'pradvancedpromotions/adminhtml_coupons_grid_renderer_order',
|
59 |
));
|
60 |
|
61 |
+
$this->addColumn('gt', array(
|
62 |
+
'header' => Mage::helper('sales')->__('Grand Total (Base)'),
|
63 |
+
'index' => 'gt',
|
64 |
'type' => 'number'
|
65 |
));
|
66 |
|
app/code/community/Plumrocket/AdvancedPromotions/Block/Adminhtml/Coupons/Grid/Renderer/Order.php
CHANGED
@@ -20,10 +20,10 @@ class Plumrocket_Advancedpromotions_Block_Adminhtml_Coupons_Grid_Renderer_Order
|
|
20 |
{
|
21 |
public function render(Varien_Object $row)
|
22 |
{
|
23 |
-
$href = Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/view', array('order_id' => $row->
|
24 |
|
25 |
-
if ($row->
|
26 |
-
return '<a href="' . $href . '" target="_blank">' . $row->
|
27 |
}
|
28 |
|
29 |
return '';
|
20 |
{
|
21 |
public function render(Varien_Object $row)
|
22 |
{
|
23 |
+
$href = Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/view', array('order_id' => $row->getOrderId()));
|
24 |
|
25 |
+
if ($row->getOrderIncrementId()) {
|
26 |
+
return '<a href="' . $href . '" target="_blank">' . $row->getOrderIncrementId() . '</a>';
|
27 |
}
|
28 |
|
29 |
return '';
|
app/code/community/Plumrocket/AdvancedPromotions/Block/Adminhtml/Coupons/Grid/Renderer/Rule.php
CHANGED
@@ -22,6 +22,6 @@ class Plumrocket_Advancedpromotions_Block_Adminhtml_Coupons_Grid_Renderer_Rule
|
|
22 |
{
|
23 |
$href = Mage::helper('adminhtml')->getUrl('adminhtml/promo_quote/edit', array('id' => $row->getRuleId()));
|
24 |
|
25 |
-
return '<a href="' . $href . '" target="_blank">' . $row->
|
26 |
}
|
27 |
}
|
22 |
{
|
23 |
$href = Mage::helper('adminhtml')->getUrl('adminhtml/promo_quote/edit', array('id' => $row->getRuleId()));
|
24 |
|
25 |
+
return '<a href="' . $href . '" target="_blank">' . $row->getRuleName() . '</a>';
|
26 |
}
|
27 |
}
|
app/code/community/Plumrocket/AdvancedPromotions/Helper/Data.php
CHANGED
@@ -17,6 +17,8 @@
|
|
17 |
|
18 |
class Plumrocket_AdvancedPromotions_Helper_Data extends Plumrocket_AdvancedPromotions_Helper_Main
|
19 |
{
|
|
|
|
|
20 |
public function moduleEnabled($store = null)
|
21 |
{
|
22 |
return true;
|
17 |
|
18 |
class Plumrocket_AdvancedPromotions_Helper_Data extends Plumrocket_AdvancedPromotions_Helper_Main
|
19 |
{
|
20 |
+
const RUNTIME_CONFIG_KEY = 'pradvancedpromotions/cron/runtime';
|
21 |
+
|
22 |
public function moduleEnabled($store = null)
|
23 |
{
|
24 |
return true;
|
app/code/community/Plumrocket/AdvancedPromotions/Model/Cron.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plumrocket Inc.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the End-user License Agreement
|
8 |
+
* that is available through the world-wide-web at this URL:
|
9 |
+
* http://wiki.plumrocket.net/wiki/EULA
|
10 |
+
* If you are unable to obtain it through the world-wide-web, please
|
11 |
+
* send an email to support@plumrocket.com so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* @package Plumrocket_AdvancedPromotions
|
14 |
+
* @copyright Copyright (c) 2017 Plumrocket Inc. (http://www.plumrocket.com)
|
15 |
+
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Plumrocket_AdvancedPromotions_Model_Cron
|
19 |
+
{
|
20 |
+
public function reindex()
|
21 |
+
{
|
22 |
+
Mage::getSingleton('pradvancedpromotions/index')->reindex();
|
23 |
+
}
|
24 |
+
}
|
app/code/community/Plumrocket/AdvancedPromotions/Model/{Resource/Grid/Collection.php → Index.php}
RENAMED
@@ -15,16 +15,17 @@
|
|
15 |
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
|
16 |
*/
|
17 |
|
18 |
-
class
|
19 |
{
|
20 |
-
public static $itemInc = 0;
|
21 |
|
22 |
-
|
23 |
{
|
24 |
-
|
25 |
-
|
26 |
-
$item->setId(self::$itemInc);
|
27 |
-
|
28 |
-
return parent::addItem($item);
|
29 |
}
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
15 |
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
|
16 |
*/
|
17 |
|
18 |
+
class Plumrocket_AdvancedPromotions_Model_Index extends Mage_Core_Model_Abstract
|
19 |
{
|
|
|
20 |
|
21 |
+
public function _construct()
|
22 |
{
|
23 |
+
parent::_construct();
|
24 |
+
$this->_init('pradvancedpromotions/index');
|
|
|
|
|
|
|
25 |
}
|
26 |
+
|
27 |
+
public function reindex()
|
28 |
+
{
|
29 |
+
$this->_getResource()->reindex();
|
30 |
+
}
|
31 |
}
|
app/code/community/Plumrocket/AdvancedPromotions/Model/Mysql4/Grid/Collection.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plumrocket Inc.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the End-user License Agreement
|
8 |
+
* that is available through the world-wide-web at this URL:
|
9 |
+
* http://wiki.plumrocket.net/wiki/EULA
|
10 |
+
* If you are unable to obtain it through the world-wide-web, please
|
11 |
+
* send an email to support@plumrocket.com so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* @package Plumrocket_AdvancedPromotions
|
14 |
+
* @copyright Copyright (c) 2017 Plumrocket Inc. (http://www.plumrocket.com)
|
15 |
+
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Plumrocket_AdvancedPromotions_Model_Mysql4_Grid_Collection extends Mage_SalesRule_Model_Resource_Rule_Collection
|
19 |
+
{
|
20 |
+
public static $itemInc = 0;
|
21 |
+
|
22 |
+
public function addItem(Varien_Object $item)
|
23 |
+
{
|
24 |
+
self::$itemInc++;
|
25 |
+
$item->setIdFieldName('fake_id');
|
26 |
+
$item->setId(self::$itemInc);
|
27 |
+
|
28 |
+
return parent::addItem($item);
|
29 |
+
}
|
30 |
+
|
31 |
+
public function _initSelect()
|
32 |
+
{
|
33 |
+
Mage_Rule_Model_Resource_Rule_Collection_Abstract::_initSelect();
|
34 |
+
$this->getSelect()
|
35 |
+
->joinLeft(
|
36 |
+
array('rule_coupons' => $this->getTable('salesrule/coupon')),
|
37 |
+
'main_table.rule_id = rule_coupons.rule_id AND rule_coupons.is_primary = 1',
|
38 |
+
array()
|
39 |
+
);
|
40 |
+
return $this;
|
41 |
+
}
|
42 |
+
}
|
app/code/community/Plumrocket/AdvancedPromotions/Model/Mysql4/Index.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plumrocket Inc.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the End-user License Agreement
|
8 |
+
* that is available through the world-wide-web at this URL:
|
9 |
+
* http://wiki.plumrocket.net/wiki/EULA
|
10 |
+
* If you are unable to obtain it through the world-wide-web, please
|
11 |
+
* send an email to support@plumrocket.com so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* @package Plumrocket_AdvancedPromotions
|
14 |
+
* @copyright Copyright (c) 2017 Plumrocket Inc. (http://www.plumrocket.com)
|
15 |
+
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Plumrocket_AdvancedPromotions_Model_Mysql4_Index extends Mage_Core_Model_Mysql4_Abstract
|
19 |
+
{
|
20 |
+
public function _construct()
|
21 |
+
{
|
22 |
+
$this->_init('pradvancedpromotions/index', 'index_id');
|
23 |
+
}
|
24 |
+
|
25 |
+
public function reindex()
|
26 |
+
{
|
27 |
+
$resource = Mage::getSingleton('core/resource');
|
28 |
+
|
29 |
+
$this->_getWriteAdapter()->query('DELETE FROM ' . $resource->getTableName('pradvancedpromotions/index'));
|
30 |
+
|
31 |
+
$collection = new Plumrocket_AdvancedPromotions_Model_Mysql4_Grid_Collection;
|
32 |
+
$collection
|
33 |
+
->addFieldToSelect('rule_id')
|
34 |
+
->addFieldToSelect('name');
|
35 |
+
$collection->getSelect()
|
36 |
+
->joinLeft(array('cp' => $resource->getTableName('salesrule/coupon')),
|
37 |
+
'main_table.rule_id = cp.rule_id',
|
38 |
+
array('code')
|
39 |
+
)->joinLeft(array('o' => $resource->getTableName('sales/order')),
|
40 |
+
'FIND_IN_SET(main_table.rule_id, o.applied_rule_ids) AND o.coupon_code IS NULL
|
41 |
+
or o.coupon_code = cp.code
|
42 |
+
',
|
43 |
+
array('entity_id', 'increment_id', 'base_grand_total')
|
44 |
+
)->where('cp.code IS NOT NULL OR o.increment_id IS NOT NULL');
|
45 |
+
|
46 |
+
$collection->addFilterToMap('code', 'cp.code');
|
47 |
+
|
48 |
+
$query = 'INSERT INTO ' . $resource->getTableName('pradvancedpromotions/index'). ' (rule_id, rule_name, coupon_code, order_id, order_increment_id, gt) ' .
|
49 |
+
(string) $collection->getSelect();
|
50 |
+
|
51 |
+
$this->_getWriteAdapter()->query($query);
|
52 |
+
|
53 |
+
Mage::getConfig()->saveConfig(
|
54 |
+
Plumrocket_AdvancedPromotions_Helper_Data::RUNTIME_CONFIG_KEY,
|
55 |
+
Mage::getSingleton('core/date')->timestamp(),
|
56 |
+
'default',
|
57 |
+
0
|
58 |
+
)->reinit();
|
59 |
+
|
60 |
+
}
|
61 |
+
}
|
app/code/community/Plumrocket/AdvancedPromotions/Model/Mysql4/Index/Collection.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plumrocket Inc.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the End-user License Agreement
|
8 |
+
* that is available through the world-wide-web at this URL:
|
9 |
+
* http://wiki.plumrocket.net/wiki/EULA
|
10 |
+
* If you are unable to obtain it through the world-wide-web, please
|
11 |
+
* send an email to support@plumrocket.com so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* @package Plumrocket_AdvancedPromotions
|
14 |
+
* @copyright Copyright (c) 2017 Plumrocket Inc. (http://www.plumrocket.com)
|
15 |
+
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Plumrocket_AdvancedPromotions_Model_Mysql4_Index_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
19 |
+
{
|
20 |
+
public function _construct()
|
21 |
+
{
|
22 |
+
parent::_construct();
|
23 |
+
$this->_init('pradvancedpromotions/index');
|
24 |
+
}
|
25 |
+
|
26 |
+
}
|
app/code/community/Plumrocket/AdvancedPromotions/controllers/Adminhtml/Prpromo/CouponsController.php
CHANGED
@@ -19,6 +19,16 @@ class Plumrocket_AdvancedPromotions_Adminhtml_Prpromo_CouponsController extends
|
|
19 |
{
|
20 |
public function indexAction()
|
21 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
$this->loadLayout()
|
23 |
->_setActiveMenu('promo')
|
24 |
->_title($this->__('Orders & Coupons'));
|
@@ -26,6 +36,18 @@ class Plumrocket_AdvancedPromotions_Adminhtml_Prpromo_CouponsController extends
|
|
26 |
$this->renderLayout();
|
27 |
}
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
protected function _isAllowed()
|
30 |
{
|
31 |
return Mage::getSingleton('admin/session')->isAllowed('promo/quote/shopping_cart_coupons');
|
19 |
{
|
20 |
public function indexAction()
|
21 |
{
|
22 |
+
if (!Mage::getStoreConfig(Plumrocket_AdvancedPromotions_Helper_Data::RUNTIME_CONFIG_KEY)) {
|
23 |
+
Mage::getSingleton('pradvancedpromotions/index')->reindex();
|
24 |
+
}
|
25 |
+
|
26 |
+
Mage::getSingleton('adminhtml/session')->addNotice(
|
27 |
+
Mage::helper('core')->__('Last updated: %s. To refresh last Orders & Coupons data, click <a href="%s">here</a>.',
|
28 |
+
date('M d, Y g:i:s A', Mage::getStoreConfig(Plumrocket_AdvancedPromotions_Helper_Data::RUNTIME_CONFIG_KEY)),
|
29 |
+
Mage::helper('adminhtml')->getUrl('*/*/refresh')
|
30 |
+
)
|
31 |
+
);
|
32 |
$this->loadLayout()
|
33 |
->_setActiveMenu('promo')
|
34 |
->_title($this->__('Orders & Coupons'));
|
36 |
$this->renderLayout();
|
37 |
}
|
38 |
|
39 |
+
public function refreshAction()
|
40 |
+
{
|
41 |
+
try {
|
42 |
+
Mage::getSingleton('pradvancedpromotions/index')->reindex();
|
43 |
+
Mage::getSingleton('adminhtml/session')->addSuccess('Data refreshed successfully.');
|
44 |
+
} catch (Exception $e) {
|
45 |
+
Mage::getSingleton('adminhtml/session')->addError('Cannot refresh data. '. $e->getMessage());
|
46 |
+
}
|
47 |
+
|
48 |
+
$this->_redirectReferer();
|
49 |
+
}
|
50 |
+
|
51 |
protected function _isAllowed()
|
52 |
{
|
53 |
return Mage::getSingleton('admin/session')->isAllowed('promo/quote/shopping_cart_coupons');
|
app/code/community/Plumrocket/AdvancedPromotions/etc/config.xml
CHANGED
@@ -20,20 +20,40 @@
|
|
20 |
<modules>
|
21 |
<Plumrocket_AdvancedPromotions>
|
22 |
<wiki>http://wiki.plumrocket.com/wiki/Advanced_Promotions_v1.x</wiki>
|
23 |
-
<version>1.0.
|
24 |
</Plumrocket_AdvancedPromotions>
|
25 |
</modules>
|
26 |
<global>
|
27 |
-
<models>
|
28 |
-
<pradvancedpromotions>
|
29 |
-
<class>Plumrocket_AdvancedPromotions_Model</class>
|
30 |
-
</pradvancedpromotions>
|
31 |
-
</models>
|
32 |
<helpers>
|
33 |
<pradvancedpromotions>
|
34 |
<class>Plumrocket_AdvancedPromotions_Helper</class>
|
35 |
</pradvancedpromotions>
|
36 |
</helpers>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
<blocks>
|
38 |
<pradvancedpromotions>
|
39 |
<class>Plumrocket_AdvancedPromotions_Block</class>
|
@@ -94,4 +114,16 @@
|
|
94 |
</adminhtml>
|
95 |
</routers>
|
96 |
</admin>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
</config>
|
20 |
<modules>
|
21 |
<Plumrocket_AdvancedPromotions>
|
22 |
<wiki>http://wiki.plumrocket.com/wiki/Advanced_Promotions_v1.x</wiki>
|
23 |
+
<version>1.0.1</version>
|
24 |
</Plumrocket_AdvancedPromotions>
|
25 |
</modules>
|
26 |
<global>
|
|
|
|
|
|
|
|
|
|
|
27 |
<helpers>
|
28 |
<pradvancedpromotions>
|
29 |
<class>Plumrocket_AdvancedPromotions_Helper</class>
|
30 |
</pradvancedpromotions>
|
31 |
</helpers>
|
32 |
+
<models>
|
33 |
+
<pradvancedpromotions>
|
34 |
+
<class>Plumrocket_AdvancedPromotions_Model</class>
|
35 |
+
<resourceModel>pradvancedpromotions_mysql4</resourceModel>
|
36 |
+
</pradvancedpromotions>
|
37 |
+
<pradvancedpromotions_mysql4>
|
38 |
+
<class>Plumrocket_AdvancedPromotions_Model_Mysql4</class>
|
39 |
+
<entities>
|
40 |
+
<index>
|
41 |
+
<table>pradvancedpromotions_index</table>
|
42 |
+
</index>
|
43 |
+
</entities>
|
44 |
+
</pradvancedpromotions_mysql4>
|
45 |
+
</models>
|
46 |
+
|
47 |
+
<resources>
|
48 |
+
<pradvancedpromotions_setup>
|
49 |
+
<setup>
|
50 |
+
<module>Plumrocket_AdvancedPromotions</module>
|
51 |
+
</setup>
|
52 |
+
<connection>
|
53 |
+
<use>core_setup</use>
|
54 |
+
</connection>
|
55 |
+
</pradvancedpromotions_setup>
|
56 |
+
</resources>
|
57 |
<blocks>
|
58 |
<pradvancedpromotions>
|
59 |
<class>Plumrocket_AdvancedPromotions_Block</class>
|
114 |
</adminhtml>
|
115 |
</routers>
|
116 |
</admin>
|
117 |
+
<crontab>
|
118 |
+
<jobs>
|
119 |
+
<pradvancedpromotions_reindex>
|
120 |
+
<schedule>
|
121 |
+
<cron_expr>15 6 * * *</cron_expr>
|
122 |
+
</schedule>
|
123 |
+
<run>
|
124 |
+
<model>pradvancedpromotions/cron::reindex</model>
|
125 |
+
</run>
|
126 |
+
</pradvancedpromotions_reindex>
|
127 |
+
</jobs>
|
128 |
+
</crontab>
|
129 |
</config>
|
app/code/community/Plumrocket/AdvancedPromotions/sql/pradvancedpromotions_setup/mysql4-upgrade-1.0.0-1.0.1.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plumrocket Inc.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the End-user License Agreement
|
8 |
+
* that is available through the world-wide-web at this URL:
|
9 |
+
* http://wiki.plumrocket.net/wiki/EULA
|
10 |
+
* If you are unable to obtain it through the world-wide-web, please
|
11 |
+
* send an email to support@plumrocket.com so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* @package Plumrocket_AdvancedPromotions
|
14 |
+
* @copyright Copyright (c) 2017 Plumrocket Inc. (http://www.plumrocket.com)
|
15 |
+
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
|
16 |
+
*/
|
17 |
+
|
18 |
+
$installer = $this;
|
19 |
+
$installer->startSetup();
|
20 |
+
$sql = "CREATE TABLE IF NOT EXISTS `{$this->getTable('pradvancedpromotions_index')}` (
|
21 |
+
`index_id` int(11) NOT NULL,
|
22 |
+
`rule_id` int(11) NOT NULL,
|
23 |
+
`rule_name` varchar(255) NOT NULL,
|
24 |
+
`coupon_code` varchar(255) NOT NULL,
|
25 |
+
`order_id` int(11) NOT NULL,
|
26 |
+
`order_increment_id` varchar(255) NOT NULL,
|
27 |
+
`gt` float NOT NULL
|
28 |
+
) ENGINE=MyISAM;";
|
29 |
+
|
30 |
+
$installer->run($sql);
|
31 |
+
|
32 |
+
$sql = "ALTER TABLE `{$this->getTable('pradvancedpromotions_index')}`
|
33 |
+
ADD PRIMARY KEY (`index_id`),
|
34 |
+
ADD KEY `rule_id` (`rule_id`),
|
35 |
+
ADD KEY `rule_name` (`rule_name`),
|
36 |
+
ADD KEY `coupon_code` (`coupon_code`),
|
37 |
+
ADD KEY `order_id` (`order_id`),
|
38 |
+
ADD KEY `order_increment_id` (`order_increment_id`),
|
39 |
+
ADD KEY `gt` (`gt`);";
|
40 |
+
$installer->run($sql);
|
41 |
+
|
42 |
+
$sql = "ALTER TABLE `{$this->getTable('pradvancedpromotions_index')}`
|
43 |
+
MODIFY `index_id` int(11) NOT NULL AUTO_INCREMENT;";
|
44 |
+
$installer->run($sql);
|
45 |
+
|
46 |
+
|
47 |
+
|
48 |
+
|
49 |
+
$installer->endSetup();
|
app/etc/modules/Plumrocket_AdvancedPromotions.xml
CHANGED
@@ -21,7 +21,7 @@
|
|
21 |
<Plumrocket_AdvancedPromotions>
|
22 |
<active>true</active>
|
23 |
<codePool>community</codePool>
|
24 |
-
<version>1.0.
|
25 |
<name>Advanced Promotions</name>
|
26 |
<depends>
|
27 |
<Plumrocket_Base />
|
21 |
<Plumrocket_AdvancedPromotions>
|
22 |
<active>true</active>
|
23 |
<codePool>community</codePool>
|
24 |
+
<version>1.0.1</version>
|
25 |
<name>Advanced Promotions</name>
|
26 |
<depends>
|
27 |
<Plumrocket_Base />
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Plumrocket_AdvancedPromotions</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://wiki.plumrocket.net/wiki/EULA">End-user License Agreement</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Advanced Promotions Magento Extension allows to significantly speed-up Admin's work with Shopping Cart Price Rules and Catalog Price Rules by adding some very useful features.</summary>
|
10 |
<description>With this extension you can import & export rules, mass-update status or mass delete from the grid, view and search coupon codes by order number, shopping cart rules, coupon usage, etc.</description>
|
11 |
-
<notes>
|
12 |
<authors><author><name>Plumrocket Team</name><user>plumrocket</user><email>support@plumrocket.com</email></author></authors>
|
13 |
-
<date>2017-02-
|
14 |
-
<time>
|
15 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Plumrocket_AdvancedPromotions.xml" hash="
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php><package><name>Plumrocket_Base</name><channel>community</channel><min/><max/></package
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Plumrocket_AdvancedPromotions</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://wiki.plumrocket.net/wiki/EULA">End-user License Agreement</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Advanced Promotions Magento Extension allows to significantly speed-up Admin's work with Shopping Cart Price Rules and Catalog Price Rules by adding some very useful features.</summary>
|
10 |
<description>With this extension you can import & export rules, mass-update status or mass delete from the grid, view and search coupon codes by order number, shopping cart rules, coupon usage, etc.</description>
|
11 |
+
<notes>Advanced Promotions Magento Extension allows to significantly speed-up Admin's work with Shopping Cart Price Rules and Catalog Price Rules by adding some very useful features. With this extension you can import & export rules, mass-update status or mass delete from the grid, view and search coupon codes by order number, shopping cart rules, coupon usage, etc.</notes>
|
12 |
<authors><author><name>Plumrocket Team</name><user>plumrocket</user><email>support@plumrocket.com</email></author></authors>
|
13 |
+
<date>2017-02-27</date>
|
14 |
+
<time>11:40:15</time>
|
15 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Plumrocket_AdvancedPromotions.xml" hash="eee6ffa00b04c4b9b3764bdbfdd6fabe"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pradvancedpromotions.xml" hash="105aa3df1c2ba4b95dfe5efb877035ce"/></dir><dir name="template"><dir name="pradvancedpromotions"><file name="index.phtml" hash="a980ab721b7eadfae07dac56036aa5c9"/></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Plumrocket"><dir name="AdvancedPromotions"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><file name="Edit.php" hash="5a9e3fc1569a4ad19da0825d6c7a4d55"/><file name="Grid.php" hash="d9452e846c6d338f4e8566f98eb709a4"/><dir name="Import"><file name="Form.php" hash="1a2509787b4f7c13d58e304b023a4ced"/><dir name="Tab"><file name="Main.php" hash="e904ffe2326a0870205851905700af9e"/></dir><file name="Tabs.php" hash="88795b77c355872bc9c372ff7632ca74"/></dir><file name="Import.php" hash="f71a1e4c79a7039ea2e3f68a16d489f9"/></dir><file name="Catalog.php" hash="2baac9b770037f9d330615299a140ae0"/><dir name="Coupons"><dir name="Grid"><dir name="Renderer"><file name="Order.php" hash="b4555476b78667cf36dd4dcef10623ae"/><file name="Rule.php" hash="33c6d0dceeeaea8cee080217dcd69ea6"/></dir></dir><file name="Grid.php" hash="3151e86a801222bf1740062866da5396"/></dir><file name="Coupons.php" hash="c76aab4148f877ac9c222f7d8db46c6a"/><dir name="Quote"><file name="Edit.php" hash="058b41e060878e8e20a2d2407e9ac66e"/><file name="Grid.php" hash="f11964225e023c0b99f05a0420452161"/><dir name="Import"><file name="Form.php" hash="2c0f442645acd2ea7f1b3320a097dfbe"/><dir name="Tab"><file name="Main.php" hash="800cebb9c79d73577257a571984dd1b6"/></dir><file name="Tabs.php" hash="ba44c083d481b32ee244a1addaf64eed"/></dir><file name="Import.php" hash="cdf7ad0c253adb5747bbc4fff09d4612"/></dir><file name="Quote.php" hash="a781ebdb546be89bb01c715963c30ce8"/><file name="Sales.php" hash="bf50cfa925c6d40e37b46c42d9ab9311"/></dir><dir name="System"><dir name="Config"><file name="Version.php" hash="5f3e9529ae0cc04ab8e3e4d3330ef38b"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="1c1d0259dc9be398da93b3026e51bd42"/><file name="Main.php" hash="d71c93c107c995318e2239eb2961cf72"/></dir><dir name="Model"><file name="Cron.php" hash="7b7369de6cd62d9c9201a96058182f3e"/><file name="Index.php" hash="90563e8306a79d5846aa453baa37337c"/><dir name="Mysql4"><dir name="Grid"><file name="Collection.php" hash="55d7db8ba15f8438301dd4d70abd5f64"/></dir><dir name="Index"><file name="Collection.php" hash="fc4250b29b4a098c7f72cb936fa3b8b6"/></dir><file name="Index.php" hash="059ddb6284a3d27eb79f11b1e06cb8fb"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Prpromo"><file name="CatalogController.php" hash="d7ed1dca6e26eeb149df4adf30398561"/><file name="CouponsController.php" hash="221c36a0c38f4e772853caecbbba5eb1"/><file name="QuoteController.php" hash="48233ef617ed4957586641833d317a64"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ef62e76b05bc710ea9e60d34150be19e"/><file name="config.xml" hash="713472ebe3bf81eb2c1965debb77e8f3"/><file name="system.xml" hash="16df95c84c7531cd9db7825be8e1a958"/></dir><dir name="sql"><dir name="pradvancedpromotions_setup"><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="6cfd352d87825b6286414c9f47bacbcf"/></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php><package><name>Plumrocket_Base</name><channel>community</channel><min/><max/></package></required></dependencies>
|
18 |
</package>
|