Version Notes
NC
Download this release
Release Info
Developer | Magento Core Team |
Extension | XPRIME_GoogleRemarketing |
Version | 0.1.2 |
Comparing to | |
See all releases |
Version 0.1.2
- app/code/community/Xprime/Remarketing/Block/Adminhtml/Items.php +19 -0
- app/code/community/Xprime/Remarketing/Block/Adminhtml/Items/Edit.php +44 -0
- app/code/community/Xprime/Remarketing/Block/Adminhtml/Items/Edit/Form.php +106 -0
- app/code/community/Xprime/Remarketing/Block/Adminhtml/Items/Grid.php +98 -0
- app/code/community/Xprime/Remarketing/Block/Js.php +184 -0
- app/code/community/Xprime/Remarketing/Helper/Data.php +54 -0
- app/code/community/Xprime/Remarketing/Model/Mysql4/Remarketing.php +20 -0
- app/code/community/Xprime/Remarketing/Model/Mysql4/Remarketing/Collection.php +20 -0
- app/code/community/Xprime/Remarketing/Model/Remarketing.php +15 -0
- app/code/community/Xprime/Remarketing/controllers/Adminhtml/RemarketingController.php +152 -0
- app/code/community/Xprime/Remarketing/etc/adminhtml.xml +40 -0
- app/code/community/Xprime/Remarketing/etc/config.xml +83 -0
- app/code/community/Xprime/Remarketing/etc/system.xml +73 -0
- app/code/community/Xprime/Remarketing/sql/remarketing_setup/mysql4-install-0.1.0.php +81 -0
- app/code/community/Xprime/Remarketing/sql/remarketing_setup/mysql4-upgrade-0.1.0-0.1.1.php +54 -0
- app/design/frontend/default/default/layout/remarketing.xml +10 -0
- app/etc/modules/Xprime_Remarketing.xml +9 -0
- app/locale/en_US/Xprime_Remarketing.csv +24 -0
- app/locale/fr_FR/Xprime_Remarketing.csv +24 -0
- package.xml +26 -0
app/code/community/Xprime/Remarketing/Block/Adminhtml/Items.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* X-PRIME Google Remarketing Module
|
4 |
+
* @author X-PRIME developers Team <magento@x-prime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<?php
|
9 |
+
class Xprime_Remarketing_Block_Adminhtml_Items extends Mage_Adminhtml_Block_Widget_Grid_Container
|
10 |
+
{
|
11 |
+
public function __construct()
|
12 |
+
{
|
13 |
+
$this->_controller = 'adminhtml_items';
|
14 |
+
$this->_blockGroup = 'remarketing';
|
15 |
+
$this->_headerText = Mage::helper('remarketing')->__('Remarketing label list');
|
16 |
+
$this->_addButtonLabel = Mage::helper('remarketing')->__('Add a label');
|
17 |
+
parent::__construct();
|
18 |
+
}
|
19 |
+
}
|
app/code/community/Xprime/Remarketing/Block/Adminhtml/Items/Edit.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* X-PRIME Google Remarketing Module
|
4 |
+
* @author X-PRIME developers Team <magento@x-prime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<?php
|
9 |
+
|
10 |
+
class Xprime_Remarketing_Block_Adminhtml_Items_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
11 |
+
{
|
12 |
+
public function __construct()
|
13 |
+
{
|
14 |
+
parent::__construct();
|
15 |
+
|
16 |
+
$this->_objectId = 'id';
|
17 |
+
$this->_blockGroup = 'remarketing';
|
18 |
+
$this->_controller = 'adminhtml_items';
|
19 |
+
|
20 |
+
$this->_updateButton('save', 'label', Mage::helper('adminhtml')->__('Save'));
|
21 |
+
$this->_updateButton('delete', 'label', Mage::helper('adminhtml')->__('Delete'));
|
22 |
+
|
23 |
+
$this->_addButton('saveandcontinue', array(
|
24 |
+
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
25 |
+
'onclick' => 'saveAndContinueEdit()',
|
26 |
+
'class' => 'save',
|
27 |
+
), -100);
|
28 |
+
|
29 |
+
$this->_formScripts[] = "
|
30 |
+
function saveAndContinueEdit(){
|
31 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
32 |
+
}
|
33 |
+
";
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getHeaderText()
|
37 |
+
{
|
38 |
+
if( Mage::registry('remarketing_data') && Mage::registry('remarketing_data')->getId() ) {
|
39 |
+
return Mage::helper('remarketing')->__("Edit the label '%s'", $this->htmlEscape(Mage::registry('remarketing_data')->getTitle()));
|
40 |
+
} else {
|
41 |
+
return Mage::helper('remarketing')->__('Add a label');
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
app/code/community/Xprime/Remarketing/Block/Adminhtml/Items/Edit/Form.php
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* X-PRIME Google Remarketing Module
|
4 |
+
* @author X-PRIME developers Team <magento@x-prime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<?php
|
9 |
+
/**
|
10 |
+
* Remarketing label edit form
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
|
14 |
+
class Xprime_Remarketing_Block_Adminhtml_Items_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
15 |
+
{
|
16 |
+
|
17 |
+
public function __construct()
|
18 |
+
{
|
19 |
+
parent::__construct();
|
20 |
+
$this->setId('ramarketing_form');
|
21 |
+
$this->setTitle(Mage::helper('remarketing')->__('General Information'));
|
22 |
+
}
|
23 |
+
|
24 |
+
protected function _prepareForm()
|
25 |
+
{
|
26 |
+
$model = Mage::registry('remarketing_data');
|
27 |
+
|
28 |
+
$form = new Varien_Data_Form(
|
29 |
+
array('id' => 'edit_form', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))), 'method' => 'post')
|
30 |
+
);
|
31 |
+
|
32 |
+
$fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('remarketing')->__('General Information')));
|
33 |
+
|
34 |
+
if ($model->getId()) {
|
35 |
+
$fieldset->addField('id', 'hidden', array(
|
36 |
+
'name' => 'id',
|
37 |
+
));
|
38 |
+
}
|
39 |
+
|
40 |
+
$fieldset->addField('form_key', 'hidden', array(
|
41 |
+
'name' => 'form_key',
|
42 |
+
'value' => Mage::getSingleton('core/session')->getFormKey(),
|
43 |
+
));
|
44 |
+
|
45 |
+
$fieldset->addField('store_id', 'hidden', array(
|
46 |
+
'name' => 'store_id',
|
47 |
+
'value' => (int)$this->getRequest()->getParam('store')
|
48 |
+
));
|
49 |
+
|
50 |
+
$fieldset->addField('title', 'text', array(
|
51 |
+
'name' => 'title',
|
52 |
+
'label' => Mage::helper('remarketing')->__('Title'),
|
53 |
+
'title' => Mage::helper('remarketing')->__('Title'),
|
54 |
+
'required' => true,
|
55 |
+
));
|
56 |
+
|
57 |
+
$fieldset->addField('label', 'text', array(
|
58 |
+
'name' => 'label',
|
59 |
+
'label' => Mage::helper('remarketing')->__('Conversion label'),
|
60 |
+
'title' => Mage::helper('remarketing')->__('Conversion label'),
|
61 |
+
'required' => true,
|
62 |
+
));
|
63 |
+
|
64 |
+
$fieldset->addField('cms_page', 'select', array(
|
65 |
+
'label' => Mage::helper('remarketing')->__('Linked CMS page'),
|
66 |
+
'title' => Mage::helper('remarketing')->__('Linked CMS page'),
|
67 |
+
'name' => 'cms_page',
|
68 |
+
'required' => false,
|
69 |
+
'options' => Mage::helper('remarketing')->getCmsPages(),
|
70 |
+
));
|
71 |
+
|
72 |
+
$fieldset->addField('search_query', 'text', array(
|
73 |
+
'name' => 'search_query',
|
74 |
+
'label' => Mage::helper('remarketing')->__('Associated search query'),
|
75 |
+
'title' => Mage::helper('remarketing')->__('Associated search query'),
|
76 |
+
'required' => false,
|
77 |
+
));
|
78 |
+
|
79 |
+
$fieldset->addField('is_active', 'select', array(
|
80 |
+
'label' => Mage::helper('remarketing')->__('Status'),
|
81 |
+
'title' => Mage::helper('remarketing')->__('Status'),
|
82 |
+
'name' => 'is_active',
|
83 |
+
'required' => true,
|
84 |
+
'options' => array(
|
85 |
+
0 => Mage::helper('remarketing')->__('Disabled'),
|
86 |
+
1 => Mage::helper('remarketing')->__('Enabled'),
|
87 |
+
),
|
88 |
+
));
|
89 |
+
|
90 |
+
|
91 |
+
if (!$model->getId() && !Mage::getSingleton('adminhtml/session')->getRemarketingData() ) {
|
92 |
+
$model->setIsActive(1);
|
93 |
+
}
|
94 |
+
|
95 |
+
if ( Mage::getSingleton('adminhtml/session')->getRemarketingData() ) {
|
96 |
+
$form->addValues(Mage::getSingleton('adminhtml/session')->getRemarketingData());
|
97 |
+
Mage::getSingleton('adminhtml/session')->setRemarketingData(null);
|
98 |
+
} else {
|
99 |
+
$form->addValues($model->getData());
|
100 |
+
}
|
101 |
+
|
102 |
+
$form->setUseContainer(true);
|
103 |
+
$this->setForm($form);
|
104 |
+
return parent::_prepareForm();
|
105 |
+
}
|
106 |
+
}
|
app/code/community/Xprime/Remarketing/Block/Adminhtml/Items/Grid.php
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* X-PRIME Google Remarketing Module
|
4 |
+
* @author X-PRIME developers Team <magento@x-prime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<?php
|
9 |
+
|
10 |
+
class Xprime_Remarketing_Block_Adminhtml_Items_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
11 |
+
{
|
12 |
+
public function __construct()
|
13 |
+
{
|
14 |
+
parent::__construct();
|
15 |
+
$this->setId('remarketingGrid');
|
16 |
+
$this->setDefaultSort('id');
|
17 |
+
$this->setDefaultDir('ASC');
|
18 |
+
$this->setSaveParametersInSession(true);
|
19 |
+
}
|
20 |
+
|
21 |
+
protected function _prepareCollection()
|
22 |
+
{
|
23 |
+
$collection = Mage::getModel('remarketing/remarketing')->getCollection();
|
24 |
+
$this->setCollection($collection);
|
25 |
+
return parent::_prepareCollection();
|
26 |
+
}
|
27 |
+
|
28 |
+
protected function _prepareColumns()
|
29 |
+
{
|
30 |
+
$this->addColumn('id', array(
|
31 |
+
'header' => Mage::helper('remarketing')->__('ID'),
|
32 |
+
'align' =>'right',
|
33 |
+
'width' => '50px',
|
34 |
+
'index' => 'id',
|
35 |
+
));
|
36 |
+
|
37 |
+
$this->addColumn('title', array(
|
38 |
+
'header' => Mage::helper('remarketing')->__('Title'),
|
39 |
+
'align' =>'left',
|
40 |
+
'index' => 'title',
|
41 |
+
'width' => '150px',
|
42 |
+
));
|
43 |
+
|
44 |
+
$this->addColumn('label', array(
|
45 |
+
'header' => Mage::helper('remarketing')->__('Label'),
|
46 |
+
'align' =>'left',
|
47 |
+
'width' => '150px',
|
48 |
+
'index' => 'label',
|
49 |
+
));
|
50 |
+
|
51 |
+
|
52 |
+
$this->addColumn('is_active', array(
|
53 |
+
'header' => Mage::helper('remarketing')->__('Status'),
|
54 |
+
'align' => 'left',
|
55 |
+
'width' => '80px',
|
56 |
+
'index' => 'is_active',
|
57 |
+
'type' => 'options',
|
58 |
+
'options' => array(
|
59 |
+
1 => Mage::helper('remarketing')->__('Enabled'),
|
60 |
+
0 => Mage::helper('remarketing')->__('Disabled'),
|
61 |
+
),
|
62 |
+
));
|
63 |
+
|
64 |
+
$this->addColumn('update_time', array(
|
65 |
+
'header' => Mage::helper('remarketing')->__('Updated at'),
|
66 |
+
'align' =>'left',
|
67 |
+
'width' => '160px',
|
68 |
+
'index' => 'update_time',
|
69 |
+
));
|
70 |
+
|
71 |
+
$this->addColumn('action',
|
72 |
+
array(
|
73 |
+
'header' => Mage::helper('remarketing')->__('Action'),
|
74 |
+
'width' => '100',
|
75 |
+
'type' => 'action',
|
76 |
+
'getter' => 'getId',
|
77 |
+
'actions' => array(
|
78 |
+
array(
|
79 |
+
'caption' => Mage::helper('adminhtml')->__('Edit'),
|
80 |
+
'url' => array('base'=> '*/*/edit'),
|
81 |
+
'field' => 'id'
|
82 |
+
)
|
83 |
+
),
|
84 |
+
'filter' => false,
|
85 |
+
'sortable' => false,
|
86 |
+
'is_system' => true,
|
87 |
+
));
|
88 |
+
|
89 |
+
return parent::_prepareColumns();
|
90 |
+
}
|
91 |
+
|
92 |
+
|
93 |
+
public function getRowUrl($row)
|
94 |
+
{
|
95 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
96 |
+
}
|
97 |
+
|
98 |
+
}
|
app/code/community/Xprime/Remarketing/Block/Js.php
ADDED
@@ -0,0 +1,184 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* X-PRIME Google Remarketing Module
|
4 |
+
* @author X-PRIME developers Team <magento@x-prime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<?php
|
9 |
+
/**
|
10 |
+
* Block displaying the google remarketing code
|
11 |
+
*/
|
12 |
+
class Xprime_Remarketing_Block_Js extends Mage_Core_Block_Template
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* label of the remarketing campain
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
+
protected $_conversionLabel;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* title of the remarketing campain
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
protected $_conversionTitle;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* set the label
|
28 |
+
*
|
29 |
+
* @param string $label
|
30 |
+
* @return Xprime_Remarketing_Block_Js
|
31 |
+
*/
|
32 |
+
public function setConversionLabel($label)
|
33 |
+
{
|
34 |
+
$this->_conversionLabel = $label;
|
35 |
+
return $this;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* set the title
|
40 |
+
*
|
41 |
+
* @param string $title
|
42 |
+
* @return Xprime_Remarketing_Block_Js
|
43 |
+
*/
|
44 |
+
public function setConversionTitle($title)
|
45 |
+
{
|
46 |
+
$this->_conversionTitle = $title;
|
47 |
+
return $this;
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* get the conversion label
|
52 |
+
* @return string
|
53 |
+
*/
|
54 |
+
public function getConversionLabel()
|
55 |
+
{
|
56 |
+
if (is_null($this->_conversionLabel)){
|
57 |
+
|
58 |
+
//on a product page?
|
59 |
+
$product = Mage::registry('product');
|
60 |
+
if ($product && $product->getId()){
|
61 |
+
if ($product->getData('product_remarketing_label')){
|
62 |
+
$this->_conversionLabel = $product->getData('product_remarketing_label');
|
63 |
+
$this->_conversionTitle = $product->getData('product_remarketing_title');
|
64 |
+
return $this->_conversionLabel;
|
65 |
+
}else{
|
66 |
+
return false; //on es sur une fiche produit mais sans label de remarketing
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
//on a category page?
|
71 |
+
$categorie = Mage::registry('current_category');
|
72 |
+
if ($categorie && $categorie->getId()){
|
73 |
+
if ($categorie->getData('category_remarketing_label')){
|
74 |
+
$this->_conversionLabel = $categorie->getData('category_remarketing_label');
|
75 |
+
$this->_conversionTitle = $categorie->getData('category_remarketing_title');
|
76 |
+
return $this->_conversionLabel;
|
77 |
+
}else{
|
78 |
+
return false; //on es sur une page catégorie mais sans label de remarketing
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
//get the http request
|
83 |
+
$request = Mage::app()->getRequest();
|
84 |
+
|
85 |
+
//on a search result page?
|
86 |
+
if ($request->getModuleName() == "catalogsearch" && ($request->getActionName() == "result" || $request->getControllerName() == "result")){
|
87 |
+
$query = Mage::helper('catalogsearch')->getQuery();
|
88 |
+
/* @var $query Mage_CatalogSearch_Model_Query */
|
89 |
+
$query->setStoreId(Mage::app()->getStore()->getId());
|
90 |
+
|
91 |
+
if ($query->getData('query_text')){
|
92 |
+
//on recherche un label associé au terme de recherche ou à son synonyme
|
93 |
+
$searchQuery = array($query->getData('query_text'));
|
94 |
+
if ($query->getData('synonym_for')) $searchQuery[] = $query->getData('synonym_for');
|
95 |
+
$item = Mage::getModel('remarketing/remarketing')->getCollection()
|
96 |
+
->addFieldToFilter('search_query', array('in' => $searchQuery))
|
97 |
+
->addFieldToFilter('is_active', 1)
|
98 |
+
->getLastItem();
|
99 |
+
if ($item->getId()){
|
100 |
+
$this->_conversionLabel = $item->getLabel();
|
101 |
+
$this->_conversionTitle = $item->getTitle();
|
102 |
+
return $this->_conversionLabel;
|
103 |
+
}else{
|
104 |
+
return false;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
//on a CMS page?
|
111 |
+
//récupération du chemin appellé (apres le FQDN), si vide on part du principe qu'on est sur la HP
|
112 |
+
$identifier = (trim($request->getPathInfo(), '/')) ? trim($request->getPathInfo(), '/') : Mage::getStoreConfig('web/default/cms_home_page', Mage::app()->getStore()->getId());
|
113 |
+
|
114 |
+
$page = Mage::getModel('cms/page');
|
115 |
+
$pageId = $page->checkIdentifier($identifier, Mage::app()->getStore()->getId());
|
116 |
+
|
117 |
+
if ($pageId) {
|
118 |
+
$item = Mage::getModel('remarketing/remarketing')->getCollection()
|
119 |
+
->addFieldToFilter('cms_page', $identifier)
|
120 |
+
->addFieldToFilter('is_active', 1)
|
121 |
+
->getLastItem();
|
122 |
+
if ($item->getId()){
|
123 |
+
$this->_conversionLabel = $item->getLabel();
|
124 |
+
$this->_conversionTitle = $item->getTitle();
|
125 |
+
return $this->_conversionLabel;
|
126 |
+
}else{
|
127 |
+
return false;
|
128 |
+
}
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
return $this->_conversionLabel;
|
133 |
+
}
|
134 |
+
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Rendu du script js de remarketing
|
138 |
+
*
|
139 |
+
* @return string
|
140 |
+
*/
|
141 |
+
protected function _toHtml()
|
142 |
+
{
|
143 |
+
//label de conversion
|
144 |
+
$label = $this->getConversionLabel();
|
145 |
+
|
146 |
+
//si remarketing inactif ou abscence de label
|
147 |
+
if (!Mage::helper('remarketing')->isGoogleRemarketingAvailable() || !$label) {
|
148 |
+
return '';
|
149 |
+
}
|
150 |
+
|
151 |
+
//configuration globale
|
152 |
+
$accountId = Mage::getStoreConfig(Xprime_Remarketing_Helper_Data::XML_PATH_ACCOUNT);
|
153 |
+
$lang = Mage::getStoreConfig(Xprime_Remarketing_Helper_Data::XML_PATH_LANGUAGE);
|
154 |
+
$format = Mage::getStoreConfig(Xprime_Remarketing_Helper_Data::XML_PATH_FORMAT);
|
155 |
+
$color = Mage::getStoreConfig(Xprime_Remarketing_Helper_Data::XML_PATH_COLOR);
|
156 |
+
$value = Mage::getStoreConfig(Xprime_Remarketing_Helper_Data::XML_PATH_VALUE);
|
157 |
+
|
158 |
+
//protocole http ou https?
|
159 |
+
$protocol = Mage::app()->getRequest()->isSecure() ? 'https' : 'http';
|
160 |
+
|
161 |
+
return '
|
162 |
+
<!-- BEGIN OF GOOGLE REMARKETING CODE FOR '.$this->_conversionTitle.'-->
|
163 |
+
<script type="text/javascript">
|
164 |
+
/* <![CDATA[ */
|
165 |
+
var google_conversion_id = '.$accountId.';
|
166 |
+
var google_conversion_language = "'.$lang.'";
|
167 |
+
var google_conversion_format = "'.$format.'";
|
168 |
+
var google_conversion_color = "'.$color.'";
|
169 |
+
var google_conversion_label = "'.$label.'";
|
170 |
+
var google_conversion_value = '.$value.';
|
171 |
+
/* ]]> */
|
172 |
+
</script>
|
173 |
+
<script type="text/javascript" src="'.$protocol.'://www.googleadservices.com/pagead/conversion.js">
|
174 |
+
</script>
|
175 |
+
<noscript>
|
176 |
+
<div style="display:inline;">
|
177 |
+
<img height="1" width="1" style="border-style:none;" alt="" src="'.$protocol.'://www.googleadservices.com/pagead/conversion/1011161225/?label=2T_nCN_bmwIQibGU4gM&guid=ON&script=0"/>
|
178 |
+
</div>
|
179 |
+
</noscript>
|
180 |
+
<!-- END OF GOOGLE REMARKETING CODE FOR [LIST_LABEL]-->
|
181 |
+
';
|
182 |
+
}
|
183 |
+
}
|
184 |
+
?>
|
app/code/community/Xprime/Remarketing/Helper/Data.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* X-PRIME Google Remarketing Module
|
4 |
+
* @author X-PRIME developers Team <magento@x-prime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<?php
|
9 |
+
/**
|
10 |
+
* Helper du module Remarketing
|
11 |
+
*/
|
12 |
+
class Xprime_Remarketing_Helper_Data extends Mage_Core_Helper_Abstract
|
13 |
+
{
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Config paths
|
17 |
+
*/
|
18 |
+
const XML_PATH_ACTIVE = 'google/remarketing/active';
|
19 |
+
const XML_PATH_ACCOUNT = 'google/remarketing/account';
|
20 |
+
const XML_PATH_LANGUAGE = 'google/remarketing/language';
|
21 |
+
const XML_PATH_FORMAT = 'google/remarketing/format';
|
22 |
+
const XML_PATH_COLOR = 'google/remarketing/color';
|
23 |
+
const XML_PATH_VALUE = 'google/remarketing/value';
|
24 |
+
|
25 |
+
|
26 |
+
/**
|
27 |
+
* is the module available?
|
28 |
+
*
|
29 |
+
* @param mixed $store
|
30 |
+
* @return bool
|
31 |
+
*/
|
32 |
+
public function isGoogleRemarketingAvailable($store = null)
|
33 |
+
{
|
34 |
+
$accountId = Mage::getStoreConfig(self::XML_PATH_ACCOUNT, $store);
|
35 |
+
return $accountId && Mage::getStoreConfigFlag(self::XML_PATH_ACTIVE, $store);
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* get The Cms pages
|
40 |
+
* @return array
|
41 |
+
*/
|
42 |
+
public function getCmsPages()
|
43 |
+
{
|
44 |
+
$collection = Mage::getModel('cms/page')->getCollection();
|
45 |
+
$pages = $collection->toOptionArray();
|
46 |
+
$result = array('' => Mage::helper('adminhtml')->__('None'));
|
47 |
+
if (count($pages)){
|
48 |
+
foreach ($pages as $page){
|
49 |
+
$result[$page['value']] = '['.$page['value'].'] '.$page['label'];
|
50 |
+
}
|
51 |
+
}
|
52 |
+
return $result;
|
53 |
+
}
|
54 |
+
}
|
app/code/community/Xprime/Remarketing/Model/Mysql4/Remarketing.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* X-PRIME Google Remarketing Module
|
4 |
+
* @author X-PRIME developers Team <magento@x-prime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<?php
|
9 |
+
/**
|
10 |
+
* Remarketing Mysql4 resource model
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
|
14 |
+
class Xprime_Remarketing_Model_Mysql4_Remarketing extends Mage_Core_Model_Mysql4_Abstract
|
15 |
+
{
|
16 |
+
protected function _construct()
|
17 |
+
{
|
18 |
+
$this->_init('remarketing/remarketing', 'id');
|
19 |
+
}
|
20 |
+
}
|
app/code/community/Xprime/Remarketing/Model/Mysql4/Remarketing/Collection.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* X-PRIME Google Remarketing Module
|
4 |
+
* @author X-PRIME developers Team <magento@x-prime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<?php
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Remarketing Mysql4 collection model resource
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
class Xprime_Remarketing_Model_Mysql4_Remarketing_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
15 |
+
{
|
16 |
+
public function _construct()
|
17 |
+
{
|
18 |
+
$this->_init('remarketing/remarketing');
|
19 |
+
}
|
20 |
+
}
|
app/code/community/Xprime/Remarketing/Model/Remarketing.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* X-PRIME Google Remarketing Module
|
4 |
+
* @author X-PRIME developers Team <magento@x-prime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<?php
|
9 |
+
class Xprime_Remarketing_Model_Remarketing extends Mage_Core_Model_Abstract
|
10 |
+
{
|
11 |
+
protected function _construct()
|
12 |
+
{
|
13 |
+
$this->_init('remarketing/remarketing');
|
14 |
+
}
|
15 |
+
}
|
app/code/community/Xprime/Remarketing/controllers/Adminhtml/RemarketingController.php
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* X-PRIME Google Remarketing Module
|
4 |
+
* @author X-PRIME developers Team <magento@x-prime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<?php
|
9 |
+
|
10 |
+
class Xprime_Remarketing_Adminhtml_RemarketingController extends Mage_Adminhtml_Controller_Action
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* init
|
14 |
+
*
|
15 |
+
* @return Xprime_Remarketing_Adminhtml_ListController
|
16 |
+
*/
|
17 |
+
protected function _initAction()
|
18 |
+
{
|
19 |
+
$this->loadLayout()
|
20 |
+
->_setActiveMenu('catalog/remarketing')
|
21 |
+
->_addBreadcrumb( Mage::helper('remarketing')->__('Remarketing management'),
|
22 |
+
Mage::helper('remarketing')->__('Remarketing management')
|
23 |
+
);
|
24 |
+
return $this;
|
25 |
+
}
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Main index action (Grid)
|
30 |
+
*/
|
31 |
+
public function indexAction()
|
32 |
+
{
|
33 |
+
$this->_initAction()
|
34 |
+
->_addContent($this->getLayout()->createBlock('remarketing/adminhtml_items'))
|
35 |
+
->renderLayout();
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* edit action
|
40 |
+
**/
|
41 |
+
public function editAction()
|
42 |
+
{
|
43 |
+
// Récupération du label en cours d'édition
|
44 |
+
Mage::register ( 'current_label', Mage::getModel ( 'remarketing/remarketing' ) );
|
45 |
+
if ($id = ( int ) $this->getRequest ()->getParam ( 'id' )) {
|
46 |
+
Mage::registry ( 'current_label' )->load ( $id );
|
47 |
+
}
|
48 |
+
$model = Mage::registry ( 'current_label' );
|
49 |
+
if ($model->getId() || $id == 0) {
|
50 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
51 |
+
if (!empty($data)) {
|
52 |
+
$model->setData($data);
|
53 |
+
}
|
54 |
+
Mage::register('remarketing_data', $model);
|
55 |
+
$this->loadLayout();
|
56 |
+
$this->_setActiveMenu('catalog/remarketing');
|
57 |
+
|
58 |
+
$this->_addBreadcrumb(Mage::helper('remarketing')->__('Remarketing management'), Mage::helper('remarketing')->__('Remarketing management'));
|
59 |
+
$this->_addBreadcrumb(Mage::helper('remarketing')->__('Edit a label'), Mage::helper('remarketing')->__('Edit a label'));
|
60 |
+
|
61 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
62 |
+
|
63 |
+
$this->_addContent($this->getLayout()->createBlock('remarketing/adminhtml_items_edit'));
|
64 |
+
|
65 |
+
$this->renderLayout();
|
66 |
+
} else {
|
67 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('remarketing')->__('The label does not exist'));
|
68 |
+
$this->_redirect('*/*/');
|
69 |
+
}
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* new label
|
74 |
+
**/
|
75 |
+
public function newAction()
|
76 |
+
{
|
77 |
+
$this->_forward('edit');
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* save label
|
82 |
+
**/
|
83 |
+
|
84 |
+
public function saveAction()
|
85 |
+
{
|
86 |
+
$data = $this->getRequest()->getPost();
|
87 |
+
if ($data) {
|
88 |
+
$model = Mage::getModel('remarketing/remarketing');
|
89 |
+
// Mise à jour des données dans le modèle
|
90 |
+
$model->setData($data)
|
91 |
+
->setId($this->getRequest()->getParam('id'));
|
92 |
+
try {
|
93 |
+
// Mise à jour des dates
|
94 |
+
if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
|
95 |
+
$model->setCreatedTime(now())
|
96 |
+
->setUpdateTime(now());
|
97 |
+
} else {
|
98 |
+
$model->setUpdateTime(now());
|
99 |
+
}
|
100 |
+
|
101 |
+
// On sauvegarde
|
102 |
+
$model->save();
|
103 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('remarketing')->__('The label was succesfully saved.'));
|
104 |
+
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
105 |
+
|
106 |
+
if ($this->getRequest()->getParam('back')) {
|
107 |
+
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
108 |
+
return;
|
109 |
+
}
|
110 |
+
|
111 |
+
$this->_redirect('*/*/');
|
112 |
+
return;
|
113 |
+
}catch (Exception $e) {
|
114 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
115 |
+
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
116 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
117 |
+
return;
|
118 |
+
}
|
119 |
+
}
|
120 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('remarketing')->__('The label does not exist'));
|
121 |
+
$this->_redirect('*/*/');
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* delete label
|
126 |
+
*/
|
127 |
+
public function deleteAction() {
|
128 |
+
if( $this->getRequest()->getParam('id') > 0 ) {
|
129 |
+
try {
|
130 |
+
$model = Mage::getModel('remarketing/remarketing');
|
131 |
+
$model->setId($this->getRequest()->getParam('id'))
|
132 |
+
->delete();
|
133 |
+
|
134 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('remarketing')->__('The label was succesfully deleted.'));
|
135 |
+
$this->_redirect('*/*/');
|
136 |
+
} catch (Exception $e) {
|
137 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
138 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
139 |
+
}
|
140 |
+
}
|
141 |
+
$this->_redirect('*/*/');
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* acl
|
146 |
+
* @return bool
|
147 |
+
*/
|
148 |
+
protected function _isAllowed()
|
149 |
+
{
|
150 |
+
return Mage::getSingleton('admin/session')->isAllowed('catalog/remarketing');
|
151 |
+
}
|
152 |
+
}
|
app/code/community/Xprime/Remarketing/etc/adminhtml.xml
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<catalog translate="title" module="remarketing">
|
5 |
+
<children>
|
6 |
+
<remarketing translate="title" module="remarketing">
|
7 |
+
<title>Remarketing</title>
|
8 |
+
<sort_order>5</sort_order>
|
9 |
+
<action>adminhtml/remarketing/index</action>
|
10 |
+
</remarketing>
|
11 |
+
</children>
|
12 |
+
</catalog>
|
13 |
+
</menu>
|
14 |
+
<acl>
|
15 |
+
<resources>
|
16 |
+
<admin>
|
17 |
+
<children>
|
18 |
+
<system>
|
19 |
+
<children>
|
20 |
+
<config>
|
21 |
+
<children>
|
22 |
+
<google translate="title" module="remarketing">
|
23 |
+
<title>Google API</title>
|
24 |
+
</google>
|
25 |
+
</children>
|
26 |
+
</config>
|
27 |
+
</children>
|
28 |
+
</system>
|
29 |
+
<catalog>
|
30 |
+
<children>
|
31 |
+
<remarketing translate="title" module="remarketing">
|
32 |
+
<title>Remarketing</title>
|
33 |
+
</remarketing>
|
34 |
+
</children>
|
35 |
+
</catalog>
|
36 |
+
</children>
|
37 |
+
</admin>
|
38 |
+
</resources>
|
39 |
+
</acl>
|
40 |
+
</config>
|
app/code/community/Xprime/Remarketing/etc/config.xml
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Xprime_Remarketing>
|
5 |
+
<version>0.1.2</version>
|
6 |
+
</Xprime_Remarketing>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<models>
|
10 |
+
<remarketing>
|
11 |
+
<class>Xprime_Remarketing_Model</class>
|
12 |
+
<resourceModel>remarketing_mysql4</resourceModel>
|
13 |
+
</remarketing>
|
14 |
+
<remarketing_mysql4>
|
15 |
+
<class>Xprime_Remarketing_Model_Mysql4</class>
|
16 |
+
<entities>
|
17 |
+
<remarketing>
|
18 |
+
<table>remarketing</table>
|
19 |
+
</remarketing>
|
20 |
+
</entities>
|
21 |
+
</remarketing_mysql4>
|
22 |
+
</models>
|
23 |
+
<resources>
|
24 |
+
<remarketing_setup>
|
25 |
+
<setup>
|
26 |
+
<module>Xprime_Remarketing</module>
|
27 |
+
<class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
|
28 |
+
</setup>
|
29 |
+
</remarketing_setup>
|
30 |
+
</resources>
|
31 |
+
<blocks>
|
32 |
+
<remarketing>
|
33 |
+
<class>Xprime_Remarketing_Block</class>
|
34 |
+
</remarketing>
|
35 |
+
</blocks>
|
36 |
+
<helpers>
|
37 |
+
<remarketing>
|
38 |
+
<class>Xprime_Remarketing_Helper</class>
|
39 |
+
</remarketing>
|
40 |
+
</helpers>
|
41 |
+
</global>
|
42 |
+
<frontend>
|
43 |
+
<layout>
|
44 |
+
<updates>
|
45 |
+
<remarketing>
|
46 |
+
<file>remarketing.xml</file>
|
47 |
+
</remarketing>
|
48 |
+
</updates>
|
49 |
+
</layout>
|
50 |
+
</frontend>
|
51 |
+
<adminhtml>
|
52 |
+
<translate>
|
53 |
+
<modules>
|
54 |
+
<Xprime_Remarketing>
|
55 |
+
<files>
|
56 |
+
<default>Xprime_Remarketing.csv</default>
|
57 |
+
</files>
|
58 |
+
</Xprime_Remarketing>
|
59 |
+
</modules>
|
60 |
+
</translate>
|
61 |
+
</adminhtml>
|
62 |
+
<default>
|
63 |
+
<google>
|
64 |
+
<remarketing>
|
65 |
+
<language>fr</language>
|
66 |
+
<format>3</format>
|
67 |
+
<color>666666</color>
|
68 |
+
<value>0</value>
|
69 |
+
</remarketing>
|
70 |
+
</google>
|
71 |
+
</default>
|
72 |
+
<admin>
|
73 |
+
<routers>
|
74 |
+
<adminhtml>
|
75 |
+
<args>
|
76 |
+
<modules>
|
77 |
+
<remarketing before="Mage_Adminhtml">Xprime_Remarketing_Adminhtml</remarketing>
|
78 |
+
</modules>
|
79 |
+
</args>
|
80 |
+
</adminhtml>
|
81 |
+
</routers>
|
82 |
+
</admin>
|
83 |
+
</config>
|
app/code/community/Xprime/Remarketing/etc/system.xml
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<google translate="label" module="remarketing">
|
5 |
+
<groups>
|
6 |
+
<remarketing translate="label">
|
7 |
+
<label>Google Remarketing</label>
|
8 |
+
<frontend_type>text</frontend_type>
|
9 |
+
<sort_order>10</sort_order>
|
10 |
+
<show_in_default>1</show_in_default>
|
11 |
+
<show_in_website>1</show_in_website>
|
12 |
+
<show_in_store>1</show_in_store>
|
13 |
+
<fields>
|
14 |
+
<active translate="label">
|
15 |
+
<label>Enable</label>
|
16 |
+
<frontend_type>select</frontend_type>
|
17 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
18 |
+
<sort_order>10</sort_order>
|
19 |
+
<show_in_default>1</show_in_default>
|
20 |
+
<show_in_website>1</show_in_website>
|
21 |
+
<show_in_store>1</show_in_store>
|
22 |
+
</active>
|
23 |
+
<account translate="label">
|
24 |
+
<label>Account Number</label>
|
25 |
+
<frontend_type>text</frontend_type>
|
26 |
+
<comment><![CDATA[google_conversion_id]]></comment>
|
27 |
+
<sort_order>20</sort_order>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
<show_in_website>1</show_in_website>
|
30 |
+
<show_in_store>1</show_in_store>
|
31 |
+
</account>
|
32 |
+
<language translate="label">
|
33 |
+
<label>Language</label>
|
34 |
+
<frontend_type>text</frontend_type>
|
35 |
+
<comment><![CDATA[google_conversion_language]]></comment>
|
36 |
+
<sort_order>30</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 |
+
</language>
|
41 |
+
<format translate="label">
|
42 |
+
<label>Format</label>
|
43 |
+
<frontend_type>text</frontend_type>
|
44 |
+
<comment><![CDATA[google_conversion_format]]></comment>
|
45 |
+
<sort_order>40</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>1</show_in_store>
|
49 |
+
</format>
|
50 |
+
<color translate="label">
|
51 |
+
<label>Color</label>
|
52 |
+
<frontend_type>text</frontend_type>
|
53 |
+
<comment><![CDATA[google_conversion_color]]></comment>
|
54 |
+
<sort_order>50</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
</color>
|
59 |
+
<value translate="label">
|
60 |
+
<label>Value</label>
|
61 |
+
<frontend_type>text</frontend_type>
|
62 |
+
<comment><![CDATA[google_conversion_value]]></comment>
|
63 |
+
<sort_order>55</sort_order>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>1</show_in_store>
|
67 |
+
</value>
|
68 |
+
</fields>
|
69 |
+
</remarketing>
|
70 |
+
</groups>
|
71 |
+
</google>
|
72 |
+
</sections>
|
73 |
+
</config>
|
app/code/community/Xprime/Remarketing/sql/remarketing_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* X-PRIME Google Remarketing Module
|
4 |
+
* @author X-PRIME developers Team <magento@x-prime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<?php
|
9 |
+
|
10 |
+
$this->startSetup();
|
11 |
+
|
12 |
+
//remarketing label attributes for products
|
13 |
+
$this->addAttribute('catalog_product', 'product_remarketing_label', array(
|
14 |
+
'group' => 'Meta Information',
|
15 |
+
'type' => 'varchar',
|
16 |
+
'input' => 'text',
|
17 |
+
'label' => 'Remarketing label',
|
18 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
19 |
+
'visible' => 1,
|
20 |
+
'required' => 0,
|
21 |
+
'visible_on_front' => 0,
|
22 |
+
'is_html_allowed_on_front' => 0,
|
23 |
+
'is_configurable' => 0,
|
24 |
+
'source' => '',
|
25 |
+
'searchable' => 0,
|
26 |
+
'filterable' => 0,
|
27 |
+
'comparable' => 0,
|
28 |
+
'unique' => false,
|
29 |
+
'user_defined' => false,
|
30 |
+
'is_user_defined' => false,
|
31 |
+
'used_in_product_listing' => true
|
32 |
+
));
|
33 |
+
|
34 |
+
//remarketing label attributes for categories
|
35 |
+
$this->addAttribute('catalog_category', 'category_remarketing_label', array(
|
36 |
+
'group' => 'General Information',
|
37 |
+
'type' => 'varchar',
|
38 |
+
'input' => 'text',
|
39 |
+
'label' => 'Remarketing label',
|
40 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
41 |
+
'visible' => 1,
|
42 |
+
'required' => 0,
|
43 |
+
'visible_on_front' => 0,
|
44 |
+
'is_html_allowed_on_front' => 0,
|
45 |
+
'is_configurable' => 0,
|
46 |
+
'source' => '',
|
47 |
+
'searchable' => 0,
|
48 |
+
'filterable' => 0,
|
49 |
+
'comparable' => 0,
|
50 |
+
'unique' => false,
|
51 |
+
'user_defined' => false,
|
52 |
+
'is_user_defined' => false
|
53 |
+
));
|
54 |
+
|
55 |
+
//creation de la table remarketing
|
56 |
+
$this->run("
|
57 |
+
DROP TABLE IF EXISTS `{$this->getTable('remarketing')}`;
|
58 |
+
CREATE TABLE `{$this->getTable('remarketing')}` (
|
59 |
+
`id` INT(11) NOT NULL auto_increment,
|
60 |
+
`title` varchar(255) NOT NULL default '',
|
61 |
+
`label` varchar(255) NOT NULL default '',
|
62 |
+
`cms_page` varchar(255) NOT NULL default '',
|
63 |
+
`search_query` varchar(255) NOT NULL default '',
|
64 |
+
`is_active` tinyint(1) NOT NULL default '0',
|
65 |
+
`store_id` smallint(5) UNSIGNED NOT NULL,
|
66 |
+
`creation_time` datetime default NULL,
|
67 |
+
`update_time` datetime default NULL,
|
68 |
+
PRIMARY KEY (`id`)
|
69 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
70 |
+
");
|
71 |
+
|
72 |
+
$this->run("
|
73 |
+
ALTER TABLE `{$this->getTable('remarketing')}` ADD KEY ( `store_id` );
|
74 |
+
ALTER TABLE `{$this->getTable('remarketing')}`
|
75 |
+
ADD CONSTRAINT `FK_REMARKETING_ITEM_STORE` FOREIGN KEY (`store_id`)
|
76 |
+
REFERENCES `{$this->getTable('core_store')}` (`store_id`)
|
77 |
+
ON UPDATE CASCADE
|
78 |
+
ON DELETE CASCADE;
|
79 |
+
");
|
80 |
+
|
81 |
+
$this->endSetup();
|
app/code/community/Xprime/Remarketing/sql/remarketing_setup/mysql4-upgrade-0.1.0-0.1.1.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* X-PRIME Google Remarketing Module
|
4 |
+
* @author X-PRIME developers Team <magento@x-prime.com>
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
?>
|
8 |
+
<?php
|
9 |
+
$this->startSetup();
|
10 |
+
|
11 |
+
//remarketing title attributes for products
|
12 |
+
$this->addAttribute('catalog_product', 'product_remarketing_title', array(
|
13 |
+
'group' => 'Meta Information',
|
14 |
+
'type' => 'varchar',
|
15 |
+
'input' => 'text',
|
16 |
+
'label' => 'Title of the remarketing label',
|
17 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
18 |
+
'visible' => 1,
|
19 |
+
'required' => 0,
|
20 |
+
'visible_on_front' => 0,
|
21 |
+
'is_html_allowed_on_front' => 0,
|
22 |
+
'is_configurable' => 0,
|
23 |
+
'source' => '',
|
24 |
+
'searchable' => 0,
|
25 |
+
'filterable' => 0,
|
26 |
+
'comparable' => 0,
|
27 |
+
'unique' => false,
|
28 |
+
'user_defined' => false,
|
29 |
+
'is_user_defined' => false,
|
30 |
+
'used_in_product_listing' => true
|
31 |
+
));
|
32 |
+
|
33 |
+
//remarketing title attributes for categories
|
34 |
+
$this->addAttribute('catalog_category', 'category_remarketing_title', array(
|
35 |
+
'group' => 'General Information',
|
36 |
+
'type' => 'varchar',
|
37 |
+
'input' => 'text',
|
38 |
+
'label' => 'Title of the remarketing label',
|
39 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
40 |
+
'visible' => 1,
|
41 |
+
'required' => 0,
|
42 |
+
'visible_on_front' => 0,
|
43 |
+
'is_html_allowed_on_front' => 0,
|
44 |
+
'is_configurable' => 0,
|
45 |
+
'source' => '',
|
46 |
+
'searchable' => 0,
|
47 |
+
'filterable' => 0,
|
48 |
+
'comparable' => 0,
|
49 |
+
'unique' => false,
|
50 |
+
'user_defined' => false,
|
51 |
+
'is_user_defined' => false
|
52 |
+
));
|
53 |
+
|
54 |
+
$this->endSetup();
|
app/design/frontend/default/default/layout/remarketing.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<!-- Ajout du javascript pour le remarketing-->
|
4 |
+
<default>
|
5 |
+
<reference name="before_body_end">
|
6 |
+
<block type="remarketing/js" name="google_remarketing" as="google_remarketing" />
|
7 |
+
</reference>
|
8 |
+
</default>
|
9 |
+
</layout>
|
10 |
+
|
app/etc/modules/Xprime_Remarketing.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Xprime_Remarketing>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Xprime_Remarketing>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/locale/en_US/Xprime_Remarketing.csv
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"General Information","General Information"
|
2 |
+
"Title","Title"
|
3 |
+
"Conversion label","Conversion label"
|
4 |
+
"Linked CMS page","Linked CMS page"
|
5 |
+
"Associated search query","Associated search query"
|
6 |
+
"Status","Status"
|
7 |
+
"Disabled","Disabled"
|
8 |
+
"Enabled","Enabled"
|
9 |
+
"Edit the label '%s'","Edit the label '%s'"
|
10 |
+
"Add a label","Add a label"
|
11 |
+
"Updated at","Updated at"
|
12 |
+
"Remarketing label list","Remarketing label list"
|
13 |
+
"The label was succesfully deleted.","The label was succesfully deleted."
|
14 |
+
"The label does not exist","The label does not exist"
|
15 |
+
"The label was succesfully saved.","The label was succesfully saved."
|
16 |
+
"Remarketing management","Remarketing management"
|
17 |
+
"Edit a label","Edit a label"
|
18 |
+
"Enable","Enable"
|
19 |
+
"Account Number","Account Number"
|
20 |
+
"Language","Language"
|
21 |
+
"Color","Color"
|
22 |
+
"Value","Value"
|
23 |
+
"Remarketing label","Remarketing label"
|
24 |
+
"Title of the remarketing label","Title of the remarketing label"
|
app/locale/fr_FR/Xprime_Remarketing.csv
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"General Information","Information générale"
|
2 |
+
"Title","Titre"
|
3 |
+
"Conversion label","Label de conversion"
|
4 |
+
"Linked CMS page","Page CMS liée"
|
5 |
+
"Associated search query","Mot clé de recherche"
|
6 |
+
"Status","Statut"
|
7 |
+
"Disabled","Inactif"
|
8 |
+
"Enabled","Actif"
|
9 |
+
"Edit the label '%s'","Editer le label '%s'"
|
10 |
+
"Add a label","Ajouter un label"
|
11 |
+
"Updated at","Mis à jour"
|
12 |
+
"Remarketing label list","Liste des labels de remarketing"
|
13 |
+
"The label was succesfully deleted.","Le label a été supprimé avec succès."
|
14 |
+
"The label does not exist","Le label n'existe pas."
|
15 |
+
"The label was succesfully saved.","Le label a été sauvegardé avec succès."
|
16 |
+
"Remarketing management","Gestion du Remarketing"
|
17 |
+
"Edit a label","Edition d'un label"
|
18 |
+
"Enable","Activer"
|
19 |
+
"Account Number","Numero du compte"
|
20 |
+
"Language","Langue"
|
21 |
+
"Color","Couleur"
|
22 |
+
"Value","Valeur"
|
23 |
+
"Remarketing label","Label de remarketing"
|
24 |
+
"Title of the remarketing label","Titre du label de remarketing"
|
package.xml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>XPRIME_GoogleRemarketing</name>
|
4 |
+
<version>0.1.2</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>add the possibility to have the google remarketing conversion code on your store.</summary>
|
10 |
+
<description>Remarketing allows you to show ads to users who've previously visited your website as they browse the Web. More infos here: http://www.google.com/ads/innovations/remarketing.html
|
11 |
+
|
12 |
+
This extension let you tag your store's pages with the conversion labels. You can tag:
|
13 |
+
- a product page
|
14 |
+
- a category page
|
15 |
+
- a cms page
|
16 |
+
- a search result page on a specific query.
|
17 |
+
|
18 |
+
Developed by the Magento team of X-PRIME GROUP (http://www.xprimegroupe.com)</description>
|
19 |
+
<notes>NC</notes>
|
20 |
+
<authors><author><name>X-PRIME Magento Team</name><user>auto-converted</user><email>magento@xprimegroupe.com</email></author></authors>
|
21 |
+
<date>2011-05-17</date>
|
22 |
+
<time>15:18:41</time>
|
23 |
+
<contents><target name="magelocale"><dir name="en_US"><file name="Xprime_Remarketing.csv" hash="7980b619275aaa2eca565fca716f382b"/></dir><dir name="fr_FR"><file name="Xprime_Remarketing.csv" hash="9c7aeee4404ca28b2b84e99ad09a2bc3"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="remarketing.xml" hash="47afbb94f4a43e17d4c72c5030abd299"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Xprime_Remarketing.xml" hash="e1767e33efe0eaabc57e9692b2e70a6e"/></dir></target><target name="magecommunity"><dir name="Xprime"><dir name="Remarketing"><dir name="Block"><dir name="Adminhtml"><dir name="Items"><dir name="Edit"><file name="Form.php" hash="b27115fa0da8c8aa5953f9fdebe3d5b0"/></dir><file name="Edit.php" hash="c27b71022c4c5c63a38635047155f958"/><file name="Grid.php" hash="43e1642516e7e2627ea72ed47d3e2ef7"/></dir><file name="Items.php" hash="d2312b7c3f07e1afaf5b4e444f9afb2e"/></dir><file name="Js.php" hash="318493c5d90f023c7b2ab2fcb841776f"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="RemarketingController.php" hash="dd2b0395126d17c294d79c2abe11d304"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="1dd9707c7dcef91e49c2bce9dcb17279"/><file name="config.xml" hash="1fc7225c786d38500d9119c4680bd934"/><file name="system.xml" hash="e029c5492975cb08586e5f8fb978957f"/></dir><dir name="Helper"><file name="Data.php" hash="b3b841c2b258ef5157d20d5fb464e449"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Remarketing"><file name="Collection.php" hash="9f535009671aa4541ee2df6533cc6e4f"/></dir><file name="Remarketing.php" hash="ca205341c96f9da4fd97bbc26a8ff52a"/></dir><file name="Remarketing.php" hash="83fe2a136b6458aa009568509dcf65fb"/></dir><dir name="sql"><dir name="remarketing_setup"><file name="mysql4-install-0.1.0.php" hash="5526d020af339d322a60d0f6bf05d06a"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="24e362b5107b7e49e33472b52d56adc8"/></dir></dir></dir></dir></target></contents>
|
24 |
+
<compatible/>
|
25 |
+
<dependencies/>
|
26 |
+
</package>
|