addwish - Version 0.0.4

Version Notes

Get addwish on your site and we'll show your products on ours!

addwish is a wish list that lets users share the products they want with people who want to buy them. But unlike other wish lists, with addwish your products also appear as inspiration in searches for similar products on addwish.com. If addwish users select your product for their list, their family and friends are automatically directed to your web shop where they can make the purchase.


  • Easy to install and maintenance free

  • Increases traffic to your shop

  • High conversion rates

Download this release

Release Info

Developer addwish
Extension addwish
Version 0.0.4
Comparing to
See all releases


Code changes from version 0.0.3 to 0.0.4

Files changed (46) hide show
  1. app/code/local/Addwish/Addwish/Block/Toggle.php +0 -20
  2. app/code/local/Addwish/Addwish/Helper/Data.php +0 -6
  3. app/code/local/Addwish/Addwish/etc/config.xml +0 -62
  4. app/code/local/Addwish/Addwish/etc/system.xml +0 -62
  5. app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator.php +12 -0
  6. app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/Grid.php +51 -0
  7. app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/Renderer.php +4 -0
  8. app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View.php +12 -0
  9. app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tab/Details.php +7 -0
  10. app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tab/Details/List.php +20 -0
  11. app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tab/Form.php +10 -0
  12. app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tab/Recommend.php +7 -0
  13. app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tab/Recommend/List.php +20 -0
  14. app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tab/Search.php +7 -0
  15. app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tab/Search/List.php +20 -0
  16. app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tabs.php +40 -0
  17. app/code/local/Addwish/Integrator/Block/Integrator.php +8 -0
  18. app/code/local/Addwish/Integrator/Helper/Data.php +6 -0
  19. app/code/local/Addwish/Integrator/Model/Integrator.php +10 -0
  20. app/code/local/Addwish/Integrator/Model/Mysql4/Integrator.php +9 -0
  21. app/code/local/Addwish/Integrator/Model/Mysql4/Integrator/Collection.php +10 -0
  22. app/code/local/Addwish/Integrator/Model/Observer.php +90 -0
  23. app/code/local/Addwish/Integrator/controllers/Adminhtml/IntegratorController.php +155 -0
  24. app/code/local/Addwish/Integrator/controllers/IndexController.php +72 -0
  25. app/code/local/Addwish/Integrator/etc/config.xml +146 -0
  26. app/code/local/Addwish/Integrator/sql/addwish_setup/mysql4-install-0.0.4.php +28 -0
  27. app/design/adminhtml/default/default/layout/integrator.xml +151 -0
  28. app/design/adminhtml/default/default/template/integrator/integrator/list.phtml +132 -0
  29. app/design/adminhtml/default/default/template/integrator/recommendations.phtml +64 -0
  30. app/design/adminhtml/default/default/template/integrator/search.phtml +6 -0
  31. app/design/frontend/base/default/layout/addwish.xml +0 -14
  32. app/design/frontend/base/default/layout/integrator.xml +27 -0
  33. app/design/frontend/base/default/template/addwish/basket-span.phtml +28 -0
  34. app/design/frontend/base/default/template/addwish/catalog/product/view/addto.phtml +0 -41
  35. app/design/frontend/base/default/template/addwish/conversion-span.phtml +30 -0
  36. app/design/frontend/base/default/template/addwish/integrator.phtml +17 -0
  37. app/design/frontend/base/default/template/addwish/js.phtml +0 -25
  38. app/design/frontend/base/default/template/addwish/product-span.phtml +68 -0
  39. app/design/frontend/base/default/template/addwish/product_meta.phtml +0 -46
  40. app/design/frontend/base/default/template/addwish/search-result-page.phtml +0 -0
  41. app/design/frontend/base/default/template/addwish/upsells-page.phtml +46 -0
  42. app/etc/modules/Addwish_Addwish.xml +0 -9
  43. app/etc/modules/Addwish_Integrator.xml +12 -0
  44. package.xml +27 -12
  45. skin/adminhtml/default/default/css/addwish.css +7 -0
  46. skin/adminhtml/default/default/images/addwish/addwish.png +0 -0
