Pixelshop_Integration - Version 1.1.0

Version Notes

Init Version.

Download this release

Release Info

Developer Rafael Mor
Extension Pixelshop_Integration
Version 1.1.0
Comparing to
See all releases


Code changes from version 1.0.0 to 1.1.0

app/code/community/Pixelshop/Integration/Block/Index.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Pixelshop_Integration_Block_Index extends Mage_Core_Block_Template {
3
+
4
+ public static $_store = '';
5
+
6
+ protected function _getStore()
7
+ {
8
+ if(self::$_store){
9
+ self::$_store = Mage::app()->getStore()->getStoreId();
10
+ }
11
+
12
+ return self::$_store;
13
+ }
14
+
15
+ public function getParameters()
16
+ {
17
+ $orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
18
+
19
+ $order = Mage::getModel('sales/order')->load($orderId);
20
+
21
+ $total = (float) $order->getSubtotal();
22
+
23
+ $items = $order->getAllItems();
24
+
25
+ $products = '';
26
+
27
+ foreach($items as $i):
28
+ $products .= $i->getProductId() . ',';
29
+ endforeach;
30
+
31
+ $products = substr($products, 0, -1);
32
+
33
+ $currency = Mage::app()->getStore($this->_getStore())->getCurrentCurrencyCode();
34
+
35
+ $data = array(
36
+ "order_id" => $orderId,
37
+ "revenue" => $total,
38
+ "products" => $products,
39
+ "currency" => $currency
40
+ );
41
+
42
+ return $data;
43
+ }
44
+
45
+ public function getPixelshopId()
46
+ {
47
+ return Mage::getStoreConfig('pixelshop/pixelshop/pixelshop_id', $this->_getStore());
48
+ }
49
+
50
+ public function getThePixel()
51
+ {
52
+ $params = $this->getParameters();
53
+
54
+ return $this->getPixelshopId() . '?order_id=' . $params['order_id'] . '&amp;revenue=' . $params['revenue'] . '&amp;currency=' . $params['currency'] . '&amp;products=' . $params['products'] . '';
55
+ }
56
+
57
+ }
app/code/community/Pixelshop/Integration/controllers/IndexController.php CHANGED
@@ -1,12 +1,9 @@
1
  <?php
2
 
3
- class Pixelshop_Integration_IndexController extends Mage_Adminhtml_Controller_Action
4
- {
5
-
6
- public function indexAction()
7
- {
8
  $this->loadLayout();
9
- $this->renderLayout();
10
  }
11
-
12
  }
1
  <?php
2
 
3
+ class Pixelshop_Integration_IndexController extends Mage_Core_Controller_Front_Action {
4
+
5
+ public function IndexAction() {
 
 
6
  $this->loadLayout();
7
+ $this->renderLayout();
8
  }
 
9
  }
app/code/community/Pixelshop/Integration/etc/config.xml CHANGED
@@ -79,4 +79,14 @@
79
  </resources>
80
  </acl>
81
  </adminhtml>
 
 
 
 
 
 
 
 
 
 
82
  </config>
79
  </resources>
80
  </acl>
81
  </adminhtml>
82
+
83
+ <frontend>
84
+ <layout>
85
+ <updates>
86
+ <pixelshop>
87
+ <file>pixelshop.xml</file>
88
+ </pixelshop>
89
+ </updates>
90
+ </layout>
91
+ </frontend>
92
  </config>
app/code/community/Pixelshop/Integration/etc/system.xml CHANGED
@@ -30,6 +30,15 @@
30
  <show_in_store>1</show_in_store>
31
  <comment>Enter the API Key provided by Pixelshop.</comment>
32
  </api_key>
 
 
 
 
 
 
 
 
 
33
  </fields>
34
  </pixelshop>
35
  </groups>
30
  <show_in_store>1</show_in_store>
31
  <comment>Enter the API Key provided by Pixelshop.</comment>
32
  </api_key>
33
+ <pixelshop_id translate="label">
34
+ <label>Pixelshop ID</label>
35
+ <frontend_type>text</frontend_type>
36
+ <sort_order>25</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>1</show_in_website>
39
+ <show_in_store>1</show_in_store>
40
+ <comment>You can find your id after the slash in the branded page - https://pixelshop.me/pixelshop_id</comment>
41
+ </pixelshop_id>
42
  </fields>
43
  </pixelshop>
44
  </groups>
app/design/frontend/base/default/layout/pixelshop.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <checkout_onepage_success translate="label">
4
+ <reference name="content">
5
+ <block type="pixelshop/index" name="pixelshop_index" template="pixelshop/index.phtml"/>
6
+ </reference>
7
+ </checkout_onepage_success>
8
+ </layout>
app/design/frontend/base/default/template/pixelshop/index.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php if( $this->getPixelshopId() ) : ?>
2
+ <script type="text/javascript" src="http://pixelshop.web/conversions/<?php echo $this->getThePixel(); ?>"></script>
3
+ <?php endif; ?>
package.xml CHANGED
@@ -1,18 +1,22 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Pixelshop_Integration</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Wordpress plugin for pixelshop.io Integration.</summary>
10
- <description>Wordpress plugin for pixelshop.io Integration.</description>
 
 
 
 
11
  <notes>Init Version.</notes>
