Version Notes
Gift for new customer build from scratch to work seamlessly in Magento
• Version number: 1.0.0.1
• Stability: Stable
• Compatibility: 1.5, 1.6, 1.6.1, 1.6.2.0, 1.7, 1.8
Admin will able configure ‘Gift for new customer’ related option from System > Configuration > ‘Gift for New Customer’.
Download this release
Release Info
Developer | Posixtech Ltd. |
Extension | Posixtech_Ncp |
Version | 1.0.0.1 |
Comparing to | |
See all releases |
Version 1.0.0.1
- app/code/community/Posixtech/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/Block/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/Block/Adminhtml/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/Block/Adminhtml/Sales/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/Block/Adminhtml/Sales/Items/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/Block/Adminhtml/Sales/Items/Column/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/Block/Adminhtml/Sales/Items/Column/Downloadable/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/Block/Adminhtml/Sales/Items/Column/Downloadable/Name.php +84 -0
- app/code/community/Posixtech/Ncp/Block/Adminhtml/Sales/Items/Column/Name.php +84 -0
- app/code/community/Posixtech/Ncp/Block/Sales/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/Block/Sales/Order/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/Block/Sales/Order/Item/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/Block/Sales/Order/Item/Renderer/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/Block/Sales/Order/Item/Renderer/Default.php +82 -0
- app/code/community/Posixtech/Ncp/Block/Sales/Order/Item/Renderer/Downloadable.php +82 -0
- app/code/community/Posixtech/Ncp/Helper/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/Helper/Data.php +40 -0
- app/code/community/Posixtech/Ncp/Model/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/Model/Observer.php +324 -0
- app/code/community/Posixtech/Ncp/etc/.DS_Store +0 -0
- app/code/community/Posixtech/Ncp/etc/adminhtml.xml +57 -0
- app/code/community/Posixtech/Ncp/etc/config.xml +114 -0
- app/code/community/Posixtech/Ncp/etc/system.xml +94 -0
- app/etc/modules/Posixtech_Ncp.xml +43 -0
- package.xml +54 -0
app/code/community/Posixtech/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/Block/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/Block/Adminhtml/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/Block/Adminhtml/Sales/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/Block/Adminhtml/Sales/Items/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/Block/Adminhtml/Sales/Items/Column/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/Block/Adminhtml/Sales/Items/Column/Downloadable/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/Block/Adminhtml/Sales/Items/Column/Downloadable/Name.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* Posixtech Ltd.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
*
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to info@posixtech.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* You can edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future.
|
19 |
+
*
|
20 |
+
* =================================================================
|
21 |
+
* MAGENTO EDITION USAGE NOTICE
|
22 |
+
* =================================================================
|
23 |
+
* This package designed for Magento COMMUNITY edition version 1.5.0.0 to all upper version.
|
24 |
+
* Posixtech Ltd. does not guarantee correct work of this extension
|
25 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
26 |
+
* Posixtech Ltd. does not provide extension support in case of
|
27 |
+
* incorrect edition usage.
|
28 |
+
* =================================================================
|
29 |
+
*
|
30 |
+
* @category Posixtech
|
31 |
+
* @package Ncp
|
32 |
+
* @copyright Copyright (c) 2013 Posixtech Ltd. (http://www.posixtech.com)
|
33 |
+
* @license http://www.posixtech.com/POSIXTECH_LTD_LICENSE.txt
|
34 |
+
*
|
35 |
+
*/
|
36 |
+
|
37 |
+
|
38 |
+
class Posixtech_Ncp_Block_Adminhtml_Sales_Items_Column_Downloadable_Name extends Mage_Downloadable_Block_Adminhtml_Sales_Items_Column_Downloadable_Name
|
39 |
+
{
|
40 |
+
public function getOrderOptions()
|
41 |
+
{
|
42 |
+
$result = array();
|
43 |
+
$options = null;
|
44 |
+
|
45 |
+
/**
|
46 |
+
Here the 'info_buyRequest' is a custom option assigned from Observer.php
|
47 |
+
And we need to populate the custom option in order or invoice detail page for admin panel
|
48 |
+
*/
|
49 |
+
$infoBuyRequest = $this->getItem()->getProductOptionByCode('info_buyRequest');
|
50 |
+
|
51 |
+
if(isset($infoBuyRequest['option']))
|
52 |
+
{
|
53 |
+
$option = unserialize($infoBuyRequest['option']);
|
54 |
+
$_options = array(
|
55 |
+
0=>array(
|
56 |
+
'label' => $option['label'],
|
57 |
+
'value' => $option['value'],
|
58 |
+
'print_value' => $option['value'],
|
59 |
+
/*'option_id' => '1',*/
|
60 |
+
'option_type' => 'text',
|
61 |
+
'custom_view' => true
|
62 |
+
)
|
63 |
+
);
|
64 |
+
$options = array('additional_options'=>$_options);
|
65 |
+
$options = array_merge($options, $this->getItem()->getProductOptions());
|
66 |
+
}else{
|
67 |
+
$options = $this->getItem()->getProductOptions();
|
68 |
+
}
|
69 |
+
|
70 |
+
if ($options) {
|
71 |
+
if (isset($options['options'])) {
|
72 |
+
$result = array_merge($result, $options['options']);
|
73 |
+
}
|
74 |
+
if (isset($options['additional_options'])) {
|
75 |
+
$result = array_merge($result, $options['additional_options']);
|
76 |
+
}
|
77 |
+
if (!empty($options['attributes_info'])) {
|
78 |
+
$result = array_merge($options['attributes_info'], $result);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
return $result;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
?>
|
app/code/community/Posixtech/Ncp/Block/Adminhtml/Sales/Items/Column/Name.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* Posixtech Ltd.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
*
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to info@posixtech.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* You can edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future.
|
19 |
+
*
|
20 |
+
* =================================================================
|
21 |
+
* MAGENTO EDITION USAGE NOTICE
|
22 |
+
* =================================================================
|
23 |
+
* This package designed for Magento COMMUNITY edition version 1.5.0.0 to all upper version.
|
24 |
+
* Posixtech Ltd. does not guarantee correct work of this extension
|
25 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
26 |
+
* Posixtech Ltd. does not provide extension support in case of
|
27 |
+
* incorrect edition usage.
|
28 |
+
* =================================================================
|
29 |
+
*
|
30 |
+
* @category Posixtech
|
31 |
+
* @package Ncp
|
32 |
+
* @copyright Copyright (c) 2013 Posixtech Ltd. (http://www.posixtech.com)
|
33 |
+
* @license http://www.posixtech.com/POSIXTECH_LTD_LICENSE.txt
|
34 |
+
*
|
35 |
+
*/
|
36 |
+
|
37 |
+
|
38 |
+
class Posixtech_Ncp_Block_Adminhtml_Sales_Items_Column_Name extends Mage_Adminhtml_Block_Sales_Items_Column_Name
|
39 |
+
{
|
40 |
+
public function getOrderOptions()
|
41 |
+
{
|
42 |
+
$result = array();
|
43 |
+
$options = null;
|
44 |
+
|
45 |
+
/**
|
46 |
+
Here the 'info_buyRequest' is a custom option assigned from Observer.php
|
47 |
+
And we need to populate the custom option in order or invoice detail page for admin panel
|
48 |
+
*/
|
49 |
+
$infoBuyRequest = $this->getItem()->getProductOptionByCode('info_buyRequest');
|
50 |
+
|
51 |
+
if(isset($infoBuyRequest['option']))
|
52 |
+
{
|
53 |
+
$option = unserialize($infoBuyRequest['option']);
|
54 |
+
$_options = array(
|
55 |
+
0=>array(
|
56 |
+
'label' => $option['label'],
|
57 |
+
'value' => $option['value'],
|
58 |
+
'print_value' => $option['value'],
|
59 |
+
/*'option_id' => '1',*/
|
60 |
+
'option_type' => 'text',
|
61 |
+
'custom_view' => true
|
62 |
+
)
|
63 |
+
);
|
64 |
+
$options = array('additional_options'=>$_options);
|
65 |
+
$options = array_merge($options, $this->getItem()->getProductOptions());
|
66 |
+
}else{
|
67 |
+
$options = $this->getItem()->getProductOptions();
|
68 |
+
}
|
69 |
+
|
70 |
+
if ($options) {
|
71 |
+
if (isset($options['options'])) {
|
72 |
+
$result = array_merge($result, $options['options']);
|
73 |
+
}
|
74 |
+
if (isset($options['additional_options'])) {
|
75 |
+
$result = array_merge($result, $options['additional_options']);
|
76 |
+
}
|
77 |
+
if (!empty($options['attributes_info'])) {
|
78 |
+
$result = array_merge($options['attributes_info'], $result);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
return $result;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
?>
|
app/code/community/Posixtech/Ncp/Block/Sales/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/Block/Sales/Order/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/Block/Sales/Order/Item/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/Block/Sales/Order/Item/Renderer/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/Block/Sales/Order/Item/Renderer/Default.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* Posixtech Ltd.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
*
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to info@posixtech.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* You can edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future.
|
19 |
+
*
|
20 |
+
* =================================================================
|
21 |
+
* MAGENTO EDITION USAGE NOTICE
|
22 |
+
* =================================================================
|
23 |
+
* This package designed for Magento COMMUNITY edition version 1.5.0.0 to all upper version.
|
24 |
+
* Posixtech Ltd. does not guarantee correct work of this extension
|
25 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
26 |
+
* Posixtech Ltd. does not provide extension support in case of
|
27 |
+
* incorrect edition usage.
|
28 |
+
* =================================================================
|
29 |
+
*
|
30 |
+
* @category Posixtech
|
31 |
+
* @package Ncp
|
32 |
+
* @copyright Copyright (c) 2013 Posixtech Ltd. (http://www.posixtech.com)
|
33 |
+
* @license http://www.posixtech.com/POSIXTECH_LTD_LICENSE.txt
|
34 |
+
*
|
35 |
+
*/
|
36 |
+
|
37 |
+
class Posixtech_Ncp_Block_Sales_Order_Item_Renderer_Default extends Mage_Sales_Block_Order_Item_Renderer_Default
|
38 |
+
{
|
39 |
+
/**
|
40 |
+
* This function is responsible to display the gift option in front-end
|
41 |
+
* Here the product option 'info_buyRequest' comes from Observer.php
|
42 |
+
* @return multitype:
|
43 |
+
*/
|
44 |
+
|
45 |
+
public function getItemOptions()
|
46 |
+
{
|
47 |
+
$infoBuyRequest = $this->getOrderItem()->getProductOptionByCode('info_buyRequest');
|
48 |
+
if(isset($infoBuyRequest['option']))
|
49 |
+
{
|
50 |
+
$option = unserialize($infoBuyRequest['option']);
|
51 |
+
$_options = array(
|
52 |
+
0=>array(
|
53 |
+
'label' => $option['label'],
|
54 |
+
'value' => $option['value'],
|
55 |
+
'print_value' => $option['value'],
|
56 |
+
'option_type' => 'text',
|
57 |
+
'custom_view' => true
|
58 |
+
)
|
59 |
+
);
|
60 |
+
$options = array('additional_options'=>$_options);
|
61 |
+
|
62 |
+
$options = array_merge($options, $this->getOrderItem()->getProductOptions());
|
63 |
+
}else{
|
64 |
+
$options = $this->getOrderItem()->getProductOptions();
|
65 |
+
}
|
66 |
+
|
67 |
+
$result = array();
|
68 |
+
if ($options) {
|
69 |
+
if (isset($options['options'])) {
|
70 |
+
$result = array_merge($result, $options['options']);
|
71 |
+
}
|
72 |
+
if (isset($options['additional_options'])) {
|
73 |
+
$result = array_merge($result, $options['additional_options']);
|
74 |
+
}
|
75 |
+
if (isset($options['attributes_info'])) {
|
76 |
+
$result = array_merge($result, $options['attributes_info']);
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
return $result;
|
81 |
+
}
|
82 |
+
}
|
app/code/community/Posixtech/Ncp/Block/Sales/Order/Item/Renderer/Downloadable.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* Posixtech Ltd.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
*
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to info@posixtech.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* You can edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future.
|
19 |
+
*
|
20 |
+
* =================================================================
|
21 |
+
* MAGENTO EDITION USAGE NOTICE
|
22 |
+
* =================================================================
|
23 |
+
* This package designed for Magento COMMUNITY edition version 1.5.0.0 to all upper version.
|
24 |
+
* Posixtech Ltd. does not guarantee correct work of this extension
|
25 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
26 |
+
* Posixtech Ltd. does not provide extension support in case of
|
27 |
+
* incorrect edition usage.
|
28 |
+
* =================================================================
|
29 |
+
*
|
30 |
+
* @category Posixtech
|
31 |
+
* @package Ncp
|
32 |
+
* @copyright Copyright (c) 2013 Posixtech Ltd. (http://www.posixtech.com)
|
33 |
+
* @license http://www.posixtech.com/POSIXTECH_LTD_LICENSE.txt
|
34 |
+
*
|
35 |
+
*/
|
36 |
+
|
37 |
+
class Posixtech_Ncp_Block_Sales_Order_Item_Renderer_Downloadable extends Mage_Downloadable_Block_Sales_Order_Item_Renderer_Downloadable
|
38 |
+
{
|
39 |
+
/**
|
40 |
+
* This function is responsible to display the gift option in front-end
|
41 |
+
* Here the product option 'info_buyRequest' comes from Observer.php
|
42 |
+
* @return multitype:
|
43 |
+
*/
|
44 |
+
|
45 |
+
public function getItemOptions()
|
46 |
+
{
|
47 |
+
$infoBuyRequest = $this->getOrderItem()->getProductOptionByCode('info_buyRequest');
|
48 |
+
if(isset($infoBuyRequest['option']))
|
49 |
+
{
|
50 |
+
$option = unserialize($infoBuyRequest['option']);
|
51 |
+
$_options = array(
|
52 |
+
0=>array(
|
53 |
+
'label' => $option['label'],
|
54 |
+
'value' => $option['value'],
|
55 |
+
'print_value' => $option['value'],
|
56 |
+
'option_type' => 'text',
|
57 |
+
'custom_view' => true
|
58 |
+
)
|
59 |
+
);
|
60 |
+
$options = array('additional_options'=>$_options);
|
61 |
+
|
62 |
+
$options = array_merge($options, $this->getOrderItem()->getProductOptions());
|
63 |
+
}else{
|
64 |
+
$options = $this->getOrderItem()->getProductOptions();
|
65 |
+
}
|
66 |
+
|
67 |
+
$result = array();
|
68 |
+
if ($options) {
|
69 |
+
if (isset($options['options'])) {
|
70 |
+
$result = array_merge($result, $options['options']);
|
71 |
+
}
|
72 |
+
if (isset($options['additional_options'])) {
|
73 |
+
$result = array_merge($result, $options['additional_options']);
|
74 |
+
}
|
75 |
+
if (isset($options['attributes_info'])) {
|
76 |
+
$result = array_merge($result, $options['attributes_info']);
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
return $result;
|
81 |
+
}
|
82 |
+
}
|
app/code/community/Posixtech/Ncp/Helper/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/Helper/Data.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* Posixtech Ltd.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
*
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to info@posixtech.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* You can edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future.
|
19 |
+
*
|
20 |
+
* =================================================================
|
21 |
+
* MAGENTO EDITION USAGE NOTICE
|
22 |
+
* =================================================================
|
23 |
+
* This package designed for Magento COMMUNITY edition version 1.5.0.0 to all upper version.
|
24 |
+
* Posixtech Ltd. does not guarantee correct work of this extension
|
25 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
26 |
+
* Posixtech Ltd. does not provide extension support in case of
|
27 |
+
* incorrect edition usage.
|
28 |
+
* =================================================================
|
29 |
+
*
|
30 |
+
* @category Posixtech
|
31 |
+
* @package Ncp
|
32 |
+
* @copyright Copyright (c) 2013 Posixtech Ltd. (http://www.posixtech.com)
|
33 |
+
* @license http://www.posixtech.com/POSIXTECH_LTD_LICENSE.txt
|
34 |
+
*
|
35 |
+
*/
|
36 |
+
class Posixtech_Ncp_Helper_Data extends Mage_Core_Helper_Abstract {
|
37 |
+
|
38 |
+
}
|
39 |
+
|
40 |
+
?>
|
app/code/community/Posixtech/Ncp/Model/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/Model/Observer.php
ADDED
@@ -0,0 +1,324 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* Posixtech Ltd.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
*
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to info@posixtech.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* You can edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future.
|
19 |
+
*
|
20 |
+
* =================================================================
|
21 |
+
* MAGENTO EDITION USAGE NOTICE
|
22 |
+
* =================================================================
|
23 |
+
* This package designed for Magento COMMUNITY edition version 1.5.0.0 to all upper version.
|
24 |
+
* Posixtech Ltd. does not guarantee correct work of this extension
|
25 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
26 |
+
* Posixtech Ltd. does not provide extension support in case of
|
27 |
+
* incorrect edition usage.
|
28 |
+
* =================================================================
|
29 |
+
*
|
30 |
+
* @category Posixtech
|
31 |
+
* @package Ncp
|
32 |
+
* @copyright Copyright (c) 2013 Posixtech Ltd. (http://www.posixtech.com)
|
33 |
+
* @license http://www.posixtech.com/POSIXTECH_LTD_LICENSE.txt
|
34 |
+
*
|
35 |
+
*/
|
36 |
+
class Posixtech_Ncp_Model_Observer {
|
37 |
+
/**
|
38 |
+
* Add the gift product to cart
|
39 |
+
* @param Varien_Event_Observer $obs
|
40 |
+
*/
|
41 |
+
public function addAditionalProduct(Varien_Event_Observer $obs)
|
42 |
+
{
|
43 |
+
/**
|
44 |
+
* Check the validity of this customer for the gift product validity
|
45 |
+
*/
|
46 |
+
if(!$this->_isValidForGift()){
|
47 |
+
return;
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
Check the module configuration for enable status, product id
|
52 |
+
*/
|
53 |
+
$isActive = Mage::getStoreConfig('posixtech_options/posixtech_ncp/active');
|
54 |
+
$configProductID = Mage::getStoreConfig('posixtech_options/posixtech_ncp/product_id');
|
55 |
+
|
56 |
+
if($isActive) {
|
57 |
+
$item = $obs->getProduct();
|
58 |
+
$requestProductID = $item->getId();
|
59 |
+
if($configProductID == $requestProductID) {
|
60 |
+
return;
|
61 |
+
} else {
|
62 |
+
$cartObj = Mage::getSingleton('checkout/cart');
|
63 |
+
$duplicateProductCounter = 0;
|
64 |
+
foreach ($cartObj->getItems() as $cartItem) {
|
65 |
+
if($configProductID==$cartItem->getProductId()) {
|
66 |
+
$duplicateProductCounter++;
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
if($duplicateProductCounter>=1) {
|
71 |
+
return;
|
72 |
+
}
|
73 |
+
|
74 |
+
$productModel=Mage::getModel('catalog/product');
|
75 |
+
$productObj=$productModel->load($configProductID);
|
76 |
+
$params = array();
|
77 |
+
if($productObj->getTypeId() == 'simple') {
|
78 |
+
$params['qty'] = 1;
|
79 |
+
} else {
|
80 |
+
$links = Mage::getModel('downloadable/product_type')->getLinks($productObj);
|
81 |
+
$linkId = 0;
|
82 |
+
foreach ($links as $link) {
|
83 |
+
$linkId = $link->getId();
|
84 |
+
}
|
85 |
+
|
86 |
+
$params['product'] = $configProductID;
|
87 |
+
$params['qty'] = 1;
|
88 |
+
$params['links'] = array($linkId);
|
89 |
+
}
|
90 |
+
|
91 |
+
$request = new Varien_Object();
|
92 |
+
$request->setData($params);
|
93 |
+
|
94 |
+
$cart = Mage::getModel('checkout/cart');
|
95 |
+
$cart->addProduct($productObj, $request);
|
96 |
+
$cart->save();
|
97 |
+
|
98 |
+
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
|
99 |
+
return;
|
100 |
+
}
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Modify the gift product price as a $0.00 (if the product price is not Zero)
|
107 |
+
* Assign the free gift message as a product option
|
108 |
+
* @param Varien_Event_Observer $obs
|
109 |
+
*/
|
110 |
+
public function modifyPrice(Varien_Event_Observer $obs)
|
111 |
+
{
|
112 |
+
/**
|
113 |
+
* Check the validity of this customer for the gift product validity
|
114 |
+
*/
|
115 |
+
if(!$this->_isValidForGift()){
|
116 |
+
return;
|
117 |
+
}
|
118 |
+
|
119 |
+
$isActive = Mage::getStoreConfig('posixtech_options/posixtech_ncp/active');
|
120 |
+
$configProductID = Mage::getStoreConfig('posixtech_options/posixtech_ncp/product_id');
|
121 |
+
$configProductTitle = Mage::getStoreConfig('posixtech_options/posixtech_ncp/product_title');
|
122 |
+
|
123 |
+
if($isActive) {
|
124 |
+
$item = $obs->getQuoteItem();
|
125 |
+
$requestProductID = $item->getProductId();
|
126 |
+
if($configProductID == $requestProductID) {
|
127 |
+
$lastAddedProduct = Mage::getSingleton('checkout/session')->getLastAddedProductId();
|
128 |
+
if($lastAddedProduct) {
|
129 |
+
if($lastAddedProduct != $configProductID) {
|
130 |
+
|
131 |
+
$infoRequest = unserialize($item->getOptionByCode('info_buyRequest')->getValue());
|
132 |
+
$item = ( $item->getParentItem() ? $item->getParentItem() : $item );
|
133 |
+
$price = 0;
|
134 |
+
$item->setCustomPrice($price);
|
135 |
+
$item->setQty(1);
|
136 |
+
$item->setOriginalCustomPrice($price);
|
137 |
+
$infoRequest['option'] = serialize(array(
|
138 |
+
'label' => 'Free Gift',
|
139 |
+
'value' => $configProductTitle
|
140 |
+
));
|
141 |
+
$item->getOptionByCode('info_buyRequest')->setValue(serialize($infoRequest));
|
142 |
+
$_options = array(
|
143 |
+
1 => array(
|
144 |
+
'label' => 'Free Gift',
|
145 |
+
'value' => $configProductTitle,
|
146 |
+
'print_value' => $configProductTitle,
|
147 |
+
'option_type' => 'text',
|
148 |
+
'custom_view' => true
|
149 |
+
)
|
150 |
+
);
|
151 |
+
$options = array(
|
152 |
+
'code' => 'additional_options',
|
153 |
+
'value' => serialize($_options)
|
154 |
+
);
|
155 |
+
$item->addOption($options);
|
156 |
+
|
157 |
+
$item->getProduct()->setIsSuperMode(true);
|
158 |
+
}
|
159 |
+
}
|
160 |
+
}
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* This function will ensure total number of gift product in cart
|
166 |
+
* It should be always 1
|
167 |
+
* So, customer will not able to update the qty of the gift product in cart
|
168 |
+
* @param Varien_Event_Observer $obs
|
169 |
+
*/
|
170 |
+
public function checkoutCartProductUpdateAfter(Varien_Event_Observer $obs)
|
171 |
+
{
|
172 |
+
/**
|
173 |
+
* Check the validity of this customer for the gift product validity
|
174 |
+
*/
|
175 |
+
if(!$this->_isValidForGift()){
|
176 |
+
return;
|
177 |
+
}
|
178 |
+
|
179 |
+
$isActive = Mage::getStoreConfig('posixtech_options/posixtech_ncp/active');
|
180 |
+
$configProductID = Mage::getStoreConfig('posixtech_options/posixtech_ncp/product_id');
|
181 |
+
|
182 |
+
if($isActive) {
|
183 |
+
$cart = $obs->getCart();
|
184 |
+
foreach ($cart->getItems() as $cartItem) {
|
185 |
+
if($configProductID==$cartItem->getProductId()) {
|
186 |
+
if($cartItem->getPrice() == '0.0000') {
|
187 |
+
$price = 0;
|
188 |
+
$cartItem->setCustomPrice($price);
|
189 |
+
$cartItem->setQty(1);
|
190 |
+
$cartItem->setOriginalCustomPrice($price);
|
191 |
+
}
|
192 |
+
}
|
193 |
+
}
|
194 |
+
}
|
195 |
+
}
|
196 |
+
/**
|
197 |
+
* If a gust customer(not registred Yet) add any number of products AND login into the checkout page,
|
198 |
+
* the gift product will be added to his cart automatically
|
199 |
+
*
|
200 |
+
* @param Varien_Event_Observer $obs
|
201 |
+
*/
|
202 |
+
public function addAdditionalProductAfterLogin(Varien_Event_Observer $obs)
|
203 |
+
{
|
204 |
+
/**
|
205 |
+
* Check the validity of this customer for the gift product validity
|
206 |
+
*/
|
207 |
+
if(!$this->_isValidForGift()){
|
208 |
+
return;
|
209 |
+
}
|
210 |
+
|
211 |
+
$isActive = Mage::getStoreConfig('posixtech_options/posixtech_ncp/active');
|
212 |
+
$configProductID = Mage::getStoreConfig('posixtech_options/posixtech_ncp/product_id');
|
213 |
+
|
214 |
+
if($isActive) {
|
215 |
+
$cartObj = Mage::getSingleton('checkout/cart');
|
216 |
+
if($cartObj->getItemsCount() == 0) {
|
217 |
+
return;
|
218 |
+
}
|
219 |
+
|
220 |
+
$duplicateProductCounter = 0;
|
221 |
+
foreach ($cartObj->getItems() as $cartItem) {
|
222 |
+
if($configProductID==$cartItem->getProductId()) {
|
223 |
+
$duplicateProductCounter++;
|
224 |
+
}
|
225 |
+
}
|
226 |
+
|
227 |
+
if($duplicateProductCounter>=1) {
|
228 |
+
return;
|
229 |
+
}
|
230 |
+
|
231 |
+
$quoteObj = Mage::getSingleton('checkout/session')->getQuote();
|
232 |
+
$productModel=Mage::getModel('catalog/product');
|
233 |
+
$productObj=$productModel->load($configProductID);
|
234 |
+
$params = array();
|
235 |
+
if($productObj->getTypeId() == 'simple') {
|
236 |
+
$params['qty'] = 1;
|
237 |
+
} else {
|
238 |
+
$links = Mage::getModel('downloadable/product_type')->getLinks($productObj);
|
239 |
+
$linkId = 0;
|
240 |
+
foreach ($links as $link) {
|
241 |
+
$linkId = $link->getId();
|
242 |
+
}
|
243 |
+
|
244 |
+
$params['product'] = $configProductID;
|
245 |
+
$params['qty'] = 1;
|
246 |
+
$params['links'] = array($linkId);
|
247 |
+
}
|
248 |
+
|
249 |
+
$request = new Varien_Object();
|
250 |
+
$request->setData($params);
|
251 |
+
|
252 |
+
$quoteObj->addProduct($productObj , $request);
|
253 |
+
$quoteObj->save();
|
254 |
+
|
255 |
+
$cartItems = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
|
256 |
+
$duplicateProductCounter = 0;
|
257 |
+
foreach ($cartItems as $cartItem) {
|
258 |
+
$cartItem = ( $cartItem->getParentItem() ? $cartItem->getParentItem() : $cartItem );
|
259 |
+
if($configProductID==$cartItem->getProductId()) {
|
260 |
+
$configProductTitle = Mage::getStoreConfig('posixtech_options/posixtech_ncp/product_title');
|
261 |
+
$infoRequest = unserialize($cartItem->getOptionByCode('info_buyRequest')->getValue());
|
262 |
+
$price = 0;
|
263 |
+
$cartItem->setCustomPrice($price);
|
264 |
+
$cartItem->setQty(1);
|
265 |
+
$cartItem->setOriginalCustomPrice($price);
|
266 |
+
$infoRequest['option'] = serialize(array(
|
267 |
+
'label' => 'Free Gift',
|
268 |
+
'value' => $configProductTitle
|
269 |
+
));
|
270 |
+
$cartItem->getOptionByCode('info_buyRequest')->setValue(serialize($infoRequest));
|
271 |
+
$_options = array(
|
272 |
+
1 => array(
|
273 |
+
'label' => 'Free Gift',
|
274 |
+
'value' => $configProductTitle,
|
275 |
+
'print_value' => $configProductTitle,
|
276 |
+
'option_type' => 'text',
|
277 |
+
'custom_view' => true
|
278 |
+
)
|
279 |
+
);
|
280 |
+
$options = array(
|
281 |
+
'code' => 'additional_options',
|
282 |
+
'value' => serialize($_options)
|
283 |
+
);
|
284 |
+
$cartItem->addOption($options);
|
285 |
+
}
|
286 |
+
}
|
287 |
+
|
288 |
+
return;
|
289 |
+
}
|
290 |
+
}
|
291 |
+
|
292 |
+
/**
|
293 |
+
*
|
294 |
+
* @return number
|
295 |
+
*/
|
296 |
+
public function _isValidForGift()
|
297 |
+
{
|
298 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
299 |
+
|
300 |
+
/**
|
301 |
+
* check for guest customer
|
302 |
+
*/
|
303 |
+
if(!$customer->getId()) {
|
304 |
+
return 0;
|
305 |
+
}
|
306 |
+
|
307 |
+
/**
|
308 |
+
* Load order list by customer id
|
309 |
+
*/
|
310 |
+
$orders = Mage::getResourceModel('sales/order_collection')
|
311 |
+
->addFieldToSelect('*')
|
312 |
+
->addFieldToFilter('customer_id', $customer->getId());
|
313 |
+
|
314 |
+
/**
|
315 |
+
* if $order > 0 means, this customer already place at least one order
|
316 |
+
* That means, this is not a new customer
|
317 |
+
*/
|
318 |
+
if(count($orders) > 0) {
|
319 |
+
return 0;
|
320 |
+
}
|
321 |
+
|
322 |
+
return 1;
|
323 |
+
}
|
324 |
+
}
|
app/code/community/Posixtech/Ncp/etc/.DS_Store
ADDED
Binary file
|
app/code/community/Posixtech/Ncp/etc/adminhtml.xml
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
*
|
4 |
+
* Posixtech Ltd.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
*
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to info@posixtech.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* You can edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future.
|
19 |
+
*
|
20 |
+
* =================================================================
|
21 |
+
* MAGENTO EDITION USAGE NOTICE
|
22 |
+
* =================================================================
|
23 |
+
* This package designed for Magento COMMUNITY edition version 1.5.0.0 to all upper version.
|
24 |
+
* Posixtech Ltd. does not guarantee correct work of this extension
|
25 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
26 |
+
* Posixtech Ltd. does not provide extension support in case of
|
27 |
+
* incorrect edition usage.
|
28 |
+
* =================================================================
|
29 |
+
*
|
30 |
+
* @category Posixtech
|
31 |
+
* @package Ncp
|
32 |
+
* @copyright Copyright (c) 2013 Posixtech Ltd. (http://www.posixtech.com)
|
33 |
+
* @license http://www.posixtech.com/POSIXTECH_LTD_LICENSE.txt
|
34 |
+
*
|
35 |
+
-->
|
36 |
+
|
37 |
+
<config>
|
38 |
+
<acl>
|
39 |
+
<resources>
|
40 |
+
<admin>
|
41 |
+
<children>
|
42 |
+
<system>
|
43 |
+
<children>
|
44 |
+
<config>
|
45 |
+
<children>
|
46 |
+
<posixtech_options>
|
47 |
+
<title>Gift For New Customer</title>
|
48 |
+
</posixtech_options>
|
49 |
+
</children>
|
50 |
+
</config>
|
51 |
+
</children>
|
52 |
+
</system>
|
53 |
+
</children>
|
54 |
+
</admin>
|
55 |
+
</resources>
|
56 |
+
</acl>
|
57 |
+
</config>
|
app/code/community/Posixtech/Ncp/etc/config.xml
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
*
|
4 |
+
* Posixtech Ltd.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
*
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to info@posixtech.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* You can edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future.
|
19 |
+
*
|
20 |
+
* =================================================================
|
21 |
+
* MAGENTO EDITION USAGE NOTICE
|
22 |
+
* =================================================================
|
23 |
+
* This package designed for Magento COMMUNITY edition version 1.5.0.0 to all upper version.
|
24 |
+
* Posixtech Ltd. does not guarantee correct work of this extension
|
25 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
26 |
+
* Posixtech Ltd. does not provide extension support in case of
|
27 |
+
* incorrect edition usage.
|
28 |
+
* =================================================================
|
29 |
+
*
|
30 |
+
* @category Posixtech
|
31 |
+
* @package Ncp
|
32 |
+
* @copyright Copyright (c) 2013 Posixtech Ltd. (http://www.posixtech.com)
|
33 |
+
* @license http://www.posixtech.com/POSIXTECH_LTD_LICENSE.txt
|
34 |
+
*
|
35 |
+
-->
|
36 |
+
|
37 |
+
<config>
|
38 |
+
<modules>
|
39 |
+
<Posixtech_Ncp>
|
40 |
+
<version>1.0.0.1</version>
|
41 |
+
</Posixtech_Ncp>
|
42 |
+
</modules>
|
43 |
+
<global>
|
44 |
+
<models>
|
45 |
+
<ncp>
|
46 |
+
<class>Posixtech_Ncp_Model</class>
|
47 |
+
</ncp>
|
48 |
+
</models>
|
49 |
+
<events>
|
50 |
+
<checkout_cart_add_product_complete>
|
51 |
+
<observers>
|
52 |
+
<posixtech_ncp_addaditionalproduct_observer>
|
53 |
+
<type>singleton</type>
|
54 |
+
<class>ncp/observer</class>
|
55 |
+
<method>addAditionalProduct</method>
|
56 |
+
</posixtech_ncp_addaditionalproduct_observer>
|
57 |
+
</observers>
|
58 |
+
</checkout_cart_add_product_complete>
|
59 |
+
<checkout_cart_product_add_after>
|
60 |
+
<observers>
|
61 |
+
<posixtech_ncp_modifyPrice_observer>
|
62 |
+
<type>singleton</type>
|
63 |
+
<class>ncp/observer</class>
|
64 |
+
<method>modifyPrice</method>
|
65 |
+
</posixtech_ncp_modifyPrice_observer>
|
66 |
+
</observers>
|
67 |
+
</checkout_cart_product_add_after>
|
68 |
+
<checkout_cart_update_items_after>
|
69 |
+
<observers>
|
70 |
+
<posixtech_ncp_checkoutcartproductupdateafter_observer>
|
71 |
+
<type>singleton</type>
|
72 |
+
<class>ncp/observer</class>
|
73 |
+
<method>checkoutCartProductUpdateAfter</method>
|
74 |
+
</posixtech_ncp_checkoutcartproductupdateafter_observer>
|
75 |
+
</observers>
|
76 |
+
</checkout_cart_update_items_after>
|
77 |
+
<customer_login>
|
78 |
+
<observers>
|
79 |
+
<posixtech_ncp_addadditionalproductafterlogin_observer>
|
80 |
+
<type>singleton</type>
|
81 |
+
<class>ncp/observer</class>
|
82 |
+
<method>addAdditionalProductAfterLogin</method>
|
83 |
+
</posixtech_ncp_addadditionalproductafterlogin_observer>
|
84 |
+
</observers>
|
85 |
+
</customer_login>
|
86 |
+
</events>
|
87 |
+
<blocks>
|
88 |
+
<ncp>
|
89 |
+
<class>Posixtech_Ncp_Block</class>
|
90 |
+
</ncp>
|
91 |
+
<sales>
|
92 |
+
<rewrite>
|
93 |
+
<order_item_renderer_default>Posixtech_Ncp_Block_Sales_Order_Item_Renderer_Default</order_item_renderer_default>
|
94 |
+
</rewrite>
|
95 |
+
</sales>
|
96 |
+
<adminhtml>
|
97 |
+
<rewrite>
|
98 |
+
<sales_items_column_name>Posixtech_Ncp_Block_Adminhtml_Sales_Items_Column_Name</sales_items_column_name>
|
99 |
+
</rewrite>
|
100 |
+
</adminhtml>
|
101 |
+
<downloadable>
|
102 |
+
<rewrite>
|
103 |
+
<sales_order_item_renderer_downloadable>Posixtech_Ncp_Block_Sales_Order_Item_Renderer_Downloadable</sales_order_item_renderer_downloadable>
|
104 |
+
<adminhtml_sales_items_column_downloadable_name>Posixtech_Ncp_Block_Adminhtml_Sales_Items_Column_Downloadable_Name</adminhtml_sales_items_column_downloadable_name>
|
105 |
+
</rewrite>
|
106 |
+
</downloadable>
|
107 |
+
</blocks>
|
108 |
+
<helpers>
|
109 |
+
<ncp>
|
110 |
+
<class>Posixtech_Ncp_Helper</class>
|
111 |
+
</ncp>
|
112 |
+
</helpers>
|
113 |
+
</global>
|
114 |
+
</config>
|
app/code/community/Posixtech/Ncp/etc/system.xml
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
*
|
4 |
+
* Posixtech Ltd.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
*
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to info@posixtech.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* You can edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future.
|
19 |
+
*
|
20 |
+
* =================================================================
|
21 |
+
* MAGENTO EDITION USAGE NOTICE
|
22 |
+
* =================================================================
|
23 |
+
* This package designed for Magento COMMUNITY edition version 1.5.0.0 to all upper version.
|
24 |
+
* Posixtech Ltd. does not guarantee correct work of this extension
|
25 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
26 |
+
* Posixtech Ltd. does not provide extension support in case of
|
27 |
+
* incorrect edition usage.
|
28 |
+
* =================================================================
|
29 |
+
*
|
30 |
+
* @category Posixtech
|
31 |
+
* @package Ncp
|
32 |
+
* @copyright Copyright (c) 2013 Posixtech Ltd. (http://www.posixtech.com)
|
33 |
+
* @license http://www.posixtech.com/POSIXTECH_LTD_LICENSE.txt
|
34 |
+
*
|
35 |
+
-->
|
36 |
+
|
37 |
+
<config>
|
38 |
+
<tabs>
|
39 |
+
<posixtechtab translate="label" module="ncp">
|
40 |
+
<label>GIFT NEW CUSTOMER</label>
|
41 |
+
<sort_order>100</sort_order>
|
42 |
+
</posixtechtab>
|
43 |
+
</tabs>
|
44 |
+
<sections>
|
45 |
+
<posixtech_options translate="label" module="ncp">
|
46 |
+
<label>Gift For New Customer</label>
|
47 |
+
<tab>posixtechtab</tab>
|
48 |
+
<frontend_type>text</frontend_type>
|
49 |
+
<sort_order>1</sort_order>
|
50 |
+
<show_in_default>1</show_in_default>
|
51 |
+
<show_in_website>1</show_in_website>
|
52 |
+
<show_in_store>1</show_in_store>
|
53 |
+
<groups>
|
54 |
+
<posixtech_ncp translate="label">
|
55 |
+
<label>Gift For New Customer (Add Free Product to Cart)</label>
|
56 |
+
<frontend_type>text</frontend_type>
|
57 |
+
<sort_order>150</sort_order>
|
58 |
+
<show_in_default>1</show_in_default>
|
59 |
+
<show_in_website>1</show_in_website>
|
60 |
+
<show_in_store>1</show_in_store>
|
61 |
+
<fields>
|
62 |
+
<active translate="label">
|
63 |
+
<label>Enabled</label>
|
64 |
+
<frontend_type>select</frontend_type>
|
65 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
66 |
+
<sort_order>1</sort_order>
|
67 |
+
<show_in_default>1</show_in_default>
|
68 |
+
<show_in_website>1</show_in_website>
|
69 |
+
<show_in_store>0</show_in_store>
|
70 |
+
</active>
|
71 |
+
<product_id translate="label">
|
72 |
+
<label>Product ID#</label>
|
73 |
+
<frontend_type>text</frontend_type>
|
74 |
+
<sort_order>2</sort_order>
|
75 |
+
<show_in_default>1</show_in_default>
|
76 |
+
<show_in_website>1</show_in_website>
|
77 |
+
<show_in_store>1</show_in_store>
|
78 |
+
<comment><![CDATA[Only Simple OR Downloadable types product ID]]></comment>
|
79 |
+
</product_id>
|
80 |
+
<product_title translate="label">
|
81 |
+
<label>Gift Message</label>
|
82 |
+
<frontend_type>text</frontend_type>
|
83 |
+
<sort_order>3</sort_order>
|
84 |
+
<show_in_default>1</show_in_default>
|
85 |
+
<show_in_website>1</show_in_website>
|
86 |
+
<show_in_store>1</show_in_store>
|
87 |
+
<comment><![CDATA[This message will be visiable under the product title as an option]]></comment>
|
88 |
+
</product_title>
|
89 |
+
</fields>
|
90 |
+
</posixtech_ncp>
|
91 |
+
</groups>
|
92 |
+
</posixtech_options>
|
93 |
+
</sections>
|
94 |
+
</config>
|
app/etc/modules/Posixtech_Ncp.xml
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
*
|
4 |
+
* Posixtech Ltd.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
*
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to info@posixtech.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* You can edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future.
|
19 |
+
*
|
20 |
+
* =================================================================
|
21 |
+
* MAGENTO EDITION USAGE NOTICE
|
22 |
+
* =================================================================
|
23 |
+
* This package designed for Magento COMMUNITY edition version 1.5.0.0 to all upper version.
|
24 |
+
* Posixtech Ltd. does not guarantee correct work of this extension
|
25 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
26 |
+
* Posixtech Ltd. does not provide extension support in case of
|
27 |
+
* incorrect edition usage.
|
28 |
+
* =================================================================
|
29 |
+
*
|
30 |
+
* @category Posixtech
|
31 |
+
* @package Ncp
|
32 |
+
* @copyright Copyright (c) 2013 Posixtech Ltd. (http://www.posixtech.com)
|
33 |
+
* @license http://www.posixtech.com/POSIXTECH_LTD_LICENSE.txt
|
34 |
+
*
|
35 |
+
-->
|
36 |
+
<config>
|
37 |
+
<modules>
|
38 |
+
<Posixtech_Ncp>
|
39 |
+
<active>true</active>
|
40 |
+
<codePool>community</codePool>
|
41 |
+
</Posixtech_Ncp>
|
42 |
+
</modules>
|
43 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Posixtech_Ncp</name>
|
4 |
+
<version>1.0.0.1</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.posixtech.com/POSIXTECH_LTD_LICENSE.txt">POSIXTECH_LTD_LICENSE</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>If you want to take care your new customer, this module is for you. It will allow you to add a free product.</summary>
|
10 |
+
<description>If you want to run highly flexible promotions for a new customer, this easy to use extension will help you. Go beyond the standard Magento promotion options, it will allow you to offer a free gift (simple or downloadable) product to the automatically into customer cart only for first checkout –<br /><br />
|
11 |
+

|
12 |
+
Well if you want to setup promotions for a new customer only that either aren't possible in standard Magento, or require combining multiple complex rules to work.
|
13 |
+
Using this module with fine-grained control over simple and actions to set up creative, targeted promotions. Leave promotion restrictions behind.
|
14 |
+

|
15 |
+
The free gift product will relate with general shipping price and not free shipping product according to default configuration.
|
16 |
+
<br /><br />
|
17 |
+

|
18 |
+
<br />
|
19 |
+
<img src="http://store.posixtech.com/media/magento_extension_service/posixtech_guarantee.jpg" /><br /><br />
|
20 |
+
<b>Customer Experience</b><br />
|
21 |
+
1. Free customer support.<br />
|
22 |
+
2. Free extension updates.<br />
|
23 |
+
3. Free bug fixing.<br />
|
24 |
+
4. PE compatibility<br />
|
25 |
+
5. Easy 2-minute installation<br />
|
26 |
+
6. Our code is 100% open source and unencrypted. Easily add your own customizations<br />
|
27 |
+
7. Free upgrades during support period<br />
|
28 |
+
8. Easy to understand user manuals show you how to get the most out of your extension<br />
|
29 |
+
9. Our friendly team provides expert product support and troubleshooting<br /><br />
|
30 |
+

|
31 |
+

|
32 |
+
Visit Extension Page: <a href="http://store.posixtech.com/gift-for-new-customer.html">http://store.posixtech.com/gift-for-new-customer.html</a>
|
33 |
+
<br /><br />
|
34 |
+
User Guide: <a href="http://store.posixtech.com/gift-for-new-customer.html"> http://store.posixtech.com/gift-for-new-customer.html</a> 
|
35 |
+
<br /><br />
|
36 |
+
Please, check Magento versions compatibility on the product page!
|
37 |
+
<br /><br />
|
38 |
+
Themes and extensions releases, updates & promotions — follow <a href="http://www.posixtech.com ">Posixtech</a> on <a href="http://twitter.com/posixtech">Twitter</a> and <a href="https://www.facebook.com/Posixtech">Facebook</a>
|
39 |
+
</description>
|
40 |
+
<notes>Gift for new customer build from scratch to work seamlessly in Magento
|
41 |
+

|
42 |
+
• Version number: 1.0.0.1 
|
43 |
+
• Stability: Stable 
|
44 |
+
• Compatibility: 1.5, 1.6, 1.6.1, 1.6.2.0, 1.7, 1.8 
|
45 |
+

|
46 |
+
Admin will able configure ‘Gift for new customer’ related option from System > Configuration > ‘Gift for New Customer’.
|
47 |
+
</notes>
|
48 |
+
<authors><author><name>Posixtech Ltd.</name><user>posixtech</user><email>info@posixtech.com</email></author></authors>
|
49 |
+
<date>2013-12-02</date>
|
50 |
+
<time>09:36:38</time>
|
51 |
+
<contents><target name="magecommunity"><dir name="Posixtech"><dir name="Ncp"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Items"><dir name="Column"><dir name="Downloadable"><file name="Name.php" hash="5bbef5cb5a39206df7c213c81fad571b"/><file name=".DS_Store" hash="4dc3fd858282e5267cf5cec833d15481"/></dir><file name="Name.php" hash="3a4930465b251ac42e5912099d02690a"/><file name=".DS_Store" hash="4dc3fd858282e5267cf5cec833d15481"/></dir><file name=".DS_Store" hash="4ac18eee28c8c9fcb0a4c28aab7b710b"/></dir><file name=".DS_Store" hash="8014761e4f3df08a0e67de20a88c4c17"/></dir><file name=".DS_Store" hash="cd9231b78fe667dc9494f668eab59ee6"/></dir><dir name="Sales"><dir name="Order"><dir name="Item"><dir name="Renderer"><file name="Default.php" hash="1c57fb1ba8798372251f591ae0749e82"/><file name="Downloadable.php" hash="1630015b3a34157de10e93d434781850"/><file name=".DS_Store" hash="dcbabc3593cb871eed8173e1acf2b9c2"/></dir><file name=".DS_Store" hash="92ea3fa99cf2904b4da1257865a58321"/></dir><file name=".DS_Store" hash="94a7b96cb293727ae297d9bc53757031"/></dir><file name=".DS_Store" hash="2946788498b3a879c46c41acecfa245f"/></dir><file name=".DS_Store" hash="433d2ce801b611651eebc00b6e54d539"/></dir><dir name="Helper"><file name="Data.php" hash="b2f9aa796853f15aeed76c45f7e0a2c2"/><file name=".DS_Store" hash="5cc9b356b8566590d84d1a846226a1e1"/></dir><dir name="Model"><file name="Observer.php" hash="afc1d4de9768656dcf04b729679ab478"/><file name=".DS_Store" hash="78324b2382ec00241b369f1f84f73039"/></dir><dir name="etc"><file name="adminhtml.xml" hash="92ee3d94732ad704c69c3a4b117e2a2d"/><file name="config.xml" hash="5d705be527039c4adc5959592a41a6bb"/><file name="system.xml" hash="ebb0257cf6d6530a3511d869e06d638b"/><file name=".DS_Store" hash="e643d5a147d51957f89005b37bebc28c"/></dir><file name=".DS_Store" hash="d59e4a930456777da82234c1b6f92878"/></dir><file name=".DS_Store" hash="65cf5f12860844f5a63eccc006d6d1df"/></dir></target><target name="mageetc"><dir name="modules"><file name="Posixtech_Ncp.xml" hash="f72bf039ce6caf8cf879051059902f16"/></dir></target></contents>
|
52 |
+
<compatible/>
|
53 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
54 |
+
</package>
|