app/code/local/Addwish/Addwish/Block/Toggle.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
-
3
- class Addwish_Addwish_Block_Toggle extends Mage_Core_Block_Template
4
- {
5
- public function _prepareLayout()
6
- {
7
- if (!Mage::getStoreConfigFlag('addwish/general/enabled')) return;
8
- $layout = $this->getLayout();
9
- $beforeBodyEnd = $layout->getBlock('before_body_end');
10
- if (is_object($beforeBodyEnd)) {
11
- // --- js file ---
12
- $block = $layout->getBlock('addwish');
13
- if (!is_object($block)) {
14
- $block = $layout->createBlock('core/template', 'addwish')
15
- ->setTemplate('addwish/js.phtml');
16
- }
17
- $beforeBodyEnd->append($block);
18
- }
19
- }
20
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Addwish/Addwish/Helper/Data.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- class Addwish_Addwish_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
-
6
- }
 
 
 
 
 
 
app/code/local/Addwish/Addwish/etc/config.xml DELETED
@@ -1,62 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Addwish_Addwish>
5
- <version>0.0.3</version>
6
- </Addwish_Addwish>
7
- </modules>
8
- <frontend>
9
- <layout>
10
- <updates>
11
- <addwish>
12
- <file>addwish.xml</file>
13
- </addwish>
14
- </updates>
15
- </layout>
16
- </frontend>
17
- <adminhtml>
18
- <acl>
19
- <resources>
20
- <all>
21
- <title>Allow Everything</title>
22
- </all>
23
- <admin>
24
- <children>
25
- <system>
26
- <children>
27
- <config>
28
- <children>
29
- <addwish translate="title" module="addwish">
30
- <title><![CDATA[Addwish: Addwish]]></title>
31
- <sort_order>2000</sort_order>
32
- </addwish>
33
- </children>
34
- </config>
35
- </children>
36
- </system>
37
- </children>
38
- </admin>
39
- </resources>
40
- </acl>
41
- </adminhtml>
42
- <global>
43
- <blocks>
44
- <addwish>
45
- <class>Addwish_Addwish_Block</class>
46
- </addwish>
47
- </blocks>
48
- <helpers>
49
- <addwish>
50
- <class>Addwish_Addwish_Helper</class>
51
- </addwish>
52
- </helpers>
53
- </global>
54
- <default>
55
- <addwish>
56
- <general>
57
- <!--<enabled>1</enabled>-->
58
- <deactivate_standard_wishlist>1</deactivate_standard_wishlist>
59
- </general>
60
- </addwish>
61
- </default>
62
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Addwish/Addwish/etc/system.xml DELETED
@@ -1,62 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <tabs>
4
- <addwish translate="label" module="addwish">
5
- <label>Addwish</label>
6
- <sort_order>150</sort_order>
7
- </addwish>
8
- </tabs>
9
- <sections>
10
- <addwish translate="label" module="addwish">
11
- <label>Addwish</label>
12
- <tab>addwish</tab>
13
- <frontend_type>text</frontend_type>
14
- <sort_order>200</sort_order>
15
- <show_in_default>1</show_in_default>
16
- <show_in_website>1</show_in_website>
17
- <show_in_store>1</show_in_store>
18
- <groups>
19
- <general translate="label">
20
- <label>General</label>
21
- <frontend_type>text</frontend_type>
22
- <sort_order>10</sort_order>
23
- <show_in_default>1</show_in_default>
24
- <show_in_website>1</show_in_website>
25
- <show_in_store>1</show_in_store>
26
- <fields>
27
- <enabled translate="label">
28
- <label>Enable</label>
29
- <frontend_type>select</frontend_type>
30
- <source_model>adminhtml/system_config_source_yesno</source_model>
31
- <sort_order>1</sort_order>
32
- <show_in_default>1</show_in_default>
33
- <show_in_website>1</show_in_website>
34
- <show_in_store>1</show_in_store>
35
- </enabled>
36
- <id translate="label comment">
37
- <label>Addwish ID</label>
38
- <comment>Please enter your addwish ID.
39
- If you don't have an addwish ID, please go to http://addwish.com/company/frontpage.html and sign up for a free account.
40
- You can see your ID at the end of the sign-up process.
41
- </comment>
42
- <frontend_type>text</frontend_type>
43
- <sort_order>15</sort_order>
44
- <show_in_default>1</show_in_default>
45
- <show_in_website>1</show_in_website>
46
- <show_in_store>1</show_in_store>
47
- </id>
48
- <deactivate_standard_wishlist translate="label">
49
- <label>Deactivate Standard Wishlist</label>
50
- <frontend_type>select</frontend_type>
51
- <source_model>adminhtml/system_config_source_yesno</source_model>
52
- <sort_order>30</sort_order>
53
- <show_in_default>1</show_in_default>
54
- <show_in_website>1</show_in_website>
55
- <show_in_store>1</show_in_store>
56
- </deactivate_standard_wishlist>
57
- </fields>
58
- </general>
59
- </groups>
60
- </addwish>
61
- </sections>
62
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Addwish_Integrator_Block_Adminhtml_Integrator extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_integrator';
7
+ $this->_blockGroup = 'integrator';
8
+ $this->_headerText = Mage::helper('integrator')->__('AddWish');
9
+ $this->_addButtonLabel = Mage::helper('integrator')->__('AddWish');
10
+ parent::__construct();
11
+ }
12
+ }
app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/Grid.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Addwish_Integrator_Block_Adminhtml_Integrator_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('integratorGrid');
9
+ $this->setDefaultSort('id');
10
+ $this->setDefaultDir('ASC');
11
+ $this->setSaveParametersInSession(true);
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('integrator/integrator')->getCollection();
17
+ $this->setCollection($collection);
18
+ return parent::_prepareCollection();
19
+ }
20
+
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn('id', array(
24
+ 'header' => Mage::helper('integrator')->__('ID'),
25
+ 'align' =>'right',
26
+ 'width' => '50px',
27
+ 'index' => 'id',
28
+ ));
29
+
30
+ $this->addColumn('email', array(
31
+ 'header' => Mage::helper('integrator')->__('Email ID'),
32
+ 'align' => 'left',
33
+ 'index' => 'email',
34
+ ));
35
+
36
+ return parent::_prepareColumns();
37
+ }
38
+
39
+ protected function _prepareMassaction()
40
+ {
41
+ $this->setMassactionIdField('id');
42
+ $this->getMassactionBlock()->setFormFieldName('integrator');
43
+ return $this;
44
+ }
45
+
46
+ public function getRowUrl($row)
47
+ {
48
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
49
+ }
50
+
51
+ }
app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/Renderer.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ class Addwish_Integrator_Block_Adminhtml_Integrator_Renderer extends Mage_Adminhtml_Block_Widget_Form_Container
3
+ {
4
+ }
app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Addwish_Integrator_Block_Adminhtml_Integrator_View extends Mage_Adminhtml_Block_Widget_Form_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+
7
+ }
8
+ public function getHeaderText()
9
+ {
10
+ return Mage::helper('integrator')->__("addwish");
11
+ }
12
+ }
app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tab/Details.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ class Addwish_Integrator_Block_Adminhtml_Integrator_View_Tab_Details extends Mage_Adminhtml_Block_Text_List
3
+ {
4
+
5
+
6
+
7
+ }
app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tab/Details/List.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Addwish_Integrator_Block_Adminhtml_Integrator_View_Tab_Details_List extends Mage_Adminhtml_Block_Template
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->setTemplate('integrator/integrator/list.phtml');
7
+ }
8
+
9
+ protected function _toHtml()
10
+ {
11
+ $integratorCollection = Mage::getModel('integrator/integrator')->getCollection();
12
+ $this->assign('integratorCollection', $integratorCollection->getData());
13
+ return parent::_toHtml();
14
+ }
15
+
16
+ protected function _prepareLayout()
17
+ {
18
+ return parent::_prepareLayout();
19
+ }
20
+ }
app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tab/Form.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Addwish_Integrator_Block_Adminhtml_Integrator_View_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form();
8
+ return parent::_prepareForm();
9
+ }
10
+ }
app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tab/Recommend.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ class Addwish_Integrator_Block_Adminhtml_Integrator_View_Tab_Recommend extends Mage_Adminhtml_Block_Text_List
3
+ {
4
+
5
+
6
+
7
+ }
app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tab/Recommend/List.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Addwish_Integrator_Block_Adminhtml_Integrator_View_Tab_Recommend_List extends Mage_Adminhtml_Block_Template
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->setTemplate('integrator/recommendations.phtml');
7
+ }
8
+
9
+ protected function _toHtml()
10
+ {
11
+ $integratorCollection = Mage::getModel('integrator/integrator')->getCollection();
12
+ $this->assign('integratorCollection', $integratorCollection->getData());
13
+ return parent::_toHtml();
14
+ }
15
+
16
+ protected function _prepareLayout()
17
+ {
18
+ return parent::_prepareLayout();
19
+ }
20
+ }
app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tab/Search.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ class Addwish_Integrator_Block_Adminhtml_Integrator_View_Tab_Search extends Mage_Adminhtml_Block_Text_List
3
+ {
4
+
5
+
6
+
7
+ }
app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tab/Search/List.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Addwish_Integrator_Block_Adminhtml_Integrator_View_Tab_Search_List extends Mage_Adminhtml_Block_Template
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->setTemplate('integrator/search.phtml');
7
+ }
8
+
9
+ protected function _toHtml()
10
+ {
11
+ $integratorCollection = Mage::getModel('integrator/integrator')->getCollection();
12
+ $this->assign('integratorCollection', $integratorCollection->getData());
13
+ return parent::_toHtml();
14
+ }
15
+
16
+ protected function _prepareLayout()
17
+ {
18
+ return parent::_prepareLayout();
19
+ }
20
+ }
app/code/local/Addwish/Integrator/Block/Adminhtml/Integrator/View/Tabs.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Addwish_Integrator_Block_Adminhtml_Integrator_View_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('integrator_tabs');
10
+ $this->setTitle(Mage::helper('integrator')->__('addwish Settings'));
11
+ }
12
+
13
+ protected function _beforeToHtml()
14
+ {
15
+ $this->addTab('details_section', array(
16
+ 'label' => Mage::helper('integrator')->__('Setup'),
17
+ 'title' => Mage::helper('integrator')->__('Setup'),
18
+ 'content' => $this->getLayout()->createBlock('integrator/adminhtml_integrator_view_tab_details_list')
19
+ ->toHtml(),
20
+ 'active' => ( $this->getRequest()->getParam('tab') == 'details_section' ) ? true : false,
21
+ ));
22
+
23
+ $this->addTab('recommendation_section', array(
24
+ 'label' => Mage::helper('integrator')->__('Recommendations'),
25
+ 'title' => Mage::helper('integrator')->__('Recommendations'),
26
+ 'content' => $this->getLayout()->createBlock('integrator/adminhtml_integrator_view_tab_recommend_list')
27
+ ->toHtml(),
28
+ 'active' => ( $this->getRequest()->getParam('tab') == 'recommendation_section' ) ? true : false,
29
+ ));
30
+
31
+ $this->addTab('search_section', array(
32
+ 'label' => Mage::helper('integrator')->__('Search'),
33
+ 'title' => Mage::helper('integrator')->__('Search'),
34
+ 'content' => $this->getLayout()->createBlock('integrator/adminhtml_integrator_view_tab_search_list')
35
+ ->toHtml(),
36
+ 'active' => ( $this->getRequest()->getParam('tab') == 'search_section' ) ? true : false,
37
+ ));
38
+ return parent::_beforeToHtml();
39
+ }
40
+ }
app/code/local/Addwish/Integrator/Block/Integrator.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Addwish_Integrator_Block_Integrator extends Mage_Core_Block_Template
3
+ {
4
+ public function _prepareLayout()
5
+ {
6
+ return parent::_prepareLayout();
7
+ }
8
+ }
app/code/local/Addwish/Integrator/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Addwish_Integrator_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/local/Addwish/Integrator/Model/Integrator.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Addwish_Integrator_Model_Integrator extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('integrator/integrator');
9
+ }
10
+ }
app/code/local/Addwish/Integrator/Model/Mysql4/Integrator.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Addwish_Integrator_Model_Mysql4_Integrator extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ $this->_init('integrator/integrator', 'id');
8
+ }
9
+ }
app/code/local/Addwish/Integrator/Model/Mysql4/Integrator/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Addwish_Integrator_Model_Mysql4_Integrator_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('integrator/integrator');
9
+ }
10
+ }
app/code/local/Addwish/Integrator/Model/Observer.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Addwish_Integrator_Model_Observer
3
+ {
4
+
5
+ public function inspectCartAddData($observer=null){
6
+ $model = Mage::getModel('integrator/integrator')->load(1);
7
+ if($model->getData('enableUpsells')==1){
8
+ $url = Mage::getUrl('integrator/index/upsells');
9
+ Mage::getSingleton('core/session')->addSuccess('Product Added to Cart!');
10
+ Mage::app()->getFrontController()->getResponse()->setRedirect($url);
11
+ Mage::app()->getResponse()->sendResponse();
12
+ exit;
13
+ exit;
14
+ }
15
+ }
16
+ public function addWishCron($observer=null){
17
+ $model = Mage::getModel('integrator/integrator')->load(1);
18
+ $currentHour=date("h");
19
+ if($model->getData('cron_time')!==$currentHour){
20
+ return;
21
+ }
22
+ Mage::log("Running AddWish Cron");
23
+
24
+ $products_out='<?xml version="1.0" encoding="UTF-8"?><products>';
25
+ $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('visibility', 4);
26
+ $products->addAttributeToSelect('*');
27
+ foreach($products as $product) {
28
+ $imageUrl = Mage::helper('catalog/image')->init($product , 'thumbnail')->resize(256);
29
+ $specialPrice = number_format($product->getSpecialPrice(), 2, '.', '');
30
+ $regularPrice = number_format($product->getPrice(), 2, '.', '');
31
+ $products_out.="<product><url>".$product->getProductUrl()."</url><title>".htmlentities($product->getName(),ENT_QUOTES,'UTF-8')."</title><imgurl>".$imageUrl."</imgurl>";
32
+ if(isset($specialPrice) && $specialPrice>0){
33
+ $products_out.= "<price>".$specialPrice."</price>";
34
+ $products_out.= "<previousprice>".$regularPrice."</previousprice>";
35
+ }else{
36
+ $products_out.= "<price>".$regularPrice."</price>";
37
+ }
38
+ if($product->getMetaKeyword()!=''){
39
+ $products_out.= "<keywords>".htmlentities($product->getMetaKeyword(),ENT_QUOTES,'UTF-8')."</keywords>";
40
+ }
41
+ if($product->getDescription()!=''){
42
+ $products_out.= "<description>".htmlentities($product->getDescription(),ENT_QUOTES,'UTF-8')."</description>";
43
+ }
44
+ $products_out.= "<productnumber>".$product->getId()."</productnumber>";
45
+ $products_out.= "<currency>".Mage::app()->getStore()->getCurrentCurrencyCode()."</currency>";
46
+ $cats = $product->getCategoryIds();
47
+ $products_out.= "<hierarchies>";
48
+ foreach ($cats as $category_id) {
49
+ $products_out.= "<hierarchy> ";
50
+ $category = Mage::getModel('catalog/category')->load($category_id) ;
51
+ $catnames = array();
52
+ foreach ($category->getParentCategories() as $parent) {
53
+ if(trim($parent->getName())!=""){
54
+ $catnames[] = $parent->getName();
55
+ $products_out.= "<category>".htmlspecialchars(htmlentities($parent->getName(),ENT_QUOTES,'UTF-8'))."</category>";
56
+ }
57
+ }
58
+
59
+ $products_out.= "</hierarchy> ";
60
+ }
61
+ $products_out.= "</hierarchies>";
62
+ if($product->getData('brand')){
63
+ $products_out.= "<brand>".$product->getData('brand')."</brand>";
64
+ }
65
+
66
+ if($product->isInStock()){
67
+ $products_out.= "<instock>true</instock>";
68
+ }else{
69
+ $products_out.= "<instock>false</instock>";
70
+ }
71
+
72
+ if($product->getData('gender')){
73
+ $products_out.= "<gender>".$product->getData('gender')."</gender>";
74
+ }
75
+ if($product->getData('pricedetail')){
76
+ $products_out.= "<pricedetail>".$product->getData('pricedetail')."</pricedetail>";
77
+ }
78
+ //
79
+ $products_out.= "</product>";
80
+ }
81
+ $products_out.= "</products>";
82
+ $file_path=Mage::getBaseDir()."/addwishProductExport.xml";
83
+ $addwishProductExport = fopen($file_path, "w");
84
+ fwrite($addwishProductExport, $products_out);
85
+ fclose($addwishProductExport);
86
+ Mage::log('Feed Generated successfully.');
87
+ }
88
+
89
+ }
90
+ ?>
app/code/local/Addwish/Integrator/controllers/Adminhtml/IntegratorController.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Addwish_Integrator_Adminhtml_IntegratorController extends Mage_Adminhtml_Controller_action
4
+ {
5
+
6
+ protected function _initAction() {
7
+ $this->loadLayout()
8
+ ->_setActiveMenu('integrator/integrator')
9
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('AddWish Settings'), Mage::helper('adminhtml')->__('AddWish Settings'));
10
+ return $this;
11
+ }
12
+ public function indexAction() {
13
+ $this->_initAction()
14
+ ->renderLayout();
15
+ }
16
+ protected function _integratorModule($moduleName) {
17
+ // Disable the module itself
18
+ $nodePath = "modules/$moduleName/active";
19
+ if (Mage::helper('core/data')->isModuleEnabled($moduleName)) {
20
+ Mage::getConfig()->setNode($nodePath, 'false', true);
21
+ }
22
+
23
+ // Disable its output as well (which was already loaded)
24
+ $outputPath = "advanced/modules_disable_output/$moduleName";
25
+ if (!Mage::getStoreConfig($outputPath)) {
26
+ Mage::app()->getStore()->setConfig($outputPath, true);
27
+ }
28
+ }
29
+ public function viewAction(){
30
+ $this->loadLayout();
31
+ $this->_initLayoutMessages('core/session');
32
+ $this->_setActiveMenu('integrator/integrator');
33
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('AddWish'), Mage::helper('adminhtml')->__('AddWish'));
34
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('AddWish'), Mage::helper('adminhtml')->__('AddWish'));
35
+
36
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
37
+ if ($data = $this->getRequest()->getPost()) {
38
+ switch($data['action']){
39
+ case "dataexport":
40
+ $k['ipaddress']=$data['ipaddress'];
41
+ $k['cron_time']=$data['cron_hour'];
42
+ if(isset($data['enable_order_feed'])){
43
+ $k['enable_order_export']=$data['enable_order_feed'];
44
+ }else{
45
+ $k['enable_order_export']=0;
46
+ }
47
+ if(isset($data['enable_product_feed'])){
48
+ $k['enable_product_feed']=$data['enable_product_feed'];
49
+ }else{
50
+ $k['enable_product_feed']=0;
51
+ }
52
+ break;
53
+ case "scriptsetup":
54
+ $k['userId']=$data['addwishID'];
55
+ break;
56
+ case "recomendations":
57
+ if(isset($data['addwishUpsells'])){
58
+ $k['enableUpsells']=$data['addwishUpsells'];
59
+ }else{
60
+ $k['enableUpsells']=0;
61
+ }
62
+ break;
63
+ }
64
+ $model = Mage::getModel('integrator/integrator');
65
+ $model->setData($k)
66
+ ->setId(1);
67
+
68
+ try {
69
+ $model->save();
70
+ Mage::getSingleton('core/session')->addSuccess('Configuration was successfully saved.');
71
+ } catch (Exception $e) {
72
+ Mage::getSingleton('customer/session')->addSuccess('Some error occured.');
73
+ exit;
74
+ }
75
+ }
76
+ $this->_addContent($this->getLayout()->createBlock('integrator/adminhtml_integrator_view'))
77
+ ->_addLeft($this->getLayout()->createBlock('integrator/adminhtml_integrator_view_tabs'));
78
+ $this->renderLayout();
79
+ }
80
+ public function editAction() {
81
+
82
+ }
83
+ public function generatefeedAction(){
84
+ $products_out='<?xml version="1.0" encoding="UTF-8"?><products>';
85
+ $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('visibility', 4);
86
+ $products->addAttributeToSelect('*');
87
+ foreach($products as $product) {
88
+ $imageUrl = Mage::helper('catalog/image')->init($product , 'thumbnail')->resize(256);
89
+ $specialPrice = number_format($product->getSpecialPrice(), 2, '.', '');
90
+ $regularPrice = number_format($product->getPrice(), 2, '.', '');
91
+ $products_out.="<product><url>".$product->getProductUrl()."</url><title>".htmlspecialchars(htmlentities($product->getName(),ENT_QUOTES,'UTF-8'))."</title><imgurl>".$imageUrl."</imgurl>";
92
+ if(isset($specialPrice) && $specialPrice>0){
93
+ $products_out.= "<price>".$specialPrice."</price>";
94
+ $products_out.= "<previousprice>".$regularPrice."</previousprice>";
95
+ }else{
96
+ $products_out.= "<price>".$regularPrice."</price>";
97
+ }
98
+ if($product->getMetaKeyword()!=''){
99
+ $products_out.= "<keywords>".htmlentities($product->getMetaKeyword(),ENT_QUOTES,'UTF-8')."</keywords>";
100
+ }
101
+ if($product->getDescription()!=''){
102
+ $products_out.= "<description>".htmlspecialchars(htmlentities($product->getDescription(),ENT_QUOTES,'UTF-8'))."</description>";
103
+ }
104
+ $products_out.= "<productnumber>".$product->getId()."</productnumber>";
105
+ $products_out.= "<currency>".Mage::app()->getStore()->getCurrentCurrencyCode()."</currency>";
106
+ $cats = $product->getCategoryIds();
107
+ $products_out.= "<hierarchies>";
108
+ foreach ($cats as $category_id) {
109
+ $products_out.= "<hierarchy> ";
110
+ $category = Mage::getModel('catalog/category')->load($category_id) ;
111
+ $catnames = array();
112
+ foreach ($category->getParentCategories() as $parent) {
113
+ if(trim($parent->getName())!=""){
114
+ $catnames[] = $parent->getName();
115
+
116
+ $products_out.= "<category>".htmlspecialchars(htmlentities($parent->getName(),ENT_QUOTES,'UTF-8'))."</category>";
117
+ }
118
+ }
119
+
120
+ $products_out.= "</hierarchy> ";
121
+ }
122
+ $products_out.= "</hierarchies>";
123
+ if($product->getData('brand')){
124
+ $products_out.= "<brand>".$product->getData('brand')."</brand>";
125
+ }
126
+
127
+ if($product->isInStock()){
128
+ $products_out.= "<instock>true</instock>";
129
+ }else{
130
+ $products_out.= "<instock>false</instock>";
131
+ }
132
+
133
+ if($product->getData('gender')){
134
+ $products_out.= "<gender>".$product->getData('gender')."</gender>";
135
+ }
136
+ if($product->getData('pricedetail')){
137
+ $products_out.= "<pricedetail>".$product->getData('pricedetail')."</pricedetail>";
138
+ }
139
+ //
140
+ $products_out.= "</product>";
141
+ }
142
+ $products_out.= "</products>";
143
+ $file_path=Mage::getBaseDir()."/addwishProductExport.xml";
144
+ $addwishProductExport = fopen($file_path, "w");
145
+ fwrite($addwishProductExport, $products_out);
146
+ fclose($addwishProductExport);
147
+ Mage::getSingleton('core/session')->addSuccess('Feed Generated successfully.');
148
+ $this->_redirect('*/*/view');
149
+
150
+ }
151
+ public function newAction()
152
+ {
153
+ $this->_forward('edit');
154
+ }
155
+ }
app/code/local/Addwish/Integrator/controllers/IndexController.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Addwish_Integrator_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function searchAction(){
5
+ $this->loadLayout();
6
+ $this->renderLayout();
7
+ }
8
+ public function upsellsAction(){
9
+ $this->loadLayout();
10
+ $this->renderLayout();
11
+ }
12
+ public function orderListAction(){
13
+ $model = Mage::getModel('integrator/integrator')->load(1);
14
+ if($model->getData('ipaddress')!=''){
15
+ $allowedIps=explode(",",$model->getData('ipaddress'));
16
+ $ipaddress = '';
17
+ if ($_SERVER['HTTP_CLIENT_IP'])
18
+ $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
19
+ else if($_SERVER['HTTP_X_FORWARDED_FOR'])
20
+ $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
21
+ else if($_SERVER['HTTP_X_FORWARDED'])
22
+ $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
23
+ else if($_SERVER['HTTP_FORWARDED_FOR'])
24
+ $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
25
+ else if($_SERVER['HTTP_FORWARDED'])
26
+ $ipaddress = $_SERVER['HTTP_FORWARDED'];
27
+ else if($_SERVER['REMOTE_ADDR'])
28
+ $ipaddress = $_SERVER['REMOTE_ADDR'];
29
+ else
30
+ $ipaddress = 'UNKNOWN';
31
+ if(!in_array($ipaddress,$allowedIps)){
32
+ echo "Access Denied";
33
+ exit;
34
+ }
35
+
36
+ }
37
+ if($model->getData('enable_order_export')==0){
38
+ echo "Access Denied";
39
+ exit;
40
+ }
41
+ $exportFromDate=$this->getRequest()->getParam('exportFromDate');
42
+ $exportToDate=$this->getRequest()->getParam('exportToDate');
43
+ $fromDate = date('Y-m-d H:i:s', strtotime($exportFromDate));
44
+ $toDate = date('Y-m-d H:i:s', strtotime($exportToDate));
45
+ header("Content-type: text/xml");
46
+ echo '<?xml version="1.0" encoding="UTF-8"?><orders><exportFromDate>'.$exportFromDate.'</exportFromDate><exportToDate>'.$exportToDate.'</exportToDate>';
47
+ $orders = Mage::getModel('sales/order')->getCollection()
48
+ ->addAttributeToFilter('created_at', array('from'=>$fromDate, 'to'=>$toDate))
49
+ ->addAttributeToFilter('status', array('eq' => Mage_Sales_Model_Order::STATE_COMPLETE));
50
+ foreach($orders as $order){
51
+ $order_total=number_format($order->getData('base_grand_total'), 2, '.', '');
52
+ echo '<order><orderDate>'.$order->getData('created_at').'</orderDate><orderNumber>'.$order->getData('increment_id').'</orderNumber><orderTotal>'.$order_total.'</orderTotal><orderLines>';
53
+ $items = $order->getAllItems();
54
+ foreach($items as $orderItem):
55
+ $_product = Mage::getModel('catalog/product')
56
+ ->load($orderItem->getProductId());
57
+ echo '<orderLine><productnumber>'.$_product->getId().'</productnumber><productURL>'.$_product->getProductUrl().'</productURL><quantity>'.(int)$orderItem->getData('qty_ordered').'</quantity></orderLine>';
58
+ endforeach;
59
+ echo '</orderLines></order>';
60
+ }
61
+ echo '</orders>';
62
+ //echo "</pre>";
63
+
64
+
65
+ exit;
66
+ }
67
+ public function indexAction()
68
+ {
69
+ $this->_redirect('/');
70
+ }
71
+ }
72
+ ?>
app/code/local/Addwish/Integrator/etc/config.xml ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Addwish_Integrator>
5
+ <version>0.2.0</version>
6
+ </Addwish_Integrator>
7
+ </modules>
8
+ <crontab>
9
+ <jobs>
10
+ <addwish_cron>
11
+ <schedule>
12
+ <cron_expr>*/50 * * * *</cron_expr>
13
+ </schedule>
14
+ <run>
15
+ <model>integrator/observer::addWishCron</model>
16
+ </run>
17
+ </addwish_cron>
18
+ </jobs>
19
+ </crontab>
20
+ <frontend>
21
+
22
+
23
+ <events>
24
+ <checkout_cart_add_product_complete>
25
+ <observers>
26
+ <inspectCartAddData>
27
+ <class>Addwish_Integrator_Model_Observer</class>
28
+ <method>inspectCartAddData</method>
29
+ </inspectCartAddData>
30
+ </observers>
31
+ </checkout_cart_add_product_complete>
32
+ </events>
33
+ <routers>
34
+ <integrator>
35
+ <use>standard</use>
36
+ <args>
37
+ <module>Addwish_Integrator</module>
38
+ <frontName>integrator</frontName>
39
+ </args>
40
+ </integrator>
41
+ </routers>
42
+ <layout>
43
+ <updates>
44
+ <integrator>
45
+ <file>integrator.xml</file>
46
+ </integrator>
47
+ </updates>
48
+ </layout>
49
+ </frontend>
50
+ <admin>
51
+ <routers>
52
+ <integrator>
53
+ <use>admin</use>
54
+ <args>
55
+ <module>Addwish_Integrator</module>
56
+ <frontName>integrator</frontName>
57
+ </args>
58
+ </integrator>
59
+ </routers>
60
+ </admin>
61
+ <adminhtml>
62
+ <menu>
63
+
64
+ <integrator module="integrator">
65
+ <title>addwish</title>
66
+ <sort_order>1</sort_order>
67
+ <children>
68
+ <items module="integrator">
69
+ <title>addwish Configuration</title>
70
+ <sort_order>0</sort_order>
71
+ <action>integrator/adminhtml_integrator/view</action>
72
+ </items>
73
+ </children>
74
+ </integrator>
75
+ </menu>
76
+ <acl>
77
+ <resources>
78
+ <all>
79
+ <title>Allow Everything</title>
80
+ </all>
81
+ <admin>
82
+ <children>
83
+ <Addwish_Integrator>
84
+ <title>Integrator Module</title>
85
+ <sort_order>10</sort_order>
86
+ </Addwish_Integrator>
87
+ </children>
88
+ </admin>
89
+ </resources>
90
+ </acl>
91
+ <layout>
92
+ <updates>
93
+ <integrator>
94
+ <file>integrator.xml</file>
95
+ </integrator>
96
+ </updates>
97
+ </layout>
98
+ </adminhtml>
99
+
100
+ <global>
101
+ <models>
102
+ <integrator>
103
+ <class>Addwish_Integrator_Model</class>
104
+ <resourceModel>integrator_mysql4</resourceModel>
105
+ </integrator>
106
+ <integrator_mysql4>
107
+ <class>Addwish_Integrator_Model_Mysql4</class>
108
+ <entities>
109
+ <integrator>
110
+ <table>addwish</table>
111
+ </integrator>
112
+ </entities>
113
+ </integrator_mysql4>
114
+ </models>
115
+ <resources>
116
+ <addwish_setup>
117
+ <setup>
118
+ <module>Addwish_Integrator</module>
119
+ </setup>
120
+ <connection>
121
+ <use>core_setup</use>
122
+ </connection>
123
+ </addwish_setup>
124
+ <addwish_write>
125
+ <connection>
126
+ <use>core_write</use>
127
+ </connection>
128
+ </addwish_write>
129
+ <addwish_read>
130
+ <connection>
131
+ <use>core_read</use>
132
+ </connection>
133
+ </addwish_read>
134
+ </resources>
135
+ <blocks>
136
+ <integrator>
137
+ <class>Addwish_Integrator_Block</class>
138
+ </integrator>
139
+ </blocks>
140
+ <helpers>
141
+ <integrator>
142
+ <class>Addwish_Integrator_Helper</class>
143
+ </integrator>
144
+ </helpers>
145
+ </global>
146
+ </config>
app/code/local/Addwish/Integrator/sql/addwish_setup/mysql4-install-0.0.4.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $prefix = Mage::getConfig()->getTablePrefix();
5
+
6
+ $installer->run("CREATE TABLE IF NOT EXISTS `".$prefix."addwish` (
7
+ `id` int(11) NOT NULL AUTO_INCREMENT,
8
+ `userId` varchar(255) NOT NULL,
9
+ `enableUpsells` int(11) NOT NULL,
10
+ `ipaddress` text NOT NULL,
11
+ `cron_time` varchar(11) NOT NULL,
12
+ `enable_product_feed` tinyint(4) NOT NULL,
13
+ `enable_order_export` tinyint(4) NOT NULL,
14
+ PRIMARY KEY (`id`)
15
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
16
+
17
+ --
18
+ -- Dumping data for table `addwish`
19
+ --
20
+
21
+ INSERT INTO `".$prefix."addwish` (`id`, `userId`, `enableUpsells`,`ipaddress`) VALUES ('1', '', '0','46.137.110.51');");
22
+
23
+ Mage::getModel('core/url_rewrite')->setIsSystem(0)->setOptions('')->setIdPath('Add Wish Search')->setTargetPath('/integrator/index/search')->setRequestPath('addwish-search-result.html')->save();
24
+ Mage::getModel('core/url_rewrite')->setIsSystem(0)->setOptions('')->setIdPath('Add Wish Order list')->setTargetPath('integrator/index/orderlist')->setRequestPath('orderExportFeed.xml')->save();
25
+
26
+
27
+ $installer->endSetup();
28
+ ?>
app/design/adminhtml/default/default/layout/integrator.xml ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <integrator_adminhtml_integrator_index>
4
+ <reference name="head">
5
+ <action method="setTitle">
6
+ <title>addwish Settings</title>
7
+ </action>
8
+ <action method="setTitle">
9
+ <title>addwish Settings</title>
10
+ </action>
11
+ <action method="setCanLoadTinyMce">
12
+ <load>1</load>
13
+ </action>
14
+ <action method="setCanLoadExtJs">
15
+ <flag>1</flag>
16
+ </action>
17
+ <action method="addJs">
18
+ <script>mage/adminhtml/variables.js</script>
19
+ </action>
20
+ <action method="addJs">
21
+ <script>mage/adminhtml/wysiwyg/widget.js</script>
22
+ </action>
23
+ <action method="addJs">
24
+ <script>lib/flex.js</script>
25
+ </action>
26
+ <action method="addJs">
27
+ <script>lib/FABridge.js</script>
28
+ </action>
29
+ <action method="addJs">
30
+ <script>mage/adminhtml/flexuploader.js</script>
31
+ </action>
32
+ <action method="addJs">
33
+ <script>mage/adminhtml/browser.js</script>
34
+ </action>
35
+ <action method="addJs">
36
+ <script>prototype/window.js</script>
37
+ </action>
38
+ <action method="addItem">
39
+ <name>skin/adminhtml/default/default/lib/prototype/windows/themes/magento.css
40
+ </name>
41
+ </action>
42
+ <action method="addItem">
43
+ <type>js_css</type>
44
+ <name>prototype/windows/themes/default.css</name>
45
+ </action>
46
+ </reference>
47
+ <reference name="content">
48
+ <block type="integrator/adminhtml_integrator" name="integrator" />
49
+ </reference>
50
+ </integrator_adminhtml_integrator_index>
51
+ <integrator_adminhtml_integrator_edit>
52
+ <reference name="head">
53
+ <action method="setTitle">
54
+ <title>addwish Settings</title>
55
+ </action>
56
+ <action method="setTitle">
57
+ <title>addwish Settings</title>
58
+ </action>
59
+ <action method="setCanLoadTinyMce">
60
+ <load>1</load>
61
+ </action>
62
+ <action method="setCanLoadExtJs">
63
+ <flag>1</flag>
64
+ </action>
65
+ <action method="addJs">
66
+ <script>mage/adminhtml/variables.js</script>
67
+ </action>
68
+ <action method="addJs">
69
+ <script>mage/adminhtml/wysiwyg/widget.js</script>
70
+ </action>
71
+ <action method="addJs">
72
+ <script>lib/flex.js</script>
73
+ </action>
74
+ <action method="addJs">
75
+ <script>lib/FABridge.js</script>
76
+ </action>
77
+ <action method="addJs">
78
+ <script>mage/adminhtml/flexuploader.js</script>
79
+ </action>
80
+ <action method="addJs">
81
+ <script>mage/adminhtml/browser.js</script>
82
+ </action>
83
+ <action method="addJs">
84
+ <script>prototype/window.js</script>
85
+ </action>
86
+ <action method="addItem">
87
+ <name>skin/adminhtml/default/default/lib/prototype/windows/themes/magento.css
88
+ </name>
89
+ </action>
90
+ <action method="addItem">
91
+ <type>js_css</type>
92
+ <name>prototype/windows/themes/default.css</name>
93
+ </action>
94
+ </reference>
95
+ </integrator_adminhtml_integrator_edit>
96
+
97
+
98
+
99
+ <integrator_adminhtml_integrator_view>
100
+ <reference name="head">
101
+ <action method="setTitle">
102
+ <title>addwish Settings</title>
103
+ </action>
104
+ <action method="setTitle">
105
+ <title>addwish Settings</title>
106
+ </action>
107
+ <action method="setCanLoadTinyMce">
108
+ <load>1</load>
109
+ </action>
110
+ <action method="setCanLoadExtJs">
111
+ <flag>1</flag>
112
+ </action>
113
+ <action method="addJs">
114
+ <script>mage/adminhtml/variables.js</script>
115
+ </action>
116
+ <action method="addJs">
117
+ <script>mage/adminhtml/wysiwyg/widget.js</script>
118
+ </action>
119
+ <action method="addJs">
120
+ <script>lib/flex.js</script>
121
+ </action>
122
+ <action method="addJs">
123
+ <script>lib/FABridge.js</script>
124
+ </action>
125
+ <action method="addJs">
126
+ <script>mage/adminhtml/flexuploader.js</script>
127
+ </action>
128
+ <action method="addJs">
129
+ <script>mage/adminhtml/browser.js</script>
130
+ </action>
131
+ <action method="addJs">
132
+ <script>prototype/window.js</script>
133
+ </action>
134
+ <action method="addItem">
135
+ <name>skin/adminhtml/default/default/lib/prototype/windows/themes/magento.css
136
+ </name>
137
+ </action>
138
+ <action method="addItem">
139
+ <type>js_css</type>
140
+ <name>prototype/windows/themes/default.css</name>
141
+ </action>
142
+ </reference>
143
+ <reference name="content">
144
+ <block type="integrator/adminhtml_integrator_view" name="integrator" />
145
+ </reference>
146
+ </integrator_adminhtml_integrator_view>
147
+
148
+
149
+
150
+
151
+ </layout>
app/design/adminhtml/default/default/template/integrator/integrator/list.phtml ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <link rel="stylesheet" href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);?>adminhtml/default/default/css/addwish.css" />
2
+ <link rel="stylesheet" href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);?>adminhtml/default/default/boxes.css" />
3
+ <div style="float: left; margin-top: 0;">
4
+ <img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);?>adminhtml/default/default/images/addwish/addwish.png" alt="addwish logo" />
5
+ </div>
6
+ <div class='clear'></div>
7
+ <div class="introtext" style="margin-top:-70px">Great! You’ve successfully installed the addwish for business extension. This will allow you to quickly implement changes to how addwish functions on your webshop. We’ve made the extension as easy to use as possible but if you do have any questions don’t hesitate to contact us on <a href="mailto:support@addwish.com">support@addwish.com</a>. Alternatively, check out our FAQs on <a href="http://addwish.com/company/faq.html" target="_blank">http://addwish.com/company/faq.html</a>. We hope you enjoy growing your business with addwish!</div>
8
+ <div class="entry-edit">
9
+ <div class="entry-edit-head collapseable">
10
+ <a onclick="Fieldset.toggleCollapse('general_region', ''); return false;" href="#" id="general_region-head" class="">Script Setup</a>
11
+ </div>
12
+ <form action='' method='post'>
13
+ <input type='hidden' name='action' value='scriptsetup'/>
14
+ <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
15
+ <fieldset id="general_region" class="config collapseable">
16
+ <legend>Script Setup</legend>
17
+ <?php
18
+ $model = Mage::getModel('integrator/integrator')->load(1);
19
+ ?>
20
+ <div class="introtext" style="margin-bottom: 10px">
21
+ In order to use this extension you'll need to have an addwish business ID.<br>If you don't already have one you can sign up for one on our <a href="http://www.addwish.com/business/"target="_blank">webpage</a> <br>
22
+ Once you have an addwish business ID enter it in the box below and press save.</div>
23
+
24
+
25
+ <div style="float: left">
26
+ <p>Your addwish ID</p>
27
+ </div>
28
+ <div style="float: left; margin-left: 20px;">
29
+ <input type='text' name='addwishID' size="40" value='<?php echo $model->getData('userId');?>'/>
30
+ </div>
31
+ <div style="float: left; margin-left: 20px;">
32
+ <input type="submit" class="form-button" value="Save" name="submit">
33
+ </div>
34
+ <div style="clear:both">
35
+
36
+ </div>
37
+
38
+ </fieldset>
39
+ </form>
40
+ </div>
41
+
42
+ <div class='clear'></div>
43
+ <div class="entry-edit">
44
+ <div class="entry-edit-head collapseable">
45
+ <a
46
+ onclick="Fieldset.toggleCollapse('general_region', ''); return false;"
47
+ href="#" id="general_region-head" class="">Data Export Setup</a>
48
+ </div>
49
+ <form action='' method='post'>
50
+ <input type='hidden' name='action' value='dataexport'/>
51
+ <input name="form_key" type="hidden"
52
+ value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
53
+ <fieldset id="general_region" class="config collapseable">
54
+ <legend>Data Export Setup</legend>
55
+ <?php
56
+ $model = Mage::getModel('integrator/integrator')->load(1);
57
+ ?>
58
+ <div style="margin-bottom: 10px" class="introtext">
59
+ This extension will automatically create a product feed and an order history feed, which will allow addwish to correctly identify and display all the products on your webshop <br>and create relations between them, based on your historical orders. <br>
60
+ <br>
61
+ The product feed is being updated once pr. day. As generating the feed requires the plugin to read all product data we recommend that you choose a time when this feed can automatically re-generate daily. Please select from the drop-down selction below.
62
+ <br>
63
+ If you want to disable the product or order history feed you can do so below, however this will cause the addwish features to stop being updated and stop from displaying up-to-date.<br><br>
64
+
65
+ We have included a text area, where you can enter the IP addresses that you would allow to fetch the data feeds. The addwish IP has been pre-entered. If you would like to add another IP address, you can do so by clicking edit. If you delete all the IP addresses from this box the data exports will be publicly available.
66
+
67
+
68
+
69
+
70
+
71
+ </div>
72
+ <h6>Product feed</h6> <p>Here are the settings for the product feed, you can access the product feed from this url: <a href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);?>addwishProductExport.xml" target="_blank">addwishProductExport.xml</a></p>
73
+ <div style="float:left">
74
+ <input type="checkbox" value="1" name="enable_product_feed" <?php if($model->getData('enable_product_feed')==1){echo "checked='checked'";} ?>/><label style="margin-left: 10px;">Product feed</label>
75
+ <span style="margin-left: 20px;margin-right: 20px;">Start feed update at: </span><select name="cron_hour" style="width: 60px;">
76
+ <?php
77
+ for($i=1;$i<=24;$i++){
78
+ $selected='';
79
+ if($i==$model->getData('cron_time')){
80
+ $selected='selected="selected"';
81
+ }
82
+ echo "<option value='".$i."' ".$selected.">".date("H:i",strtotime("$i:00"))."</option>";
83
+ }
84
+ ?> </select>
85
+ </div>
86
+ <div style="float:left; margin-left: 20px"><a href="<?php echo $this->getUrl('integrator/adminhtml_integrator/generatefeed/');?>" class="form-button" style="float: left; text-decoration:none;">Update Product feed Now</a>
87
+ <span style="margin-left: 10px;"><i>Click the button to update the product feed now. Usefull if you just updated prices, and you want it populated to addwish</i></span></div>
88
+ <br>
89
+
90
+ <br>
91
+
92
+ <div style="clear:both"></div>
93
+ <hr>
94
+
95
+ <div style="margin-top: 10px;">
96
+ <h6>Order feed</h6><p>Enable and disable the order feed here. Addwish uses this to gather all needed information from historical orders to get the best possible data for our algorithms. You can access the order feed from this link
97
+ <a href="<?php echo Mage::getBaseUrl();?>integrator/index/orderList/?exportFromDate=2015-11-11&amp;exportToDate=2015-12-11" target="_blank">/integrator/index/orderList/?exportFromDate=2015-11-11&amp;exportToDate=2015-12-11</a></p>
98
+ </div>
99
+ <div style="clear:both; margin-top: 5px;"></div>
100
+ <div style="float:left">
101
+ <input type="checkbox" value="1" name="enable_order_feed" <?php if($model->getData('enable_order_export')==1){echo "checked='checked'";} ?>/><label for="general_region_display_all" style="margin-left: 10px;">Order feed</label>
102
+ </div>
103
+ <div style="clear:both; margin-top: 5px;"></div>
104
+ <br>
105
+ <hr>
106
+
107
+ <div style="margin-top: 10px;">
108
+ <h6>Feed access settings</h6><p>Indicate which IP addresses you will allow to access you feed data. The addwish IP is pre-entered into the text field below. Seperate each IP address with a komma. If you delete all IP addresses, all IP addresses, everybody can access your feeds.
109
+ </p><div>
110
+ <textarea name="ipaddress" id="ipaddress" style="width: 297px; height: 77px;" disabled="disabled"><?php echo $model->getData('ipaddress');?></textarea></textarea> <a href="javascript:void(0);" onclick="editip();">edit</a></div>
111
+ <div style="clear:both"></div>
112
+ <br>
113
+ <hr>
114
+ <div style="clear: both; margin-top: 10px;"></div>
115
+
116
+ <div style="float: left;">
117
+ <input type="submit" name="submit" value="Update Settings" class="form-button">
118
+ </div>
119
+ <br>
120
+ <div style="clear: both; margin-top: 10px;"></div>
121
+
122
+ </div>
123
+
124
+
125
+ </fieldset>
126
+ </form>
127
+ </div>
128
+ <script language='javascript'>
129
+ function editip(){
130
+ document.getElementById("ipaddress").disabled = false;
131
+ }
132
+ </script>
app/design/adminhtml/default/default/template/integrator/recommendations.phtml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <link
2
+ rel="stylesheet"
3
+ href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);?>adminhtml/default/default/css/addwish.css" />
4
+ <link
5
+ rel="stylesheet"
6
+ href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);?>adminhtml/default/default/boxes.css" />
7
+ <div style="float: left; margin-top: 0;">
8
+ <img
9
+ src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);?>adminhtml/default/default/images/addwish/addwish.png"
10
+ alt="addwish logo" />
11
+
12
+ </div>
13
+ <div class='clear'></div>
14
+ <div class="entry-edit">
15
+ <div class="entry-edit-head collapseable">
16
+ <a class="" id="general_recommend-head" href="#" onclick="Fieldset.toggleCollapse('general_recommend', ''); return false;">Recommendations</a>
17
+ </div>
18
+ <form action="" method="post">
19
+ <input type="hidden" name="action" value="recomendations">
20
+ <input name="form_key" type="hidden"
21
+ value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
22
+ <fieldset class="config collapseable" id="general_recommend">
23
+ <legend>Recomendations</legend>
24
+ <?php
25
+ $model = Mage::getModel('integrator/integrator')->load(1);
26
+ ?>
27
+ <div style="margin-bottom: 20px;" class="introtext">
28
+ Personalised recommendations will be displaying unique, relevant content targeted to their needs and shopping habits.
29
+ All the hard work of getting setup is being done by the addwish team, so please if you havn't done so yet, reach out to us, and we will make sure that all your requirements will be handled quickly.
30
+ <br>Get setup with personalised recommendations:
31
+ <br>
32
+ <ul style="list-style: none none none; margin-left: 20px;">
33
+ <li>Encourage your users to continue shopping on your shop</li>
34
+ <li>Customised algorithms to suit your customer experience strategy</li>
35
+ <li>Use them everywhere you wish, both on your front page, product page, category pages or any where else you find it relevant</li>
36
+ </ul>
37
+
38
+ Our recommendations feature automatically analyses user behaviour to recommend products that customers are most likely to buy.
39
+ <br>
40
+ <br>
41
+ In this Magento extension we have included the possibility of having a special upsell page. The upsell page will be shown everytime a product is added to the cart.<br>
42
+ On this upsell page we will have the opotunity to show specialised product recommendations for upsell based on the user and on the contents of the cart.
43
+ <br>
44
+ You can enable and disable the upsell page below. <br><br><b>Before enabling the upsell page, <u>please contact addwish support on <a href="mailto:support@addwish.com">support@addwish.com</a></u> to get you requirements for the recommendations on the upsell page implemented <br> Also please visit the upsell page before enabling the page to tailor the design of the upsell page. You can visit the page from this link : <br>
45
+ <a href="<?php echo Mage::getBaseUrl();?>integrator/index/upsells?productId=3" target="_blank">integrator/index/upsells?productId=3</a></b><br><i>Notice that you can change the ID in the url, to see how the product recommendations will depend on the product added to the cart.
46
+ </i>
47
+ </div>
48
+ <div style="clear:both"></div>
49
+ <div style="float: left">Enable upsell page</div>
50
+ <input type="checkbox" style="margin-left: 10px;" <?php if($model->getData('enableUpsells')==1){echo "checked='checked'";} ?> value="1" name="addwishUpsells">
51
+
52
+
53
+ <div style="clear:both; margin-top: 10px;"></div>
54
+ <hr>
55
+
56
+ <div style="float: left; margin-top: 10px;"><input type="submit" class="form-button" value="Update Settings" name="submit"></div>
57
+
58
+
59
+ <div style="clear:both"></div>
60
+
61
+
62
+ </fieldset>
63
+ </form>
64
+ </div>
app/design/adminhtml/default/default/template/integrator/search.phtml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ Our live search feature simplifies and speeds up your customers’ searches, and gives them live results while typing.<br>
2
+ It automatically corrects and understands spelling errors and gives them quick previews as they type.
3
+ <br><br>Included in the Search feature is also a full featured result page.<br>This plug-in automatically generated this result page, and the addwish javascript present on you shop pages, makes sure that the searched products is shown.
4
+ <br>You can visit the page here <a href="<?php echo Mage::getBaseUrl();?>addwish-search-result.html" target="_blank">/addwish-search-result.html</a> and make sure that design seperate from the space where the results will be shown, is fitting into you requirements.
5
+ <br><b>Please contact <a href="mailto:support@addwish.com">support@addwish.com</a> to get the search implemented and setup for you webshop.
6
+ </b>
app/design/frontend/base/default/layout/addwish.xml DELETED
@@ -1,14 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
- <default>
4
- <block type="addwish/toggle"></block>
5
- <reference name="top.links">
6
- <action method="removeLinkBlock" ifconfig="addwish/general/deactivate_standard_wishlist"><blockName>wishlist_link</blockName></action>
7
- </reference>
8
- </default>
9
- <catalog_product_view>
10
- <reference name="head">
11
- <block type="catalog/product_view" name="addwish_meta" template="addwish/product_meta.phtml" />
12
- </reference>
13
- </catalog_product_view>
14
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/layout/integrator.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <block type="core/template" name="addwish" template="addwish/integrator.phtml" />
6
+ </reference>
7
+ </default>
8
+ <catalog_product_view>
9
+ <reference name="content"><block type="core/template" name="addwish" template="addwish/product-span.phtml" after="addtocart" /></reference>
10
+ </catalog_product_view>
11
+ <checkout_cart_index>
12
+ <reference name="content"><block type="core/template" name="addwish" template="addwish/basket-span.phtml" after="addtocart" /></reference>
13
+ </checkout_cart_index>
14
+ <checkout_onepage_success>
15
+ <reference name="content"><block type="core/template" name="addwish" template="addwish/conversion-span.phtml" after="addtocart" /></reference>
16
+ </checkout_onepage_success>
17
+
18
+ <integrator_index_search>
19
+ <reference name="content"><block type="core/template" name="addwish" template="addwish/search-result-page.phtml" /></reference>
20
+ </integrator_index_search>
21
+ <integrator_index_upsells>
22
+ <reference name="content"><block type="core/template" name="addwish" template="addwish/upsells-page.phtml" /></reference>
23
+ </integrator_index_upsells>
24
+
25
+
26
+ </layout>
27
+
app/design/frontend/base/default/template/addwish/basket-span.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
3
+ ?><span class="addwish-basket" style="display:none"
4
+ data-total="<?php echo number_format($quote->getData('subtotal'), 2, '.', '');?>"
5
+ data-tax="<?php echo number_format($quote->getData('grand_total')-$quote->getData('subtotal'), 2, '.', '');?>"
6
+ data-noshipping="">
7
+ <?php
8
+ $cartItems = Mage::getModel('checkout/cart')->getItems();
9
+ if(count($cartItems)>0){
10
+ foreach($cartItems->getData() as $cartProduct){
11
+ $product=Mage::getModel('catalog/product')->load($cartProduct['product_id']);
12
+ if($product->isVisibleInSiteVisibility()){
13
+ ?>
14
+ <span class="addwish-product"
15
+ data-unit-price="<?php echo number_format($cartProduct['price'], 2, '.', '');?>"
16
+ data-url="<?php echo $product->getProductUrl();?>"
17
+ data-productnumber="<?php echo $product->getId();?>"
18
+ data-sku="<?php echo $product->getSku();?>"
19
+ data-quantity="<?php echo (int)$cartProduct['qty'];?>"
20
+ data-unit-tax="<?php echo number_format($cartProduct['tax_amount'], 2, '.', '');?>">
21
+ </span>
22
+ <?php
23
+ }
24
+ }
25
+ }
26
+ ?>
27
+
28
+ </span>
app/design/frontend/base/default/template/addwish/catalog/product/view/addto.phtml DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
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 license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package base_default
23
- * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- ?>
27
-
28
- <?php $_product = $this->getProduct(); ?>
29
- <?php $_wishlistSubmitUrl = $this->helper('wishlist')->getAddUrl($_product); ?>
30
-
31
- <ul class="add-to-links">
32
- <?php if ($this->helper('wishlist')->isAllow()) : ?>
33
- <li><a href="#" onclick="ADDWISH_PARTNER_NS.link_click()" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
34
- <?php endif; ?>
35
- <?php
36
- $_compareUrl = $this->helper('catalog/product_compare')->getAddUrl($_product);
37
- ?>
38
- <?php if($_compareUrl) : ?>
39
- <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
40
- <?php endif; ?>
41
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/addwish/conversion-span.phtml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $order = Mage::getSingleton('sales/order');
3
+ $order->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
4
+ ?>
5
+ <span class="addwish-conversion" style="display:none;"
6
+ data-tax="<?php echo number_format(Mage::helper('checkout')->getQuote()->getShippingAddress()->getData('tax_amount'), 2, '.', '');?>"
7
+ data-ordernumber="<?php echo $order->getIncrementId();?>"
8
+ data-total="<?php echo number_format($order->getSubtotal(), 2, '.', '');?>"
9
+ >
10
+
11
+ <?php
12
+ $cartItems= $order->getAllItems();
13
+ foreach($cartItems as $cartProduct){
14
+ $product=Mage::getModel('catalog/product')->load($cartProduct->getData('product_id'));
15
+ if($product->isVisibleInSiteVisibility()){
16
+ ?>
17
+ <span class="addwish-product"
18
+ data-unit-price="<?php echo number_format($cartProduct->getData('price'), 2, '.', '');?>"
19
+ data-url="<?php echo $product->getProductUrl();?>"
20
+ data-productnumber="<?php echo $product->getId();?>"
21
+ data-sku="<?php echo $product->getSku();?>"
22
+ data-quantity="<?php echo (int)$cartProduct->getData('qty_ordered');?>"
23
+ data-unit-tax="<?php echo number_format($cartProduct->getData('tax_amount'), 2, '.', '');?>">
24
+ </span>
25
+ <?php
26
+ }
27
+ }
28
+ ?>
29
+
30
+ </span>
app/design/frontend/base/default/template/addwish/integrator.phtml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $model = Mage::getModel('integrator/integrator')->load(1);
3
+ if($model->getData('userId')!=''){
4
+ ?><script type="text/javascript">
5
+ (function() {
6
+ var aws = document.createElement('script');
7
+ aws.type = 'text/javascript';
8
+ if (typeof(aws.async) != "undefined") { aws.async = true; }
9
+ aws.src = (window.location.protocol == 'https:' ? 'https://d1pna5l3xsntoj.cloudfront.net' :
10
+ 'http://cdn.addwish.com') + '/scripts/company/awAddGift.js#<?php echo $model->getData('userId');?>';
11
+ var s = document.getElementsByTagName('script')[0];
12
+ s.parentNode.insertBefore(aws, s);
13
+ })();
14
+ </script>
15
+ <?php
16
+ }
17
+ ?>
app/design/frontend/base/default/template/addwish/js.phtml DELETED
@@ -1,25 +0,0 @@
1
- <?php $addwishId = Mage::getStoreConfig('addwish/general/id'); ?>
2
- <script type="text/javascript">
3
- //<![CDATA[
4
- (function() {
5
- var gms = document.createElement('script'); gms.type = 'text/javascript';
6
- if(typeof gms.async != "undefined") {gms.async = true;}
7
- gms.src = (window.location.protocol == 'https' ? 'https://www.' : 'http://cdn.') +
8
- 'addwish.com/scripts/company/awAddGift.js#<?php echo $addwishId ?>';
9
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gms, s);
10
- })();
11
-
12
- <?php if (Mage::getStoreConfigFlag('addwish/general/deactivate_standard_wishlist')): ?>
13
- document.observe("dom:loaded", function() {
14
- $$('.link-wishlist').each(Element.hide);
15
-
16
- wishlist = $$('.catalog-product-view .add-to-links .link-wishlist')[0];
17
- wishlist.show();
18
- wishlist.href = "javascript:void(0)";
19
- wishlist.setAttribute("onclick", "ADDWISH_PARTNER_NS.link_click()");
20
- });
21
-
22
- <?php endif; ?>
23
- //]]>
24
- </script>
25
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/addwish/product-span.phtml ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $product = Mage::registry('current_product');
3
+ $specialPrice = number_format($product->getSpecialPrice(), 2, '.', '');
4
+ $regularPrice = number_format($product->getPrice(), 2, '.', '');
5
+ $product_image=Mage::helper('catalog/image')->init($product , 'thumbnail')->resize(256);
6
+ ?>
7
+ <span class="addwish-product-info" style="display:none"
8
+ data-title="<?php echo htmlentities($product->getName());?>"
9
+ data-imgurl="<?php echo $product_image;?>"
10
+ <?php
11
+ if(isset($specialPrice) && $specialPrice>0){
12
+ echo 'data-price="'.$specialPrice.'"';
13
+ echo 'data-previousprice="'.$regularPrice.'" ';
14
+ }else{
15
+ echo 'data-price="'.$regularPrice.'" ';
16
+ }
17
+ ?>
18
+ data-productnumber="<?php echo $product->getId();?>"
19
+ data-sku="<?php echo $product->getSku();?>"
20
+ data-url="<?php echo $product->getProductUrl();?>"
21
+ data-currency="<?php echo Mage::app()->getStore()->getCurrentCurrencyCode();?>"
22
+ <?php
23
+ if($product->getData('brand')){
24
+ echo "data-brand='".$product->getData('brand')."'";
25
+ }
26
+
27
+ $cats = $product->getCategoryIds();
28
+ $catJsonArray=array();
29
+ foreach ($cats as $category_id) {
30
+ $category = Mage::getModel('catalog/category')->load($category_id) ;
31
+ foreach ($category->getParentCategories() as $parent) {
32
+ $catJsonArray[] = htmlentities($parent->getName());
33
+ }
34
+ }
35
+ ?>
36
+ data-category='<?php echo addslashes(json_encode($catJsonArray));?>'
37
+ <?php if($product->isInStock()){
38
+ echo "data-instock='true'";
39
+ }else{
40
+ echo "data-instock='false'";
41
+ }
42
+ if($product->getData('gender')){
43
+ $attr = $product->getResource()->getAttribute("gender");
44
+ $genderLabel = $attr->getSource()->getOptionText($product->getData('gender'));
45
+ echo "data-gender='".$genderLabel."'";
46
+ }
47
+ if($product->getData('pricedetail')){
48
+ echo "data-pricedetail='".$product->getData('pricedetail')."'";
49
+ }
50
+ if($product->getData('score')){
51
+ echo "data-score='".$product->getData('score')."'";
52
+ }
53
+ if($product->getData('newsletter-promotion')){
54
+ echo "data-newsletter-promotion='".$product->getData('newsletter-promotion')."'";
55
+ }
56
+ if($product->getData('recurrent')){
57
+ echo "data-recurrent='".$product->getData('recurrent')."'";
58
+ }
59
+ if($product->getData('sold-related')){
60
+ echo "data-sold-related='".$product->getData('sold-related')."'";
61
+ }
62
+ $uencURL=Mage::helper('checkout/cart')->getAddUrl($product);
63
+ $elem1=explode("uenc/",$uencURL);
64
+ $elem2=explode("/product",$elem1[1]);
65
+ ?>
66
+ data-formkey='<?php echo Mage::getSingleton('core/session')->getFormKey();?>'
67
+ data-uenc='<?php echo $elem2[0];?>'
68
+ ></span>
app/design/frontend/base/default/template/addwish/product_meta.phtml DELETED
@@ -1,46 +0,0 @@
1
- <?php if (Mage::getStoreConfigFlag('addwish/general/enabled')): ?>
2
- <?php
3
- $_helper = $this->helper('catalog/output');
4
- $_product = $this->getProduct();
5
- $orgImageHeight = (int) $this->helper('catalog/image')->init($_product, 'image')->getOriginalHeight();
6
- $orgImageWidth = (int) $this->helper('catalog/image')->init($_product, 'image')->getOriginalWidth();
7
- ?>
8
- <?php if ($orgImageHeight > 768): ?>
9
- <?php $imageHeight = 400; ?>
10
- <?php $imageWidth = $imageHeight * $orgImageWidth / $orgImageHeight; ?>
11
- <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize($imageWidth, $imageHeight); ?>" />
12
- <?php else: ?>
13
- <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>" />
14
- <?php endif; ?>
15
- <meta property="og:title" content="<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>" />
16
- <meta property="og:price" content="<?php echo number_format($_product->getFinalPrice(), 2) ?>" />
17
-
18
- <script type="text/javascript">
19
- document.observe("dom:loaded", function() {
20
- var metaImageCount = 0;
21
- var metaTitleCount = 0;
22
- var metaPriceCount = 0;
23
-
24
- metaCollection = document.getElementsByTagName('meta');
25
-
26
- for (i=0;i<metaCollection.length;i++) {
27
- meta = metaCollection[i];
28
-
29
- if (meta.getAttribute("property") == "og:image") {
30
- if (metaImageCount++ > 0)
31
- meta.parentNode.removeChild(meta);
32
- }
33
-
34
- if (meta.getAttribute("property") == "og:title") {
35
- if (metaTitleCount++ > 0)
36
- meta.parentNode.removeChild(meta);
37
- }
38
-
39
- if (meta.getAttribute("property") == "og:price") {
40
- if (metaPriceCount++ > 0)
41
- meta.parentNode.removeChild(meta);
42
- }
43
- }
44
- });
45
- </script>
46
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/addwish/search-result-page.phtml ADDED
File without changes
app/design/frontend/base/default/template/addwish/upsells-page.phtml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $lastAddedProduct=Mage::getSingleton('checkout/session')->getLastAddedProductId(true);
3
+ if($lastAddedProduct>0){
4
+ $product=Mage::getModel('catalog/product')->load($lastAddedProduct);
5
+ ?>
6
+ <div class="col-main">
7
+ <a href="<?php echo $product->getProductUrl();?>" style="float:left" class="button">Continue Shopping</a>
8
+ <a href="<?php echo Mage::helper('checkout/cart')->getCartUrl(); ;?>" style="float:right" class="button">Proceed to Checkout</a>
9
+
10
+ <div style="clear:both; margin-top: 50px">
11
+ <h2>You have just added a product to the cart</h2>
12
+ </div>
13
+
14
+
15
+ <div class="sub-head-addwish"><h3>Here are some products that might have your interest</h3></div>
16
+ <span id="addwish-upsell-1" style="display:none"></span>
17
+
18
+ <div class="sub-head-addwish" style="margin-top: 50px;"><h3>Products chosen for you:</h3></div>
19
+ <span id="addwish-upsell-2" style="display:none"></span>
20
+ <span class="addwish-upsell-info" style="display:none" data-url="<?php echo $product->getProductUrl();?>"></span>
21
+ </div>
22
+ <?php
23
+ }else{
24
+ $productId=$this->getRequest()->getParam('productId');
25
+ if($productId>0){
26
+ $product=Mage::getModel('catalog/product')->load($productId);
27
+ ?><div class="col-main">
28
+ <a href="<?php echo $product->getProductUrl();?>" style="float:left" class="button">Continue Shopping</a>
29
+ <a href="<?php echo Mage::helper('checkout/cart')->getCartUrl(); ;?>" style="float:right" class="button">Proceed to Checkout</a>
30
+
31
+ <div style="clear:both; margin-top: 50px">
32
+ <h2>You have just added a product to the cart</h2>
33
+ </div>
34
+
35
+
36
+ <div class="sub-head-addwish"><h3>Here are some products that might have your interest</h3></div>
37
+ <span id="addwish-upsell-1" style="display:none"></span>
38
+
39
+ <div class="sub-head-addwish" style="margin-top: 50px;"><h3>Products chosen for you:</h3></div>
40
+ <span id="addwish-upsell-2" style="display:none"></span>
41
+ <span class="addwish-upsell-info" style="display:none" data-url="<?php echo $product->getProductUrl();?>"></span>
42
+ </div>
43
+ <?php
44
+ }
45
+ }
46
+ ?>
app/etc/modules/Addwish_Addwish.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Addwish_Addwish>
5
- <active>true</active>
6
- <codePool>local</codePool>
7
- </Addwish_Addwish>
8
- </modules>
9
- </config>
 
 
 
 
 
 
 
 
 