12
  <authors><author><name>Rafael Mor</name><user>MAG003256829</user><email>hello@pixelshop.io</email></author></authors>
13
- <date>2016-01-04</date>
14
- <time>00:13:42</time>
15
- <contents><target name="magecommunity"><dir name="Pixelshop"><dir name="Integration"><dir name="Block"><dir name="Adminhtml"><dir name="Form"><dir name="Edit"><file name="Form.php" hash="0df16f804b101e2c97f9f6c4a7f494e8"/><dir name="Renderer"><file name="Label.php" hash="930fd900edbce86ba8a5b2d7beff0e98"/><file name="Multienabled.php" hash="301a459c880f8a9ebd46e1d751b61747"/></dir><dir name="Tab"><file name="General.php" hash="7f65cc6eae52d15367851713a86efb57"/></dir><file name="Tabs.php" hash="3081d5cd38467d7680a41bcfd01f583e"/></dir><file name="Edit.php" hash="f91b49add8cc9e0b3233e11fa03115ff"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="0884df2e4ec177a73d5a579ca274a015"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ExportoController.php" hash="03989dd2469d900cdfa291885351dd64"/></dir><file name="IndexController.php" hash="a25e29209d6f19149548833650ecf648"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f9a835131ebdb683db9bc81341b40398"/><file name="config.xml" hash="147434bbf4c147ff85d41871632eae77"/><file name="system.xml" hash="0f2fa9ccc2bccf944582f922cd1aaa47"/></dir></dir></dir></target><target name="magelib"><dir name="Pixelshop"><dir name="Pixelshop"><file name="Export.php" hash="c380a11e2a726c84be2d5db6f01d1022"/></dir><file name="Pixelshop.php" hash="59923c917497b056ceb0cbda77b5fc57"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pixelshop.xml" hash="370a0fd810b833fcf9d8e0380672c3c3"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="pixelshop"><dir name="integration"><file name="pixelshop.css" hash="4cb6365e6c3601fc759ca408410935b5"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="modules"><file name="Pixelshop_Integration.xml" hash=""/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><extension><name>curl</name><min/><max/></extension></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Pixelshop_Integration</name>
4
+ <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Pixelshop - Visual Commerce | Visual Marketing - Integration allow you to export all of your products and track conversions.</summary>
10
+ <description>Pixelshop - Visual Commerce | Visual Marketing&#xD;
11
+ &#xD;
12
+ Pixelshop is a Visual Commerce &amp; Visual Marketing company for businesses we turns your Instagram to shoppable gallery, this is the best solution for the instagram missing link, we also allow you to collect filter and curate your User-generated Content in our simple and intuitive dashboard. &#xD;
13
+ &#xD;
14
+ This one-time integration will save you from creating manually all your products to Pixelshop and other implementation pains. </description>
15
  <notes>Init Version.</notes>
16
  <authors><author><name>Rafael Mor</name><user>MAG003256829</user><email>hello@pixelshop.io</email></author></authors>
17
+ <date>2016-01-14</date>
18
+ <time>08:38:03</time>
19
+ <contents><target name="magecommunity"><dir name="Pixelshop"><dir name="Integration"><dir name="Block"><dir name="Adminhtml"><dir name="Form"><dir name="Edit"><file name="Form.php" hash="0df16f804b101e2c97f9f6c4a7f494e8"/><dir name="Renderer"><file name="Label.php" hash="930fd900edbce86ba8a5b2d7beff0e98"/><file name="Multienabled.php" hash="301a459c880f8a9ebd46e1d751b61747"/></dir><dir name="Tab"><file name="General.php" hash="7f65cc6eae52d15367851713a86efb57"/></dir><file name="Tabs.php" hash="3081d5cd38467d7680a41bcfd01f583e"/></dir><file name="Edit.php" hash="f91b49add8cc9e0b3233e11fa03115ff"/></dir></dir><file name="Index.php" hash="91a83f926c1a04dd25eaf6083e06d9b5"/></dir><dir name="Helper"><file name="Data.php" hash="0884df2e4ec177a73d5a579ca274a015"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ExportoController.php" hash="03989dd2469d900cdfa291885351dd64"/></dir><file name="IndexController.php" hash="20efcde96bc206efd09075b927dde751"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f9a835131ebdb683db9bc81341b40398"/><file name="config.xml" hash="27814fb16a183e2538ed75d147b9d0c0"/><file name="system.xml" hash="33fb11bd52f78647cc007963b8d54527"/></dir></dir></dir></target><target name="magelib"><dir name="Pixelshop"><dir name="Pixelshop"><file name="Export.php" hash="c380a11e2a726c84be2d5db6f01d1022"/></dir><file name="Pixelshop.php" hash="59923c917497b056ceb0cbda77b5fc57"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pixelshop.xml" hash="370a0fd810b833fcf9d8e0380672c3c3"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pixelshop.xml" hash="fb553fde359d98e711299058923f52b5"/></dir><dir name="template"><dir name="pixelshop"><file name="index.phtml" hash="f92cc7e5ea2632c9af3a5d5b86dd20ac"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="pixelshop"><dir name="integration"><file name="pixelshop.css" hash="4cb6365e6c3601fc759ca408410935b5"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="modules"><file name="Pixelshop_Integration.xml" hash=""/></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><extension><name>curl</name><min/><max/></extension></required></dependencies>
22
  </package>