app/etc/modules/Addwish_Integrator.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Addwish_Integrator>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ <depends>
8
+ <Mage_Adminhtml/>
9
+ </depends>
10
+ </Addwish_Integrator>
11
+ </modules>
12
+ </config>
package.xml CHANGED
@@ -1,19 +1,34 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>addwish</name>
4
- <version>0.0.3</version>
5
- <stability>stable</stability>
6
- <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Free wish list functionality on your web shop plus promotion of your products on the addwish.com site.</summary>
10
- <description>Addwish is a wish list that lets users share the products they want with the people who want to buy them. But unlike other wish lists, with addwish your products also appear as inspiration in searches for similar products on addwish.com.</description>
11
- <notes>We've added the ability to remove Magento's default wish list, but keep "add to wish list button" which can be set to open addwish instead of the built-in wishlist:&#xD;
12
- We have also made some updates so the price is now being correctly displayed.</notes>
13
- <authors><author><name>addwish</name><user>auto-converted</user><email>sales@addwish.com</email></author></authors>
14
- <date>2013-11-28</date>
15
- <time>14:17:24</time>
16
- <contents><target name="magelocal"><dir name="Addwish"><dir name="Addwish"><dir name="Block"><file name="Toggle.php" hash="319a199b5fdea2ac85662e4b36e7cf57"/></dir><dir name="Helper"><file name="Data.php" hash="3b59bdb805d9736d854906b15b28269b"/></dir><dir name="etc"><file name="config.xml" hash="6f27458c65ed9b43b1e84949893de6d5"/><file name="system.xml" hash="876588894b57c7d91ec72457fcd93a06"/></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Addwish_Addwish.xml" hash="e48317efb40c5cb1bd2b2c76f7ad3c84"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="addwish.xml" hash="03e84b1cf01ef280901e41c9ead76c24"/></dir><dir name="template"><dir name="addwish"><dir name="catalog"><dir name="product"><dir name="view"><file name="addto.phtml" hash="198c269e765335e7be8205f2f7da95ae"/></dir></dir></dir><file name="js.phtml" hash="1cdedb760736b7be4ef5a9cd05b0b8ba"/><file name="product_meta.phtml" hash="cf688bd4168b6f94316ede1f8483cc7e"/></dir></dir></dir></dir></dir></target></contents>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  <compatible/>
18
- <dependencies/>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>addwish</name>
4
+ <version>0.0.4</version>
5
+ <stability>devel</stability>
6
+ <license>OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Personalized recommendations, search and wishlist</summary>
10
+ <description>&lt;p&gt;&lt;b&gt;Get addwish on your site and we'll show your products on ours!&lt;/b&gt;&lt;/p&gt;&#xD;
11
+ &#xD;
12
+ &lt;p&gt;addwish is a wish list that lets users share the products they want with people who want to buy them. But unlike other wish lists, with addwish your products also appear as inspiration in searches for similar products on addwish.com. If addwish users select your product for their list, their family and friends are automatically directed to your web shop where they can make the purchase. &lt;/p&gt;&#xD;
13
+ &#xD;
14
+ &lt;ul&gt;&#xD;
15
+ &lt;li&gt;Easy to install and maintenance free&lt;/li&gt;&#xD;
16
+ &lt;li&gt;Increases traffic to your shop&lt;/li&gt;&#xD;
17
+ &lt;li&gt;High conversion rates&lt;/li&gt;&#xD;
18
+ &lt;/ul&gt;</description>
19
+ <notes>&lt;p&gt;&lt;b&gt;Get addwish on your site and we'll show your products on ours!&lt;/b&gt;&lt;/p&gt;&#xD;
20
+ &#xD;
21
+ &lt;p&gt;addwish is a wish list that lets users share the products they want with people who want to buy them. But unlike other wish lists, with addwish your products also appear as inspiration in searches for similar products on addwish.com. If addwish users select your product for their list, their family and friends are automatically directed to your web shop where they can make the purchase. &lt;/p&gt;&#xD;
22
+ &#xD;
23
+ &lt;ul&gt;&#xD;
24
+ &lt;li&gt;Easy to install and maintenance free&lt;/li&gt;&#xD;
25
+ &lt;li&gt;Increases traffic to your shop&lt;/li&gt;&#xD;
26
+ &lt;li&gt;High conversion rates&lt;/li&gt;&#xD;
27
+ &lt;/ul&gt;</notes>
28
+ <authors><author><name>addwish</name><user>addwish</user><email>krj@addwish.com</email></author></authors>
29
+ <date>2016-01-29</date>
30
+ <time>08:16:01</time>
31
+ <contents><target name="magelocal"><dir name="Addwish"><dir name="Integrator"><dir name="Block"><dir name="Adminhtml"><dir name="Integrator"><file name="Grid.php" hash="3fa75f93b5251ffd849c662f964a1d57"/><file name="Renderer.php" hash="a7469e6df67f94a039a92874321da38e"/><dir name="View"><dir name="Tab"><dir name="Details"><file name="List.php" hash="d08e9b7f83f98b3050a7118ac2369242"/></dir><file name="Details.php" hash="b5220cabab90ccede514fa0e6766555b"/><file name="Form.php" hash="ad6373c64686899d246a11bb2fe17fc1"/><dir name="Recommend"><file name="List.php" hash="b35150ab52310670ab518cb45c1a2e33"/></dir><file name="Recommend.php" hash="6f19611e2e83f8247d97e591fc958bf1"/><dir name="Search"><file name="List.php" hash="5df43f1363e6ae96b94188d45ce7801a"/></dir><file name="Search.php" hash="73ffb13e76137acd67f9a9b9c7751358"/></dir><file name="Tabs.php" hash="1c573a29d7ceb90873409af2b674fc95"/></dir><file name="View.php" hash="42c8b170dae90fc7ef89d8dc5e99bc83"/></dir><file name="Integrator.php" hash="40496a2bd632188c498ada4477ac3752"/></dir><file name="Integrator.php" hash="458f91e566dc29429a8f4506485b254a"/></dir><dir name="Helper"><file name="Data.php" hash="a4de920a156bda655d1ae676f5080514"/></dir><dir name="Model"><file name="Integrator.php" hash="c41ae42230aa6837714da7922c626945"/><dir name="Mysql4"><dir name="Integrator"><file name="Collection.php" hash="d622ef3fcda60d4f980b1c504073c6a6"/></dir><file name="Integrator.php" hash="052377e4c9fdb94a912653287997e58b"/></dir><file name="Observer.php" hash="676fe6acac9d18cc98af41dd874a9d85"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IntegratorController.php" hash="173ce1c012f61f1457c4c0e3f72c70f4"/></dir><file name="IndexController.php" hash="ad35156483a306981af7e0537bab282d"/></dir><dir name="etc"><file name="config.xml" hash="ed48dc9dd2a070da53469a638684a491"/></dir><dir name="sql"><dir name="addwish_setup"><file name="mysql4-install-0.0.4.php" hash="3efb0b443436da1653d68797fba695dc"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><file name="addwish.css" hash="f8711a6d3845f2c39698ca95064abb4c"/></dir><dir name="images"><dir name="addwish"><file name="addwish.png" hash="a588d24d1919d9206eff40a886b88ef1"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="integrator.xml" hash="7c7d92345ca22fb3f3ed42324d7b4656"/></dir><dir name="template"><dir name="integrator"><dir name="integrator"><file name="list.phtml" hash="4b2a16ca729f50f84c2e6b3d7fa67929"/></dir><file name="recommendations.phtml" hash="961ff25fb0409a75f222c58d5c48ef22"/><file name="search.phtml" hash="bcf56fe0d8728a45ca5421a0d6273385"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="integrator.xml" hash="3b5dc56c43797ab0bc97c4f2860db9ed"/></dir><dir name="template"><dir name="addwish"><file name="basket-span.phtml" hash="43ae1f4ca8daad61d16ef84bbfcab2cf"/><file name="conversion-span.phtml" hash="69ab18c525182edc1b83b0690556ac8c"/><file name="integrator.phtml" hash="c28de947018ddc40f1a9dc9d6c51ee60"/><file name="product-span.phtml" hash="c1a0a4db17271f9d9ba522d159805e0c"/><file name="search-result-page.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="upsells-page.phtml" hash="6045046fe46f56ea37f0f3c43f6c5a1e"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Addwish_Integrator.xml" hash="b445d0c5897f7ecefabd04e2e4bc9530"/></dir></target></contents>
32
  <compatible/>
33
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
34
  </package>
skin/adminhtml/default/default/css/addwish.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+
2
+ .introtext {
3
+ margin-bottom: 43px;
4
+ }
5
+ #informative {
6
+ list-style: outside none circle;
7
+ }
skin/adminhtml/default/default/images/addwish/addwish.png ADDED
Binary file