Version Notes
Integration of econda Web Controlling functions.
Download this release
Release Info
Developer | Magento Core Team |
Extension | Mage_Econda |
Version | 1.5.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.7 to 1.5.0
- app/code/local/Mage/Econda/Block/Adminhtml/Econda.php +0 -12
- app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit.php +0 -45
- app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit/Form.php +0 -19
- app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit/Tab/Form.php +0 -58
- app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit/Tabs.php +0 -24
- app/code/local/Mage/Econda/Block/Adminhtml/Econda/Grid.php +0 -116
- app/code/local/Mage/Econda/Block/Adminhtml/Tracker.php +0 -12
- app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit.php +0 -45
- app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit/Form.php +0 -19
- app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit/Tab/Form.php +0 -58
- app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit/Tabs.php +0 -24
- app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Grid.php +0 -116
- app/code/local/Mage/Econda/Block/Econda.php +201 -777
- app/code/local/Mage/Econda/Block/EcondaOp.php +103 -0
- app/code/local/Mage/Econda/Block/Emos.php +759 -0
- app/code/local/Mage/Econda/Block/emos.php +0 -796
- app/code/local/Mage/Econda/Helper/Data.php +78 -4
- app/code/local/Mage/Econda/Language/english.php +0 -46
- app/code/local/Mage/Econda/Language/german.php +0 -46
- app/code/local/Mage/Econda/Model/Base.php +345 -0
- app/code/local/Mage/Econda/Model/Basket.php +484 -0
- app/code/local/Mage/Econda/Model/Econda.php +0 -10
- app/code/local/Mage/Econda/Model/Item.php +65 -0
- app/code/local/Mage/Econda/Model/Mysql4/Econda.php +0 -10
- app/code/local/Mage/Econda/Model/Mysql4/Econda/Collection.php +0 -10
- app/code/local/Mage/Econda/Model/Mysql4/Tracker.php +0 -10
- app/code/local/Mage/Econda/Model/Mysql4/Tracker/Collection.php +0 -10
- app/code/local/Mage/Econda/Model/Status.php +0 -15
- app/code/local/Mage/Econda/Model/System/Config/Source/Billing.php +23 -2
- app/code/local/Mage/Econda/Model/System/Config/Source/Language.php +23 -2
- app/code/local/Mage/Econda/Model/System/Config/Source/Siteid.php +22 -2
- app/code/local/Mage/Econda/Model/System/Config/Source/Tracking.php +0 -12
- app/code/local/Mage/Econda/controllers/Adminhtml/EcondaController.php +0 -214
- app/code/local/Mage/Econda/controllers/Adminhtml/TrackerController.php +0 -214
- app/code/local/Mage/Econda/controllers/IndexController.php +0 -47
- app/code/local/Mage/Econda/etc/config.xml +54 -45
- app/code/local/Mage/Econda/etc/system.xml +210 -47
- app/design/adminhtml/default/default/layout/econda.xml +0 -8
- app/design/frontend/base/default/layout/econda.xml +32 -0
- app/design/frontend/base/default/template/econda/tracker.phtml +20 -0
- app/design/frontend/default/default/layout/econda.xml +30 -28
- app/design/frontend/default/default/template/econda/tracker.phtml +19 -7
- app/design/frontend/default/default/template/econda/trackerms.phtml +0 -3
- app/design/frontend/default/default/template/econda/trackerop.phtml +0 -131
- app/etc/modules/Mage_Econda.xml +27 -7
- app/locale/de_AT/Mage_Econda.csv +2 -3
- app/locale/de_CH/Mage_Econda.csv +2 -3
- app/locale/de_DE/Mage_Econda.csv +2 -3
- app/locale/en_US/Mage_Econda.csv +2 -3
- js/tracker/emosop.js +30 -19
- package.xml +7 -7
app/code/local/Mage/Econda/Block/Adminhtml/Econda.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Mage_Econda_Block_Adminhtml_Econda extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
-
{
|
4 |
-
public function __construct()
|
5 |
-
{
|
6 |
-
$this->_controller = 'adminhtml_econda';
|
7 |
-
$this->_blockGroup = 'econda';
|
8 |
-
$this->_headerText = Mage::helper('econda')->__('Item Manager');
|
9 |
-
$this->_addButtonLabel = Mage::helper('econda')->__('Add Item');
|
10 |
-
parent::__construct();
|
11 |
-
}
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit.php
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Block_Adminhtml_Econda_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
|
9 |
-
$this->_objectId = 'id';
|
10 |
-
$this->_blockGroup = 'econda';
|
11 |
-
$this->_controller = 'adminhtml_econda';
|
12 |
-
|
13 |
-
$this->_updateButton('save', 'label', Mage::helper('econda')->__('Save Item'));
|
14 |
-
$this->_updateButton('delete', 'label', Mage::helper('econda')->__('Delete Item'));
|
15 |
-
|
16 |
-
$this->_addButton('saveandcontinue', array(
|
17 |
-
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
18 |
-
'onclick' => 'saveAndContinueEdit()',
|
19 |
-
'class' => 'save',
|
20 |
-
), -100);
|
21 |
-
|
22 |
-
$this->_formScripts[] = "
|
23 |
-
function toggleEditor() {
|
24 |
-
if (tinyMCE.getInstanceById('econda_content') == null) {
|
25 |
-
tinyMCE.execCommand('mceAddControl', false, 'econda_content');
|
26 |
-
} else {
|
27 |
-
tinyMCE.execCommand('mceRemoveControl', false, 'econda_content');
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
function saveAndContinueEdit(){
|
32 |
-
editForm.submit($('edit_form').action+'back/edit/');
|
33 |
-
}
|
34 |
-
";
|
35 |
-
}
|
36 |
-
|
37 |
-
public function getHeaderText()
|
38 |
-
{
|
39 |
-
if( Mage::registry('econda_data') && Mage::registry('econda_data')->getId() ) {
|
40 |
-
return Mage::helper('econda')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('econda_data')->getTitle()));
|
41 |
-
} else {
|
42 |
-
return Mage::helper('econda')->__('Add Item');
|
43 |
-
}
|
44 |
-
}
|
45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit/Form.php
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Block_Adminhtml_Econda_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
-
{
|
5 |
-
protected function _prepareForm()
|
6 |
-
{
|
7 |
-
$form = new Varien_Data_Form(array(
|
8 |
-
'id' => 'edit_form',
|
9 |
-
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
10 |
-
'method' => 'post',
|
11 |
-
'enctype' => 'multipart/form-data'
|
12 |
-
)
|
13 |
-
);
|
14 |
-
|
15 |
-
$form->setUseContainer(true);
|
16 |
-
$this->setForm($form);
|
17 |
-
return parent::_prepareForm();
|
18 |
-
}
|
19 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit/Tab/Form.php
DELETED
@@ -1,58 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Block_Adminhtml_Econda_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
-
{
|
5 |
-
protected function _prepareForm()
|
6 |
-
{
|
7 |
-
$form = new Varien_Data_Form();
|
8 |
-
$this->setForm($form);
|
9 |
-
$fieldset = $form->addFieldset('econda_form', array('legend'=>Mage::helper('econda')->__('Item information')));
|
10 |
-
|
11 |
-
$fieldset->addField('title', 'text', array(
|
12 |
-
'label' => Mage::helper('econda')->__('Title'),
|
13 |
-
'class' => 'required-entry',
|
14 |
-
'required' => true,
|
15 |
-
'name' => 'title',
|
16 |
-
));
|
17 |
-
|
18 |
-
$fieldset->addField('filename', 'file', array(
|
19 |
-
'label' => Mage::helper('econda')->__('File'),
|
20 |
-
'required' => false,
|
21 |
-
'name' => 'filename',
|
22 |
-
));
|
23 |
-
|
24 |
-
$fieldset->addField('status', 'select', array(
|
25 |
-
'label' => Mage::helper('econda')->__('Status'),
|
26 |
-
'name' => 'status',
|
27 |
-
'values' => array(
|
28 |
-
array(
|
29 |
-
'value' => 1,
|
30 |
-
'label' => Mage::helper('econda')->__('Enabled'),
|
31 |
-
),
|
32 |
-
|
33 |
-
array(
|
34 |
-
'value' => 2,
|
35 |
-
'label' => Mage::helper('econda')->__('Disabled'),
|
36 |
-
),
|
37 |
-
),
|
38 |
-
));
|
39 |
-
|
40 |
-
$fieldset->addField('content', 'editor', array(
|
41 |
-
'name' => 'content',
|
42 |
-
'label' => Mage::helper('econda')->__('Content'),
|
43 |
-
'title' => Mage::helper('econda')->__('Content'),
|
44 |
-
'style' => 'width:700px; height:500px;',
|
45 |
-
'wysiwyg' => false,
|
46 |
-
'required' => true,
|
47 |
-
));
|
48 |
-
|
49 |
-
if ( Mage::getSingleton('adminhtml/session')->getEcondaData() )
|
50 |
-
{
|
51 |
-
$form->setValues(Mage::getSingleton('adminhtml/session')->getEcondaData());
|
52 |
-
Mage::getSingleton('adminhtml/session')->setEcondaData(null);
|
53 |
-
} elseif ( Mage::registry('econda_data') ) {
|
54 |
-
$form->setValues(Mage::registry('econda_data')->getData());
|
55 |
-
}
|
56 |
-
return parent::_prepareForm();
|
57 |
-
}
|
58 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Block/Adminhtml/Econda/Edit/Tabs.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Block_Adminhtml_Econda_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
-
{
|
5 |
-
|
6 |
-
public function __construct()
|
7 |
-
{
|
8 |
-
parent::__construct();
|
9 |
-
$this->setId('econda_tabs');
|
10 |
-
$this->setDestElementId('edit_form');
|
11 |
-
$this->setTitle(Mage::helper('econda')->__('Item Information'));
|
12 |
-
}
|
13 |
-
|
14 |
-
protected function _beforeToHtml()
|
15 |
-
{
|
16 |
-
$this->addTab('form_section', array(
|
17 |
-
'label' => Mage::helper('econda')->__('Item Information'),
|
18 |
-
'title' => Mage::helper('econda')->__('Item Information'),
|
19 |
-
'content' => $this->getLayout()->createBlock('econda/adminhtml_econda_edit_tab_form')->toHtml(),
|
20 |
-
));
|
21 |
-
|
22 |
-
return parent::_beforeToHtml();
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Block/Adminhtml/Econda/Grid.php
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Block_Adminhtml_Econda_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
$this->setId('econdaGrid');
|
9 |
-
$this->setDefaultSort('econda_id');
|
10 |
-
$this->setDefaultDir('ASC');
|
11 |
-
$this->setSaveParametersInSession(true);
|
12 |
-
}
|
13 |
-
|
14 |
-
protected function _prepareCollection()
|
15 |
-
{
|
16 |
-
$collection = Mage::getModel('econda/econda')->getCollection();
|
17 |
-
$this->setCollection($collection);
|
18 |
-
return parent::_prepareCollection();
|
19 |
-
}
|
20 |
-
|
21 |
-
protected function _prepareColumns()
|
22 |
-
{
|
23 |
-
$this->addColumn('econda_id', array(
|
24 |
-
'header' => Mage::helper('econda')->__('ID'),
|
25 |
-
'align' =>'right',
|
26 |
-
'width' => '50px',
|
27 |
-
'index' => 'econda_id',
|
28 |
-
));
|
29 |
-
|
30 |
-
$this->addColumn('title', array(
|
31 |
-
'header' => Mage::helper('econda')->__('Title'),
|
32 |
-
'align' =>'left',
|
33 |
-
'index' => 'title',
|
34 |
-
));
|
35 |
-
|
36 |
-
/*
|
37 |
-
$this->addColumn('content', array(
|
38 |
-
'header' => Mage::helper('econda')->__('Item Content'),
|
39 |
-
'width' => '150px',
|
40 |
-
'index' => 'content',
|
41 |
-
));
|
42 |
-
*/
|
43 |
-
|
44 |
-
$this->addColumn('status', array(
|
45 |
-
'header' => Mage::helper('econda')->__('Status'),
|
46 |
-
'align' => 'left',
|
47 |
-
'width' => '80px',
|
48 |
-
'index' => 'status',
|
49 |
-
'type' => 'options',
|
50 |
-
'options' => array(
|
51 |
-
1 => 'Enabled',
|
52 |
-
2 => 'Disabled',
|
53 |
-
),
|
54 |
-
));
|
55 |
-
|
56 |
-
$this->addColumn('action',
|
57 |
-
array(
|
58 |
-
'header' => Mage::helper('econda')->__('Action'),
|
59 |
-
'width' => '100',
|
60 |
-
'type' => 'action',
|
61 |
-
'getter' => 'getId',
|
62 |
-
'actions' => array(
|
63 |
-
array(
|
64 |
-
'caption' => Mage::helper('econda')->__('Edit'),
|
65 |
-
'url' => array('base'=> '*/*/edit'),
|
66 |
-
'field' => 'id'
|
67 |
-
)
|
68 |
-
),
|
69 |
-
'filter' => false,
|
70 |
-
'sortable' => false,
|
71 |
-
'index' => 'stores',
|
72 |
-
'is_system' => true,
|
73 |
-
));
|
74 |
-
|
75 |
-
$this->addExportType('*/*/exportCsv', Mage::helper('econda')->__('CSV'));
|
76 |
-
$this->addExportType('*/*/exportXml', Mage::helper('econda')->__('XML'));
|
77 |
-
|
78 |
-
return parent::_prepareColumns();
|
79 |
-
}
|
80 |
-
|
81 |
-
protected function _prepareMassaction()
|
82 |
-
{
|
83 |
-
$this->setMassactionIdField('econda_id');
|
84 |
-
$this->getMassactionBlock()->setFormFieldName('econda');
|
85 |
-
|
86 |
-
$this->getMassactionBlock()->addItem('delete', array(
|
87 |
-
'label' => Mage::helper('econda')->__('Delete'),
|
88 |
-
'url' => $this->getUrl('*/*/massDelete'),
|
89 |
-
'confirm' => Mage::helper('econda')->__('Are you sure?')
|
90 |
-
));
|
91 |
-
|
92 |
-
$statuses = Mage::getSingleton('econda/status')->getOptionArray();
|
93 |
-
|
94 |
-
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
95 |
-
$this->getMassactionBlock()->addItem('status', array(
|
96 |
-
'label'=> Mage::helper('econda')->__('Change status'),
|
97 |
-
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
98 |
-
'additional' => array(
|
99 |
-
'visibility' => array(
|
100 |
-
'name' => 'status',
|
101 |
-
'type' => 'select',
|
102 |
-
'class' => 'required-entry',
|
103 |
-
'label' => Mage::helper('econda')->__('Status'),
|
104 |
-
'values' => $statuses
|
105 |
-
)
|
106 |
-
)
|
107 |
-
));
|
108 |
-
return $this;
|
109 |
-
}
|
110 |
-
|
111 |
-
public function getRowUrl($row)
|
112 |
-
{
|
113 |
-
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
114 |
-
}
|
115 |
-
|
116 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Block/Adminhtml/Tracker.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Mage_Econda_Block_Adminhtml_Tracker extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
-
{
|
4 |
-
public function __construct()
|
5 |
-
{
|
6 |
-
$this->_controller = 'adminhtml_tracker';
|
7 |
-
$this->_blockGroup = 'tracker';
|
8 |
-
$this->_headerText = Mage::helper('tracker')->__('Item Manager');
|
9 |
-
$this->_addButtonLabel = Mage::helper('tracker')->__('Add Item');
|
10 |
-
parent::__construct();
|
11 |
-
}
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit.php
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Block_Adminhtml_Tracker_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
|
9 |
-
$this->_objectId = 'id';
|
10 |
-
$this->_blockGroup = 'tracker';
|
11 |
-
$this->_controller = 'adminhtml_tracker';
|
12 |
-
|
13 |
-
$this->_updateButton('save', 'label', Mage::helper('tracker')->__('Save Item'));
|
14 |
-
$this->_updateButton('delete', 'label', Mage::helper('tracker')->__('Delete Item'));
|
15 |
-
|
16 |
-
$this->_addButton('saveandcontinue', array(
|
17 |
-
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
18 |
-
'onclick' => 'saveAndContinueEdit()',
|
19 |
-
'class' => 'save',
|
20 |
-
), -100);
|
21 |
-
|
22 |
-
$this->_formScripts[] = "
|
23 |
-
function toggleEditor() {
|
24 |
-
if (tinyMCE.getInstanceById('tracker_content') == null) {
|
25 |
-
tinyMCE.execCommand('mceAddControl', false, 'tracker_content');
|
26 |
-
} else {
|
27 |
-
tinyMCE.execCommand('mceRemoveControl', false, 'tracker_content');
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
function saveAndContinueEdit(){
|
32 |
-
editForm.submit($('edit_form').action+'back/edit/');
|
33 |
-
}
|
34 |
-
";
|
35 |
-
}
|
36 |
-
|
37 |
-
public function getHeaderText()
|
38 |
-
{
|
39 |
-
if( Mage::registry('tracker_data') && Mage::registry('tracker_data')->getId() ) {
|
40 |
-
return Mage::helper('tracker')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('tracker_data')->getTitle()));
|
41 |
-
} else {
|
42 |
-
return Mage::helper('tracker')->__('Add Item');
|
43 |
-
}
|
44 |
-
}
|
45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit/Form.php
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Block_Adminhtml_Tracker_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
-
{
|
5 |
-
protected function _prepareForm()
|
6 |
-
{
|
7 |
-
$form = new Varien_Data_Form(array(
|
8 |
-
'id' => 'edit_form',
|
9 |
-
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
10 |
-
'method' => 'post',
|
11 |
-
'enctype' => 'multipart/form-data'
|
12 |
-
)
|
13 |
-
);
|
14 |
-
|
15 |
-
$form->setUseContainer(true);
|
16 |
-
$this->setForm($form);
|
17 |
-
return parent::_prepareForm();
|
18 |
-
}
|
19 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit/Tab/Form.php
DELETED
@@ -1,58 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Block_Adminhtml_Tracker_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
-
{
|
5 |
-
protected function _prepareForm()
|
6 |
-
{
|
7 |
-
$form = new Varien_Data_Form();
|
8 |
-
$this->setForm($form);
|
9 |
-
$fieldset = $form->addFieldset('tracker_form', array('legend'=>Mage::helper('tracker')->__('Item information')));
|
10 |
-
|
11 |
-
$fieldset->addField('title', 'text', array(
|
12 |
-
'label' => Mage::helper('tracker')->__('Title'),
|
13 |
-
'class' => 'required-entry',
|
14 |
-
'required' => true,
|
15 |
-
'name' => 'title',
|
16 |
-
));
|
17 |
-
|
18 |
-
$fieldset->addField('filename', 'file', array(
|
19 |
-
'label' => Mage::helper('tracker')->__('File'),
|
20 |
-
'required' => false,
|
21 |
-
'name' => 'filename',
|
22 |
-
));
|
23 |
-
|
24 |
-
$fieldset->addField('status', 'select', array(
|
25 |
-
'label' => Mage::helper('tracker')->__('Status'),
|
26 |
-
'name' => 'status',
|
27 |
-
'values' => array(
|
28 |
-
array(
|
29 |
-
'value' => 1,
|
30 |
-
'label' => Mage::helper('tracker')->__('Enabled'),
|
31 |
-
),
|
32 |
-
|
33 |
-
array(
|
34 |
-
'value' => 2,
|
35 |
-
'label' => Mage::helper('tracker')->__('Disabled'),
|
36 |
-
),
|
37 |
-
),
|
38 |
-
));
|
39 |
-
|
40 |
-
$fieldset->addField('content', 'editor', array(
|
41 |
-
'name' => 'content',
|
42 |
-
'label' => Mage::helper('tracker')->__('Content'),
|
43 |
-
'title' => Mage::helper('tracker')->__('Content'),
|
44 |
-
'style' => 'width:700px; height:500px;',
|
45 |
-
'wysiwyg' => false,
|
46 |
-
'required' => true,
|
47 |
-
));
|
48 |
-
|
49 |
-
if ( Mage::getSingleton('adminhtml/session')->getTrackerData() )
|
50 |
-
{
|
51 |
-
$form->setValues(Mage::getSingleton('adminhtml/session')->getTrackerData());
|
52 |
-
Mage::getSingleton('adminhtml/session')->setTrackerData(null);
|
53 |
-
} elseif ( Mage::registry('tracker_data') ) {
|
54 |
-
$form->setValues(Mage::registry('tracker_data')->getData());
|
55 |
-
}
|
56 |
-
return parent::_prepareForm();
|
57 |
-
}
|
58 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Edit/Tabs.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Block_Adminhtml_Tracker_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
-
{
|
5 |
-
|
6 |
-
public function __construct()
|
7 |
-
{
|
8 |
-
parent::__construct();
|
9 |
-
$this->setId('tracker_tabs');
|
10 |
-
$this->setDestElementId('edit_form');
|
11 |
-
$this->setTitle(Mage::helper('tracker')->__('Item Information'));
|
12 |
-
}
|
13 |
-
|
14 |
-
protected function _beforeToHtml()
|
15 |
-
{
|
16 |
-
$this->addTab('form_section', array(
|
17 |
-
'label' => Mage::helper('tracker')->__('Item Information'),
|
18 |
-
'title' => Mage::helper('tracker')->__('Item Information'),
|
19 |
-
'content' => $this->getLayout()->createBlock('tracker/adminhtml_tracker_edit_tab_form')->toHtml(),
|
20 |
-
));
|
21 |
-
|
22 |
-
return parent::_beforeToHtml();
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Block/Adminhtml/Tracker/Grid.php
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Block_Adminhtml_Tracker_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
$this->setId('trackerGrid');
|
9 |
-
$this->setDefaultSort('tracker_id');
|
10 |
-
$this->setDefaultDir('ASC');
|
11 |
-
$this->setSaveParametersInSession(true);
|
12 |
-
}
|
13 |
-
|
14 |
-
protected function _prepareCollection()
|
15 |
-
{
|
16 |
-
$collection = Mage::getModel('tracker/tracker')->getCollection();
|
17 |
-
$this->setCollection($collection);
|
18 |
-
return parent::_prepareCollection();
|
19 |
-
}
|
20 |
-
|
21 |
-
protected function _prepareColumns()
|
22 |
-
{
|
23 |
-
$this->addColumn('tracker_id', array(
|
24 |
-
'header' => Mage::helper('tracker')->__('ID'),
|
25 |
-
'align' =>'right',
|
26 |
-
'width' => '50px',
|
27 |
-
'index' => 'tracker_id',
|
28 |
-
));
|
29 |
-
|
30 |
-
$this->addColumn('title', array(
|
31 |
-
'header' => Mage::helper('tracker')->__('Title'),
|
32 |
-
'align' =>'left',
|
33 |
-
'index' => 'title',
|
34 |
-
));
|
35 |
-
|
36 |
-
/*
|
37 |
-
$this->addColumn('content', array(
|
38 |
-
'header' => Mage::helper('tracker')->__('Item Content'),
|
39 |
-
'width' => '150px',
|
40 |
-
'index' => 'content',
|
41 |
-
));
|
42 |
-
*/
|
43 |
-
|
44 |
-
$this->addColumn('status', array(
|
45 |
-
'header' => Mage::helper('tracker')->__('Status'),
|
46 |
-
'align' => 'left',
|
47 |
-
'width' => '80px',
|
48 |
-
'index' => 'status',
|
49 |
-
'type' => 'options',
|
50 |
-
'options' => array(
|
51 |
-
1 => 'Enabled',
|
52 |
-
2 => 'Disabled',
|
53 |
-
),
|
54 |
-
));
|
55 |
-
|
56 |
-
$this->addColumn('action',
|
57 |
-
array(
|
58 |
-
'header' => Mage::helper('tracker')->__('Action'),
|
59 |
-
'width' => '100',
|
60 |
-
'type' => 'action',
|
61 |
-
'getter' => 'getId',
|
62 |
-
'actions' => array(
|
63 |
-
array(
|
64 |
-
'caption' => Mage::helper('tracker')->__('Edit'),
|
65 |
-
'url' => array('base'=> '*/*/edit'),
|
66 |
-
'field' => 'id'
|
67 |
-
)
|
68 |
-
),
|
69 |
-
'filter' => false,
|
70 |
-
'sortable' => false,
|
71 |
-
'index' => 'stores',
|
72 |
-
'is_system' => true,
|
73 |
-
));
|
74 |
-
|
75 |
-
$this->addExportType('*/*/exportCsv', Mage::helper('tracker')->__('CSV'));
|
76 |
-
$this->addExportType('*/*/exportXml', Mage::helper('tracker')->__('XML'));
|
77 |
-
|
78 |
-
return parent::_prepareColumns();
|
79 |
-
}
|
80 |
-
|
81 |
-
protected function _prepareMassaction()
|
82 |
-
{
|
83 |
-
$this->setMassactionIdField('tracker_id');
|
84 |
-
$this->getMassactionBlock()->setFormFieldName('tracker');
|
85 |
-
|
86 |
-
$this->getMassactionBlock()->addItem('delete', array(
|
87 |
-
'label' => Mage::helper('tracker')->__('Delete'),
|
88 |
-
'url' => $this->getUrl('*/*/massDelete'),
|
89 |
-
'confirm' => Mage::helper('tracker')->__('Are you sure?')
|
90 |
-
));
|
91 |
-
|
92 |
-
$statuses = Mage::getSingleton('tracker/status')->getOptionArray();
|
93 |
-
|
94 |
-
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
95 |
-
$this->getMassactionBlock()->addItem('status', array(
|
96 |
-
'label'=> Mage::helper('tracker')->__('Change status'),
|
97 |
-
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
98 |
-
'additional' => array(
|
99 |
-
'visibility' => array(
|
100 |
-
'name' => 'status',
|
101 |
-
'type' => 'select',
|
102 |
-
'class' => 'required-entry',
|
103 |
-
'label' => Mage::helper('tracker')->__('Status'),
|
104 |
-
'values' => $statuses
|
105 |
-
)
|
106 |
-
)
|
107 |
-
));
|
108 |
-
return $this;
|
109 |
-
}
|
110 |
-
|
111 |
-
public function getRowUrl($row)
|
112 |
-
{
|
113 |
-
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
114 |
-
}
|
115 |
-
|
116 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Block/Econda.php
CHANGED
@@ -1,822 +1,246 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
* Redistributions of source code must retain the above copyright notice,
|
21 |
-
this list of conditions and the following disclaimer.
|
22 |
-
* Redistributions in binary form must reproduce the above copyright notice,
|
23 |
-
this list of conditions and the following disclaimer in the documentation
|
24 |
-
and/or other materials provided with the distribution.
|
25 |
-
* Neither the name of the ECONDA GmbH nor the names of its contributors may
|
26 |
-
be used to endorse or promote products derived from this software without
|
27 |
-
specific prior written permission.
|
28 |
-
|
29 |
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
30 |
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
31 |
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
32 |
-
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
33 |
-
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
34 |
-
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
35 |
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
36 |
-
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
37 |
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
38 |
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
39 |
-
*/
|
40 |
-
|
41 |
-
/** This Class is a implementation of a PHP Function to include
|
42 |
-
* ECONDA Tracking into Magento Shop-Systems.
|
43 |
*/
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
class Mage_Econda_Block_Econda extends Mage_Core_Block_Template
|
49 |
{
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
public function __construct()
|
53 |
{
|
54 |
-
|
55 |
$this->setTemplate('econda/tracker.phtml');
|
56 |
}
|
57 |
-
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
59 |
{
|
60 |
-
|
61 |
-
|
62 |
-
* config get language
|
63 |
*/
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
* config get emos version
|
81 |
*/
|
82 |
-
|
83 |
-
$
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
Mage::getModel('core/config')->saveConfig($trackValue,$checkVersion);
|
88 |
-
Mage::getModel('core/config')->cleanCache();
|
89 |
-
}
|
90 |
-
}
|
91 |
-
else{
|
92 |
-
$checkVersion = Mage::getStoreConfig($trackValue, $storeId);
|
93 |
-
}
|
94 |
-
|
95 |
-
/*
|
96 |
-
* path to emos2.js
|
97 |
-
*/
|
98 |
-
$jsUrl = $this->getJsUrl();
|
99 |
-
$pathToFile = $jsUrl.'tracker/';
|
100 |
-
|
101 |
-
/*
|
102 |
-
* start of emos string
|
103 |
-
*/
|
104 |
-
$emosString = "\n\n<!-- Start Econda-Monitor M117 -->\n\n";
|
105 |
-
|
106 |
-
$emos = new EMOS($pathToFile);
|
107 |
-
|
108 |
-
if($checkVersion == '2') {
|
109 |
-
$emos->trackMode(intval($checkVersion));
|
110 |
-
}
|
111 |
-
|
112 |
$emos->addCdata();
|
113 |
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
* emos addContent
|
120 |
-
*/
|
121 |
-
$storeCode = Mage::app()->getStore()->getCode();
|
122 |
-
$storeNameLoad = Mage::getModel('core/store_group')->load($storeId);
|
123 |
-
$storeName = $storeNameLoad->getName();
|
124 |
-
$tablePrefix = Mage::getConfig()->getTablePrefix();
|
125 |
-
$getPath = Mage::helper('catalog')->getBreadcrumbPath($this->getCategory());
|
126 |
-
if(sizeof($getPath) > 0) {
|
127 |
-
$contentPath = "Start";
|
128 |
-
}
|
129 |
-
else{
|
130 |
-
$contentPath = "";
|
131 |
-
}
|
132 |
-
|
133 |
-
$realUrl = Mage::helper('core/url')->getCurrentUrl();
|
134 |
-
|
135 |
-
//content for checkout
|
136 |
-
$contentCheckout = '';
|
137 |
-
$stepCheckout = '';
|
138 |
-
|
139 |
-
if(stristr($realUrl,'checkout/multishipping/login/') != false) {
|
140 |
-
$contentCheckout = $eLang[0];
|
141 |
-
$stepCheckout = 'LOGIN';
|
142 |
-
}
|
143 |
-
if(stristr($realUrl,'checkout/multishipping/register/') != false) {
|
144 |
-
$contentCheckout = $eLang[1];
|
145 |
-
$stepCheckout = 'LOGINREGISTER';
|
146 |
-
}
|
147 |
-
if(stristr($realUrl,'checkout/multishipping/addresses/') != false) {
|
148 |
-
$contentCheckout = $eLang[2].'/'.$eLang[3];
|
149 |
-
$stepCheckout = 'SHIPPINGADRESS';
|
150 |
-
}
|
151 |
-
if(stristr($realUrl,'checkout/multishipping/shipping/') != false) {
|
152 |
-
$contentCheckout = $eLang[2].'/'.$eLang[4];
|
153 |
-
$stepCheckout = 'SHIPPINGMETHOD';
|
154 |
-
}
|
155 |
-
if(stristr($realUrl,'checkout/multishipping/billing/') != false) {
|
156 |
-
$contentCheckout = $eLang[5];
|
157 |
-
$stepCheckout = 'PAYMENT';
|
158 |
-
}
|
159 |
-
if(stristr($realUrl,'checkout/multishipping/overview/') != false || stristr($realUrl,'paypal/express/review/') != false) {
|
160 |
-
$contentCheckout = $eLang[36];
|
161 |
-
$stepCheckout = 'REVIEW';
|
162 |
-
}
|
163 |
-
if(stristr($realUrl,'checkout/multishipping/success/') != false || stristr($realUrl,'checkout/onepage/success/') != false || stristr($realUrl,'uospayment/success/') != false) {
|
164 |
-
$contentCheckout = $eLang[41];
|
165 |
-
$stepCheckout = 'SUCCESS';
|
166 |
-
}
|
167 |
-
|
168 |
-
foreach($getPath as $pathID) {
|
169 |
-
$contentPath .= '/'.$pathID['label'];
|
170 |
-
}
|
171 |
-
|
172 |
-
$getTagName = "";
|
173 |
-
$getTagId = "";
|
174 |
-
if(stristr($realUrl,'q=') != false) $contentPath .= 'Start/'.$eLang[6].'/'.$eLang[7];
|
175 |
-
if(stristr($realUrl,'/about-') != false || stristr($realUrl,'/impressum') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[10];
|
176 |
-
if(stristr($realUrl,'/datenschutz') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[11];
|
177 |
-
if(stristr($realUrl,'/agb') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[12];
|
178 |
-
if(stristr($realUrl,'/rss') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[13];
|
179 |
-
if(stristr($realUrl,'/customer-service') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[14];
|
180 |
-
if(stristr($realUrl,'/seo_sitemap') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[15];
|
181 |
-
if(stristr($realUrl,'/seo_sitemap/product') != false) $contentPath .= '-'.$eLang[16];
|
182 |
-
if(stristr($realUrl,'/term/popular') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[17];
|
183 |
-
if(stristr($realUrl,'/catalogsearch/advanced') != false) {
|
184 |
-
$contentPath .= 'Start/'.$eLang[6].'/'.$eLang[8];
|
185 |
-
if(stristr($realUrl,'catalogsearch/advanced/result/?') != false) {
|
186 |
-
$contentPath .= '/'.$eLang[18];
|
187 |
-
}
|
188 |
-
}
|
189 |
-
if(stristr($realUrl,'/contacts/') != false) $contentPath .= 'Start/'.$eLang[9].'/'.$eLang[19];
|
190 |
-
if(stristr($realUrl,'/login') != false) $contentPath .= 'Start/'.$eLang[0];
|
191 |
-
if(stristr($realUrl,'/customer/account/create/') != false) $contentPath .= 'Start/'.$eLang[20];
|
192 |
-
if(stristr($realUrl,'/customer/account/forgotpassword/') != false) $contentPath .= 'Start/'.$eLang[21];
|
193 |
-
if(stristr($realUrl,'/customer/') != false && stristr($realUrl,'/customer/account/login/') == false && stristr($realUrl,'/customer/account/forgotpassword/') == false && stristr($realUrl,'/customer/account/create/') == false) $contentPath .= 'Start/'.$eLang[22];
|
194 |
-
if(stristr($realUrl,'/customer/account/') != false && stristr($realUrl,'/customer/account/edit/') == false && stristr($realUrl,'/customer/account/login/') == false && stristr($realUrl,'/customer/account/forgotpassword/') == false && stristr($realUrl,'/customer/account/create/') == false) $contentPath .= '/'.$eLang[23];
|
195 |
-
if(stristr($realUrl,'/customer/account/edit/') != false) $contentPath .= '/'.$eLang[24];
|
196 |
-
if(stristr($realUrl,'/customer/address/') != false) $contentPath .= '/'.$eLang[25];
|
197 |
-
if(stristr($realUrl,'/sales/order/history/') != false) $contentPath .= 'Start/'.$eLang[22].'/'.$eLang[26];
|
198 |
-
if(stristr($realUrl,'/review/customer/') != false) $contentPath .= '/'.$eLang[27];
|
199 |
-
if(stristr($realUrl,'/tag/customer/') != false) $contentPath .= '/'.$eLang[28];
|
200 |
-
if(stristr($realUrl,'/newsletter/manage/') != false) $contentPath .= 'Start/'.$eLang[22].'/'.$eLang[29];
|
201 |
-
if(stristr($realUrl,'/wishlist/') != false) $contentPath .= 'Start/'.$eLang[22].'/'.$eLang[30];
|
202 |
-
if(stristr($realUrl,'/downloadable/customer/products/') != false) $contentPath .= '/'.$eLang[31];
|
203 |
-
if(stristr($realUrl,'checkout/cart') != false) $contentPath .= 'Start/'.$eLang[32].'/'.$eLang[33];
|
204 |
-
if(stristr($realUrl,'checkout/onepage/success') != false) $contentPath .= 'Start/'.$eLang[32].'/'.$eLang[41];
|
205 |
-
if(stristr($realUrl,'/checkout/multishipping') != false) $contentPath .= 'Start/'.$eLang[32].'/'.$contentCheckout;
|
206 |
-
if(stristr($realUrl,'/review') != false && stristr($realUrl,'/review/customer/') == false) $contentPath .= '/'.$eLang[34];
|
207 |
-
if($contentPath == '/Bewertungen') $contentPath = 'Start/'.$eLang[9].'/'.$eLang[37];
|
208 |
-
if(stristr($realUrl,'/tag/') != false && stristr($realUrl,'/tag/customer/') == false) {
|
209 |
-
$contentPath .= 'Start/'.$eLang[35];
|
210 |
-
$tagIdPos = strpos($realUrl,'/tagId/'); //tag id from url, hmmm.
|
211 |
-
$getTagId = substr($realUrl,$tagIdPos+6);
|
212 |
-
$getTagId = intval(str_replace('/','',$getTagId));
|
213 |
-
$tableTag = $tablePrefix.'tag';
|
214 |
-
$result = $db->query("SELECT name FROM $tableTag WHERE tag_id = $getTagId");
|
215 |
-
$row = $result->fetch(PDO::FETCH_ASSOC);
|
216 |
-
$getTagName .= $row['name'];
|
217 |
-
if(trim($getTagName) == ''){
|
218 |
-
$contentPath .= '/'.$eLang[36];
|
219 |
-
}
|
220 |
-
else{
|
221 |
-
$contentPath .= '/'.$getTagName;
|
222 |
-
}
|
223 |
-
}
|
224 |
|
225 |
-
|
226 |
-
*
|
227 |
*/
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
$checkPath = substr($checkPath,0,$reqPos);
|
235 |
-
}
|
236 |
-
if(substr($checkPath,-1) == "/") {
|
237 |
-
$checkPath = substr($checkPath,0,-1);
|
238 |
-
}
|
239 |
-
$checkPath = str_replace("/index.php/".$storeCode,"",$checkPath);
|
240 |
-
$checkPath = str_replace("/index.php","",$checkPath);
|
241 |
-
$codeLen = strlen($storeCode);
|
242 |
-
if(substr($checkPath,0,$codeLen+1) == '/'.$storeCode) {
|
243 |
-
$checkPath = substr($checkPath,$codeLen+1);
|
244 |
-
}
|
245 |
-
if(trim($checkPath) != '') {
|
246 |
-
$urlExtExp = explode("/",$checkPath);
|
247 |
-
$urlExtO = '';
|
248 |
-
for($i = 0; $i < sizeof($urlExtExp); $i++) {
|
249 |
-
if(trim($urlExtExp[$i]) != ''){
|
250 |
-
$urlExtO .= ucfirst($urlExtExp[$i]).'/';
|
251 |
-
}
|
252 |
-
}
|
253 |
-
$contentPath = 'Start/'.$eLang[38].'/'.substr($urlExtO,0,-1);
|
254 |
-
$contentPath = str_replace("//","/",$contentPath);
|
255 |
-
}
|
256 |
}
|
|
|
257 |
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
$
|
264 |
-
if(substr($urlExt,0,$codeLen+1) == '/'.$storeCode) {
|
265 |
-
$urlExt = substr($urlExt,$codeLen+1);
|
266 |
-
}
|
267 |
-
$urlExt = str_replace(".html","",$urlExt);
|
268 |
-
$urlExt = str_replace("//","/",$urlExt);
|
269 |
-
|
270 |
-
if(substr($urlExt,0,1) == '/') {
|
271 |
-
$urlExt = substr($urlExt,1);
|
272 |
-
}
|
273 |
-
|
274 |
-
if(substr($urlExt,-1) == '/') {
|
275 |
-
$urlExt = substr($urlExt,0,-1);
|
276 |
-
}
|
277 |
-
$urlExtExp = explode("/",$urlExt);
|
278 |
-
$urlExtO = '';
|
279 |
-
for($i = 0; $i < sizeof($urlExtExp); $i++) {
|
280 |
-
$urlExtO .= ucfirst($urlExtExp[$i]).'/';
|
281 |
-
}
|
282 |
-
$urlExtO = substr($urlExtO,0,-1);
|
283 |
-
$contentPath = 'Start/'.$eLang[38].'/'.$urlExtO;
|
284 |
-
if(trim($contentPath == '' || $contentPath == 'Start/'.$eLang[38].'/' || $contentPath == 'Start/'.$eLang[38].'/index.php/')){
|
285 |
-
$contentPath = 'Start';
|
286 |
-
}
|
287 |
}
|
288 |
|
289 |
-
|
290 |
-
|
291 |
-
$emos->addContent($contentPath);
|
292 |
-
}
|
293 |
-
|
294 |
-
//onePage checkout success
|
295 |
-
if(stristr($realUrl,'checkout/onepage/success') != false) {
|
296 |
-
$emos->addContent($contentPath);
|
297 |
-
}
|
298 |
-
|
299 |
-
/*
|
300 |
-
* emos addPageID
|
301 |
*/
|
302 |
-
$emos->addPageID(
|
303 |
|
304 |
-
|
305 |
-
*
|
306 |
*/
|
307 |
-
$
|
308 |
-
$siteidOv = Mage::getStoreConfig($siteidValue, $storeId);
|
309 |
-
if(!empty($siteidOv) && trim($siteidOv) != "") {
|
310 |
-
$siteName = trim($siteidOv);
|
311 |
-
}
|
312 |
-
else {
|
313 |
-
$siteName = $_SERVER['SERVER_NAME'];
|
314 |
-
}
|
315 |
$emos->addSiteID($siteName);
|
316 |
-
|
317 |
-
|
318 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
319 |
*/
|
320 |
-
$getLocale = Mage::app()->getStore()->getStoreId(); // locale as shopID
|
321 |
-
$emos->addLangID($getLocale);
|
322 |
-
|
323 |
-
// save pageID, siteID and langID into session for onePageCheckout
|
324 |
$jsSessionData = $contentPath.','.$siteName.','.$getLocale;
|
325 |
$session->setData('econda_content',$jsSessionData);
|
326 |
-
|
327 |
-
/*
|
328 |
-
* emos addSearch
|
329 |
-
*/
|
330 |
-
if(Mage::helper('catalogSearch')->getQueryText() != null) {
|
331 |
-
$searchQuery = Mage::helper('catalogSearch')->getQueryText();
|
332 |
-
$getQuery = Mage::helper('catalogSearch')->getQuery();
|
333 |
-
$searchQuery = $getQuery->query_text;
|
334 |
-
$searchHits = $getQuery->num_results;
|
335 |
-
$emos->addSearch($searchQuery, $searchHits);
|
336 |
-
}
|
337 |
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
foreach($searchCriterias as $val) {
|
345 |
-
$searchQuery .= $val['value'];
|
346 |
-
}
|
347 |
-
$productCollection = Mage::getSingleton('catalogsearch/advanced')->getProductCollection();
|
348 |
-
$emos->addSearch($searchQuery, sizeof($productCollection));
|
349 |
-
}
|
350 |
-
|
351 |
-
/*
|
352 |
-
* emos Basket add / remove item
|
353 |
-
*/
|
354 |
-
if(stristr($realUrl,'checkout/cart') != false) {
|
355 |
-
$emos->addOrderProcess("1_".$eLang[33]);
|
356 |
-
}
|
357 |
-
|
358 |
-
$isAddBasket = false;
|
359 |
-
$billingOption = 'econda/econda/billing_total';
|
360 |
-
|
361 |
-
//bugfix for basket after customer re-login
|
362 |
-
if(Mage::getSingleton('customer/session')->isLoggedIn() == 1) {
|
363 |
-
if($session->getData('econda_logged') != 1) {
|
364 |
-
$oldBasket = true;
|
365 |
-
}
|
366 |
-
else{
|
367 |
-
$oldBasket = false;
|
368 |
-
}
|
369 |
-
}
|
370 |
-
else{
|
371 |
-
$oldBasket = false;
|
372 |
-
}
|
373 |
-
$nIdArray = array();
|
374 |
-
$nQtyArray = array();
|
375 |
-
$nNmeArray = array();
|
376 |
-
$counter = 1;
|
377 |
-
|
378 |
-
foreach($session->getQuote()->getAllItems() as $item) {
|
379 |
-
$nIdArray[$counter] = $item->getproductId();
|
380 |
-
$nQtyArray[$counter] = $item->getQty();
|
381 |
-
$nNmeArray[$counter] = $item->getItemId();
|
382 |
-
$counter += 1;
|
383 |
-
}
|
384 |
-
if(!$session->getData('econda_card_id')){
|
385 |
-
$session->setData('econda_card_id',$nIdArray);
|
386 |
-
$session->setData('econda_card_qty',$nQtyArray);
|
387 |
-
$session->setData('econda_card_nme',$nNmeArray);
|
388 |
-
$oIdArray = $nIdArray;
|
389 |
-
$oQtyArray = $nQtyArray;
|
390 |
-
$oNmeArray = $nNmeArray;
|
391 |
-
$eStarter = 1;
|
392 |
}
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
$
|
399 |
}
|
400 |
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
$eItem->productID = $item->getproductId();
|
410 |
-
if(Mage::getStoreConfig($billingOption, $storeId) == '1') {
|
411 |
-
if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, true) != 0) {
|
412 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, true);
|
413 |
-
}
|
414 |
-
else {
|
415 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), true, null, null, $item->getTaxClassId(), $storeId, true);
|
416 |
-
}
|
417 |
-
}
|
418 |
-
else {
|
419 |
-
if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, false) != 0) {
|
420 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, false);
|
421 |
-
}
|
422 |
-
else {
|
423 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), true, null, null, $item->getTaxClassId(), $storeId, false);
|
424 |
-
}
|
425 |
-
}
|
426 |
-
$eItem->price = $this->convertPrice($priceTax);
|
427 |
-
$eItem->quantity = $item->getQty();
|
428 |
-
$eItem->productGroup = $prodGroup.'/'.trim($item->getName());
|
429 |
-
if($eItem->price != '0.00') {
|
430 |
-
$emos->addToBasket($eItem);
|
431 |
-
}
|
432 |
-
$isAddBasket = true;
|
433 |
-
}
|
434 |
-
}
|
435 |
-
else {
|
436 |
-
foreach($session->getQuote()->getAllItems() as $item) {
|
437 |
-
$emosAction = false;
|
438 |
-
$addRmv = false;
|
439 |
-
$idKey = array_search($item->getItemId(),$oNmeArray);
|
440 |
-
if($idKey == false) {
|
441 |
-
$emosAction = 'addBasket';
|
442 |
-
$basketQty = $item->getQty();
|
443 |
-
}
|
444 |
-
if($idKey != false) {
|
445 |
-
if($oQtyArray[$idKey] != $item->getQty()) {
|
446 |
-
if($oQtyArray[$idKey] > $item->getQty() && $oNmeArray[$idKey] == $item->getItemId()) {
|
447 |
-
$emosAction = 'rmvBasket';
|
448 |
-
$basketQty = $oQtyArray[$idKey] - $item->getQty();
|
449 |
-
}
|
450 |
-
if($oQtyArray[$idKey] < $item->getQty() && $oNmeArray[$idKey] == $item->getItemId()) {
|
451 |
-
$emosAction = 'addBasket';
|
452 |
-
$basketQty = $item->getQty() - $oQtyArray[$idKey];
|
453 |
-
}
|
454 |
-
}
|
455 |
-
}
|
456 |
-
if($emosAction != false) {
|
457 |
-
$getGroup = $this->getProductCategory($item->getproductId());
|
458 |
-
if($getGroup) $prodGroup = $getGroup;
|
459 |
-
else $prodGroup = $eLang[39];
|
460 |
-
$eItem = new EMOS_Item();
|
461 |
-
$eItem->productName = trim($item->getName());
|
462 |
-
$eItem->productID = $item->getproductId();
|
463 |
-
if(Mage::getStoreConfig($billingOption, $storeId) == '1') {
|
464 |
-
if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, true) != 0) {
|
465 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, true); // with tax
|
466 |
-
}
|
467 |
-
else {
|
468 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), true, null, null, $item->getTaxClassId(), $storeId, true); // with tax
|
469 |
-
}
|
470 |
-
}
|
471 |
-
else {
|
472 |
-
if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, false) != 0) {
|
473 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, false); // with tax
|
474 |
-
}
|
475 |
-
else {
|
476 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), true, null, null, $item->getTaxClassId(), $storeId, false); // with tax
|
477 |
-
}
|
478 |
-
}
|
479 |
-
$eItem->price = $this->convertPrice($priceTax);
|
480 |
-
$eItem->quantity = $basketQty;
|
481 |
-
$eItem->productGroup = $prodGroup.'/'.trim($item->getName());
|
482 |
-
if($emosAction == 'addBasket' && stristr($this->getMessagesBlock()->getGroupedHtml(),'error-msg') == false && $eItem->price != '0.00') {
|
483 |
-
$emos->addToBasket($eItem);
|
484 |
-
$isAddBasket = true;
|
485 |
-
if(stristr($realUrl,'checkout/cart') == false) {
|
486 |
-
$addRmv = true;
|
487 |
-
}
|
488 |
-
}
|
489 |
-
if($emosAction == 'rmvBasket' && stristr($this->getMessagesBlock()->getGroupedHtml(),'error-msg') == false && $eItem->price != '0.00') {
|
490 |
-
if(!$addRmv) {
|
491 |
-
$emos->removeFromBasket($eItem);
|
492 |
-
}
|
493 |
-
$isAddBasket = true;
|
494 |
-
}
|
495 |
-
}
|
496 |
-
}
|
497 |
-
}
|
498 |
}
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
}
|
519 |
-
else {
|
520 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), false, null, null, $item->getTaxClassId(), $storeId, true); // with tax
|
521 |
-
}
|
522 |
}
|
523 |
else {
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
else {
|
528 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), false, null, null, $item->getTaxClassId(), $storeId, false); // with tax
|
529 |
-
}
|
530 |
-
}
|
531 |
-
$eItem->price = $this->convertPrice($priceTax);
|
532 |
-
$eItem->quantity = '1';
|
533 |
-
$eItem->productGroup = $prodGroup.'/'.trim($item->getName());
|
534 |
-
$emos->addDetailView($eItem);
|
535 |
-
}
|
536 |
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
|
|
542 |
}
|
543 |
-
|
544 |
-
|
545 |
-
*
|
546 |
-
*/
|
547 |
-
if(stristr($realUrl,'customer/account/index/') != false || stristr($realUrl,'checkout/multishipping/addresses/') != false){
|
548 |
-
if(stristr($this->getMessagesBlock()->getGroupedHtml(),'success-msg') != false) {
|
549 |
-
$customerId = Mage::getSingleton('customer/session')->getCustomerId();
|
550 |
-
$emos->addRegister($customerId,0);
|
551 |
-
}
|
552 |
-
}
|
553 |
-
|
554 |
-
/*
|
555 |
-
* emos addLogin
|
556 |
*/
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
break;
|
592 |
-
case 'PAYMENT':
|
593 |
-
$emos->addOrderProcess("5_".$eLang[5]);
|
594 |
-
break;
|
595 |
-
case 'REVIEW':
|
596 |
-
$emos->addOrderProcess("6_".$eLang[42]);
|
597 |
-
$actOrder = Mage::getSingleton('checkout/session')->getQuoteId();
|
598 |
-
$session->setData('econda_order_id',$actOrder);
|
599 |
-
break;
|
600 |
-
case 'SUCCESS':
|
601 |
-
$emos->addOrderProcess("7_".$eLang[41]);
|
602 |
-
|
603 |
-
/*
|
604 |
-
* addEmosBillingPageArray checkout
|
605 |
-
*/
|
606 |
-
|
607 |
-
try {
|
608 |
-
if(stristr($realUrl,'checkout/onepage/success/') != false || stristr($realUrl,'uospayment/success/') != false) {//onepage
|
609 |
-
$lastOrder = Mage::getSingleton('checkout/type_onepage')->getLastOrderId();
|
610 |
-
$lastOrderId = $lastOrder;
|
611 |
-
$quote = Mage::getSingleton('checkout/type_onepage')->getQuote();
|
612 |
-
$entityId = $quote->getData('entity_id');
|
613 |
-
if(empty($entityId)) {
|
614 |
-
$tableSfq = $tablePrefix.'sales_flat_quote';
|
615 |
-
$result = $db->query("SELECT entity_id FROM $tableSfq WHERE reserved_order_id = $lastOrder");
|
616 |
-
$row = $result->fetch(PDO::FETCH_ASSOC);
|
617 |
-
$entityId = $row['entity_id'];
|
618 |
-
}
|
619 |
-
}
|
620 |
-
else{//multipage
|
621 |
-
$entityId = intval($session->getData('econda_order_id'));
|
622 |
-
$orderIds = Mage::getSingleton('core/session')->getOrderIds(false);
|
623 |
-
if($orderIds && is_array($orderIds)) {
|
624 |
-
$lastOrderId = implode(' / ', $orderIds);
|
625 |
-
}
|
626 |
-
else {
|
627 |
-
$customerId = Mage::getSingleton('customer/session')->getCustomerId();
|
628 |
-
$tableSfqos = $tablePrefix.'sales_order';
|
629 |
-
$result = $db->query("SELECT increment_id FROM $tableSfqos WHERE customer_id = $customerId");
|
630 |
-
while($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
631 |
-
$lastOrderId = $row['increment_id'];
|
632 |
-
}
|
633 |
-
}
|
634 |
-
}
|
635 |
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
if(Mage::getStoreConfig($billingOption, $storeId) == '1') {
|
647 |
-
$priceTotal += $row['base_subtotal'];
|
648 |
-
}
|
649 |
-
else if(Mage::getStoreConfig($billingOption, $storeId) == '2') {
|
650 |
-
$priceTotal += $row['base_subtotal'] + $row['base_tax_amount'] - $row['base_shipping_tax_amount'];
|
651 |
-
}
|
652 |
-
else {
|
653 |
-
$priceTotal += $row['base_grand_total'];
|
654 |
-
}
|
655 |
-
}
|
656 |
-
|
657 |
-
$priceTotal = $this->convertPrice($priceTotal);
|
658 |
-
$custAdress = $custCountry.'/'.substr($custPostCode,0,1).'/'.substr($custPostCode,0,2).'/'.$custCity.'/'.$custPostCode;
|
659 |
-
$emos->addEmosBillingPageArray($ordId,$custId,$priceTotal,$custCountry,$custPostCode,$custCity);
|
660 |
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
$result = $db->query("SELECT product_id,name,qty,price,parent_item_id FROM $tableSfqi WHERE quote_id = $entityId");
|
668 |
|
669 |
-
|
670 |
-
|
671 |
-
$getGroup = $this->getProductCategory($row['product_id']);
|
672 |
-
if($getGroup) $prodGroup = $getGroup;
|
673 |
-
else $prodGroup = $eLang[39];
|
674 |
-
$item = Mage::getModel('catalog/product')->load($row['product_id']);
|
675 |
-
$eItem = new EMOS_Item();
|
676 |
-
$eItem->productName = trim($row['name']);
|
677 |
-
$eItem->productID = $row['product_id'];
|
678 |
-
$eItem->quantity = number_format($row['qty'],0);
|
679 |
-
$discount = $row['product_id'];
|
680 |
-
$tablePrpr = $tablePrefix.'catalog_product_entity_tier_price';
|
681 |
-
$resultp = $db->query("SELECT qty,value FROM $tablePrpr WHERE entity_id = $discount");
|
682 |
-
$rowp = $resultp->fetch(PDO::FETCH_ASSOC);
|
683 |
-
$discountcheck = 0;
|
684 |
-
if($rowp) {
|
685 |
-
if($eItem->quantity >= $rowp['qty']) {
|
686 |
-
$discountcheck = $rowp['value'];
|
687 |
-
}
|
688 |
-
}
|
689 |
-
if(Mage::getStoreConfig($billingOption, $storeId) == '1') {
|
690 |
-
if($discountcheck > 0) {
|
691 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $discountcheck, false, null, null, $item->getTaxClassId(), $storeId, true);
|
692 |
-
}
|
693 |
-
else if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, true) != 0) {
|
694 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, true);
|
695 |
-
}
|
696 |
-
else {
|
697 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), false, null, null, $item->getTaxClassId(), $storeId, true);
|
698 |
-
}
|
699 |
-
}
|
700 |
-
else {
|
701 |
-
if($discountcheck > 0) {
|
702 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $discountcheck, false, null, null, $item->getTaxClassId(), $storeId, false);
|
703 |
-
}
|
704 |
-
else if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, false) != 0) {
|
705 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, false);
|
706 |
-
}
|
707 |
-
else {
|
708 |
-
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), false, null, null, $item->getTaxClassId(), $storeId, false);
|
709 |
-
}
|
710 |
-
}
|
711 |
-
$eItem->price = $this->convertPrice($priceTax);
|
712 |
-
$eItem->productGroup = $prodGroup.'/'.trim($row['name']);
|
713 |
-
$basket[$bCounter] = $eItem;
|
714 |
-
$bCounter += 1;
|
715 |
-
}
|
716 |
-
}
|
717 |
-
$emos->addEmosBasketPageArray($basket);
|
718 |
-
} catch (Exception $e) {
|
719 |
-
Mage::log("Econda on success no billing available");
|
720 |
-
}
|
721 |
-
break;
|
722 |
-
}
|
723 |
-
|
724 |
-
$emosString .= $emos->toString();
|
725 |
-
$emosString .= "\n<!-- End Econda-Monitor -->\n\n";
|
726 |
-
if(!$this->econdaInt) {
|
727 |
-
$this->econdaInt = true;
|
728 |
-
return $emosString;
|
729 |
}
|
730 |
else {
|
731 |
-
return
|
732 |
}
|
733 |
}
|
734 |
-
|
735 |
-
/*
|
736 |
-
* get highest level category path for a product
|
737 |
-
*/
|
738 |
-
private function getProductCategory($productId)
|
739 |
-
{
|
740 |
-
Mage::getSingleton('core/session', array('name'=>'frontend'));
|
741 |
-
$db = Mage::getSingleton('core/resource')->getConnection('core_write');
|
742 |
-
$tablePrefix = Mage::getConfig()->getTablePrefix();
|
743 |
-
$tableCcp = $tablePrefix.'catalog_category_product';
|
744 |
-
$result = $db->query("SELECT category_id FROM $tableCcp WHERE product_id = $productId");
|
745 |
-
$getCatId = array();
|
746 |
-
$catPath = array();
|
747 |
-
$count = 0;
|
748 |
-
$isCategory = false;
|
749 |
-
$rootCat = Mage::app()->getStore()->getRootCategoryId();
|
750 |
-
|
751 |
-
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
752 |
-
$getCatId[$count] = $row['category_id'];
|
753 |
-
$count += 1;
|
754 |
-
$isCategory = true;
|
755 |
-
}
|
756 |
-
if($isCategory) {
|
757 |
-
$catLevel = 0;
|
758 |
-
for($i=0;$i<sizeof($getCatId);$i++) {
|
759 |
-
$getCat = $getCatId[$i];
|
760 |
-
$tableCce = $tablePrefix.'catalog_category_entity';
|
761 |
-
$result = $db->query("SELECT level,path FROM $tableCce WHERE entity_id = $getCat");
|
762 |
-
$row = $result->fetch(PDO::FETCH_ASSOC);
|
763 |
-
$catPathPa = explode('/',$row['path']);
|
764 |
-
if($catLevel < intval($row['level']) && intval($catPathPa[1]) == $rootCat) {
|
765 |
-
$catLevel = intval($row['level']);
|
766 |
-
$catPath = $catPathPa;
|
767 |
-
}
|
768 |
-
}
|
769 |
-
|
770 |
-
$category = "";
|
771 |
-
for($i=0;$i<sizeof($catPath);$i++) {
|
772 |
-
$catId = intval($catPath[$i]);
|
773 |
-
$category .= Mage::getModel('catalog/category')->load($catId)->getName()."/";
|
774 |
-
}
|
775 |
-
$category = substr($category,0,-1);
|
776 |
-
if(substr($category, 0, 1) == '/') {
|
777 |
-
$category = substr($category, 1);
|
778 |
-
}
|
779 |
-
return $category;
|
780 |
-
}
|
781 |
-
else {
|
782 |
-
return false;
|
783 |
-
}
|
784 |
-
}
|
785 |
-
|
786 |
-
private function convertPrice($price)
|
787 |
-
{
|
788 |
-
$price = number_format($price,2);
|
789 |
-
$corPrice = substr($price,0,-3);
|
790 |
-
$corPrice = str_replace(',','',$corPrice);
|
791 |
-
$corPrice = str_replace('.','',$corPrice);
|
792 |
-
return $corPrice.'.'.substr($price,-2);
|
793 |
-
}
|
794 |
-
|
795 |
-
private function emosVersion()
|
796 |
-
{
|
797 |
-
$emFile = $_SERVER{'DOCUMENT_ROOT'}."/js/tracker/emos2.js";
|
798 |
-
if(file_exists($emFile)) {
|
799 |
-
$fp = @fopen($emFile,'r');
|
800 |
-
if($fp) {
|
801 |
-
$rl = fgets($fp,60);
|
802 |
-
fclose($fp);
|
803 |
-
if(stristr($rl,'EMOS_VERSION') != false) {
|
804 |
-
$evp = strpos($rl,'EMOS_VERSION') ;
|
805 |
-
$evsb = substr($rl,$evp+12,8);
|
806 |
-
$evsb = str_replace('=','',$evsb);
|
807 |
-
$evsb = str_replace('\'','',$evsb);
|
808 |
-
$evsb = str_replace(',','',$evsb);
|
809 |
-
$evsb = str_replace('pt','',$evsb);
|
810 |
-
$evsb = str_replace('cm','',$evsb);
|
811 |
-
$evbiv = intval($evsb);
|
812 |
-
if($evbiv > 40) {
|
813 |
-
return '2';
|
814 |
-
}
|
815 |
-
}
|
816 |
-
}
|
817 |
-
return '1';
|
818 |
-
}
|
819 |
-
return '0';
|
820 |
-
}
|
821 |
}
|
822 |
-
?>
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Mage
|
16 |
+
* @package Mage_Econda
|
17 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
*/
|
20 |
|
21 |
+
/**
|
22 |
+
* Generate tracking code
|
23 |
+
*/
|
24 |
class Mage_Econda_Block_Econda extends Mage_Core_Block_Template
|
25 |
{
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @var Current url and language values
|
29 |
+
*/
|
30 |
+
private $eLang = array();
|
31 |
+
private $lang = 1;
|
32 |
+
private $realUrl = '';
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Intialize
|
36 |
+
*/
|
37 |
public function __construct()
|
38 |
{
|
39 |
+
parent::__construct();
|
40 |
$this->setTemplate('econda/tracker.phtml');
|
41 |
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Get econda JS code
|
45 |
+
*
|
46 |
+
* @return string
|
47 |
+
*/
|
48 |
+
public function getEmos()
|
49 |
{
|
50 |
+
/**
|
51 |
+
* Initial values
|
|
|
52 |
*/
|
53 |
+
Mage::getSingleton('core/session', array('name'=>'frontend'));
|
54 |
+
$db = Mage::getSingleton('core/resource')->getConnection('core_write');
|
55 |
+
$session = Mage::getSingleton('checkout/session');
|
56 |
+
$storeId = Mage::app()->getStore()->getId();
|
57 |
+
$storeCode = Mage::app()->getStore()->getCode();
|
58 |
+
$storeName = Mage::getModel('core/store_group')->load($storeId)->getName();
|
59 |
+
$this->realUrl = Mage::helper('core/url')->getCurrentUrl();
|
60 |
+
$langValue = 'econda/econda/tracking_language';
|
61 |
+
$this->eLang = Mage::helper('econda/data')->getTranslation();
|
62 |
+
$cLang = Mage::getStoreConfig($langValue, $storeId);
|
63 |
+
if($cLang == '1') {
|
64 |
+
$this->lang = 0;
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Make instance of econda helper object
|
|
|
69 |
*/
|
70 |
+
$jsUrl = $this->getJsUrl();
|
71 |
+
$pathToFile = $jsUrl.'tracker/';
|
72 |
+
$emos = Mage::getBlockSingleton('econda/emos');
|
73 |
+
$emos->emos($pathToFile);
|
74 |
+
$emos->trackMode(2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
$emos->addCdata();
|
76 |
|
77 |
+
/**
|
78 |
+
* Get checkout steps inside order process
|
79 |
+
*/
|
80 |
+
$checkoutSteps = Mage::getModel('econda/basket')->getCheckoutSteps();
|
81 |
+
$stepCheckout = $checkoutSteps[1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
+
/**
|
84 |
+
* Get content string as drilldown path
|
85 |
*/
|
86 |
+
$contentPath = "Start";
|
87 |
+
$contentPath .= Mage::getModel('econda/base')->getContentBreadcrumb();
|
88 |
+
$contentPath .= Mage::getModel('econda/base')->getContentCustom();
|
89 |
+
if(trim($contentPath) == 'Start' || trim($contentPath) == 'Start/') {
|
90 |
+
$contentPath = str_replace('/','',$contentPath);
|
91 |
+
$contentPath .= Mage::getModel('econda/base')->getContentDefault();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
}
|
93 |
+
$contentPath = str_replace('//','/',$contentPath);
|
94 |
|
95 |
+
/**
|
96 |
+
* Add content path
|
97 |
+
*/
|
98 |
+
if(stristr($this->realUrl,'checkout/onepage/') == false ||
|
99 |
+
stristr($this->realUrl,'checkout/onepage/success') != false) {
|
100 |
+
$emos->addContent($contentPath);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
}
|
102 |
|
103 |
+
/**
|
104 |
+
* Add page id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
*/
|
106 |
+
$emos->addPageID(Mage::getModel('econda/base')->getPageId($contentPath));
|
107 |
|
108 |
+
/**
|
109 |
+
* Add site id
|
110 |
*/
|
111 |
+
$siteName = Mage::getModel('econda/base')->getSiteId($storeId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
$emos->addSiteID($siteName);
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Add lang id
|
116 |
+
*/
|
117 |
+
$getLocale = Mage::getModel('econda/base')->getLangId();
|
118 |
+
$emos->addLangID($getLocale);
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Save pageID, siteID and langID into session for onePageCheckout
|
122 |
*/
|
|
|
|
|
|
|
|
|
123 |
$jsSessionData = $contentPath.','.$siteName.','.$getLocale;
|
124 |
$session->setData('econda_content',$jsSessionData);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
+
/**
|
127 |
+
* Add search results
|
128 |
+
*/
|
129 |
+
$search = Mage::getModel('econda/base')->getSearch();
|
130 |
+
if($search != null) {
|
131 |
+
$emos->addSearch($search[0],$search[1]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Add results from contact form
|
136 |
+
*/
|
137 |
+
if(Mage::getModel('econda/base')->getContact()) {
|
138 |
+
$emos->addContact($this->eLang[40][$this->lang]);
|
139 |
}
|
140 |
|
141 |
+
$message = $this->getMessagesBlock()->getGroupedHtml();
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Add results from registration
|
145 |
+
*/
|
146 |
+
$register = Mage::getModel('econda/base')->getRegister($message);
|
147 |
+
if($register != null) {
|
148 |
+
$emos->addRegister($register[0],$register[1]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Add results from login
|
153 |
+
*/
|
154 |
+
$login = Mage::getModel('econda/base')->getLogin($message);
|
155 |
+
if($login != null) {
|
156 |
+
$emos->addLogin($login[0],$login[1]);
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Add actions for add/rmv product item(s)
|
161 |
+
*/
|
162 |
+
$addBasket = Mage::getModel('econda/basket')->getProductAddRmv($message, $storeId);
|
163 |
+
$isAddBasket = $addBasket[0];
|
164 |
+
$billingOption = $addBasket[1];
|
165 |
+
$productActions = $addBasket[2];
|
166 |
+
for($i = 0; $i < sizeof($productActions); $i++) {
|
167 |
+
if($productActions[$i][0] == 'add') {
|
168 |
+
$emos->addToBasket($productActions[$i][1]);
|
|
|
|
|
|
|
|
|
169 |
}
|
170 |
else {
|
171 |
+
$emos->removeFromBasket($productActions[$i][1]);
|
172 |
+
}
|
173 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
|
175 |
+
/**
|
176 |
+
* Add action for product view
|
177 |
+
*/
|
178 |
+
if(Mage::registry('current_product') && !$isAddBasket) {
|
179 |
+
$productView = Mage::getModel('econda/basket')->getProductView($billingOption, $storeId);
|
180 |
+
$emos->addDetailView($productView);
|
181 |
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Check if checkout process steps
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
*/
|
186 |
+
switch ($stepCheckout) {
|
187 |
+
case 'BASKET':
|
188 |
+
$emos->addOrderProcess("1_".$this->eLang[33][$this->lang]);
|
189 |
+
break;
|
190 |
+
case 'LOGIN':
|
191 |
+
$emos->addOrderProcess("2_".$this->eLang[0][$this->lang]);
|
192 |
+
break;
|
193 |
+
case 'LOGINREGISTER':
|
194 |
+
$emos->addOrderProcess("3_".$this->eLang[1][$this->lang]);
|
195 |
+
break;
|
196 |
+
case 'SHIPPINGADRESS':
|
197 |
+
$emos->addOrderProcess("4_".$this->eLang[2][$this->lang]."/".$this->eLang[3][$this->lang]);
|
198 |
+
break;
|
199 |
+
case 'SHIPPINGMETHOD':
|
200 |
+
$emos->addOrderProcess("4_".$this->eLang[2][$this->lang]."/".$this->eLang[4][$this->lang]);
|
201 |
+
break;
|
202 |
+
case 'PAYMENT':
|
203 |
+
$emos->addOrderProcess("5_".$this->eLang[5][$this->lang]);
|
204 |
+
break;
|
205 |
+
case 'REVIEW':
|
206 |
+
$emos->addOrderProcess("6_".$this->eLang[42][$this->lang]);
|
207 |
+
$actOrder = Mage::getSingleton('checkout/session')->getQuoteId();
|
208 |
+
$session->setData('econda_order_id',$actOrder);
|
209 |
+
break;
|
210 |
+
case 'SUCCESS':
|
211 |
+
$emos->addOrderProcess("7_".$this->eLang[41][$this->lang]);
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Add billing for order success
|
215 |
+
*/
|
216 |
+
$billing = Mage::getModel('econda/basket')->getBilling($billingOption, $storeId);
|
217 |
+
if($billing != null) {
|
218 |
+
$emos->addEmosBillingPageArray($billing[0],$billing[1],$billing[2],$billing[3],$billing[4],$billing[5]);
|
219 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
|
221 |
+
/**
|
222 |
+
* Add basket item(s) for order success
|
223 |
+
*/
|
224 |
+
$entityId = $billing[6];
|
225 |
+
$basket = Mage::getModel('econda/basket')->getBasket($billingOption, $storeId, $entityId);
|
226 |
+
if($basket != null) {
|
227 |
+
$emos->addEmosBasketPageArray($basket);
|
228 |
+
}
|
229 |
+
break;
|
230 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
|
232 |
+
/**
|
233 |
+
* Display script code
|
234 |
+
*/
|
235 |
+
$emosString = "\n\n<!-- Start Econda-Monitor M150 -->\n";
|
236 |
+
$emosString .= $emos->toString();
|
237 |
+
$emosString .= "<!-- End Econda-Monitor -->\n\n";
|
|
|
238 |
|
239 |
+
if(stristr($this->realUrl,'checkout/onepage/index/') == false) {
|
240 |
+
return $emosString;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
}
|
242 |
else {
|
243 |
+
return Mage::getBlockSingleton('econda/econdaOp')->getEmosOp();
|
244 |
}
|
245 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
}
|
|
app/code/local/Mage/Econda/Block/EcondaOp.php
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Mage
|
16 |
+
* @package Mage_Econda
|
17 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Generate tracking code for one page checkout
|
23 |
+
*/
|
24 |
+
class Mage_Econda_Block_EcondaOp extends Mage_Core_Block_Template
|
25 |
+
{
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Get econda JS code
|
29 |
+
*
|
30 |
+
* @return string
|
31 |
+
*/
|
32 |
+
public function getEmosOp()
|
33 |
+
{
|
34 |
+
$realUrlOp = Mage::helper('core/url')->getCurrentUrl();
|
35 |
+
$opsession = Mage::getSingleton('checkout/session');
|
36 |
+
if(stristr($realUrlOp,'checkout/onepage/') != false) {
|
37 |
+
$storeIdOp = $this->getStore();
|
38 |
+
$pathToEmos = $this->getJsUrl().'tracker/emos2.js';
|
39 |
+
$pathToOpJs = $this->getJsUrl().'tracker/emosop.js';
|
40 |
+
$emosInclude = "\n<script type=\"text/javascript\" src='".$pathToEmos."'></script>\n";
|
41 |
+
$opInclude = "<script type=\"text/javascript\" src='".$pathToOpJs."'></script>\n";
|
42 |
+
$customerId = md5(Mage::getSingleton('customer/session')->getCustomerId());
|
43 |
+
$getSessionData = $opsession->getData('econda_content');
|
44 |
+
$splitSessionData = explode(',',$getSessionData);
|
45 |
+
$setPageId = md5($splitSessionData[0]);
|
46 |
+
$setSiteID = $this->dataFormat($splitSessionData[1]);
|
47 |
+
$setLangID = $splitSessionData[2];
|
48 |
+
$langValueOP = 'econda/econda/tracking_language';
|
49 |
+
$cLangOp = Mage::getStoreConfig($langValueOP, $storeIdOp);
|
50 |
+
if($cLangOp == '1') {
|
51 |
+
$lang = 0;
|
52 |
+
}
|
53 |
+
else {
|
54 |
+
$lang = 1;
|
55 |
+
}
|
56 |
+
$eLang = Mage::helper('econda/data')->getTranslation();
|
57 |
+
$langStep[0] = $eLang[0][$lang]; $langStep[1] = $eLang[43][$lang]; $langStep[2] = $eLang[2].'/'.$eLang[3][$lang];
|
58 |
+
$langStep[3] = $eLang[2][$lang].'/'.$eLang[4][$lang]; $langStep[4] = $eLang[5][$lang]; $langStep[5] = $eLang[42][$lang];
|
59 |
+
$langStep[6] = $eLang[43][$lang]; $langStep[7] = $eLang[32][$lang];
|
60 |
+
$emosLogin = "";
|
61 |
+
if(stristr($this->getMessagesBlock()->getGroupedHtml(),'error-msg') != false) {
|
62 |
+
$emosLogin .= " emospro.login = [['".$customerId."','1']];\n";
|
63 |
+
}
|
64 |
+
$isLoggedIn = Mage::getSingleton('customer/session')->isLoggedIn();
|
65 |
+
if($isLoggedIn == 1 && $opsession->getData('econda_logged') != 2) {
|
66 |
+
$emosLogin .= " emospro.login = [['".$customerId."','0']];\n";
|
67 |
+
$opsession->setData('econda_logged','2');
|
68 |
+
}
|
69 |
+
$emosOut = "\n<!-- Start Econda-Monitor M150 -->\n";
|
70 |
+
$emosOut .= "\n<script type=\"text/javascript\">\n//<![CDATA[\n";
|
71 |
+
$emosOut .= " window.emosTrackVersion = 2;\n";
|
72 |
+
$emosOut .= "//]]>\n</script>";
|
73 |
+
$emosOut .= $emosInclude;
|
74 |
+
$emosOut .= "<script type=\"text/javascript\">\n//<![CDATA[\n";
|
75 |
+
$emosOut .= " ecStep = new Array('".$langStep[0]."','".$langStep[1]."','".$langStep[2]."','".$langStep[3].
|
76 |
+
"','".$langStep[4]."','".$langStep[5]."','".$langStep[6]."','".$langStep[7]."');\n";
|
77 |
+
$emosOut .= " var emospro = {};\n";
|
78 |
+
$emosOut .= " emospro.content = 'Start/".$eLang[38][$lang]."';\n";
|
79 |
+
$emosOut .= " emospro.pageId = '".$setPageId."';\n";
|
80 |
+
$emosOut .= " emospro.siteid = '".$setSiteID."';\n";
|
81 |
+
$emosOut .= " emospro.langid = '".$setLangID."';\n";
|
82 |
+
$emosOut .= $emosLogin;
|
83 |
+
$emosOut .= "//]]>\n</script>\n".$opInclude;
|
84 |
+
$emosOut .= "\n<!-- End Econda-Monitor -->\n";
|
85 |
+
return $emosOut;
|
86 |
+
}
|
87 |
+
return "";
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Encode values for javascript
|
92 |
+
*
|
93 |
+
* @return string
|
94 |
+
*/
|
95 |
+
private function dataFormat($str)
|
96 |
+
{
|
97 |
+
$str = utf8_decode($str);
|
98 |
+
$str = html_entity_decode($str);
|
99 |
+
$str = utf8_encode($str);
|
100 |
+
$str = addcslashes($str, "\\\"'&<>]");
|
101 |
+
return $str;
|
102 |
+
}
|
103 |
+
}
|
app/code/local/Mage/Econda/Block/Emos.php
ADDED
@@ -0,0 +1,759 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*******************************************************************************
|
3 |
+
* EMOS PHP Bib 2
|
4 |
+
* $Id: emos.php,v 1.15 2009/11/17 13:24:00 egaiser Exp $
|
5 |
+
********************************************************************************
|
6 |
+
|
7 |
+
Copyright (c) 2004 - 2009 ECONDA GmbH Karlsruhe
|
8 |
+
All rights reserved.
|
9 |
+
|
10 |
+
ECONDA GmbH
|
11 |
+
Eisenlohrstr. 43
|
12 |
+
76135 Karlsruhe
|
13 |
+
Tel.: 0721/663035-0
|
14 |
+
Fax.: 0721 663035-10
|
15 |
+
info@econda.de
|
16 |
+
www.econda.de
|
17 |
+
|
18 |
+
Redistribution and use in source and binary forms, with or without modification,
|
19 |
+
are permitted provided that the following conditions are met:
|
20 |
+
|
21 |
+
* Redistributions of source code must retain the above copyright notice,
|
22 |
+
this list of conditions and the following disclaimer.
|
23 |
+
* Redistributions in binary form must reproduce the above copyright notice,
|
24 |
+
this list of conditions and the following disclaimer in the documentation
|
25 |
+
and/or other materials provided with the distribution.
|
26 |
+
* Neither the name of the ECONDA GmbH nor the names of its contributors may
|
27 |
+
be used to endorse or promote products derived from this software without
|
28 |
+
specific prior written permission.
|
29 |
+
|
30 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
31 |
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
32 |
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
33 |
+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
34 |
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
35 |
+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
36 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
37 |
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
38 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
39 |
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
40 |
+
|
41 |
+
Changes:
|
42 |
+
|
43 |
+
$Log: emos.php,v $
|
44 |
+
Revision 1.15 2009/11/17 13:24:00 egaiser
|
45 |
+
update to handle anchor tags and properties array
|
46 |
+
added public function trackMode to switch between anchor tags and properties array
|
47 |
+
added public function debugMode to show debug information
|
48 |
+
added public function rmvCdata to remove CDATA tag for properties array
|
49 |
+
added public function addMarker
|
50 |
+
added public function addTarget
|
51 |
+
added public function addGoal to set target conversion
|
52 |
+
added public function trackOnLoad to set automatic request on site load
|
53 |
+
added public function addScript for additional external Javascript integration
|
54 |
+
several changes in structural output and string encoding
|
55 |
+
|
56 |
+
Revision 1.14 2009/02/19 09:52:56 unaegele
|
57 |
+
if public function not exists fix (Removed in Revision 1.15)
|
58 |
+
|
59 |
+
Revision 1.13 2007/08/17 08:40:33 unaegele
|
60 |
+
added public function addEMOSCustomPageArray
|
61 |
+
added public function getEMOSCustomPageArray
|
62 |
+
|
63 |
+
Revision 1.12 2007/05/16 08:24:09 unaegele
|
64 |
+
fix wrong reference to htmlspecialchars_decodephp4()
|
65 |
+
|
66 |
+
Revision 1.11 2007/05/11 07:52:42 unaegele
|
67 |
+
Update ECONDA Tel Number, prepare Release 20070510
|
68 |
+
|
69 |
+
Revision 1.10 2007/05/11 07:45:53 unaegele
|
70 |
+
added \n to addSid
|
71 |
+
|
72 |
+
Revision 1.9 2007/05/10 12:19:04 unaegele
|
73 |
+
Fix php 4 compatibility for the call to htmlspecialchars_decode()
|
74 |
+
Replace traslated =chr(0xa0) with real spaces
|
75 |
+
|
76 |
+
Revision 1.8 2007/05/04 10:17:31 unaegele
|
77 |
+
several bugfixes
|
78 |
+
|
79 |
+
Revision 1.7 2007/05/04 09:59:01 unaegele
|
80 |
+
source code formating
|
81 |
+
|
82 |
+
Revision 1.6 2007/05/04 09:55:12 unaegele
|
83 |
+
*** empty log message ***
|
84 |
+
|
85 |
+
Revision 1.5 2007/05/04 09:49:08 unaegele
|
86 |
+
*** empty log message ***
|
87 |
+
|
88 |
+
Revision 1.4 2007/05/04 09:43:48 unaegele
|
89 |
+
Added methods addSiteID($siteid), addLangID($langid), addPageID($pageID), addCountryID($countryid)
|
90 |
+
|
91 |
+
Revision 1.2 added URL Encoding, Dataformat
|
92 |
+
|
93 |
+
Revision 1.1 added 1st party session tracking
|
94 |
+
|
95 |
+
*/
|
96 |
+
|
97 |
+
/* PHP Helper Class to construct a ECONDA Monitor statement for the later
|
98 |
+
* inclusion in a HTML/PHP Page.
|
99 |
+
*/
|
100 |
+
class Mage_Econda_Block_Emos
|
101 |
+
{
|
102 |
+
|
103 |
+
/* Here we store the predefined parameter list */
|
104 |
+
private $preScript = "";
|
105 |
+
|
106 |
+
/* Here we store the additional script-files */
|
107 |
+
private $inScript = "";
|
108 |
+
|
109 |
+
/* Here we store additional parameters */
|
110 |
+
private $postScript = "";
|
111 |
+
|
112 |
+
/* path to the emos2.js script-file */
|
113 |
+
private $pathToFile = "";
|
114 |
+
|
115 |
+
/* Name of the script-file */
|
116 |
+
private $scriptFileName = "emos2.js";
|
117 |
+
|
118 |
+
/* session id for 1st party sessions*/
|
119 |
+
private $emsid = "";
|
120 |
+
|
121 |
+
/* visitor id for 1st partyx visitors */
|
122 |
+
private $emvid = "";
|
123 |
+
|
124 |
+
/* start js and init properties */
|
125 |
+
private $jsStart = "<script type=\"text/javascript\">\n//<![CDATA[\n var emospro = {};\n";
|
126 |
+
|
127 |
+
/* end js and fire properties */
|
128 |
+
private $jsEnd = " window.emosPropertiesEvent(emospro);\n//]]>\n</script>\n";
|
129 |
+
|
130 |
+
/* emos2 inclusion */
|
131 |
+
private $emosBib = "";
|
132 |
+
|
133 |
+
/* ec_event */
|
134 |
+
private $ecString = "";
|
135 |
+
|
136 |
+
/* remove cdata */
|
137 |
+
private $rmvCdata = true;
|
138 |
+
|
139 |
+
/* old style anchor tags*/
|
140 |
+
private $anchorTags = true;
|
141 |
+
|
142 |
+
/* count basket items */
|
143 |
+
private $ecCounter = 0;
|
144 |
+
|
145 |
+
/* send request on site load */
|
146 |
+
private $emosFire = true;
|
147 |
+
|
148 |
+
/* main out */
|
149 |
+
private $retString = "";
|
150 |
+
|
151 |
+
/* script to stopp request on site load */
|
152 |
+
private $emosStopRequest = "<script type=\"text/javascript\">\n//<![CDATA[\n window.emosTrackVersion = 2;\n//]]>\n</script>\n";
|
153 |
+
|
154 |
+
/* Debug Mode */
|
155 |
+
private $emosDebug = 0;
|
156 |
+
|
157 |
+
/* CSS Style and Div for Debug */
|
158 |
+
private $debugOut = "\n<script type=\"text/javascript\">\n function hideEcondaDebug(){\n document.getElementById(\"econdaDebugTxt\").style.visibility = \"hidden\";\n document.getElementById(\"econdaDebugStat\").style.visibility = \"hidden\";\n document.getElementById(\"econdaDebug\").style.width = \"35px\";\n document.getElementById(\"econdaDebug\").style.height = \"15px\";\n document.getElementById(\"econdaDebugShow\").style.visibility = \"visible\";\n }\n function showEcondaDebug(){\n document.getElementById(\"econdaDebugTxt\").style.visibility = \"visible\";\n document.getElementById(\"econdaDebugStat\").style.visibility = \"visible\";\n document.getElementById(\"econdaDebug\").style.width = \"auto\";\n document.getElementById(\"econdaDebug\").style.height = \"auto\";\n document.getElementById(\"econdaDebugShow\").style.visibility = \"hidden\";\n }\n function econdaDebug(dbtxt){\n document.getElementById(\"econdaDebugTxt\").innerHTML = dbtxt;\n }\n</script>\n<div name=\"econdaDebug\" id=\"econdaDebug\" style=\"position:absolute; visibility: visible; font-family: sans-serif; font-size: 12px; color: #FFFFFF; background-color: #0088B2; left: 0px; top: 0px; width: auto; height: auto; padding: 3px; z-index: 1000;\">\n<textarea style=\"min-width: 760px; font-family: sans-serif; font-size: 13px; background-color: #FFFFFF;\" name=\"econdaDebugTxt\" id=\"econdaDebugTxt\" wrap=\"off\" cols=\"120\" rows=\"22\">\n";
|
159 |
+
private $debugEnd = "</textarea>\n<div name=\"econdaDebugStat\" id=\"econdaDebugStat\" style=\"cursor: pointer; padding: 1px;\" align=\"right\" onClick=\"javascript:hideEcondaDebug();\">[econda debug mode] HIDE</div>\n<div name=\"econdaDebugShow\" id=\"econdaDebugShow\" style=\"position: absolute; visibility: hidden; top: 0px; left: 0px; cursor: pointer; z-index: 1001;\" onClick=\"javascript:showEcondaDebug();\">SHOW</div>\n</div>\n\n";
|
160 |
+
|
161 |
+
public function __construct()
|
162 |
+
{
|
163 |
+
}
|
164 |
+
|
165 |
+
/*
|
166 |
+
* add compatibility public function for php < 5.1
|
167 |
+
*/
|
168 |
+
public function htmlspecialchars_decode_php4($str)
|
169 |
+
{
|
170 |
+
return strtr($str, array_flip(get_html_translation_table(HTML_SPECIALCHARS)));
|
171 |
+
}
|
172 |
+
|
173 |
+
/* Constructor
|
174 |
+
* Sets the path to the emos2.js js-bib and prepares the later calls
|
175 |
+
*
|
176 |
+
* @param $pathToFile The path to the js-bib (/js)
|
177 |
+
* @param $scriptFileName If we want to have annother Filename than
|
178 |
+
* emos2.js you can set it here
|
179 |
+
*/
|
180 |
+
public function emos($pathToFile , $scriptFileName = "emos2.js")
|
181 |
+
{
|
182 |
+
$this->pathToFile = $pathToFile;
|
183 |
+
if(substr($this->pathToFile,-8) == 'emos2.js') {
|
184 |
+
$this->pathToFile = substr($this->pathToFile,0,strlen($this->pathToFile)-8);
|
185 |
+
}
|
186 |
+
if(substr($this->pathToFile,-1) != '/') {
|
187 |
+
$this->pathToFile .= '/';
|
188 |
+
}
|
189 |
+
$this->scriptFileName = $scriptFileName;
|
190 |
+
if($this->scriptFileName == '' || $this->scriptFileName == null) {
|
191 |
+
$this->scriptFileName = 'emos2.js';
|
192 |
+
}
|
193 |
+
$this->prepareInScript();
|
194 |
+
}
|
195 |
+
|
196 |
+
/* formats data/values/params by eliminating named entities and xml-entities */
|
197 |
+
public function emos_ItemFormat($item)
|
198 |
+
{
|
199 |
+
$item->productID = $this->emos_DataFormat($item->productID);
|
200 |
+
$item->productName = $this->emos_DataFormat($item->productName);
|
201 |
+
$item->productGroup = $this->emos_DataFormat($item->productGroup);
|
202 |
+
$item->variant1 = $this->emos_DataFormat($item->variant1);
|
203 |
+
$item->variant2 = $this->emos_DataFormat($item->variant2);
|
204 |
+
$item->variant3 = $this->emos_DataFormat($item->variant3);
|
205 |
+
return $item;
|
206 |
+
}
|
207 |
+
|
208 |
+
/* formats data/values/params by eliminating named entities and xml-entities */
|
209 |
+
public function emos_DataFormat($str)
|
210 |
+
{
|
211 |
+
if($this->anchorTags) {
|
212 |
+
$str = urldecode($str);
|
213 |
+
//2007-05-10 Fix incompatibility with php4
|
214 |
+
if (function_exists('htmlspecialchars_decode')) {
|
215 |
+
$str = htmlspecialchars_decode($str, ENT_QUOTES);
|
216 |
+
} else {
|
217 |
+
$str = $this->htmlspecialchars_decode_php4($str);
|
218 |
+
}
|
219 |
+
$str = html_entity_decode($str);
|
220 |
+
$str = strip_tags($str);
|
221 |
+
$str = trim($str);
|
222 |
+
|
223 |
+
//2007-05-10 replace translated with spaces
|
224 |
+
$nbsp = chr(0xa0);
|
225 |
+
$str = str_replace($nbsp, " ", $str);
|
226 |
+
$str = str_replace("\"", "", $str);
|
227 |
+
$str = str_replace("'", "", $str);
|
228 |
+
$str = str_replace("%", "", $str);
|
229 |
+
$str = str_replace(",", "", $str);
|
230 |
+
$str = str_replace(";", "", $str);
|
231 |
+
/* remove unnecessary white spaces */
|
232 |
+
while (true) {
|
233 |
+
$str_temp = $str;
|
234 |
+
$str = str_replace(" ", " ", $str);
|
235 |
+
|
236 |
+
if ($str == $str_temp) {
|
237 |
+
break;
|
238 |
+
}
|
239 |
+
}
|
240 |
+
$str = str_replace(" / ", "/", $str);
|
241 |
+
$str = str_replace(" /", "/", $str);
|
242 |
+
$str = str_replace("/ ", "/", $str);
|
243 |
+
$str = substr($str, 0, 254);
|
244 |
+
$str = rawurlencode($str);
|
245 |
+
}
|
246 |
+
else {
|
247 |
+
$str = utf8_decode($str);
|
248 |
+
$str = html_entity_decode($str);
|
249 |
+
$str = strip_tags($str);
|
250 |
+
$str = utf8_encode($str);
|
251 |
+
$str = addcslashes($str, "\\\"'&<>]");
|
252 |
+
$str = trim($str);
|
253 |
+
}
|
254 |
+
return $str;
|
255 |
+
}
|
256 |
+
|
257 |
+
/* set the 1st party session id */
|
258 |
+
public function setSid($sid = "")
|
259 |
+
{
|
260 |
+
if ($sid) {
|
261 |
+
$this->emsid = $sid;
|
262 |
+
$this->appendPreScript("<a name=\"emos_sid\" title=\"$sid\"></a>\n");
|
263 |
+
}
|
264 |
+
}
|
265 |
+
|
266 |
+
/* set the 1st party visitor id */
|
267 |
+
public function setVid($vid = "")
|
268 |
+
{
|
269 |
+
if ($vid) {
|
270 |
+
$this->emvid = $vid;
|
271 |
+
$this->appendPreScript("<a name=\"emos_vid\" title=\"$vid\"></a>");
|
272 |
+
}
|
273 |
+
}
|
274 |
+
|
275 |
+
/* nothing to do. */
|
276 |
+
public function prettyPrint()
|
277 |
+
{
|
278 |
+
}
|
279 |
+
|
280 |
+
/* Concatenates the current command and the $inScript */
|
281 |
+
public function appendInScript($stringToAppend)
|
282 |
+
{
|
283 |
+
$this->inScript .= $stringToAppend;
|
284 |
+
}
|
285 |
+
|
286 |
+
/* Concatenates the current command and the $proScript */
|
287 |
+
public function appendPreScript($stringToAppend)
|
288 |
+
{
|
289 |
+
$this->preScript .= $stringToAppend;
|
290 |
+
}
|
291 |
+
|
292 |
+
/* Concatenates the current command and the $postScript */
|
293 |
+
public function appendPostScript($stringToAppend)
|
294 |
+
{
|
295 |
+
$this->postScript .= $stringToAppend;
|
296 |
+
}
|
297 |
+
|
298 |
+
/* returns the emos2.js inclusion */
|
299 |
+
public function prepareInScript()
|
300 |
+
{
|
301 |
+
$this->emosBib .= "<script type=\"text/javascript\" src=\"".$this->pathToFile.$this->scriptFileName."\"></script>\n";
|
302 |
+
}
|
303 |
+
|
304 |
+
/* returns a javascript extra inclusion at defined position */
|
305 |
+
public function addScript($script)
|
306 |
+
{
|
307 |
+
$this->emosBib .= "<script type=\"text/javascript\" src=\"".$script."\"></script>\n";
|
308 |
+
}
|
309 |
+
|
310 |
+
/* returns the whole statement */
|
311 |
+
public function toString()
|
312 |
+
{
|
313 |
+
if(!$this->anchorTags){
|
314 |
+
if($this->ecString != ""){
|
315 |
+
$this->ecString = substr($this->ecString,0,-2)."\n";
|
316 |
+
$this->ecString .= " ];\n";
|
317 |
+
}
|
318 |
+
else {
|
319 |
+
$this->ecString = "";
|
320 |
+
}
|
321 |
+
if(!$this->emosFire) {
|
322 |
+
$this->jsEnd = str_replace(" window.emosPropertiesEvent(emospro);\n","",$this->jsEnd);
|
323 |
+
}
|
324 |
+
if($this->rmvCdata) {
|
325 |
+
$this->jsStart = str_replace("\n//<![CDATA[","",$this->jsStart);
|
326 |
+
$this->jsEnd = str_replace("//]]>\n","",$this->jsEnd);
|
327 |
+
$this->emosStopRequest = str_replace("\n//<![CDATA[","",$this->emosStopRequest);
|
328 |
+
$this->emosStopRequest = str_replace("\n//]]>","",$this->emosStopRequest);
|
329 |
+
}
|
330 |
+
}
|
331 |
+
if($this->anchorTags) { //anchor tags
|
332 |
+
if($this->ecString != "") {
|
333 |
+
$this->ecString .= "//]]>\n</script>\n";
|
334 |
+
}
|
335 |
+
if($this->rmvCdata) {
|
336 |
+
$this->preScript = str_replace("\n//<![CDATA[","",$this->preScript);
|
337 |
+
$this->preScript = str_replace("\n//]]>","",$this->preScript);
|
338 |
+
$this->ecString = str_replace("\n//<![CDATA[","",$this->ecString);
|
339 |
+
$this->ecString = str_replace("\n//]]>","",$this->ecString);
|
340 |
+
}
|
341 |
+
if($this->emosDebug > 0) {
|
342 |
+
$this->retString .= $this->debugOut . $this->preScript . $this->postScript . $this->ecString . $this->emosBib . $this->inScript . $this->debugEnd;
|
343 |
+
}
|
344 |
+
if($this->emosDebug == 0 || $this->emosDebug == 2){
|
345 |
+
$this->retString .= $this->preScript . $this->postScript . $this->ecString . $this->emosBib . $this->inScript;
|
346 |
+
}
|
347 |
+
}
|
348 |
+
else {
|
349 |
+
if($this->emosDebug > 0) {
|
350 |
+
$this->retString .= $this->debugOut . $this->emosStopRequest . $this->emosBib . $this->jsStart . $this->preScript . $this->ecString . $this->postScript . $this->jsEnd . $this->inScript . $this->debugEnd;
|
351 |
+
}
|
352 |
+
if($this->emosDebug == 0 || $this->emosDebug == 2){
|
353 |
+
$this->retString .= $this->emosStopRequest . $this->emosBib . $this->jsStart . $this->preScript . $this->ecString . $this->postScript . $this->jsEnd . $this->inScript;
|
354 |
+
}
|
355 |
+
}
|
356 |
+
return $this->retString;
|
357 |
+
}
|
358 |
+
|
359 |
+
/* constructs anchor tags */
|
360 |
+
public function getAnchorTag($title = "", $rel = "", $rev = "")
|
361 |
+
{
|
362 |
+
$rel = $this->emos_DataFormat($rel);
|
363 |
+
$rev = $this->emos_DataFormat($rev);
|
364 |
+
$anchor = "<a name=\"emos_name\" title=\"".$title."\" rel=\"".$rel."\" rev=\"".$rev."\"></a>\n";
|
365 |
+
return $anchor;
|
366 |
+
}
|
367 |
+
|
368 |
+
/* constructs a js property event */
|
369 |
+
public function getProperty($title = "", $rel = "", $rev = "", $brck = false)
|
370 |
+
{
|
371 |
+
if($this->anchorTags) {
|
372 |
+
return $this->getAnchorTag($title, $rel, $rev);
|
373 |
+
}
|
374 |
+
$rel = $this->emos_DataFormat($rel);
|
375 |
+
$rev = $this->emos_DataFormat($rev);
|
376 |
+
$setRev = false;
|
377 |
+
if(trim($rev) != "") {
|
378 |
+
$setRev = true;
|
379 |
+
}
|
380 |
+
$out = " emospro.".$title." = ";
|
381 |
+
if($setRev) {
|
382 |
+
$out .= "[[";
|
383 |
+
}
|
384 |
+
$out .= "'".$rel."'";
|
385 |
+
if($setRev) {
|
386 |
+
if($brck) {
|
387 |
+
$out .= "]]";
|
388 |
+
}
|
389 |
+
else {
|
390 |
+
$out .= ",'".$rev."']]";
|
391 |
+
}
|
392 |
+
}
|
393 |
+
$out .= ";\n";
|
394 |
+
return $out;
|
395 |
+
}
|
396 |
+
|
397 |
+
/* adds a property event for marker tracking
|
398 |
+
* emospro.marker = content
|
399 |
+
*/
|
400 |
+
public function addMarker($content)
|
401 |
+
{
|
402 |
+
$this->appendPreScript($this->getProperty("marker", $content, "", true));
|
403 |
+
}
|
404 |
+
|
405 |
+
/* adds a property event for target tracking
|
406 |
+
* emospro.Target = [[group,name]]
|
407 |
+
*/
|
408 |
+
public function addTarget($group, $name)
|
409 |
+
{
|
410 |
+
$this->appendPreScript($this->getProperty("Target", $group, $name));
|
411 |
+
}
|
412 |
+
|
413 |
+
/* adds a property event for target conversion
|
414 |
+
* emospro.cGoal = 0 or 1
|
415 |
+
*/
|
416 |
+
public function addGoal($goal)
|
417 |
+
{
|
418 |
+
$this->appendPreScript($this->getProperty("cGoal", $goal));
|
419 |
+
}
|
420 |
+
|
421 |
+
/* remove CDATA from script */
|
422 |
+
public function addCdata()
|
423 |
+
{
|
424 |
+
$this->rmvCdata = false;
|
425 |
+
}
|
426 |
+
|
427 |
+
/* set tracking mode
|
428 |
+
* 2 = js properties, everything else = anchor tags
|
429 |
+
*/
|
430 |
+
public function trackMode($mode)
|
431 |
+
{
|
432 |
+
if($mode == 2) {
|
433 |
+
$this->anchorTags = false;
|
434 |
+
}
|
435 |
+
}
|
436 |
+
|
437 |
+
/* send request on site load
|
438 |
+
* true or false
|
439 |
+
*/
|
440 |
+
public function trackOnLoad($send)
|
441 |
+
{
|
442 |
+
$this->emosFire = $send;
|
443 |
+
}
|
444 |
+
|
445 |
+
/* show debug informations inside a container
|
446 |
+
* 1 = debug only, 2 = debug and send request
|
447 |
+
*/
|
448 |
+
public function debugMode($send)
|
449 |
+
{
|
450 |
+
$this->emosDebug = $send;
|
451 |
+
}
|
452 |
+
|
453 |
+
/* adds a property event for content tracking
|
454 |
+
* emospro.content = content
|
455 |
+
*/
|
456 |
+
public function addContent($content)
|
457 |
+
{
|
458 |
+
$this->appendPreScript($this->getProperty("content", $content));
|
459 |
+
}
|
460 |
+
|
461 |
+
/* adds a property event for orderprocess tracking
|
462 |
+
* emospro.orderProcess = processStep
|
463 |
+
*/
|
464 |
+
public function addOrderProcess($processStep)
|
465 |
+
{
|
466 |
+
$this->appendPreScript($this->getProperty("orderProcess", $processStep));
|
467 |
+
}
|
468 |
+
|
469 |
+
/* adds a property event for siteid tracking
|
470 |
+
* emospro.siteid = siteid
|
471 |
+
*/
|
472 |
+
public function addSiteID($siteid)
|
473 |
+
{
|
474 |
+
$this->appendPreScript($this->getProperty("siteid", $siteid));
|
475 |
+
}
|
476 |
+
|
477 |
+
/* adds a property event for language tracking
|
478 |
+
* emospro.langid = langid
|
479 |
+
*/
|
480 |
+
public function addLangID($langid)
|
481 |
+
{
|
482 |
+
$this->appendPreScript($this->getProperty("langid", $langid));
|
483 |
+
}
|
484 |
+
|
485 |
+
/* adds a property event for country tracking
|
486 |
+
* emospro.countryid = countryid
|
487 |
+
*/
|
488 |
+
public function addCountryID($countryid)
|
489 |
+
{
|
490 |
+
$this->appendPreScript($this->getProperty("countryid", $countryid));
|
491 |
+
}
|
492 |
+
|
493 |
+
/* adds a property event for pageid tracking
|
494 |
+
* emospro.pageid = pageID
|
495 |
+
*/
|
496 |
+
public function addPageID($pageID)
|
497 |
+
{
|
498 |
+
if(!$this->anchorTags) {
|
499 |
+
$this->appendPreScript($this->getProperty("pageId", $pageID));
|
500 |
+
}
|
501 |
+
else {
|
502 |
+
$this->appendPreScript("<script type=\"text/javascript\">\n//<![CDATA[\n window.emosPageId = '$pageID';\n//]]>\n</script>\n");
|
503 |
+
}
|
504 |
+
}
|
505 |
+
|
506 |
+
/* adds a property event for search tracking
|
507 |
+
* emospro.search = [[queryString,numberOfHits]]
|
508 |
+
*/
|
509 |
+
public function addSearch($queryString, $numberOfHits)
|
510 |
+
{
|
511 |
+
$this->appendPreScript($this->getProperty("search", $queryString, $numberOfHits));
|
512 |
+
}
|
513 |
+
|
514 |
+
/* adds a property event for registration tracking
|
515 |
+
* The userid gets a md5() to fullfilll german datenschutzgesetz
|
516 |
+
* emospro.register = [[userID,result]] //(result: 0=true,1=false)
|
517 |
+
*/
|
518 |
+
public function addRegister($userID, $result)
|
519 |
+
{
|
520 |
+
$this->appendPreScript($this->getProperty("register", md5($userID), $result));
|
521 |
+
}
|
522 |
+
|
523 |
+
/* adds a property event for login tracking
|
524 |
+
* The userid gets a md5() to fullfilll german datenschutzgesetz
|
525 |
+
* emospro.login = [[userID,result]] //(result: 0=true,1=false)
|
526 |
+
*/
|
527 |
+
public function addLogin($userID, $result)
|
528 |
+
{
|
529 |
+
$this->appendPreScript($this->getProperty("login", md5($userID), $result));
|
530 |
+
}
|
531 |
+
|
532 |
+
/* adds a property event for contact tracking
|
533 |
+
* emospro.scontact = contactType
|
534 |
+
*/
|
535 |
+
public function addContact($contactType)
|
536 |
+
{
|
537 |
+
$this->appendPreScript($this->getProperty("scontact", $contactType));
|
538 |
+
}
|
539 |
+
|
540 |
+
/* adds a property event for download tracking
|
541 |
+
* emospro.download = downloadLabel
|
542 |
+
*/
|
543 |
+
public function addDownload($downloadLabel)
|
544 |
+
{
|
545 |
+
$this->appendPreScript($this->getProperty("download", $downloadLabel));
|
546 |
+
}
|
547 |
+
|
548 |
+
/* constructs a emosECPageArray of given $event type
|
549 |
+
* @param $item a instance of class EMOS_Item
|
550 |
+
* @param $event Type of this event ("add","c_rmv","c_add")
|
551 |
+
*/
|
552 |
+
public function getEmosECPageArray($item, $event)
|
553 |
+
{
|
554 |
+
if(!$this->anchorTags){
|
555 |
+
$item = $this->emos_ItemFormat($item);
|
556 |
+
if($this->ecString == "") {
|
557 |
+
$this->ecString .= " emospro.ec_Event = [\n";
|
558 |
+
}
|
559 |
+
$this->ecString .= " ['".$event."','".$item->productID."','".$item->productName."','".$item->price."','".$item->productGroup."','".$item->quantity."','".$item->variant1."','".$item->variant2."','".$item->variant2."'],\n";
|
560 |
+
}
|
561 |
+
else { //anchor tags
|
562 |
+
$item = $this->emos_ItemFormat($item);
|
563 |
+
if($this->ecCounter == 0) {
|
564 |
+
$this->ecString .= "<script type=\"text/javascript\">\n//<![CDATA[\n";
|
565 |
+
$this->ecString .= " var emosECPageArray = new Array();\n";
|
566 |
+
}
|
567 |
+
$this->ecString .=" emosECPageArray[".$this->ecCounter."] = new Array();\n" .
|
568 |
+
" emosECPageArray[".$this->ecCounter."]['event'] = '".$event."';\n" .
|
569 |
+
" emosECPageArray[".$this->ecCounter."]['id'] = '".$item->productID."';\n" .
|
570 |
+
" emosECPageArray[".$this->ecCounter."]['name'] = '".$item->productName."';\n" .
|
571 |
+
" emosECPageArray[".$this->ecCounter."]['preis'] = '".$item->price."';\n" .
|
572 |
+
" emosECPageArray[".$this->ecCounter."]['group'] = '".$item->productGroup."';\n" .
|
573 |
+
" emosECPageArray[".$this->ecCounter."]['anzahl'] = '".$item->quantity."';\n" .
|
574 |
+
" emosECPageArray[".$this->ecCounter."]['var1'] = '".$item->variant1."';\n" .
|
575 |
+
" emosECPageArray[".$this->ecCounter."]['var2'] = '".$item->variant2."';\n" .
|
576 |
+
" emosECPageArray[".$this->ecCounter."]['var3'] = '".$item->variant3."';\n" ;
|
577 |
+
$this->ecCounter += 1;
|
578 |
+
}
|
579 |
+
}
|
580 |
+
|
581 |
+
/* adds a detailView to the preScript */
|
582 |
+
public function addDetailView($item)
|
583 |
+
{
|
584 |
+
$this->getEmosECPageArray($item, "view");
|
585 |
+
}
|
586 |
+
|
587 |
+
/* adds a removeFromBasket to the preScript */
|
588 |
+
public function removeFromBasket($item)
|
589 |
+
{
|
590 |
+
$this->getEmosECPageArray($item, "c_rmv");
|
591 |
+
}
|
592 |
+
|
593 |
+
/* adds a addToBasket to the preScript */
|
594 |
+
public function addToBasket($item)
|
595 |
+
{
|
596 |
+
$this->getEmosECPageArray($item, "c_add");
|
597 |
+
}
|
598 |
+
|
599 |
+
/* constructs a emosBillingPageArray of given $event type */
|
600 |
+
public function addEmosBillingPageArray($billingID = "", $customerNumber = "", $total = 0, $country = "", $cip = "", $city = "")
|
601 |
+
{
|
602 |
+
$out = $this->getEmosBillingArray($billingID, $customerNumber, $total, $country, $cip, $city, "emosBillingPageArray");
|
603 |
+
$this->appendPreScript($out);
|
604 |
+
}
|
605 |
+
|
606 |
+
/* gets a emosBillingArray for a given ArrayName
|
607 |
+
* md5 the customer id to to fullfilll german datenschutzgesetz
|
608 |
+
*/
|
609 |
+
public function getEmosBillingArray($billingID = "", $customerNumber = "", $total = 0, $country = "", $cip = "", $city = "", $arrayName = "")
|
610 |
+
{
|
611 |
+
$customerNumber = md5($customerNumber);
|
612 |
+
$country = $this->emos_DataFormat($country);
|
613 |
+
$cip = $this->emos_DataFormat($cip);
|
614 |
+
$city = $this->emos_DataFormat($city);
|
615 |
+
|
616 |
+
/* get a / separated location string for later drilldown */
|
617 |
+
$ort = "";
|
618 |
+
if ($country) {
|
619 |
+
$ort .= "$country/";
|
620 |
+
}
|
621 |
+
if ($cip) {
|
622 |
+
$ort .= substr($cip, 0, 1) . "/" . substr($cip, 0, 2) . "/";
|
623 |
+
}
|
624 |
+
if ($city) {
|
625 |
+
$ort .= "$city/";
|
626 |
+
}
|
627 |
+
if ($cip) {
|
628 |
+
$ort .= $cip;
|
629 |
+
}
|
630 |
+
if(!$this->anchorTags){
|
631 |
+
$out = " emospro.billing = [['".$billingID."','".$customerNumber."','".$ort."','".$total."']];\n";
|
632 |
+
}
|
633 |
+
else { //anchor tags
|
634 |
+
$out = "<script type=\"text/javascript\">\n//<![CDATA[\n" .
|
635 |
+
" var ".$arrayName." = new Array();\n" .
|
636 |
+
" ".$arrayName."[0] = '".$billingID."';\n" .
|
637 |
+
" ".$arrayName."[1] = '".$customerNumber."';\n" .
|
638 |
+
" ".$arrayName."[2] = '".$ort."';\n" .
|
639 |
+
" ".$arrayName."[3] = '".$total."';\n" .
|
640 |
+
"//]]>\n</script>\n";
|
641 |
+
}
|
642 |
+
return $out;
|
643 |
+
}
|
644 |
+
|
645 |
+
/* adds a emosBasket Page Array*/
|
646 |
+
public function addEmosBasketPageArray($basket)
|
647 |
+
{
|
648 |
+
if(!$this->anchorTags){
|
649 |
+
$this->getEmosBasketPageArray($basket, "buy");
|
650 |
+
}
|
651 |
+
else {
|
652 |
+
$this->getEmosBasketPageArray($basket, "emosBasketPageArray");
|
653 |
+
}
|
654 |
+
}
|
655 |
+
|
656 |
+
/* returns a emosBasketArray of given Name */
|
657 |
+
public function getEmosBasketPageArray($basket, $event)
|
658 |
+
{
|
659 |
+
if(!$this->anchorTags){
|
660 |
+
if($this->ecString == "") {
|
661 |
+
$this->ecString .= " emospro.ec_Event = [\n";
|
662 |
+
}
|
663 |
+
foreach ($basket as $item) {
|
664 |
+
$item = $this->emos_ItemFormat($item);
|
665 |
+
$this->ecString .= " ['".$event."','".$item->productID."','".$item->productName."','".$item->price."','".$item->productGroup."','".$item->quantity."','".$item->variant1."','".$item->variant2."','".$item->variant2."'],\n";
|
666 |
+
}
|
667 |
+
}
|
668 |
+
else {
|
669 |
+
$out = "<script type=\"text/javascript\">\n//<![CDATA[\n" .
|
670 |
+
" var ".$event." = new Array();\n";
|
671 |
+
$count = 0;
|
672 |
+
foreach ($basket as $item) {
|
673 |
+
$item = $this->emos_ItemFormat($item);
|
674 |
+
$out .= " ".$event."[".$count."]=new Array();\n";
|
675 |
+
$out .= " ".$event."[".$count."][0]='".$item->productID."';\n";
|
676 |
+
$out .= " ".$event."[".$count."][1]='".$item->productName."';\n";
|
677 |
+
$out .= " ".$event."[".$count."][2]='".$item->price."';\n";
|
678 |
+
$out .= " ".$event."[".$count."][3]='".$item->productGroup."';\n";
|
679 |
+
$out .= " ".$event."[".$count."][4]='".$item->quantity."';\n";
|
680 |
+
$out .= " ".$event."[".$count."][5]='".$item->variant1."';\n";
|
681 |
+
$out .= " ".$event."[".$count."][6]='".$item->variant2."';\n";
|
682 |
+
$out .= " ".$event."[".$count."][7]='".$item->variant3."';\n";
|
683 |
+
$count++;
|
684 |
+
}
|
685 |
+
$out .= "//]]>\n</script>\n";
|
686 |
+
$this->appendPreScript($out);
|
687 |
+
}
|
688 |
+
}
|
689 |
+
|
690 |
+
/*
|
691 |
+
* constructs a generic EmosCustomPageArray from a PHP Array
|
692 |
+
*/
|
693 |
+
public function getEmosCustomPageArray($listOfValues)
|
694 |
+
{
|
695 |
+
$out = "";
|
696 |
+
if(!$this->anchorTags){
|
697 |
+
$counter = 0;
|
698 |
+
foreach ($listOfValues as $value) {
|
699 |
+
$value = $this->emos_DataFormat($value);
|
700 |
+
if($counter == 0) {
|
701 |
+
$out .= " emospro.".$value." = [[";
|
702 |
+
}
|
703 |
+
else {
|
704 |
+
$out .= "'".$value."',";
|
705 |
+
}
|
706 |
+
$counter += 1;
|
707 |
+
}
|
708 |
+
$out = substr($out,0,-1);
|
709 |
+
$out .= "]];\n";
|
710 |
+
}
|
711 |
+
else {
|
712 |
+
$out .= "<script type=\"text/javascript\">\n";
|
713 |
+
$out .= " window.emosCustomPageArray = [";
|
714 |
+
foreach ($listOfValues as $value) {
|
715 |
+
$value = $this->emos_DataFormat($value);
|
716 |
+
$out .= "'".$value."',";
|
717 |
+
}
|
718 |
+
$out = substr($out,0,-1);
|
719 |
+
$out .= "];\n";
|
720 |
+
$out .= "</script>\n";
|
721 |
+
}
|
722 |
+
$this->appendPreScript($out);
|
723 |
+
}
|
724 |
+
|
725 |
+
/* constructs a emosCustomPageArray with 8 Variables and shortcut
|
726 |
+
* @param $cType Type of this event - shortcut in config
|
727 |
+
* @param $cVar1 first variable of this custom event (optional)
|
728 |
+
* @param $cVar2 second variable of this custom event (optional)
|
729 |
+
* @param $cVar3 third variable of this custom event (optional)
|
730 |
+
* @param $cVar4 fourth variable of this custom event (optional)
|
731 |
+
* @param $cVar5 fifth variable of this custom event (optional)
|
732 |
+
* @param $cVar6 sixth variable of this custom event (optional)
|
733 |
+
* @param $cVar7 seventh variable of this custom event (optional)
|
734 |
+
* @param $cVar8 eighth variable of this custom event (optional)
|
735 |
+
* @param $cVar9 nineth variable of this custom event (optional)
|
736 |
+
* @param $cVar10 tenth variable of this custom event (optional)
|
737 |
+
* @param $cVar11 eleventh variable of this custom event (optional)
|
738 |
+
* @param $cVar12 twelveth variable of this custom event (optional)
|
739 |
+
* @param $cVar13 thirteenth variable of this custom event (optional)
|
740 |
+
*/
|
741 |
+
public function addEmosCustomPageArray($cType=0, $cVar1=0, $cVar2=0, $cVar3=0, $cVar4=0, $cVar5=0, $cVar6=0, $cVar7=0, $cVar8=0, $cVar9=0, $cVar10=0, $cVar11=0, $cVar12=0, $cVar13=0)
|
742 |
+
{
|
743 |
+
$values[0] = $cType;
|
744 |
+
if($cVar1) $values[1] = $cVar1;
|
745 |
+
if($cVar2) $values[2] = $cVar2;
|
746 |
+
if($cVar3) $values[3] = $cVar3;
|
747 |
+
if($cVar4) $values[4] = $cVar4;
|
748 |
+
if($cVar5) $values[5] = $cVar5;
|
749 |
+
if($cVar6) $values[6] = $cVar6;
|
750 |
+
if($cVar7) $values[7] = $cVar7;
|
751 |
+
if($cVar8) $values[8] = $cVar8;
|
752 |
+
if($cVar9) $values[9] = $cVar9;
|
753 |
+
if($cVar10) $values[10] = $cVar10;
|
754 |
+
if($cVar11) $values[11] = $cVar11;
|
755 |
+
if($cVar12) $values[12] = $cVar12;
|
756 |
+
if($cVar13) $values[13] = $cVar13;
|
757 |
+
$this->getEmosCustomPageArray($values);
|
758 |
+
}
|
759 |
+
}
|
app/code/local/Mage/Econda/Block/emos.php
DELETED
@@ -1,796 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*******************************************************************************
|
3 |
-
* EMOS PHP Bib 2
|
4 |
-
* $Id: emos.php,v 1.15 2009/11/17 13:24:00 egaiser Exp $
|
5 |
-
********************************************************************************
|
6 |
-
|
7 |
-
Copyright (c) 2004 - 2009 ECONDA GmbH Karlsruhe
|
8 |
-
All rights reserved.
|
9 |
-
|
10 |
-
ECONDA GmbH
|
11 |
-
Eisenlohrstr. 43
|
12 |
-
76135 Karlsruhe
|
13 |
-
Tel.: 0721/663035-0
|
14 |
-
Fax.: 0721 663035-10
|
15 |
-
info@econda.de
|
16 |
-
www.econda.de
|
17 |
-
|
18 |
-
Redistribution and use in source and binary forms, with or without modification,
|
19 |
-
are permitted provided that the following conditions are met:
|
20 |
-
|
21 |
-
* Redistributions of source code must retain the above copyright notice,
|
22 |
-
this list of conditions and the following disclaimer.
|
23 |
-
* Redistributions in binary form must reproduce the above copyright notice,
|
24 |
-
this list of conditions and the following disclaimer in the documentation
|
25 |
-
and/or other materials provided with the distribution.
|
26 |
-
* Neither the name of the ECONDA GmbH nor the names of its contributors may
|
27 |
-
be used to endorse or promote products derived from this software without
|
28 |
-
specific prior written permission.
|
29 |
-
|
30 |
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
31 |
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
32 |
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
33 |
-
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
34 |
-
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
35 |
-
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
36 |
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
37 |
-
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
38 |
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
39 |
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
40 |
-
|
41 |
-
Changes:
|
42 |
-
|
43 |
-
$Log: emos.php,v $
|
44 |
-
Revision 1.15 2009/11/17 13:24:00 egaiser
|
45 |
-
update to handle anchor tags and properties array
|
46 |
-
added function trackMode to switch between anchor tags and properties array
|
47 |
-
added function debugMode to show debug information
|
48 |
-
added function rmvCdata to remove CDATA tag for properties array
|
49 |
-
added function addMarker
|
50 |
-
added function addTarget
|
51 |
-
added function addGoal to set target conversion
|
52 |
-
added function trackOnLoad to set automatic request on site load
|
53 |
-
added function addScript for additional external Javascript integration
|
54 |
-
several changes in structural output and string encoding
|
55 |
-
|
56 |
-
Revision 1.14 2009/02/19 09:52:56 unaegele
|
57 |
-
if function not exists fix (Removed in Revision 1.15)
|
58 |
-
|
59 |
-
Revision 1.13 2007/08/17 08:40:33 unaegele
|
60 |
-
added function addEMOSCustomPageArray
|
61 |
-
added function getEMOSCustomPageArray
|
62 |
-
|
63 |
-
Revision 1.12 2007/05/16 08:24:09 unaegele
|
64 |
-
fix wrong reference to htmlspecialchars_decodephp4()
|
65 |
-
|
66 |
-
Revision 1.11 2007/05/11 07:52:42 unaegele
|
67 |
-
Update ECONDA Tel Number, prepare Release 20070510
|
68 |
-
|
69 |
-
Revision 1.10 2007/05/11 07:45:53 unaegele
|
70 |
-
added \n to addSid
|
71 |
-
|
72 |
-
Revision 1.9 2007/05/10 12:19:04 unaegele
|
73 |
-
Fix php 4 compatibility for the call to htmlspecialchars_decode()
|
74 |
-
Replace traslated =chr(0xa0) with real spaces
|
75 |
-
|
76 |
-
Revision 1.8 2007/05/04 10:17:31 unaegele
|
77 |
-
several bugfixes
|
78 |
-
|
79 |
-
Revision 1.7 2007/05/04 09:59:01 unaegele
|
80 |
-
source code formating
|
81 |
-
|
82 |
-
Revision 1.6 2007/05/04 09:55:12 unaegele
|
83 |
-
*** empty log message ***
|
84 |
-
|
85 |
-
Revision 1.5 2007/05/04 09:49:08 unaegele
|
86 |
-
*** empty log message ***
|
87 |
-
|
88 |
-
Revision 1.4 2007/05/04 09:43:48 unaegele
|
89 |
-
Added methods addSiteID($siteid), addLangID($langid), addPageID($pageID), addCountryID($countryid)
|
90 |
-
|
91 |
-
Revision 1.2 added URL Encoding, Dataformat
|
92 |
-
|
93 |
-
Revision 1.1 added 1st party session tracking
|
94 |
-
|
95 |
-
*/
|
96 |
-
|
97 |
-
/* PHP Helper Class to construct a ECONDA Monitor statement for the later
|
98 |
-
* inclusion in a HTML/PHP Page.
|
99 |
-
*/
|
100 |
-
class EMOS {
|
101 |
-
|
102 |
-
/* Here we store the predefined parameter list */
|
103 |
-
var $preScript = "";
|
104 |
-
|
105 |
-
/* Here we store the additional script-files */
|
106 |
-
var $inScript = "";
|
107 |
-
|
108 |
-
/* Here we store additional parameters */
|
109 |
-
var $postScript = "";
|
110 |
-
|
111 |
-
/* path to the emos2.js script-file */
|
112 |
-
var $pathToFile = "";
|
113 |
-
|
114 |
-
/* Name of the script-file */
|
115 |
-
var $scriptFileName = "emos2.js";
|
116 |
-
|
117 |
-
/* session id for 1st party sessions*/
|
118 |
-
var $emsid = "";
|
119 |
-
|
120 |
-
/* visitor id for 1st partyx visitors */
|
121 |
-
var $emvid = "";
|
122 |
-
|
123 |
-
/* start js and init properties */
|
124 |
-
var $jsStart = "<script type=\"text/javascript\">\n//<![CDATA[\n var emospro = {};\n";
|
125 |
-
|
126 |
-
/* end js and fire properties */
|
127 |
-
var $jsEnd = " window.emosPropertiesEvent(emospro);\n//]]>\n</script>\n";
|
128 |
-
|
129 |
-
/* emos2 inclusion */
|
130 |
-
var $emosBib = "";
|
131 |
-
|
132 |
-
/* ec_event */
|
133 |
-
var $ecString = "";
|
134 |
-
|
135 |
-
/* remove cdata */
|
136 |
-
var $rmvCdata = true;
|
137 |
-
|
138 |
-
/* old style anchor tags*/
|
139 |
-
var $anchorTags = true;
|
140 |
-
|
141 |
-
/* count basket items */
|
142 |
-
var $ecCounter = 0;
|
143 |
-
|
144 |
-
/* send request on site load */
|
145 |
-
var $emosFire = true;
|
146 |
-
|
147 |
-
/* main out */
|
148 |
-
var $retString = "";
|
149 |
-
|
150 |
-
/* script to stopp request on site load */
|
151 |
-
var $emosStopRequest = "<script type=\"text/javascript\">\n//<![CDATA[\n window.emosTrackVersion = 2;\n//]]>\n</script>\n";
|
152 |
-
|
153 |
-
/* Debug Mode */
|
154 |
-
var $emosDebug = 0;
|
155 |
-
|
156 |
-
/* CSS Style and Div for Debug */
|
157 |
-
var $debugOut = "\n<script type=\"text/javascript\">\n function hideEcondaDebug(){\n document.getElementById(\"econdaDebugTxt\").style.visibility = \"hidden\";\n document.getElementById(\"econdaDebugStat\").style.visibility = \"hidden\";\n document.getElementById(\"econdaDebug\").style.width = \"35px\";\n document.getElementById(\"econdaDebug\").style.height = \"15px\";\n document.getElementById(\"econdaDebugShow\").style.visibility = \"visible\";\n }\n function showEcondaDebug(){\n document.getElementById(\"econdaDebugTxt\").style.visibility = \"visible\";\n document.getElementById(\"econdaDebugStat\").style.visibility = \"visible\";\n document.getElementById(\"econdaDebug\").style.width = \"auto\";\n document.getElementById(\"econdaDebug\").style.height = \"auto\";\n document.getElementById(\"econdaDebugShow\").style.visibility = \"hidden\";\n }\n function econdaDebug(dbtxt){\n document.getElementById(\"econdaDebugTxt\").innerHTML = dbtxt;\n }\n</script>\n<div name=\"econdaDebug\" id=\"econdaDebug\" style=\"position:absolute; visibility: visible; font-family: sans-serif; font-size: 12px; color: #FFFFFF; background-color: #0088B2; left: 0px; top: 0px; width: auto; height: auto; padding: 3px; z-index: 1000;\">\n<textarea style=\"min-width: 760px; font-family: sans-serif; font-size: 13px; background-color: #FFFFFF;\" name=\"econdaDebugTxt\" id=\"econdaDebugTxt\" wrap=\"off\" cols=\"120\" rows=\"22\">\n";
|
158 |
-
var $debugEnd = "</textarea>\n<div name=\"econdaDebugStat\" id=\"econdaDebugStat\" style=\"cursor: pointer; padding: 1px;\" align=\"right\" onClick=\"javascript:hideEcondaDebug();\">[econda debug mode] HIDE</div>\n<div name=\"econdaDebugShow\" id=\"econdaDebugShow\" style=\"position: absolute; visibility: hidden; top: 0px; left: 0px; cursor: pointer; z-index: 1001;\" onClick=\"javascript:showEcondaDebug();\">SHOW</div>\n</div>\n\n";
|
159 |
-
|
160 |
-
/*
|
161 |
-
* add compatibility function for php < 5.1
|
162 |
-
*/
|
163 |
-
function htmlspecialchars_decode_php4($str) {
|
164 |
-
return strtr($str, array_flip(get_html_translation_table(HTML_SPECIALCHARS)));
|
165 |
-
}
|
166 |
-
|
167 |
-
/* Constructor
|
168 |
-
* Sets the path to the emos2.js js-bib and prepares the later calls
|
169 |
-
*
|
170 |
-
* @param $pathToFile The path to the js-bib (/js)
|
171 |
-
* @param $scriptFileName If we want to have annother Filename than
|
172 |
-
* emos2.js you can set it here
|
173 |
-
*/
|
174 |
-
function EMOS($pathToFile , $scriptFileName = "emos2.js") {
|
175 |
-
$this->pathToFile = $pathToFile;
|
176 |
-
if(substr($this->pathToFile,-8) == 'emos2.js') {
|
177 |
-
$this->pathToFile = substr($this->pathToFile,0,strlen($this->pathToFile)-8);
|
178 |
-
}
|
179 |
-
if(substr($this->pathToFile,-1) != '/') {
|
180 |
-
$this->pathToFile .= '/';
|
181 |
-
}
|
182 |
-
$this->scriptFileName = $scriptFileName;
|
183 |
-
if($this->scriptFileName == '' || $this->scriptFileName == null) {
|
184 |
-
$this->scriptFileName = 'emos2.js';
|
185 |
-
}
|
186 |
-
$this->prepareInScript();
|
187 |
-
}
|
188 |
-
|
189 |
-
/* formats data/values/params by eliminating named entities and xml-entities */
|
190 |
-
function emos_ItemFormat($item) {
|
191 |
-
$item->productID = $this->emos_DataFormat($item->productID);
|
192 |
-
$item->productName = $this->emos_DataFormat($item->productName);
|
193 |
-
$item->productGroup = $this->emos_DataFormat($item->productGroup);
|
194 |
-
$item->variant1 = $this->emos_DataFormat($item->variant1);
|
195 |
-
$item->variant2 = $this->emos_DataFormat($item->variant2);
|
196 |
-
$item->variant3 = $this->emos_DataFormat($item->variant3);
|
197 |
-
return $item;
|
198 |
-
}
|
199 |
-
|
200 |
-
/* formats data/values/params by eliminating named entities and xml-entities */
|
201 |
-
function emos_DataFormat($str) {
|
202 |
-
if($this->anchorTags) {
|
203 |
-
$str = urldecode($str);
|
204 |
-
//2007-05-10 Fix incompatibility with php4
|
205 |
-
if (function_exists('htmlspecialchars_decode')) {
|
206 |
-
$str = htmlspecialchars_decode($str, ENT_QUOTES);
|
207 |
-
} else {
|
208 |
-
$str = $this->htmlspecialchars_decode_php4($str);
|
209 |
-
}
|
210 |
-
$str = html_entity_decode($str);
|
211 |
-
$str = strip_tags($str);
|
212 |
-
$str = trim($str);
|
213 |
-
|
214 |
-
//2007-05-10 replace translated with spaces
|
215 |
-
$nbsp = chr(0xa0);
|
216 |
-
$str = str_replace($nbsp, " ", $str);
|
217 |
-
$str = str_replace("\"", "", $str);
|
218 |
-
$str = str_replace("'", "", $str);
|
219 |
-
$str = str_replace("%", "", $str);
|
220 |
-
$str = str_replace(",", "", $str);
|
221 |
-
$str = str_replace(";", "", $str);
|
222 |
-
/* remove unnecessary white spaces */
|
223 |
-
while (true) {
|
224 |
-
$str_temp = $str;
|
225 |
-
$str = str_replace(" ", " ", $str);
|
226 |
-
|
227 |
-
if ($str == $str_temp) {
|
228 |
-
break;
|
229 |
-
}
|
230 |
-
}
|
231 |
-
$str = str_replace(" / ", "/", $str);
|
232 |
-
$str = str_replace(" /", "/", $str);
|
233 |
-
$str = str_replace("/ ", "/", $str);
|
234 |
-
$str = substr($str, 0, 254);
|
235 |
-
$str = rawurlencode($str);
|
236 |
-
}
|
237 |
-
else {
|
238 |
-
$str = utf8_decode($str);
|
239 |
-
$str = html_entity_decode($str);
|
240 |
-
$str = strip_tags($str);
|
241 |
-
$str = utf8_encode($str);
|
242 |
-
$str = addcslashes($str, "\\\"'&<>]");
|
243 |
-
$str = trim($str);
|
244 |
-
}
|
245 |
-
return $str;
|
246 |
-
}
|
247 |
-
|
248 |
-
/* set the 1st party session id */
|
249 |
-
function setSid($sid = "") {
|
250 |
-
if ($sid) {
|
251 |
-
$this->emsid = $sid;
|
252 |
-
$this->appendPreScript("<a name=\"emos_sid\" title=\"$sid\"></a>\n");
|
253 |
-
}
|
254 |
-
}
|
255 |
-
|
256 |
-
/* set the 1st party visitor id */
|
257 |
-
function setVid($vid = "") {
|
258 |
-
if ($vid) {
|
259 |
-
$this->emvid = $vid;
|
260 |
-
$this->appendPreScript("<a name=\"emos_vid\" title=\"$vid\"></a>");
|
261 |
-
}
|
262 |
-
}
|
263 |
-
|
264 |
-
/* nothing to do. */
|
265 |
-
function prettyPrint() {
|
266 |
-
}
|
267 |
-
|
268 |
-
/* Concatenates the current command and the $inScript */
|
269 |
-
function appendInScript($stringToAppend) {
|
270 |
-
$this->inScript .= $stringToAppend;
|
271 |
-
}
|
272 |
-
|
273 |
-
/* Concatenates the current command and the $proScript */
|
274 |
-
function appendPreScript($stringToAppend) {
|
275 |
-
$this->preScript .= $stringToAppend;
|
276 |
-
}
|
277 |
-
|
278 |
-
/* Concatenates the current command and the $postScript */
|
279 |
-
function appendPostScript($stringToAppend) {
|
280 |
-
$this->postScript .= $stringToAppend;
|
281 |
-
}
|
282 |
-
|
283 |
-
/* returns the emos2.js inclusion */
|
284 |
-
function prepareInScript() {
|
285 |
-
$this->emosBib .= "<script type=\"text/javascript\" src=\"".$this->pathToFile.$this->scriptFileName."\"></script>\n";
|
286 |
-
}
|
287 |
-
|
288 |
-
/* returns a javascript extra inclusion at defined position */
|
289 |
-
function addScript($script) {
|
290 |
-
$this->emosBib .= "<script type=\"text/javascript\" src=\"".$script."\"></script>\n";
|
291 |
-
}
|
292 |
-
|
293 |
-
/* returns the whole statement */
|
294 |
-
function toString() {
|
295 |
-
if(!$this->anchorTags){
|
296 |
-
if($this->ecString != ""){
|
297 |
-
$this->ecString = substr($this->ecString,0,-2)."\n";
|
298 |
-
$this->ecString .= " ];\n";
|
299 |
-
}
|
300 |
-
else {
|
301 |
-
$this->ecString = "";
|
302 |
-
}
|
303 |
-
if(!$this->emosFire) {
|
304 |
-
$this->jsEnd = str_replace(" window.emosPropertiesEvent(emospro);\n","",$this->jsEnd);
|
305 |
-
}
|
306 |
-
if($this->rmvCdata) {
|
307 |
-
$this->jsStart = str_replace("\n//<![CDATA[","",$this->jsStart);
|
308 |
-
$this->jsEnd = str_replace("//]]>\n","",$this->jsEnd);
|
309 |
-
$this->emosStopRequest = str_replace("\n//<![CDATA[","",$this->emosStopRequest);
|
310 |
-
$this->emosStopRequest = str_replace("\n//]]>","",$this->emosStopRequest);
|
311 |
-
}
|
312 |
-
}
|
313 |
-
if($this->anchorTags) { //anchor tags
|
314 |
-
if($this->ecString != "") {
|
315 |
-
$this->ecString .= "//]]>\n</script>\n";
|
316 |
-
}
|
317 |
-
if($this->rmvCdata) {
|
318 |
-
$this->preScript = str_replace("\n//<![CDATA[","",$this->preScript);
|
319 |
-
$this->preScript = str_replace("\n//]]>","",$this->preScript);
|
320 |
-
$this->ecString = str_replace("\n//<![CDATA[","",$this->ecString);
|
321 |
-
$this->ecString = str_replace("\n//]]>","",$this->ecString);
|
322 |
-
}
|
323 |
-
if($this->emosDebug > 0) {
|
324 |
-
$this->retString .= $this->debugOut . $this->preScript . $this->postScript . $this->ecString . $this->emosBib . $this->inScript . $this->debugEnd;
|
325 |
-
}
|
326 |
-
if($this->emosDebug == 0 || $this->emosDebug == 2){
|
327 |
-
$this->retString .= $this->preScript . $this->postScript . $this->ecString . $this->emosBib . $this->inScript;
|
328 |
-
}
|
329 |
-
}
|
330 |
-
else {
|
331 |
-
if($this->emosDebug > 0) {
|
332 |
-
$this->retString .= $this->debugOut . $this->emosStopRequest . $this->emosBib . $this->jsStart . $this->preScript . $this->ecString . $this->postScript . $this->jsEnd . $this->inScript . $this->debugEnd;
|
333 |
-
}
|
334 |
-
if($this->emosDebug == 0 || $this->emosDebug == 2){
|
335 |
-
$this->retString .= $this->emosStopRequest . $this->emosBib . $this->jsStart . $this->preScript . $this->ecString . $this->postScript . $this->jsEnd . $this->inScript;
|
336 |
-
}
|
337 |
-
}
|
338 |
-
return $this->retString;
|
339 |
-
}
|
340 |
-
|
341 |
-
/* constructs anchor tags */
|
342 |
-
function getAnchorTag($title = "", $rel = "", $rev = "") {
|
343 |
-
$rel = $this->emos_DataFormat($rel);
|
344 |
-
$rev = $this->emos_DataFormat($rev);
|
345 |
-
$anchor = "<a name=\"emos_name\" title=\"".$title."\" rel=\"".$rel."\" rev=\"".$rev."\"></a>\n";
|
346 |
-
return $anchor;
|
347 |
-
}
|
348 |
-
|
349 |
-
/* constructs a js property event */
|
350 |
-
function getProperty($title = "", $rel = "", $rev = "", $brck = false) {
|
351 |
-
if($this->anchorTags) {
|
352 |
-
return $this->getAnchorTag($title, $rel, $rev);
|
353 |
-
}
|
354 |
-
$rel = $this->emos_DataFormat($rel);
|
355 |
-
$rev = $this->emos_DataFormat($rev);
|
356 |
-
$setRev = false;
|
357 |
-
if(trim($rev) != "") {
|
358 |
-
$setRev = true;
|
359 |
-
}
|
360 |
-
$out = " emospro.".$title." = ";
|
361 |
-
if($setRev) {
|
362 |
-
$out .= "[[";
|
363 |
-
}
|
364 |
-
$out .= "'".$rel."'";
|
365 |
-
if($setRev) {
|
366 |
-
if($brck) {
|
367 |
-
$out .= "]]";
|
368 |
-
}
|
369 |
-
else {
|
370 |
-
$out .= ",'".$rev."']]";
|
371 |
-
}
|
372 |
-
}
|
373 |
-
$out .= ";\n";
|
374 |
-
return $out;
|
375 |
-
}
|
376 |
-
|
377 |
-
/* adds a property event for marker tracking
|
378 |
-
* emospro.marker = content
|
379 |
-
*/
|
380 |
-
function addMarker($content) {
|
381 |
-
$this->appendPreScript($this->getProperty("marker", $content, "", true));
|
382 |
-
}
|
383 |
-
|
384 |
-
/* adds a property event for target tracking
|
385 |
-
* emospro.Target = [[group,name]]
|
386 |
-
*/
|
387 |
-
function addTarget($group, $name) {
|
388 |
-
$this->appendPreScript($this->getProperty("Target", $group, $name));
|
389 |
-
}
|
390 |
-
|
391 |
-
/* adds a property event for target conversion
|
392 |
-
* emospro.cGoal = 0 or 1
|
393 |
-
*/
|
394 |
-
function addGoal($goal) {
|
395 |
-
$this->appendPreScript($this->getProperty("cGoal", $goal));
|
396 |
-
}
|
397 |
-
|
398 |
-
/* remove CDATA from script */
|
399 |
-
function addCdata() {
|
400 |
-
$this->rmvCdata = false;
|
401 |
-
}
|
402 |
-
|
403 |
-
/* set tracking mode
|
404 |
-
* 2 = js properties, everything else = anchor tags
|
405 |
-
*/
|
406 |
-
function trackMode($mode) {
|
407 |
-
if($mode == 2) {
|
408 |
-
$this->anchorTags = false;
|
409 |
-
}
|
410 |
-
}
|
411 |
-
|
412 |
-
/* send request on site load
|
413 |
-
* true or false
|
414 |
-
*/
|
415 |
-
function trackOnLoad($send) {
|
416 |
-
$this->emosFire = $send;
|
417 |
-
}
|
418 |
-
|
419 |
-
/* show debug informations inside a container
|
420 |
-
* 1 = debug only, 2 = debug and send request
|
421 |
-
*/
|
422 |
-
function debugMode($send) {
|
423 |
-
$this->emosDebug = $send;
|
424 |
-
}
|
425 |
-
|
426 |
-
/* adds a property event for content tracking
|
427 |
-
* emospro.content = content
|
428 |
-
*/
|
429 |
-
function addContent($content) {
|
430 |
-
$this->appendPreScript($this->getProperty("content", $content));
|
431 |
-
}
|
432 |
-
|
433 |
-
/* adds a property event for orderprocess tracking
|
434 |
-
* emospro.orderProcess = processStep
|
435 |
-
*/
|
436 |
-
function addOrderProcess($processStep) {
|
437 |
-
$this->appendPreScript($this->getProperty("orderProcess", $processStep));
|
438 |
-
}
|
439 |
-
|
440 |
-
/* adds a property event for siteid tracking
|
441 |
-
* emospro.siteid = siteid
|
442 |
-
*/
|
443 |
-
function addSiteID($siteid) {
|
444 |
-
$this->appendPreScript($this->getProperty("siteid", $siteid));
|
445 |
-
}
|
446 |
-
|
447 |
-
/* adds a property event for language tracking
|
448 |
-
* emospro.langid = langid
|
449 |
-
*/
|
450 |
-
function addLangID($langid) {
|
451 |
-
$this->appendPreScript($this->getProperty("langid", $langid));
|
452 |
-
}
|
453 |
-
|
454 |
-
/* adds a property event for country tracking
|
455 |
-
* emospro.countryid = countryid
|
456 |
-
*/
|
457 |
-
function addCountryID($countryid) {
|
458 |
-
$this->appendPreScript($this->getProperty("countryid", $countryid));
|
459 |
-
}
|
460 |
-
|
461 |
-
/* adds a property event for pageid tracking
|
462 |
-
* emospro.pageid = pageID
|
463 |
-
*/
|
464 |
-
function addPageID($pageID) {
|
465 |
-
if(!$this->anchorTags) {
|
466 |
-
$this->appendPreScript($this->getProperty("pageId", $pageID));
|
467 |
-
}
|
468 |
-
else {
|
469 |
-
$this->appendPreScript("<script type=\"text/javascript\">\n//<![CDATA[\n window.emosPageId = '$pageID';\n//]]>\n</script>\n");
|
470 |
-
}
|
471 |
-
}
|
472 |
-
|
473 |
-
/* adds a property event for search tracking
|
474 |
-
* emospro.search = [[queryString,numberOfHits]]
|
475 |
-
*/
|
476 |
-
function addSearch($queryString, $numberOfHits) {
|
477 |
-
$this->appendPreScript($this->getProperty("search", $queryString, $numberOfHits));
|
478 |
-
}
|
479 |
-
|
480 |
-
/* adds a property event for registration tracking
|
481 |
-
* The userid gets a md5() to fullfilll german datenschutzgesetz
|
482 |
-
* emospro.register = [[userID,result]] //(result: 0=true,1=false)
|
483 |
-
*/
|
484 |
-
function addRegister($userID, $result) {
|
485 |
-
$this->appendPreScript($this->getProperty("register", md5($userID), $result));
|
486 |
-
}
|
487 |
-
|
488 |
-
/* adds a property event for login tracking
|
489 |
-
* The userid gets a md5() to fullfilll german datenschutzgesetz
|
490 |
-
* emospro.login = [[userID,result]] //(result: 0=true,1=false)
|
491 |
-
*/
|
492 |
-
function addLogin($userID, $result) {
|
493 |
-
$this->appendPreScript($this->getProperty("login", md5($userID), $result));
|
494 |
-
}
|
495 |
-
|
496 |
-
/* adds a property event for contact tracking
|
497 |
-
* emospro.scontact = contactType
|
498 |
-
*/
|
499 |
-
function addContact($contactType) {
|
500 |
-
$this->appendPreScript($this->getProperty("scontact", $contactType));
|
501 |
-
}
|
502 |
-
|
503 |
-
/* adds a property event for download tracking
|
504 |
-
* emospro.download = downloadLabel
|
505 |
-
*/
|
506 |
-
function addDownload($downloadLabel) {
|
507 |
-
$this->appendPreScript($this->getProperty("download", $downloadLabel));
|
508 |
-
}
|
509 |
-
|
510 |
-
/* constructs a emosECPageArray of given $event type
|
511 |
-
* @param $item a instance of class EMOS_Item
|
512 |
-
* @param $event Type of this event ("add","c_rmv","c_add")
|
513 |
-
*/
|
514 |
-
function getEmosECPageArray($item, $event) {
|
515 |
-
if(!$this->anchorTags){
|
516 |
-
$item = $this->emos_ItemFormat($item);
|
517 |
-
if($this->ecString == "") {
|
518 |
-
$this->ecString .= " emospro.ec_Event = [\n";
|
519 |
-
}
|
520 |
-
$this->ecString .= " ['".$event."','".$item->productID."','".$item->productName."','".$item->price."','".$item->productGroup."','".$item->quantity."','".$item->variant1."','".$item->variant2."','".$item->variant2."'],\n";
|
521 |
-
}
|
522 |
-
else { //anchor tags
|
523 |
-
$item = $this->emos_ItemFormat($item);
|
524 |
-
if($this->ecCounter == 0) {
|
525 |
-
$this->ecString .= "<script type=\"text/javascript\">\n//<![CDATA[\n";
|
526 |
-
$this->ecString .= " var emosECPageArray = new Array();\n";
|
527 |
-
}
|
528 |
-
$this->ecString .=" emosECPageArray[".$this->ecCounter."] = new Array();\n" .
|
529 |
-
" emosECPageArray[".$this->ecCounter."]['event'] = '".$event."';\n" .
|
530 |
-
" emosECPageArray[".$this->ecCounter."]['id'] = '".$item->productID."';\n" .
|
531 |
-
" emosECPageArray[".$this->ecCounter."]['name'] = '".$item->productName."';\n" .
|
532 |
-
" emosECPageArray[".$this->ecCounter."]['preis'] = '".$item->price."';\n" .
|
533 |
-
" emosECPageArray[".$this->ecCounter."]['group'] = '".$item->productGroup."';\n" .
|
534 |
-
" emosECPageArray[".$this->ecCounter."]['anzahl'] = '".$item->quantity."';\n" .
|
535 |
-
" emosECPageArray[".$this->ecCounter."]['var1'] = '".$item->variant1."';\n" .
|
536 |
-
" emosECPageArray[".$this->ecCounter."]['var2'] = '".$item->variant2."';\n" .
|
537 |
-
" emosECPageArray[".$this->ecCounter."]['var3'] = '".$item->variant3."';\n" ;
|
538 |
-
$this->ecCounter += 1;
|
539 |
-
}
|
540 |
-
}
|
541 |
-
|
542 |
-
/* adds a detailView to the preScript */
|
543 |
-
function addDetailView($item) {
|
544 |
-
$this->getEmosECPageArray($item, "view");
|
545 |
-
}
|
546 |
-
|
547 |
-
/* adds a removeFromBasket to the preScript */
|
548 |
-
function removeFromBasket($item) {
|
549 |
-
$this->getEmosECPageArray($item, "c_rmv");
|
550 |
-
}
|
551 |
-
|
552 |
-
/* adds a addToBasket to the preScript */
|
553 |
-
function addToBasket($item) {
|
554 |
-
$this->getEmosECPageArray($item, "c_add");
|
555 |
-
}
|
556 |
-
|
557 |
-
/* constructs a emosBillingPageArray of given $event type */
|
558 |
-
function addEmosBillingPageArray($billingID = "", $customerNumber = "", $total = 0, $country = "", $cip = "", $city = "") {
|
559 |
-
$out = $this->getEmosBillingArray($billingID, $customerNumber, $total, $country, $cip, $city, "emosBillingPageArray");
|
560 |
-
$this->appendPreScript($out);
|
561 |
-
}
|
562 |
-
|
563 |
-
/* gets a emosBillingArray for a given ArrayName
|
564 |
-
* md5 the customer id to to fullfilll german datenschutzgesetz
|
565 |
-
*/
|
566 |
-
function getEmosBillingArray($billingID = "", $customerNumber = "", $total = 0, $country = "", $cip = "", $city = "", $arrayName = "") {
|
567 |
-
$customerNumber = md5($customerNumber);
|
568 |
-
$country = $this->emos_DataFormat($country);
|
569 |
-
$cip = $this->emos_DataFormat($cip);
|
570 |
-
$city = $this->emos_DataFormat($city);
|
571 |
-
|
572 |
-
/* get a / separated location string for later drilldown */
|
573 |
-
$ort = "";
|
574 |
-
if ($country) {
|
575 |
-
$ort .= "$country/";
|
576 |
-
}
|
577 |
-
if ($cip) {
|
578 |
-
$ort .= substr($cip, 0, 1) . "/" . substr($cip, 0, 2) . "/";
|
579 |
-
}
|
580 |
-
if ($city) {
|
581 |
-
$ort .= "$city/";
|
582 |
-
}
|
583 |
-
if ($cip) {
|
584 |
-
$ort .= $cip;
|
585 |
-
}
|
586 |
-
if(!$this->anchorTags){
|
587 |
-
$out = " emospro.billing = [['".$billingID."','".$customerNumber."','".$ort."','".$total."']];\n";
|
588 |
-
}
|
589 |
-
else { //anchor tags
|
590 |
-
$out = "<script type=\"text/javascript\">\n//<![CDATA[\n" .
|
591 |
-
" var ".$arrayName." = new Array();\n" .
|
592 |
-
" ".$arrayName."[0] = '".$billingID."';\n" .
|
593 |
-
" ".$arrayName."[1] = '".$customerNumber."';\n" .
|
594 |
-
" ".$arrayName."[2] = '".$ort."';\n" .
|
595 |
-
" ".$arrayName."[3] = '".$total."';\n" .
|
596 |
-
"//]]>\n</script>\n";
|
597 |
-
}
|
598 |
-
return $out;
|
599 |
-
}
|
600 |
-
|
601 |
-
/* adds a emosBasket Page Array*/
|
602 |
-
function addEmosBasketPageArray($basket) {
|
603 |
-
if(!$this->anchorTags){
|
604 |
-
$this->getEmosBasketPageArray($basket, "buy");
|
605 |
-
}
|
606 |
-
else {
|
607 |
-
$this->getEmosBasketPageArray($basket, "emosBasketPageArray");
|
608 |
-
}
|
609 |
-
}
|
610 |
-
|
611 |
-
/* returns a emosBasketArray of given Name */
|
612 |
-
function getEmosBasketPageArray($basket, $event) {
|
613 |
-
if(!$this->anchorTags){
|
614 |
-
if($this->ecString == "") {
|
615 |
-
$this->ecString .= " emospro.ec_Event = [\n";
|
616 |
-
}
|
617 |
-
foreach ($basket as $item) {
|
618 |
-
$item = $this->emos_ItemFormat($item);
|
619 |
-
$this->ecString .= " ['".$event."','".$item->productID."','".$item->productName."','".$item->price."','".$item->productGroup."','".$item->quantity."','".$item->variant1."','".$item->variant2."','".$item->variant2."'],\n";
|
620 |
-
}
|
621 |
-
}
|
622 |
-
else {
|
623 |
-
$out = "<script type=\"text/javascript\">\n//<![CDATA[\n" .
|
624 |
-
" var ".$event." = new Array();\n";
|
625 |
-
$count = 0;
|
626 |
-
foreach ($basket as $item) {
|
627 |
-
$item = $this->emos_ItemFormat($item);
|
628 |
-
$out .= " ".$event."[".$count."]=new Array();\n";
|
629 |
-
$out .= " ".$event."[".$count."][0]='".$item->productID."';\n";
|
630 |
-
$out .= " ".$event."[".$count."][1]='".$item->productName."';\n";
|
631 |
-
$out .= " ".$event."[".$count."][2]='".$item->price."';\n";
|
632 |
-
$out .= " ".$event."[".$count."][3]='".$item->productGroup."';\n";
|
633 |
-
$out .= " ".$event."[".$count."][4]='".$item->quantity."';\n";
|
634 |
-
$out .= " ".$event."[".$count."][5]='".$item->variant1."';\n";
|
635 |
-
$out .= " ".$event."[".$count."][6]='".$item->variant2."';\n";
|
636 |
-
$out .= " ".$event."[".$count."][7]='".$item->variant3."';\n";
|
637 |
-
$count++;
|
638 |
-
}
|
639 |
-
$out .= "//]]>\n</script>\n";
|
640 |
-
$this->appendPreScript($out);
|
641 |
-
}
|
642 |
-
}
|
643 |
-
|
644 |
-
/*
|
645 |
-
* constructs a generic EmosCustomPageArray from a PHP Array
|
646 |
-
*/
|
647 |
-
function getEmosCustomPageArray($listOfValues){
|
648 |
-
$out = "";
|
649 |
-
if(!$this->anchorTags){
|
650 |
-
$counter = 0;
|
651 |
-
foreach ($listOfValues as $value) {
|
652 |
-
$value = $this->emos_DataFormat($value);
|
653 |
-
if($counter == 0) {
|
654 |
-
$out .= " emospro.".$value." = [[";
|
655 |
-
}
|
656 |
-
else {
|
657 |
-
$out .= "'".$value."',";
|
658 |
-
}
|
659 |
-
$counter += 1;
|
660 |
-
}
|
661 |
-
$out = substr($out,0,-1);
|
662 |
-
$out .= "]];\n";
|
663 |
-
}
|
664 |
-
else {
|
665 |
-
$out .= "<script type=\"text/javascript\">\n";
|
666 |
-
$out .= " window.emosCustomPageArray = [";
|
667 |
-
foreach ($listOfValues as $value) {
|
668 |
-
$value = $this->emos_DataFormat($value);
|
669 |
-
$out .= "'".$value."',";
|
670 |
-
}
|
671 |
-
$out = substr($out,0,-1);
|
672 |
-
$out .= "];\n";
|
673 |
-
$out .= "</script>\n";
|
674 |
-
}
|
675 |
-
$this->appendPreScript($out);
|
676 |
-
}
|
677 |
-
|
678 |
-
/* constructs a emosCustomPageArray with 8 Variables and shortcut
|
679 |
-
* @param $cType Type of this event - shortcut in config
|
680 |
-
* @param $cVar1 first variable of this custom event (optional)
|
681 |
-
* @param $cVar2 second variable of this custom event (optional)
|
682 |
-
* @param $cVar3 third variable of this custom event (optional)
|
683 |
-
* @param $cVar4 fourth variable of this custom event (optional)
|
684 |
-
* @param $cVar5 fifth variable of this custom event (optional)
|
685 |
-
* @param $cVar6 sixth variable of this custom event (optional)
|
686 |
-
* @param $cVar7 seventh variable of this custom event (optional)
|
687 |
-
* @param $cVar8 eighth variable of this custom event (optional)
|
688 |
-
* @param $cVar9 nineth variable of this custom event (optional)
|
689 |
-
* @param $cVar10 tenth variable of this custom event (optional)
|
690 |
-
* @param $cVar11 eleventh variable of this custom event (optional)
|
691 |
-
* @param $cVar12 twelveth variable of this custom event (optional)
|
692 |
-
* @param $cVar13 thirteenth variable of this custom event (optional)
|
693 |
-
*/
|
694 |
-
function addEmosCustomPageArray($cType=0, $cVar1=0, $cVar2=0, $cVar3=0, $cVar4=0, $cVar5=0, $cVar6=0, $cVar7=0, $cVar8=0, $cVar9=0, $cVar10=0, $cVar11=0, $cVar12=0, $cVar13=0) {
|
695 |
-
$values[0] = $cType;
|
696 |
-
if($cVar1) $values[1] = $cVar1;
|
697 |
-
if($cVar2) $values[2] = $cVar2;
|
698 |
-
if($cVar3) $values[3] = $cVar3;
|
699 |
-
if($cVar4) $values[4] = $cVar4;
|
700 |
-
if($cVar5) $values[5] = $cVar5;
|
701 |
-
if($cVar6) $values[6] = $cVar6;
|
702 |
-
if($cVar7) $values[7] = $cVar7;
|
703 |
-
if($cVar8) $values[8] = $cVar8;
|
704 |
-
if($cVar9) $values[9] = $cVar9;
|
705 |
-
if($cVar10) $values[10] = $cVar10;
|
706 |
-
if($cVar11) $values[11] = $cVar11;
|
707 |
-
if($cVar12) $values[12] = $cVar12;
|
708 |
-
if($cVar13) $values[13] = $cVar13;
|
709 |
-
$this->getEmosCustomPageArray($values);
|
710 |
-
}
|
711 |
-
}
|
712 |
-
/* EMOS class end */
|
713 |
-
|
714 |
-
/* global Functions */
|
715 |
-
|
716 |
-
/*
|
717 |
-
function getEmosECEvent($item, $event) {
|
718 |
-
$item = $this->emos_ItemFormat($item);
|
719 |
-
$out = "";
|
720 |
-
$out .= "emos_ecEvent('$event'," .
|
721 |
-
"'$item->productID'," .
|
722 |
-
"'$item->productName'," .
|
723 |
-
"'$item->price'," .
|
724 |
-
"'$item->productGroup'," .
|
725 |
-
"'$item->quantity'," .
|
726 |
-
"'$item->variant1'" .
|
727 |
-
"'$item->variant2'" .
|
728 |
-
"'$item->variant3');";
|
729 |
-
return $out;
|
730 |
-
}
|
731 |
-
|
732 |
-
function getEmosViewEvent($item) {
|
733 |
-
return getEmosECEvent($item, "view");
|
734 |
-
}
|
735 |
-
|
736 |
-
function getEmosAddToBasketEvent($item) {
|
737 |
-
return getEmosECEvent($item, "c_add");
|
738 |
-
}
|
739 |
-
|
740 |
-
function getRemoveFromBasketEvent($item) {
|
741 |
-
return getEmosECEvent($item, "c_rmv");
|
742 |
-
}
|
743 |
-
|
744 |
-
function getEmosBillingEventArray($billingID = "", $customerNumber = "", $total = 0, $country = "", $cip = "", $city = "") {
|
745 |
-
$b = new EMOS();
|
746 |
-
return $b->getEmosBillingArray($billingID, $customerNumber, $total, $country, $cip, $city, "emosBillingArray");
|
747 |
-
}
|
748 |
-
|
749 |
-
function getEMOSBasketEventArray($basket) {
|
750 |
-
$b = new EMOS();
|
751 |
-
return $b->getEmosBasketArray($basket, "emosBasketArray");
|
752 |
-
}
|
753 |
-
|
754 |
-
*/
|
755 |
-
|
756 |
-
/* A Class to hold products as well a basket items
|
757 |
-
* If you want to track a product view, set the quantity to 1.
|
758 |
-
* For "real" basket items, the quantity should be given in your
|
759 |
-
* shopping systems basket/shopping cart.
|
760 |
-
*
|
761 |
-
* Purpose of this class:
|
762 |
-
* This class provides a common subset of features for most shopping systems
|
763 |
-
* products or basket/cart items. So all you have to do is to convert your
|
764 |
-
* products/articles/basket items/cart items to a EMOS_Items. And finally use
|
765 |
-
* the functionaltiy of the EMOS class.
|
766 |
-
* So for each shopping system we only have to do the conversion of the cart/basket
|
767 |
-
* and items and we can (hopefully) keep the rest of code.
|
768 |
-
*
|
769 |
-
* Shopping carts:
|
770 |
-
* A shopping cart / basket is a simple Array[] of EMOS items.
|
771 |
-
* Convert your cart to a Array of EMOS_Items and your job is nearly done.
|
772 |
-
*/
|
773 |
-
class EMOS_Item {
|
774 |
-
/** unique Identifier of a product e.g. article number */
|
775 |
-
var $productID = "NULL";
|
776 |
-
/** the name of a product */
|
777 |
-
var $productName = "NULL";
|
778 |
-
/** the price of the product, it is your choice wether its gross or net */
|
779 |
-
var $price = "NULL";
|
780 |
-
/** the product group for this product, this is a drill down dimension
|
781 |
-
* or tree-like structure
|
782 |
-
* so you might want to use it like this:
|
783 |
-
* productgroup/subgroup/subgroup/product
|
784 |
-
*/
|
785 |
-
var $productGroup = "NULL";
|
786 |
-
/* the quantity / number of products viewed/bought etc.. */
|
787 |
-
var $quantity = "NULL";
|
788 |
-
/** variant of the product e.g. size, color, brand ....
|
789 |
-
* remember to keep the order of theses variants allways the same
|
790 |
-
* decide which variant is which feature and stick to it
|
791 |
-
*/
|
792 |
-
var $variant1 = "NULL";
|
793 |
-
var $variant2 = "NULL";
|
794 |
-
var $variant3 = "NULL";
|
795 |
-
}
|
796 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Helper/Data.php
CHANGED
@@ -1,6 +1,80 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Mage
|
16 |
+
* @package Mage_Econda
|
17 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Receive translation values for tracking
|
23 |
+
*/
|
24 |
+
class Mage_Econda_Helper_Data extends Mage_Core_Block_Template
|
25 |
{
|
26 |
+
/**
|
27 |
+
* Get translation array.
|
28 |
+
*
|
29 |
+
* @return array
|
30 |
+
*/
|
31 |
+
public function getTranslation()
|
32 |
+
{
|
33 |
+
$translation = array(array("Login","Anmeldung"),
|
34 |
+
array("Register","Registrierung"),
|
35 |
+
array("Shipping","Versand"),
|
36 |
+
array("Address","Adresse"),
|
37 |
+
array("Method","Methode"),
|
38 |
+
array("Payment","Zahlung"),
|
39 |
+
array("Search","Suche"),
|
40 |
+
array("Basic Search","Einfache Suche"),
|
41 |
+
array("Advanced Search","Erweiterte Suche"),
|
42 |
+
array("Information","Informationen"),
|
43 |
+
array("About","Impressum"),
|
44 |
+
array("Privacy","Datenschutz"),
|
45 |
+
array("General Business Terms","AGB"),
|
46 |
+
array("RSS","RSS"),
|
47 |
+
array("Customer Service","Kundenservice"),
|
48 |
+
array("Sitemap","Sitemap"),
|
49 |
+
array("Products","Produkte"),
|
50 |
+
array("Popular Search Terms","Meistgesucht"),
|
51 |
+
array("Results","Ergebnis"),
|
52 |
+
array("Contact","Kontakt"),
|
53 |
+
array("Create Account","Konto erstellen"),
|
54 |
+
array("Forgot Password","Passwort anfordern"),
|
55 |
+
array("My Account","Kundenbereich"),
|
56 |
+
array("Account Dashboard","Uebersichtsseite"),
|
57 |
+
array("Account Information","Kundeninformationen"),
|
58 |
+
array("Adress Book","Adressbuch"),
|
59 |
+
array("My Orders","Bestellhistorie"),
|
60 |
+
array("My Product Reviews","Eigene Bewertungen"),
|
61 |
+
array("My Tags","Eigene Tags"),
|
62 |
+
array("Newsletter Subscriptions","Newsletter abbonieren"),
|
63 |
+
array("My Wishlist","Wunschliste"),
|
64 |
+
array("My Downloadable Products","Herunterladbare Produkte"),
|
65 |
+
array("Order Process","Kaufprozess"),
|
66 |
+
array("Shopping Cart","Warenkorb"),
|
67 |
+
array("Reviews","Bewertungen"),
|
68 |
+
array("Tags","Tags"),
|
69 |
+
array("Overview","Uebersicht"),
|
70 |
+
array("Review","Bewertung"),
|
71 |
+
array("Other Sites","Sonstige Seiten"),
|
72 |
+
array("No Category","Ohne Kategorie"),
|
73 |
+
array("Contact","Kontakt"),
|
74 |
+
array("Order Confirmation","Bestaetigung"),
|
75 |
+
array("Order Review","Bestelluebersicht"),
|
76 |
+
array("Billing","Rechnung")
|
77 |
+
);
|
78 |
+
return $translation;
|
79 |
+
}
|
80 |
+
}
|
app/code/local/Mage/Econda/Language/english.php
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$eLang[0] = "Login";
|
3 |
-
$eLang[1] = "Register";
|
4 |
-
$eLang[2] = "Shipping";
|
5 |
-
$eLang[3] = "Adress";
|
6 |
-
$eLang[4] = "Method";
|
7 |
-
$eLang[5] = "Payment";
|
8 |
-
$eLang[6] = "Search";
|
9 |
-
$eLang[7] = "Basic Search";
|
10 |
-
$eLang[8] = "Advanced Search";
|
11 |
-
$eLang[9] = "Information";
|
12 |
-
$eLang[10] = "About";
|
13 |
-
$eLang[11] = "Privacy";
|
14 |
-
$eLang[12] = "General Business Terms";
|
15 |
-
$eLang[13] = "RSS";
|
16 |
-
$eLang[14] = "Customer Service";
|
17 |
-
$eLang[15] = "Sitemap";
|
18 |
-
$eLang[16] = "Products";
|
19 |
-
$eLang[17] = "Popular Search Terms";
|
20 |
-
$eLang[18] = "Results";
|
21 |
-
$eLang[19] = "Contact";
|
22 |
-
$eLang[20] = "Create Account";
|
23 |
-
$eLang[21] = "Forgot Password";
|
24 |
-
$eLang[22] = "My Account";
|
25 |
-
$eLang[23] = "Account Dashboard";
|
26 |
-
$eLang[24] = "Account Information";
|
27 |
-
$eLang[25] = "Adress Book";
|
28 |
-
$eLang[26] = "My Orders";
|
29 |
-
$eLang[27] = "My Product Reviews";
|
30 |
-
$eLang[28] = "My Tags";
|
31 |
-
$eLang[29] = "Newsletter Subscriptions";
|
32 |
-
$eLang[30] = "My Wishlist";
|
33 |
-
$eLang[31] = "My Downloadable Products";
|
34 |
-
$eLang[32] = "Order Process";
|
35 |
-
$eLang[33] = "Shopping Cart";
|
36 |
-
$eLang[34] = "Reviews";
|
37 |
-
$eLang[35] = "Tags";
|
38 |
-
$eLang[36] = "Overview";
|
39 |
-
$eLang[37] = "Review";
|
40 |
-
$eLang[38] = "Other Sites";
|
41 |
-
$eLang[39] = "No Category";
|
42 |
-
$eLang[40] = "Contact";
|
43 |
-
$eLang[41] = "Order Confirmation";
|
44 |
-
$eLang[42] = "Order Review";
|
45 |
-
$eLang[43] = "Billing";
|
46 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Language/german.php
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$eLang[0] = "Anmeldung";
|
3 |
-
$eLang[1] = "Registrierung";
|
4 |
-
$eLang[2] = "Versand";
|
5 |
-
$eLang[3] = "Adresse";
|
6 |
-
$eLang[4] = "Methode";
|
7 |
-
$eLang[5] = "Zahlung";
|
8 |
-
$eLang[6] = "Suche";
|
9 |
-
$eLang[7] = "Einfache Suche";
|
10 |
-
$eLang[8] = "Erweiterte Suche";
|
11 |
-
$eLang[9] = "Informationen";
|
12 |
-
$eLang[10] = "Impressum";
|
13 |
-
$eLang[11] = "Datenschutz";
|
14 |
-
$eLang[12] = "AGB";
|
15 |
-
$eLang[13] = "RSS";
|
16 |
-
$eLang[14] = "Kundenservice";
|
17 |
-
$eLang[15] = "Sitemap";
|
18 |
-
$eLang[16] = "Produkte";
|
19 |
-
$eLang[17] = "Meistgesucht";
|
20 |
-
$eLang[18] = "Ergebnis";
|
21 |
-
$eLang[19] = "Kontakt";
|
22 |
-
$eLang[20] = "Konto erstellen";
|
23 |
-
$eLang[21] = "Passwort anfordern";
|
24 |
-
$eLang[22] = "Kundenbereich";
|
25 |
-
$eLang[23] = "Uebersichtsseite";
|
26 |
-
$eLang[24] = "Kundeninformationen";
|
27 |
-
$eLang[25] = "Adressbuch";
|
28 |
-
$eLang[26] = "Bestellhistorie";
|
29 |
-
$eLang[27] = "Eigene Bewertungen";
|
30 |
-
$eLang[28] = "Eigene Tags";
|
31 |
-
$eLang[29] = "Newsletter abbonieren";
|
32 |
-
$eLang[30] = "Wunschliste";
|
33 |
-
$eLang[31] = "Herunterladbare Produkte";
|
34 |
-
$eLang[32] = "Kaufprozess";
|
35 |
-
$eLang[33] = "Warenkorb";
|
36 |
-
$eLang[34] = "Bewertungen";
|
37 |
-
$eLang[35] = "Tags";
|
38 |
-
$eLang[36] = "Uebersicht";
|
39 |
-
$eLang[37] = "Bewertung";
|
40 |
-
$eLang[38] = "Sonstige Seiten";
|
41 |
-
$eLang[39] = "Ohne Kategorie";
|
42 |
-
$eLang[40] = "Kontakt";
|
43 |
-
$eLang[41] = "Bestaetigung";
|
44 |
-
$eLang[42] = "Bestelluebersicht";
|
45 |
-
$eLang[43] = "Rechnung";
|
46 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Model/Base.php
ADDED
@@ -0,0 +1,345 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Mage
|
16 |
+
* @package Mage_Econda
|
17 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Generate standard tracking values
|
23 |
+
*/
|
24 |
+
class Mage_Econda_Model_Base extends Mage_Core_Model_Abstract
|
25 |
+
{
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @var Current url and session object
|
29 |
+
*/
|
30 |
+
private $realUrl = '';
|
31 |
+
private $session = null;
|
32 |
+
private $lang = 1;
|
33 |
+
private $eLang = array();
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Intialize
|
37 |
+
*/
|
38 |
+
public function __construct()
|
39 |
+
{
|
40 |
+
$this->realUrl = Mage::helper('core/url')->getCurrentUrl();
|
41 |
+
$this->session = Mage::getSingleton('checkout/session');
|
42 |
+
$storeId = Mage::app()->getStore()->getId();
|
43 |
+
$langValue = 'econda/econda/tracking_language';
|
44 |
+
$this->eLang = Mage::helper('econda/data')->getTranslation();
|
45 |
+
$cLang = Mage::getStoreConfig($langValue, $storeId);
|
46 |
+
if($cLang == '1') {
|
47 |
+
$this->lang = 0;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Get search results
|
53 |
+
*
|
54 |
+
* @return array
|
55 |
+
*/
|
56 |
+
public function getSearch()
|
57 |
+
{
|
58 |
+
$search = null;
|
59 |
+
if(Mage::helper('catalogSearch')->getQueryText() != null) {
|
60 |
+
$searchQuery = Mage::helper('catalogSearch')->getQueryText();
|
61 |
+
$getQuery = Mage::helper('catalogSearch')->getQuery();
|
62 |
+
$searchQuery = $getQuery->query_text;
|
63 |
+
$searchHits = $getQuery->num_results;
|
64 |
+
$search = array($searchQuery, $searchHits);
|
65 |
+
}
|
66 |
+
if(stristr($this->realUrl,'/catalogsearch/advanced/result/?') != false) {
|
67 |
+
$searchQuery = '';
|
68 |
+
$searchCriterias = Mage::getSingleton('catalogsearch/advanced')->getSearchCriterias();
|
69 |
+
foreach($searchCriterias as $val) {
|
70 |
+
$searchQuery .= $val['value'];
|
71 |
+
}
|
72 |
+
$productCollection = Mage::getSingleton('catalogsearch/advanced')->getProductCollection();
|
73 |
+
$search = array($searchQuery, sizeof($productCollection));
|
74 |
+
}
|
75 |
+
return $search;
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Get page id for click tracking
|
80 |
+
*
|
81 |
+
* @return string
|
82 |
+
*/
|
83 |
+
public function getPageId($content)
|
84 |
+
{
|
85 |
+
$pageId = md5($content);
|
86 |
+
return $pageId;
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Get site id for multishops
|
91 |
+
*
|
92 |
+
* @return string
|
93 |
+
*/
|
94 |
+
public function getSiteId($storeId)
|
95 |
+
{
|
96 |
+
$siteidOv = Mage::getStoreConfig('econda/econda/tracking_siteid', $storeId);
|
97 |
+
if(!empty($siteidOv) && trim($siteidOv) != "") {
|
98 |
+
$siteName = trim($siteidOv);
|
99 |
+
}
|
100 |
+
else {
|
101 |
+
$homeUrl = Mage::helper('core/url')->getHomeUrl();
|
102 |
+
$siteName = preg_replace(array('/(http:\/\/|https:\/\/)/','/index.php/','/\//'),array('','',''),$homeUrl);
|
103 |
+
}
|
104 |
+
return $siteName;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Get language id from store id
|
109 |
+
*
|
110 |
+
* @return string
|
111 |
+
*/
|
112 |
+
public function getLangId()
|
113 |
+
{
|
114 |
+
$getLocale = Mage::app()->getStore()->getStoreId();
|
115 |
+
return $getLocale;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Get results from submitted contact form
|
120 |
+
*
|
121 |
+
* @return bool
|
122 |
+
*/
|
123 |
+
public function getContact()
|
124 |
+
{
|
125 |
+
if(stristr($this->realUrl,'/contacts/index/') != false) {
|
126 |
+
return true;
|
127 |
+
}
|
128 |
+
return false;
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Get results after registration
|
133 |
+
*
|
134 |
+
* @return array
|
135 |
+
*/
|
136 |
+
public function getRegister($message)
|
137 |
+
{
|
138 |
+
if(stristr($this->realUrl,'customer/account/index/') != false ||
|
139 |
+
stristr($this->realUrl,'checkout/multishipping/addresses/') != false){
|
140 |
+
if(stristr($message,'success-msg') != false) {
|
141 |
+
$customerId = Mage::getSingleton('customer/session')->getCustomerId();
|
142 |
+
return array($customerId,0);
|
143 |
+
}
|
144 |
+
}
|
145 |
+
return null;
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Get results after login
|
150 |
+
*
|
151 |
+
* @return array
|
152 |
+
*/
|
153 |
+
public function getLogin($message)
|
154 |
+
{
|
155 |
+
$login = null;
|
156 |
+
|
157 |
+
//login success
|
158 |
+
$isLoggedIn = Mage::getSingleton('customer/session')->isLoggedIn();
|
159 |
+
if($isLoggedIn == 1 && $this->session->getData('econda_logged') != 2) {
|
160 |
+
$this->session->setData('econda_logged','1');
|
161 |
+
}
|
162 |
+
if($this->session->getData('econda_logged') == 1) {
|
163 |
+
$customerId = Mage::getSingleton('customer/session')->getCustomerId();
|
164 |
+
$login = array($customerId,0);
|
165 |
+
$this->session->setData('econda_logged','2');
|
166 |
+
}
|
167 |
+
//login failed
|
168 |
+
if(stristr($this->realUrl,'customer/account/login/') != false ||
|
169 |
+
stristr($this->realUrl,'checkout/multishipping/login/') != false){
|
170 |
+
if(stristr($message,'error-msg') != false) {
|
171 |
+
$customerId = Mage::getSingleton('customer/session')->getCustomerId();
|
172 |
+
$login = array($customerId,1);
|
173 |
+
}
|
174 |
+
}
|
175 |
+
return $login;
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Get content path from breadcrumb if available
|
180 |
+
*
|
181 |
+
* @return string
|
182 |
+
*/
|
183 |
+
public function getContentBreadcrumb()
|
184 |
+
{
|
185 |
+
$contentPath = '';
|
186 |
+
$getPath = Mage::helper('catalog')->getBreadcrumbPath($this->getCategory());
|
187 |
+
if(sizeof($getPath) > 0) {
|
188 |
+
foreach($getPath as $pathID) {
|
189 |
+
$contentPath .= '/'.$pathID['label'];
|
190 |
+
}
|
191 |
+
}
|
192 |
+
return $contentPath;
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* Get content path for custom sites from url
|
197 |
+
*
|
198 |
+
* @return string
|
199 |
+
*/
|
200 |
+
public function getContentCustom()
|
201 |
+
{
|
202 |
+
$contentPath = '';
|
203 |
+
$checkoutSteps = Mage::getModel('econda/basket')->getCheckoutSteps();
|
204 |
+
$contentCheckout = $checkoutSteps[0];
|
205 |
+
if(stristr($this->realUrl,'q=') != false) {
|
206 |
+
$contentPath .= '/'.$this->eLang[6][$this->lang].'/'.$this->eLang[7][$this->lang];
|
207 |
+
}
|
208 |
+
if(stristr($this->realUrl,'/about-') != false || stristr($this->realUrl,'/impressum') != false) {
|
209 |
+
$contentPath .= '/'.$this->eLang[9][$this->lang].'/'.$this->eLang[10][$this->lang];
|
210 |
+
}
|
211 |
+
if(stristr($this->realUrl,'/datenschutz') != false) {
|
212 |
+
$contentPath .= '/'.$this->eLang[9][$this->lang].'/'.$this->eLang[11][$this->lang];
|
213 |
+
}
|
214 |
+
if(stristr($this->realUrl,'/agb') != false) {
|
215 |
+
$contentPath .= '/'.$this->eLang[9][$this->lang].'/'.$this->eLang[12][$this->lang];
|
216 |
+
}
|
217 |
+
if(stristr($this->realUrl,'/rss') != false) {
|
218 |
+
$contentPath .= '/'.$this->eLang[9][$this->lang].'/'.$this->eLang[13][$this->lang];
|
219 |
+
}
|
220 |
+
if(stristr($this->realUrl,'/customer-service') != false) {
|
221 |
+
$contentPath .= '/'.$this->eLang[9][$this->lang].'/'.$this->eLang[14][$this->lang];
|
222 |
+
}
|
223 |
+
if(stristr($this->realUrl,'/seo_sitemap') != false) {
|
224 |
+
$contentPath .= '/'.$this->eLang[9][$this->lang].'/'.$this->eLang[15][$this->lang];
|
225 |
+
}
|
226 |
+
if(stristr($this->realUrl,'/seo_sitemap/product') != false) {
|
227 |
+
$contentPath .= '-'.$this->eLang[16][$this->lang];
|
228 |
+
}
|
229 |
+
if(stristr($this->realUrl,'/term/popular') != false) {
|
230 |
+
$contentPath .= '/'.$this->eLang[9][$this->lang].'/'.$this->eLang[17][$this->lang];
|
231 |
+
}
|
232 |
+
if(stristr($this->realUrl,'/catalogsearch/advanced') != false) {
|
233 |
+
$contentPath .= '/'.$this->eLang[6][$this->lang].'/'.$this->eLang[8][$this->lang];
|
234 |
+
if(stristr($this->realUrl,'catalogsearch/advanced/result/?') != false) {
|
235 |
+
$contentPath .= '/'.$this->eLang[18][$this->lang];
|
236 |
+
}
|
237 |
+
}
|
238 |
+
if(stristr($this->realUrl,'/contacts/') != false) {
|
239 |
+
$contentPath .= '/'.$this->eLang[9][$this->lang].'/'.$this->eLang[19][$this->lang];
|
240 |
+
}
|
241 |
+
if(stristr($this->realUrl,'/login') != false) {
|
242 |
+
$contentPath .= '/'.$this->eLang[0][$this->lang];
|
243 |
+
}
|
244 |
+
if(stristr($this->realUrl,'/customer/account/create/') != false) {
|
245 |
+
$contentPath .= '/'.$this->eLang[20][$this->lang];
|
246 |
+
}
|
247 |
+
if(stristr($this->realUrl,'/customer/account/forgotpassword/') != false) {
|
248 |
+
$contentPath .= '/'.$this->eLang[21][$this->lang];
|
249 |
+
}
|
250 |
+
if(stristr($this->realUrl,'/customer/') != false &&
|
251 |
+
stristr($this->realUrl,'/customer/account/login/') == false &&
|
252 |
+
stristr($this->realUrl,'/customer/account/forgotpassword/') == false &&
|
253 |
+
stristr($this->realUrl,'/customer/account/create/') == false) {
|
254 |
+
$contentPath .= '/'.$this->eLang[22][$this->lang];
|
255 |
+
}
|
256 |
+
if(stristr($this->realUrl,'/customer/account/') != false &&
|
257 |
+
stristr($this->realUrl,'/customer/account/edit/') == false &&
|
258 |
+
stristr($this->realUrl,'/customer/account/login/') == false &&
|
259 |
+
stristr($this->realUrl,'/customer/account/forgotpassword/') == false &&
|
260 |
+
stristr($this->realUrl,'/customer/account/create/') == false) {
|
261 |
+
$contentPath .= '/'.$this->eLang[23][$this->lang];
|
262 |
+
}
|
263 |
+
if(stristr($this->realUrl,'/customer/account/edit/') != false) {
|
264 |
+
$contentPath .= '/'.$this->eLang[24][$this->lang];
|
265 |
+
}
|
266 |
+
if(stristr($this->realUrl,'/customer/address/') != false) {
|
267 |
+
$contentPath .= '/'.$this->eLang[25][$this->lang];
|
268 |
+
}
|
269 |
+
if(stristr($this->realUrl,'/sales/order/history/') != false) {
|
270 |
+
$contentPath .= '/'.$this->eLang[22][$this->lang].'/'.$this->eLang[26][$this->lang];
|
271 |
+
}
|
272 |
+
if(stristr($this->realUrl,'/review/customer/') != false) {
|
273 |
+
$contentPath .= '/'.$this->eLang[27][$this->lang];
|
274 |
+
}
|
275 |
+
if(stristr($this->realUrl,'/tag/customer/') != false) {
|
276 |
+
$contentPath .= '/'.$this->eLang[28][$this->lang];
|
277 |
+
}
|
278 |
+
if(stristr($this->realUrl,'/newsletter/manage/') != false) {
|
279 |
+
$contentPath .= '/'.$this->eLang[22][$this->lang].'/'.$this->eLang[29][$this->lang];
|
280 |
+
}
|
281 |
+
if(stristr($this->realUrl,'/wishlist/') != false) {
|
282 |
+
$contentPath .= '/'.$this->eLang[22][$this->lang].'/'.$this->eLang[30][$this->lang];
|
283 |
+
}
|
284 |
+
if(stristr($this->realUrl,'/downloadable/customer/products/') != false) {
|
285 |
+
$contentPath .= '/'.$this->eLang[31][$this->lang];
|
286 |
+
}
|
287 |
+
if(stristr($this->realUrl,'checkout/cart') != false) {
|
288 |
+
$contentPath .= '/'.$this->eLang[32][$this->lang].'/'.$this->eLang[33][$this->lang];
|
289 |
+
}
|
290 |
+
|
291 |
+
if(stristr($this->realUrl,'checkout/onepage/success') != false) {
|
292 |
+
$contentPath .= '/'.$this->eLang[32][$this->lang].'/'.$this->eLang[41][$this->lang];
|
293 |
+
}
|
294 |
+
if(stristr($this->realUrl,'/checkout/multishipping') != false) {
|
295 |
+
$contentPath .= '/'.$this->eLang[32][$this->lang].'/'.$contentCheckout;
|
296 |
+
}
|
297 |
+
if(stristr($this->realUrl,'/review') != false && stristr($this->realUrl,'/review/customer/') == false) {
|
298 |
+
$contentPath .= '/'.$this->eLang[34][$this->lang];
|
299 |
+
}
|
300 |
+
if($contentPath == '/Bewertungen') {
|
301 |
+
$contentPath = '/'.$this->eLang[9][$this->lang].'/'.$this->eLang[37][$this->lang];
|
302 |
+
}
|
303 |
+
|
304 |
+
if(stristr($this->realUrl,'/tag/') != false && stristr($this->realUrl,'/tag/customer/') == false) {
|
305 |
+
$contentPath .= '/'.$this->eLang[35][$this->lang];
|
306 |
+
$tagId = Mage::app()->getRequest()->getParam('tagId');
|
307 |
+
$tagName = Mage::getModel('tag/tag')->load($tagId)->getName();
|
308 |
+
if(trim($tagName) == ''){
|
309 |
+
$contentPath .= '/'.$this->eLang[36][$this->lang];
|
310 |
+
}
|
311 |
+
else{
|
312 |
+
$contentPath .= '/'.$tagName;
|
313 |
+
}
|
314 |
+
}
|
315 |
+
return $contentPath;
|
316 |
+
}
|
317 |
+
|
318 |
+
/**
|
319 |
+
* Get content path from url if path is empty
|
320 |
+
*
|
321 |
+
* @return string
|
322 |
+
*/
|
323 |
+
public function getContentDefault()
|
324 |
+
{
|
325 |
+
$contentPath = "";
|
326 |
+
$checkPath = preg_replace(array('/(http:|https:)\/\/([^\/]*)/',
|
327 |
+
'/index.php/',
|
328 |
+
'/\/\//',
|
329 |
+
'/\?(.*)/',
|
330 |
+
'/(.html|.htm|.php)/'
|
331 |
+
)
|
332 |
+
,array('','','','',''),$this->realUrl);
|
333 |
+
if(trim($checkPath) != '') {
|
334 |
+
$urlExtExp = explode("/",$checkPath);
|
335 |
+
$urlExtO = '';
|
336 |
+
for($i = 0; $i < sizeof($urlExtExp); $i++) {
|
337 |
+
if(trim($urlExtExp[$i]) != ''){
|
338 |
+
$urlExtO .= ucfirst($urlExtExp[$i]).'/';
|
339 |
+
}
|
340 |
+
}
|
341 |
+
$contentPath .= '/'.$this->eLang[38][$this->lang].'/'.substr($urlExtO,0,-1);
|
342 |
+
}
|
343 |
+
return $contentPath;
|
344 |
+
}
|
345 |
+
}
|
app/code/local/Mage/Econda/Model/Basket.php
ADDED
@@ -0,0 +1,484 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Mage
|
16 |
+
* @package Mage_Econda
|
17 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Generate basket objects and values for tracking
|
23 |
+
*/
|
24 |
+
class Mage_Econda_Model_Basket extends Mage_Core_Model_Abstract
|
25 |
+
{
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @var Current url and session object
|
29 |
+
*/
|
30 |
+
private $realUrl = '';
|
31 |
+
private $session = null;
|
32 |
+
private $lang = 1;
|
33 |
+
private $eLang = array();
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Intialize
|
37 |
+
*/
|
38 |
+
public function __construct()
|
39 |
+
{
|
40 |
+
$this->realUrl = Mage::helper('core/url')->getCurrentUrl();
|
41 |
+
$this->session = Mage::getSingleton('checkout/session');
|
42 |
+
$storeId = Mage::app()->getStore()->getId();
|
43 |
+
$langValue = 'econda/econda/tracking_language';
|
44 |
+
$this->eLang = Mage::helper('econda/data')->getTranslation();
|
45 |
+
$cLang = Mage::getStoreConfig($langValue, $storeId);
|
46 |
+
if($cLang == '1') {
|
47 |
+
$this->lang = 0;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Get deepest category path for later drilldown
|
53 |
+
*
|
54 |
+
* @return string
|
55 |
+
*/
|
56 |
+
public function getProductCategory($productId)
|
57 |
+
{
|
58 |
+
$getCatId = Mage::getModel('catalog/product')->load($productId)->getCategoryIds();
|
59 |
+
$db = Mage::getSingleton('core/resource')->getConnection('core_write');
|
60 |
+
$tablePrefix = Mage::getConfig()->getTablePrefix();
|
61 |
+
$rootCat = Mage::app()->getStore()->getRootCategoryId();
|
62 |
+
if(sizeof($getCatId) > 0) {
|
63 |
+
$catLevel = 0;
|
64 |
+
for($i=0;$i<sizeof($getCatId);$i++) {
|
65 |
+
$level = Mage::getModel('catalog/category')->load($getCatId[$i])->getLevel();
|
66 |
+
$catPathPa = Mage::getModel('catalog/category')->load($getCatId[$i])->getPathIds();
|
67 |
+
if($catLevel < intval($level) && intval($catPathPa[1]) == $rootCat) {
|
68 |
+
$catLevel = intval($level);
|
69 |
+
$catPath = $catPathPa;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
$category = "";
|
73 |
+
for($i=0;$i<sizeof($catPath);$i++) {
|
74 |
+
$catId = intval($catPath[$i]);
|
75 |
+
$category .= Mage::getModel('catalog/category')->load($catId)->getName()."/";
|
76 |
+
}
|
77 |
+
$category = substr($category,0,-1);
|
78 |
+
if(substr($category, 0, 1) == '/') {
|
79 |
+
$category = substr($category, 1);
|
80 |
+
}
|
81 |
+
return $category;
|
82 |
+
}
|
83 |
+
else {
|
84 |
+
return false;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Get checkout steps and content path for each step
|
90 |
+
*
|
91 |
+
* @return array
|
92 |
+
*/
|
93 |
+
public function getCheckoutSteps()
|
94 |
+
{
|
95 |
+
$contentCheckout = '';
|
96 |
+
$stepCheckout = '';
|
97 |
+
|
98 |
+
if(stristr($this->realUrl,'checkout/cart') != false) {
|
99 |
+
$stepCheckout = 'BASKET';
|
100 |
+
}
|
101 |
+
if(stristr($this->realUrl,'checkout/multishipping/login/') != false) {
|
102 |
+
$contentCheckout = $this->eLang[0][$this->lang];
|
103 |
+
$stepCheckout = 'LOGIN';
|
104 |
+
}
|
105 |
+
if(stristr($this->realUrl,'checkout/multishipping/register/') != false) {
|
106 |
+
$contentCheckout = $this->eLang[1][$this->lang];
|
107 |
+
$stepCheckout = 'LOGINREGISTER';
|
108 |
+
}
|
109 |
+
if(stristr($this->realUrl,'checkout/multishipping/addresses/') != false) {
|
110 |
+
$contentCheckout = $this->eLang[2][$this->lang].'/'.$this->eLang[3][$this->lang];
|
111 |
+
$stepCheckout = 'SHIPPINGADRESS';
|
112 |
+
}
|
113 |
+
if(stristr($this->realUrl,'checkout/multishipping/shipping/') != false) {
|
114 |
+
$contentCheckout = $this->eLang[2][$this->lang].'/'.$this->eLang[4][$this->lang];
|
115 |
+
$stepCheckout = 'SHIPPINGMETHOD';
|
116 |
+
}
|
117 |
+
if(stristr($this->realUrl,'checkout/multishipping/billing/') != false) {
|
118 |
+
$contentCheckout = $this->eLang[5][$this->lang];
|
119 |
+
$stepCheckout = 'PAYMENT';
|
120 |
+
}
|
121 |
+
if(stristr($this->realUrl,'checkout/multishipping/overview/') != false ||
|
122 |
+
stristr($this->realUrl,'paypal/express/review/') != false) {
|
123 |
+
$contentCheckout = $this->eLang[36][$this->lang];
|
124 |
+
$stepCheckout = 'REVIEW';
|
125 |
+
}
|
126 |
+
if(stristr($this->realUrl,'checkout/multishipping/success/') != false ||
|
127 |
+
stristr($this->realUrl,'checkout/onepage/success/') != false ||
|
128 |
+
stristr($this->realUrl,'uospayment/success/') != false) {
|
129 |
+
$contentCheckout = $this->eLang[41][$this->lang];
|
130 |
+
$stepCheckout = 'SUCCESS';
|
131 |
+
}
|
132 |
+
return array($contentCheckout,$stepCheckout);
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Get viewed product as econda object
|
137 |
+
*
|
138 |
+
* @return array
|
139 |
+
*/
|
140 |
+
public function getProductView($billingOption, $storeId)
|
141 |
+
{
|
142 |
+
$item = Mage::registry('current_product');
|
143 |
+
$getGroup = $this->getProductCategory($item->getId());
|
144 |
+
if($getGroup) {
|
145 |
+
$prodGroup = $getGroup;
|
146 |
+
}
|
147 |
+
else {
|
148 |
+
$prodGroup = $this->eLang[39][$this->lang];
|
149 |
+
}
|
150 |
+
if(Mage::getStoreConfig($billingOption, $storeId) == '1') {
|
151 |
+
if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, true) != 0) {
|
152 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, true); // with tax
|
153 |
+
}
|
154 |
+
else {
|
155 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), false, null, null, $item->getTaxClassId(), $storeId, true); // with tax
|
156 |
+
}
|
157 |
+
}
|
158 |
+
else {
|
159 |
+
if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, false) != 0) {
|
160 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, false); // with tax
|
161 |
+
}
|
162 |
+
else {
|
163 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), false, null, null, $item->getTaxClassId(), $storeId, false); // with tax
|
164 |
+
}
|
165 |
+
}
|
166 |
+
$eItem = Mage::getModel('econda/item');
|
167 |
+
$eItem->productName = trim($item->getName());
|
168 |
+
$eItem->productID = $item->getId();
|
169 |
+
$eItem->price = $this->convertPrice($priceTax);
|
170 |
+
$eItem->quantity = '1';
|
171 |
+
$eItem->productGroup = $prodGroup.'/'.trim($item->getName());
|
172 |
+
return $eItem;
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Get added or removed product from basket as econda object
|
177 |
+
*
|
178 |
+
* @return array
|
179 |
+
*/
|
180 |
+
public function getProductAddRmv($message, $storeId)
|
181 |
+
{
|
182 |
+
$isAddBasket = false;
|
183 |
+
$billingOption = 'econda/econda/billing_total';
|
184 |
+
$basketActions = Array();
|
185 |
+
|
186 |
+
// bugfix for basket after customer re-login
|
187 |
+
if(Mage::getSingleton('customer/session')->isLoggedIn() == 1) {
|
188 |
+
if($this->session->getData('econda_logged') != 1) {
|
189 |
+
$oldBasket = true;
|
190 |
+
}
|
191 |
+
else{
|
192 |
+
$oldBasket = false;
|
193 |
+
}
|
194 |
+
}
|
195 |
+
else{
|
196 |
+
$oldBasket = false;
|
197 |
+
}
|
198 |
+
$nIdArray = array();
|
199 |
+
$nQtyArray = array();
|
200 |
+
$nNmeArray = array();
|
201 |
+
$counter = 1;
|
202 |
+
foreach($this->session->getQuote()->getAllItems() as $item) {
|
203 |
+
$nIdArray[$counter] = $item->getproductId();
|
204 |
+
$nQtyArray[$counter] = $item->getQty();
|
205 |
+
$nNmeArray[$counter] = $item->getItemId();
|
206 |
+
$counter += 1;
|
207 |
+
}
|
208 |
+
if(!$this->session->getData('econda_card_id')){
|
209 |
+
$this->session->setData('econda_card_id',$nIdArray);
|
210 |
+
$this->session->setData('econda_card_qty',$nQtyArray);
|
211 |
+
$this->session->setData('econda_card_nme',$nNmeArray);
|
212 |
+
$oIdArray = $nIdArray;
|
213 |
+
$oQtyArray = $nQtyArray;
|
214 |
+
$oNmeArray = $nNmeArray;
|
215 |
+
$eStarter = 1;
|
216 |
+
}
|
217 |
+
else {
|
218 |
+
$oIdArray = $this->session->getData('econda_card_id');
|
219 |
+
$oQtyArray = $this->session->getData('econda_card_qty');
|
220 |
+
$oNmeArray = $this->session->getData('econda_card_nme');
|
221 |
+
$eStarter = 0;
|
222 |
+
}
|
223 |
+
if(!$oldBasket) {
|
224 |
+
if($eStarter == 1) {
|
225 |
+
foreach($this->session->getQuote()->getAllItems() as $item) {
|
226 |
+
$getGroup = $this->getProductCategory($item->getproductId());
|
227 |
+
if($getGroup) $prodGroup = $getGroup;
|
228 |
+
else $prodGroup = $this->eLang[39][$this->lang];
|
229 |
+
$eItem = Mage::getModel('econda/item');
|
230 |
+
$eItem->productName = trim($item->getName());
|
231 |
+
$eItem->productID = $item->getproductId();
|
232 |
+
// calculate tax
|
233 |
+
if(Mage::getStoreConfig($billingOption, $storeId) == '1') {
|
234 |
+
if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, true) != 0) {
|
235 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, true);
|
236 |
+
}
|
237 |
+
else {
|
238 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), true, null, null, $item->getTaxClassId(), $storeId, true);
|
239 |
+
}
|
240 |
+
}
|
241 |
+
else {
|
242 |
+
if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, false) != 0) {
|
243 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, false);
|
244 |
+
}
|
245 |
+
else {
|
246 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), true, null, null, $item->getTaxClassId(), $storeId, false);
|
247 |
+
}
|
248 |
+
}
|
249 |
+
$eItem->price = $this->convertPrice($priceTax);
|
250 |
+
$eItem->quantity = $item->getQty();
|
251 |
+
$eItem->productGroup = $prodGroup.'/'.trim($item->getName());
|
252 |
+
if($eItem->price != '0.00') {
|
253 |
+
$basketActions[] = Array('add', $eItem);
|
254 |
+
}
|
255 |
+
$isAddBasket = true;
|
256 |
+
}
|
257 |
+
}
|
258 |
+
else {
|
259 |
+
foreach($this->session->getQuote()->getAllItems() as $item) {
|
260 |
+
$emosAction = false;
|
261 |
+
$addRmv = false;
|
262 |
+
$idKey = array_search($item->getItemId(),$oNmeArray);
|
263 |
+
if($idKey == false) {
|
264 |
+
$emosAction = 'addBasket';
|
265 |
+
$basketQty = $item->getQty();
|
266 |
+
}
|
267 |
+
if($idKey != false) {
|
268 |
+
if($oQtyArray[$idKey] != $item->getQty()) {
|
269 |
+
if($oQtyArray[$idKey] > $item->getQty() && $oNmeArray[$idKey] == $item->getItemId()) {
|
270 |
+
$emosAction = 'rmvBasket';
|
271 |
+
$basketQty = $oQtyArray[$idKey] - $item->getQty();
|
272 |
+
}
|
273 |
+
if($oQtyArray[$idKey] < $item->getQty() && $oNmeArray[$idKey] == $item->getItemId()) {
|
274 |
+
$emosAction = 'addBasket';
|
275 |
+
$basketQty = $item->getQty() - $oQtyArray[$idKey];
|
276 |
+
}
|
277 |
+
}
|
278 |
+
}
|
279 |
+
if($emosAction != false) {
|
280 |
+
$getGroup = $this->getProductCategory($item->getproductId());
|
281 |
+
if($getGroup) $prodGroup = $getGroup;
|
282 |
+
else $prodGroup = $this->eLang[39][$this->lang];
|
283 |
+
$eItem = Mage::getModel('econda/item');
|
284 |
+
$eItem->productName = trim($item->getName());
|
285 |
+
$eItem->productID = $item->getproductId();
|
286 |
+
if(Mage::getStoreConfig($billingOption, $storeId) == '1') {
|
287 |
+
if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, true) != 0) {
|
288 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, true); // with tax
|
289 |
+
}
|
290 |
+
else {
|
291 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), true, null, null, $item->getTaxClassId(), $storeId, true); // with tax
|
292 |
+
}
|
293 |
+
}
|
294 |
+
else {
|
295 |
+
if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, false) != 0) {
|
296 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), true, null, null, $item->getTaxClassId(), $storeId, false); // with tax
|
297 |
+
}
|
298 |
+
else {
|
299 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), true, null, null, $item->getTaxClassId(), $storeId, false); // with tax
|
300 |
+
}
|
301 |
+
}
|
302 |
+
$eItem->price = $this->convertPrice($priceTax);
|
303 |
+
$eItem->quantity = $basketQty;
|
304 |
+
$eItem->productGroup = $prodGroup.'/'.trim($item->getName());
|
305 |
+
if($emosAction == 'addBasket' && stristr($message,'error-msg') == false && $eItem->price != '0.00') {
|
306 |
+
$basketActions[] = Array('add', $eItem);
|
307 |
+
$isAddBasket = true;
|
308 |
+
if(stristr($this->realUrl,'checkout/cart') == false) {
|
309 |
+
$addRmv = true;
|
310 |
+
}
|
311 |
+
}
|
312 |
+
if($emosAction == 'rmvBasket' && stristr($message,'error-msg') == false && $eItem->price != '0.00') {
|
313 |
+
if(!$addRmv) {
|
314 |
+
$basketActions[] = Array('rmv', $eItem);
|
315 |
+
}
|
316 |
+
$isAddBasket = true;
|
317 |
+
}
|
318 |
+
}
|
319 |
+
}
|
320 |
+
}
|
321 |
+
}
|
322 |
+
$this->session->setData('econda_card_qty',$nQtyArray);
|
323 |
+
$this->session->setData('econda_card_id',$nIdArray);
|
324 |
+
$this->session->setData('econda_card_nme',$nNmeArray);
|
325 |
+
return Array($isAddBasket, $billingOption, $basketActions);
|
326 |
+
}
|
327 |
+
|
328 |
+
/**
|
329 |
+
* Get products inside basket on checkout success as econda object
|
330 |
+
* include some fallback code
|
331 |
+
*
|
332 |
+
* @return array
|
333 |
+
*/
|
334 |
+
public function getBasket($billingOption, $storeId, $entityId)
|
335 |
+
{
|
336 |
+
try {
|
337 |
+
$basket = array();
|
338 |
+
$bCounter = 0;
|
339 |
+
$prefix = Mage::getConfig()->getTablePrefix();
|
340 |
+
$db = Mage::getSingleton('core/resource')->getConnection('core_write');
|
341 |
+
$table = $prefix.'sales_flat_quote_item';
|
342 |
+
$result = $db->query("SELECT product_id,name,qty,price,parent_item_id FROM $table WHERE quote_id = $entityId");
|
343 |
+
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
344 |
+
if($row['parent_item_id'] == '') {
|
345 |
+
$getGroup = Mage::getModel('econda/basket')->getProductCategory($row['product_id']);
|
346 |
+
if($getGroup) {
|
347 |
+
$prodGroup = $getGroup;
|
348 |
+
}
|
349 |
+
else {
|
350 |
+
$prodGroup = $this->eLang[39][$this->lang];
|
351 |
+
}
|
352 |
+
$item = Mage::getModel('catalog/product')->load($row['product_id']);
|
353 |
+
$eItem = Mage::getModel('econda/item');
|
354 |
+
$eItem->productName = trim($row['name']);
|
355 |
+
$eItem->productID = $row['product_id'];
|
356 |
+
$eItem->quantity = number_format($row['qty'],0);
|
357 |
+
$discount = $row['product_id'];
|
358 |
+
$table = $prefix.'catalog_product_entity_tier_price';
|
359 |
+
$resultp = $db->query("SELECT qty,value FROM $table WHERE entity_id = $discount");
|
360 |
+
$rowp = $resultp->fetch(PDO::FETCH_ASSOC);
|
361 |
+
$discountcheck = 0;
|
362 |
+
if($rowp) {
|
363 |
+
if($eItem->quantity >= $rowp['qty']) {
|
364 |
+
$discountcheck = $rowp['value'];
|
365 |
+
}
|
366 |
+
}
|
367 |
+
if(Mage::getStoreConfig($billingOption, $storeId) == '1') {
|
368 |
+
if($discountcheck > 0) {
|
369 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $discountcheck, false, null, null, $item->getTaxClassId(), $storeId, true);
|
370 |
+
}
|
371 |
+
else if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, true) != 0) {
|
372 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, true);
|
373 |
+
}
|
374 |
+
else {
|
375 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), false, null, null, $item->getTaxClassId(), $storeId, true);
|
376 |
+
}
|
377 |
+
}
|
378 |
+
else {
|
379 |
+
if($discountcheck > 0) {
|
380 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $discountcheck, false, null, null, $item->getTaxClassId(), $storeId, false);
|
381 |
+
}
|
382 |
+
else if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, false) != 0) {
|
383 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, false);
|
384 |
+
}
|
385 |
+
else {
|
386 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), false, null, null, $item->getTaxClassId(), $storeId, false);
|
387 |
+
}
|
388 |
+
}
|
389 |
+
$eItem->price = Mage::getModel('econda/basket')->convertPrice($priceTax);
|
390 |
+
$eItem->productGroup = $prodGroup.'/'.trim($row['name']);
|
391 |
+
$basket[$bCounter] = $eItem;
|
392 |
+
$bCounter += 1;
|
393 |
+
}
|
394 |
+
}
|
395 |
+
return $basket;
|
396 |
+
} catch (Exception $error) {
|
397 |
+
Mage::log("Econda on success no basket available"); // Write something into log for later support
|
398 |
+
}
|
399 |
+
return null;
|
400 |
+
}
|
401 |
+
|
402 |
+
/**
|
403 |
+
* Get billing on checkout success as econda object
|
404 |
+
* include some fallback code
|
405 |
+
*
|
406 |
+
* @return array
|
407 |
+
*/
|
408 |
+
public function getBilling($billingOption, $storeId)
|
409 |
+
{
|
410 |
+
try {
|
411 |
+
$db = Mage::getSingleton('core/resource')->getConnection('core_write');
|
412 |
+
$prefix = Mage::getConfig()->getTablePrefix();
|
413 |
+
if(stristr($this->realUrl,'checkout/onepage/success/') != false ||
|
414 |
+
stristr($this->realUrl,'uospayment/success/') != false) {//onepage
|
415 |
+
$lastOrder = Mage::getSingleton('checkout/type_onepage')->getLastOrderId();
|
416 |
+
$lastOrderId = $lastOrder;
|
417 |
+
$quote = Mage::getSingleton('checkout/type_onepage')->getQuote();
|
418 |
+
$entityId = $quote->getData('entity_id');
|
419 |
+
// fallback if there is no result
|
420 |
+
if(empty($entityId)) {
|
421 |
+
$table = $prefix.'sales_flat_quote';
|
422 |
+
$result = $db->fetchRow("SELECT entity_id FROM $table WHERE reserved_order_id = $lastOrder");
|
423 |
+
$entityId = $result['entity_id'];
|
424 |
+
}
|
425 |
+
}
|
426 |
+
else{//multipage
|
427 |
+
$entityId = intval($this->session->getData('econda_order_id'));
|
428 |
+
$orderIds = Mage::getSingleton('core/session')->getOrderIds(false);
|
429 |
+
if($orderIds && is_array($orderIds)) {
|
430 |
+
$lastOrderId = implode(' / ', $orderIds);
|
431 |
+
}
|
432 |
+
// fallback if there is no result
|
433 |
+
else {
|
434 |
+
$customerId = Mage::getSingleton('customer/session')->getCustomerId();
|
435 |
+
$table = $prefix.'sales_order';
|
436 |
+
$result = $db->query("SELECT increment_id FROM $table WHERE customer_id = $customerId");
|
437 |
+
while($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
438 |
+
$lastOrderId = $row['increment_id'];
|
439 |
+
}
|
440 |
+
}
|
441 |
+
}
|
442 |
+
// get customer address from last order
|
443 |
+
$table = $prefix.'sales_flat_quote_address';
|
444 |
+
$result = $db->query("SELECT customer_id,city,postcode,country_id,base_grand_total,base_subtotal,base_tax_amount,base_shipping_tax_amount FROM $table WHERE quote_id = $entityId AND address_type = 'shipping'");
|
445 |
+
$priceTotal = 0;
|
446 |
+
while($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
447 |
+
$custCountry = $row['country_id'];
|
448 |
+
$custPostCode = $row['postcode'];
|
449 |
+
$custCity = $row['city'];
|
450 |
+
$custId = $row['customer_id'];
|
451 |
+
$ordId = $lastOrderId;
|
452 |
+
if(Mage::getStoreConfig($billingOption, $storeId) == '1') {
|
453 |
+
$priceTotal += $row['base_subtotal'];
|
454 |
+
}
|
455 |
+
else if(Mage::getStoreConfig($billingOption, $storeId) == '2') {
|
456 |
+
$priceTotal += $row['base_subtotal'] + $row['base_tax_amount'] - $row['base_shipping_tax_amount'];
|
457 |
+
}
|
458 |
+
else {
|
459 |
+
$priceTotal += $row['base_grand_total'];
|
460 |
+
}
|
461 |
+
}
|
462 |
+
$priceTotal = Mage::getModel('econda/basket')->convertPrice($priceTotal);
|
463 |
+
$custAdress = $custCountry.'/'.substr($custPostCode,0,1).'/'.substr($custPostCode,0,2).'/'.$custCity.'/'.$custPostCode;
|
464 |
+
return Array($ordId,$custId,$priceTotal,$custCountry,$custPostCode,$custCity,$entityId);
|
465 |
+
} catch (Exception $error) {
|
466 |
+
Mage::log("Econda on success no billing available"); // Write something into log for later support
|
467 |
+
}
|
468 |
+
return null;
|
469 |
+
}
|
470 |
+
|
471 |
+
/**
|
472 |
+
* Change price format for econda
|
473 |
+
*
|
474 |
+
* @return string
|
475 |
+
*/
|
476 |
+
public function convertPrice($price)
|
477 |
+
{
|
478 |
+
$price = number_format($price,2);
|
479 |
+
$corPrice = substr($price,0,-3);
|
480 |
+
$corPrice = str_replace(',','',$corPrice);
|
481 |
+
$corPrice = str_replace('.','',$corPrice);
|
482 |
+
return $corPrice.'.'.substr($price,-2);
|
483 |
+
}
|
484 |
+
}
|
app/code/local/Mage/Econda/Model/Econda.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Model_Econda extends Mage_Core_Model_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
-
$this->_init('econda/econda');
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Model/Item.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Mage
|
16 |
+
* @package Mage_Econda
|
17 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
class Mage_Econda_Model_Item extends Mage_Core_Model_Abstract
|
21 |
+
{
|
22 |
+
|
23 |
+
/*
|
24 |
+
* @var unique Identifier of a product e.g. article number
|
25 |
+
*/
|
26 |
+
|
27 |
+
var $productID = "NULL";
|
28 |
+
|
29 |
+
/*
|
30 |
+
* @var the name of a product
|
31 |
+
*/
|
32 |
+
|
33 |
+
var $productName = "NULL";
|
34 |
+
|
35 |
+
/*
|
36 |
+
* @var the price of the product, it is your choice wether its gross or net
|
37 |
+
*/
|
38 |
+
|
39 |
+
var $price = "NULL";
|
40 |
+
|
41 |
+
/*
|
42 |
+
* @var the product group for this product, this is a drill down dimension
|
43 |
+
* or tree-like structure
|
44 |
+
* so you might want to use it like this:
|
45 |
+
* productgroup/subgroup/subgroup/product
|
46 |
+
*/
|
47 |
+
|
48 |
+
var $productGroup = "NULL";
|
49 |
+
|
50 |
+
/*
|
51 |
+
* @var the quantity / number of products viewed/bought etc..
|
52 |
+
*/
|
53 |
+
|
54 |
+
var $quantity = "NULL";
|
55 |
+
|
56 |
+
/*
|
57 |
+
* @var variant of the product e.g. size, color, brand ....
|
58 |
+
* remember to keep the order of theses variants allways the same
|
59 |
+
* decide which variant is which feature and stick to it
|
60 |
+
*/
|
61 |
+
|
62 |
+
var $variant1 = "NULL";
|
63 |
+
var $variant2 = "NULL";
|
64 |
+
var $variant3 = "NULL";
|
65 |
+
}
|
app/code/local/Mage/Econda/Model/Mysql4/Econda.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Model_Mysql4_Econda extends Mage_Core_Model_Mysql4_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
// Note that the econda_id refers to the key field in your database table.
|
8 |
-
$this->_init('econda/econda', 'econda_id');
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Model/Mysql4/Econda/Collection.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Model_Mysql4_Econda_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
-
$this->_init('econda/econda');
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Model/Mysql4/Tracker.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Model_Mysql4_Tracker extends Mage_Core_Model_Mysql4_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
// Note that the tracker_id refers to the key field in your database table.
|
8 |
-
$this->_init('tracker/tracker', 'tracker_id');
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Model/Mysql4/Tracker/Collection.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Model_Mysql4_Tracker_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
-
$this->_init('tracker/tracker');
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Model/Status.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Model_Status extends Varien_Object
|
4 |
-
{
|
5 |
-
const STATUS_ENABLED = 1;
|
6 |
-
const STATUS_DISABLED = 2;
|
7 |
-
|
8 |
-
static public function getOptionArray()
|
9 |
-
{
|
10 |
-
return array(
|
11 |
-
self::STATUS_ENABLED => Mage::helper('econda')->__('Enabled'),
|
12 |
-
self::STATUS_DISABLED => Mage::helper('econda')->__('Disabled')
|
13 |
-
);
|
14 |
-
}
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/Model/System/Config/Source/Billing.php
CHANGED
@@ -1,7 +1,28 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Mage_Econda_Model_System_Config_Source_Billing
|
4 |
{
|
|
|
|
|
|
|
|
|
5 |
public function toOptionArray()
|
6 |
{
|
7 |
return array(
|
@@ -10,4 +31,4 @@ class Mage_Econda_Model_System_Config_Source_Billing
|
|
10 |
array('value'=>'2', 'label'=>Mage::helper('econda')->__('Value of Goods with Tax (Subtotal + Tax)'))
|
11 |
);
|
12 |
}
|
13 |
-
}
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Mage
|
16 |
+
* @package Mage_Econda
|
17 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
class Mage_Econda_Model_System_Config_Source_Billing
|
21 |
{
|
22 |
+
|
23 |
+
/**
|
24 |
+
* returns the value for billing select in backend
|
25 |
+
*/
|
26 |
public function toOptionArray()
|
27 |
{
|
28 |
return array(
|
31 |
array('value'=>'2', 'label'=>Mage::helper('econda')->__('Value of Goods with Tax (Subtotal + Tax)'))
|
32 |
);
|
33 |
}
|
34 |
+
}
|
app/code/local/Mage/Econda/Model/System/Config/Source/Language.php
CHANGED
@@ -1,7 +1,28 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Mage_Econda_Model_System_Config_Source_Language
|
4 |
{
|
|
|
|
|
|
|
|
|
5 |
public function toOptionArray()
|
6 |
{
|
7 |
return array(
|
@@ -9,4 +30,4 @@ class Mage_Econda_Model_System_Config_Source_Language
|
|
9 |
array('value'=>'1', 'label'=>Mage::helper('econda')->__('english'))
|
10 |
);
|
11 |
}
|
12 |
-
}
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Mage
|
16 |
+
* @package Mage_Econda
|
17 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
class Mage_Econda_Model_System_Config_Source_Language
|
21 |
{
|
22 |
+
|
23 |
+
/**
|
24 |
+
* returns the value for language select in backend
|
25 |
+
*/
|
26 |
public function toOptionArray()
|
27 |
{
|
28 |
return array(
|
30 |
array('value'=>'1', 'label'=>Mage::helper('econda')->__('english'))
|
31 |
);
|
32 |
}
|
33 |
+
}
|
app/code/local/Mage/Econda/Model/System/Config/Source/Siteid.php
CHANGED
@@ -1,7 +1,28 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Mage_Econda_Model_System_Config_Source_Siteid
|
4 |
{
|
|
|
|
|
|
|
|
|
5 |
public function toOptionArray()
|
6 |
{
|
7 |
return array(
|
@@ -9,4 +30,3 @@ class Mage_Econda_Model_System_Config_Source_Siteid
|
|
9 |
);
|
10 |
}
|
11 |
}
|
12 |
-
?>
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Mage
|
16 |
+
* @package Mage_Econda
|
17 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
class Mage_Econda_Model_System_Config_Source_Siteid
|
21 |
{
|
22 |
+
|
23 |
+
/**
|
24 |
+
* returns the value for siteid field in backend
|
25 |
+
*/
|
26 |
public function toOptionArray()
|
27 |
{
|
28 |
return array(
|
30 |
);
|
31 |
}
|
32 |
}
|
|
app/code/local/Mage/Econda/Model/System/Config/Source/Tracking.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Model_System_Config_Source_Tracking
|
4 |
-
{
|
5 |
-
public function toOptionArray()
|
6 |
-
{
|
7 |
-
return array(
|
8 |
-
array('value'=>'1', 'label'=>Mage::helper('econda')->__('Version 1 - html')),
|
9 |
-
array('value'=>'2', 'label'=>Mage::helper('econda')->__('Version 2 - javascript'))
|
10 |
-
);
|
11 |
-
}
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/controllers/Adminhtml/EcondaController.php
DELETED
@@ -1,214 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Adminhtml_EcondaController extends Mage_Adminhtml_Controller_action
|
4 |
-
{
|
5 |
-
|
6 |
-
protected function _initAction() {
|
7 |
-
$this->loadLayout()
|
8 |
-
->_setActiveMenu('econda/items')
|
9 |
-
->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
10 |
-
|
11 |
-
return $this;
|
12 |
-
}
|
13 |
-
|
14 |
-
public function indexAction() {
|
15 |
-
$this->_initAction()
|
16 |
-
->renderLayout();
|
17 |
-
}
|
18 |
-
|
19 |
-
public function editAction() {
|
20 |
-
$id = $this->getRequest()->getParam('id');
|
21 |
-
$model = Mage::getModel('econda/econda')->load($id);
|
22 |
-
|
23 |
-
if ($model->getId() || $id == 0) {
|
24 |
-
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
25 |
-
if (!empty($data)) {
|
26 |
-
$model->setData($data);
|
27 |
-
}
|
28 |
-
|
29 |
-
Mage::register('econda_data', $model);
|
30 |
-
|
31 |
-
$this->loadLayout();
|
32 |
-
$this->_setActiveMenu('econda/items');
|
33 |
-
|
34 |
-
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
35 |
-
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
|
36 |
-
|
37 |
-
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
38 |
-
|
39 |
-
$this->_addContent($this->getLayout()->createBlock('econda/adminhtml_econda_edit'))
|
40 |
-
->_addLeft($this->getLayout()->createBlock('econda/adminhtml_econda_edit_tabs'));
|
41 |
-
|
42 |
-
$this->renderLayout();
|
43 |
-
} else {
|
44 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('econda')->__('Item does not exist'));
|
45 |
-
$this->_redirect('*/*/');
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
public function newAction() {
|
50 |
-
$this->_forward('edit');
|
51 |
-
}
|
52 |
-
|
53 |
-
public function saveAction() {
|
54 |
-
if ($data = $this->getRequest()->getPost()) {
|
55 |
-
|
56 |
-
if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
|
57 |
-
try {
|
58 |
-
/* Starting upload */
|
59 |
-
$uploader = new Varien_File_Uploader('filename');
|
60 |
-
|
61 |
-
// Any extention would work
|
62 |
-
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
|
63 |
-
$uploader->setAllowRenameFiles(false);
|
64 |
-
|
65 |
-
// Set the file upload mode
|
66 |
-
// false -> get the file directly in the specified folder
|
67 |
-
// true -> get the file in the product like folders
|
68 |
-
// (file.jpg will go in something like /media/f/i/file.jpg)
|
69 |
-
$uploader->setFilesDispersion(false);
|
70 |
-
|
71 |
-
// We set media as the upload dir
|
72 |
-
$path = Mage::getBaseDir('media') . DS ;
|
73 |
-
$uploader->save($path, $_FILES['filename']['name'] );
|
74 |
-
|
75 |
-
} catch (Exception $e) {
|
76 |
-
|
77 |
-
}
|
78 |
-
|
79 |
-
//this way the name is saved in DB
|
80 |
-
$data['filename'] = $_FILES['filename']['name'];
|
81 |
-
}
|
82 |
-
|
83 |
-
|
84 |
-
$model = Mage::getModel('econda/econda');
|
85 |
-
$model->setData($data)
|
86 |
-
->setId($this->getRequest()->getParam('id'));
|
87 |
-
|
88 |
-
try {
|
89 |
-
if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
|
90 |
-
$model->setCreatedTime(now())
|
91 |
-
->setUpdateTime(now());
|
92 |
-
} else {
|
93 |
-
$model->setUpdateTime(now());
|
94 |
-
}
|
95 |
-
|
96 |
-
$model->save();
|
97 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('econda')->__('Item was successfully saved'));
|
98 |
-
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
99 |
-
|
100 |
-
if ($this->getRequest()->getParam('back')) {
|
101 |
-
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
102 |
-
return;
|
103 |
-
}
|
104 |
-
$this->_redirect('*/*/');
|
105 |
-
return;
|
106 |
-
} catch (Exception $e) {
|
107 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
108 |
-
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
109 |
-
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
110 |
-
return;
|
111 |
-
}
|
112 |
-
}
|
113 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('econda')->__('Unable to find item to save'));
|
114 |
-
$this->_redirect('*/*/');
|
115 |
-
}
|
116 |
-
|
117 |
-
public function deleteAction() {
|
118 |
-
if( $this->getRequest()->getParam('id') > 0 ) {
|
119 |
-
try {
|
120 |
-
$model = Mage::getModel('econda/econda');
|
121 |
-
|
122 |
-
$model->setId($this->getRequest()->getParam('id'))
|
123 |
-
->delete();
|
124 |
-
|
125 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
|
126 |
-
$this->_redirect('*/*/');
|
127 |
-
} catch (Exception $e) {
|
128 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
129 |
-
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
130 |
-
}
|
131 |
-
}
|
132 |
-
$this->_redirect('*/*/');
|
133 |
-
}
|
134 |
-
|
135 |
-
public function massDeleteAction() {
|
136 |
-
$econdaIds = $this->getRequest()->getParam('econda');
|
137 |
-
if(!is_array($econdaIds)) {
|
138 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
139 |
-
} else {
|
140 |
-
try {
|
141 |
-
foreach ($econdaIds as $econdaId) {
|
142 |
-
$econda = Mage::getModel('econda/econda')->load($econdaId);
|
143 |
-
$econda->delete();
|
144 |
-
}
|
145 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(
|
146 |
-
Mage::helper('adminhtml')->__(
|
147 |
-
'Total of %d record(s) were successfully deleted', count($econdaIds)
|
148 |
-
)
|
149 |
-
);
|
150 |
-
} catch (Exception $e) {
|
151 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
152 |
-
}
|
153 |
-
}
|
154 |
-
$this->_redirect('*/*/index');
|
155 |
-
}
|
156 |
-
|
157 |
-
public function massStatusAction()
|
158 |
-
{
|
159 |
-
$econdaIds = $this->getRequest()->getParam('econda');
|
160 |
-
if(!is_array($econdaIds)) {
|
161 |
-
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
162 |
-
} else {
|
163 |
-
try {
|
164 |
-
foreach ($econdaIds as $econdaId) {
|
165 |
-
$econda = Mage::getSingleton('econda/econda')
|
166 |
-
->load($econdaId)
|
167 |
-
->setStatus($this->getRequest()->getParam('status'))
|
168 |
-
->setIsMassupdate(true)
|
169 |
-
->save();
|
170 |
-
}
|
171 |
-
$this->_getSession()->addSuccess(
|
172 |
-
$this->__('Total of %d record(s) were successfully updated', count($econdaIds))
|
173 |
-
);
|
174 |
-
} catch (Exception $e) {
|
175 |
-
$this->_getSession()->addError($e->getMessage());
|
176 |
-
}
|
177 |
-
}
|
178 |
-
$this->_redirect('*/*/index');
|
179 |
-
}
|
180 |
-
|
181 |
-
public function exportCsvAction()
|
182 |
-
{
|
183 |
-
$fileName = 'econda.csv';
|
184 |
-
$content = $this->getLayout()->createBlock('econda/adminhtml_econda_grid')
|
185 |
-
->getCsv();
|
186 |
-
|
187 |
-
$this->_sendUploadResponse($fileName, $content);
|
188 |
-
}
|
189 |
-
|
190 |
-
public function exportXmlAction()
|
191 |
-
{
|
192 |
-
$fileName = 'econda.xml';
|
193 |
-
$content = $this->getLayout()->createBlock('econda/adminhtml_econda_grid')
|
194 |
-
->getXml();
|
195 |
-
|
196 |
-
$this->_sendUploadResponse($fileName, $content);
|
197 |
-
}
|
198 |
-
|
199 |
-
protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
|
200 |
-
{
|
201 |
-
$response = $this->getResponse();
|
202 |
-
$response->setHeader('HTTP/1.1 200 OK','');
|
203 |
-
$response->setHeader('Pragma', 'public', true);
|
204 |
-
$response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
|
205 |
-
$response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
|
206 |
-
$response->setHeader('Last-Modified', date('r'));
|
207 |
-
$response->setHeader('Accept-Ranges', 'bytes');
|
208 |
-
$response->setHeader('Content-Length', strlen($content));
|
209 |
-
$response->setHeader('Content-type', $contentType);
|
210 |
-
$response->setBody($content);
|
211 |
-
$response->sendResponse();
|
212 |
-
die;
|
213 |
-
}
|
214 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/controllers/Adminhtml/TrackerController.php
DELETED
@@ -1,214 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Mage_Econda_Adminhtml_TrackerController extends Mage_Adminhtml_Controller_action
|
4 |
-
{
|
5 |
-
|
6 |
-
protected function _initAction() {
|
7 |
-
$this->loadLayout()
|
8 |
-
->_setActiveMenu('tracker/items')
|
9 |
-
->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
10 |
-
|
11 |
-
return $this;
|
12 |
-
}
|
13 |
-
|
14 |
-
public function indexAction() {
|
15 |
-
$this->_initAction()
|
16 |
-
->renderLayout();
|
17 |
-
}
|
18 |
-
|
19 |
-
public function editAction() {
|
20 |
-
$id = $this->getRequest()->getParam('id');
|
21 |
-
$model = Mage::getModel('tracker/tracker')->load($id);
|
22 |
-
|
23 |
-
if ($model->getId() || $id == 0) {
|
24 |
-
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
25 |
-
if (!empty($data)) {
|
26 |
-
$model->setData($data);
|
27 |
-
}
|
28 |
-
|
29 |
-
Mage::register('tracker_data', $model);
|
30 |
-
|
31 |
-
$this->loadLayout();
|
32 |
-
$this->_setActiveMenu('tracker/items');
|
33 |
-
|
34 |
-
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
35 |
-
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
|
36 |
-
|
37 |
-
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
38 |
-
|
39 |
-
$this->_addContent($this->getLayout()->createBlock('tracker/adminhtml_tracker_edit'))
|
40 |
-
->_addLeft($this->getLayout()->createBlock('tracker/adminhtml_tracker_edit_tabs'));
|
41 |
-
|
42 |
-
$this->renderLayout();
|
43 |
-
} else {
|
44 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('tracker')->__('Item does not exist'));
|
45 |
-
$this->_redirect('*/*/');
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
public function newAction() {
|
50 |
-
$this->_forward('edit');
|
51 |
-
}
|
52 |
-
|
53 |
-
public function saveAction() {
|
54 |
-
if ($data = $this->getRequest()->getPost()) {
|
55 |
-
|
56 |
-
if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
|
57 |
-
try {
|
58 |
-
/* Starting upload */
|
59 |
-
$uploader = new Varien_File_Uploader('filename');
|
60 |
-
|
61 |
-
// Any extention would work
|
62 |
-
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
|
63 |
-
$uploader->setAllowRenameFiles(false);
|
64 |
-
|
65 |
-
// Set the file upload mode
|
66 |
-
// false -> get the file directly in the specified folder
|
67 |
-
// true -> get the file in the product like folders
|
68 |
-
// (file.jpg will go in something like /media/f/i/file.jpg)
|
69 |
-
$uploader->setFilesDispersion(false);
|
70 |
-
|
71 |
-
// We set media as the upload dir
|
72 |
-
$path = Mage::getBaseDir('media') . DS ;
|
73 |
-
$uploader->save($path, $_FILES['filename']['name'] );
|
74 |
-
|
75 |
-
} catch (Exception $e) {
|
76 |
-
|
77 |
-
}
|
78 |
-
|
79 |
-
//this way the name is saved in DB
|
80 |
-
$data['filename'] = $_FILES['filename']['name'];
|
81 |
-
}
|
82 |
-
|
83 |
-
|
84 |
-
$model = Mage::getModel('tracker/tracker');
|
85 |
-
$model->setData($data)
|
86 |
-
->setId($this->getRequest()->getParam('id'));
|
87 |
-
|
88 |
-
try {
|
89 |
-
if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
|
90 |
-
$model->setCreatedTime(now())
|
91 |
-
->setUpdateTime(now());
|
92 |
-
} else {
|
93 |
-
$model->setUpdateTime(now());
|
94 |
-
}
|
95 |
-
|
96 |
-
$model->save();
|
97 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('tracker')->__('Item was successfully saved'));
|
98 |
-
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
99 |
-
|
100 |
-
if ($this->getRequest()->getParam('back')) {
|
101 |
-
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
102 |
-
return;
|
103 |
-
}
|
104 |
-
$this->_redirect('*/*/');
|
105 |
-
return;
|
106 |
-
} catch (Exception $e) {
|
107 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
108 |
-
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
109 |
-
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
110 |
-
return;
|
111 |
-
}
|
112 |
-
}
|
113 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('tracker')->__('Unable to find item to save'));
|
114 |
-
$this->_redirect('*/*/');
|
115 |
-
}
|
116 |
-
|
117 |
-
public function deleteAction() {
|
118 |
-
if( $this->getRequest()->getParam('id') > 0 ) {
|
119 |
-
try {
|
120 |
-
$model = Mage::getModel('tracker/tracker');
|
121 |
-
|
122 |
-
$model->setId($this->getRequest()->getParam('id'))
|
123 |
-
->delete();
|
124 |
-
|
125 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
|
126 |
-
$this->_redirect('*/*/');
|
127 |
-
} catch (Exception $e) {
|
128 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
129 |
-
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
130 |
-
}
|
131 |
-
}
|
132 |
-
$this->_redirect('*/*/');
|
133 |
-
}
|
134 |
-
|
135 |
-
public function massDeleteAction() {
|
136 |
-
$trackerIds = $this->getRequest()->getParam('tracker');
|
137 |
-
if(!is_array($trackerIds)) {
|
138 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
139 |
-
} else {
|
140 |
-
try {
|
141 |
-
foreach ($trackerIds as $trackerId) {
|
142 |
-
$tracker = Mage::getModel('tracker/tracker')->load($trackerId);
|
143 |
-
$tracker->delete();
|
144 |
-
}
|
145 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(
|
146 |
-
Mage::helper('adminhtml')->__(
|
147 |
-
'Total of %d record(s) were successfully deleted', count($trackerIds)
|
148 |
-
)
|
149 |
-
);
|
150 |
-
} catch (Exception $e) {
|
151 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
152 |
-
}
|
153 |
-
}
|
154 |
-
$this->_redirect('*/*/index');
|
155 |
-
}
|
156 |
-
|
157 |
-
public function massStatusAction()
|
158 |
-
{
|
159 |
-
$trackerIds = $this->getRequest()->getParam('tracker');
|
160 |
-
if(!is_array($trackerIds)) {
|
161 |
-
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
162 |
-
} else {
|
163 |
-
try {
|
164 |
-
foreach ($trackerIds as $trackerId) {
|
165 |
-
$tracker = Mage::getSingleton('tracker/tracker')
|
166 |
-
->load($trackerId)
|
167 |
-
->setStatus($this->getRequest()->getParam('status'))
|
168 |
-
->setIsMassupdate(true)
|
169 |
-
->save();
|
170 |
-
}
|
171 |
-
$this->_getSession()->addSuccess(
|
172 |
-
$this->__('Total of %d record(s) were successfully updated', count($trackerIds))
|
173 |
-
);
|
174 |
-
} catch (Exception $e) {
|
175 |
-
$this->_getSession()->addError($e->getMessage());
|
176 |
-
}
|
177 |
-
}
|
178 |
-
$this->_redirect('*/*/index');
|
179 |
-
}
|
180 |
-
|
181 |
-
public function exportCsvAction()
|
182 |
-
{
|
183 |
-
$fileName = 'tracker.csv';
|
184 |
-
$content = $this->getLayout()->createBlock('tracker/adminhtml_tracker_grid')
|
185 |
-
->getCsv();
|
186 |
-
|
187 |
-
$this->_sendUploadResponse($fileName, $content);
|
188 |
-
}
|
189 |
-
|
190 |
-
public function exportXmlAction()
|
191 |
-
{
|
192 |
-
$fileName = 'tracker.xml';
|
193 |
-
$content = $this->getLayout()->createBlock('tracker/adminhtml_tracker_grid')
|
194 |
-
->getXml();
|
195 |
-
|
196 |
-
$this->_sendUploadResponse($fileName, $content);
|
197 |
-
}
|
198 |
-
|
199 |
-
protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
|
200 |
-
{
|
201 |
-
$response = $this->getResponse();
|
202 |
-
$response->setHeader('HTTP/1.1 200 OK','');
|
203 |
-
$response->setHeader('Pragma', 'public', true);
|
204 |
-
$response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
|
205 |
-
$response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
|
206 |
-
$response->setHeader('Last-Modified', date('r'));
|
207 |
-
$response->setHeader('Accept-Ranges', 'bytes');
|
208 |
-
$response->setHeader('Content-Length', strlen($content));
|
209 |
-
$response->setHeader('Content-type', $contentType);
|
210 |
-
$response->setBody($content);
|
211 |
-
$response->sendResponse();
|
212 |
-
die;
|
213 |
-
}
|
214 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/controllers/IndexController.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Mage_Econda_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
-
{
|
4 |
-
public function indexAction()
|
5 |
-
{
|
6 |
-
|
7 |
-
/*
|
8 |
-
* Load an object by id
|
9 |
-
* Request looking like:
|
10 |
-
* http://site.com/econda?id=15
|
11 |
-
* or
|
12 |
-
* http://site.com/econda/id/15
|
13 |
-
*/
|
14 |
-
/*
|
15 |
-
$econda_id = $this->getRequest()->getParam('id');
|
16 |
-
|
17 |
-
if($econda_id != null && $econda_id != '') {
|
18 |
-
$econda = Mage::getModel('econda/econda')->load($econda_id)->getData();
|
19 |
-
} else {
|
20 |
-
$econda = null;
|
21 |
-
}
|
22 |
-
*/
|
23 |
-
|
24 |
-
/*
|
25 |
-
* If no param we load a the last created item
|
26 |
-
*/
|
27 |
-
/*
|
28 |
-
if($econda == null) {
|
29 |
-
$resource = Mage::getSingleton('core/resource');
|
30 |
-
$read= $resource->getConnection('core_read');
|
31 |
-
$econdaTable = $resource->getTableName('econda');
|
32 |
-
|
33 |
-
$select = $read->select()
|
34 |
-
->from($econdaTable,array('econda_id','title','content','status'))
|
35 |
-
->where('status',1)
|
36 |
-
->order('created_time DESC') ;
|
37 |
-
|
38 |
-
$econda = $read->fetchRow($select);
|
39 |
-
}
|
40 |
-
Mage::register('econda', $econda);
|
41 |
-
*/
|
42 |
-
|
43 |
-
|
44 |
-
$this->loadLayout();
|
45 |
-
$this->renderLayout();
|
46 |
-
}
|
47 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Mage/Econda/etc/config.xml
CHANGED
@@ -1,8 +1,17 @@
|
|
1 |
-
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Mage_Econda>
|
5 |
-
<version>1.
|
6 |
</Mage_Econda>
|
7 |
</modules>
|
8 |
<frontend>
|
@@ -25,51 +34,51 @@
|
|
25 |
</frontend>
|
26 |
<admin>
|
27 |
<routers>
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
</routers>
|
36 |
</admin>
|
37 |
<adminhtml>
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
</adminhtml>
|
74 |
<global>
|
75 |
<resources>
|
@@ -103,4 +112,4 @@
|
|
103 |
</econda>
|
104 |
</helpers>
|
105 |
</global>
|
106 |
-
</config>
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!-- /** * Magento * * NOTICE OF LICENSE * * This source file is subject
|
3 |
+
to the Open Software License (OSL 3.0) * that is bundled with this package
|
4 |
+
in the file LICENSE.txt. * It is also available through the world-wide-web
|
5 |
+
at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not
|
6 |
+
receive a copy of the license and are unable to * obtain it through the world-wide-web,
|
7 |
+
please send an email * to license@magentocommerce.com so we can send you
|
8 |
+
a copy immediately. * * @category Mage * @package Mage_Econda * @copyright
|
9 |
+
Copyright (c) 2010 econda GmbH (http://www.econda.de) * @license http://opensource.org/licenses/osl-3.0.php
|
10 |
+
Open Software License (OSL 3.0) */ -->
|
11 |
<config>
|
12 |
<modules>
|
13 |
<Mage_Econda>
|
14 |
+
<version>1.5.0</version>
|
15 |
</Mage_Econda>
|
16 |
</modules>
|
17 |
<frontend>
|
34 |
</frontend>
|
35 |
<admin>
|
36 |
<routers>
|
37 |
+
<econda>
|
38 |
+
<use>admin</use>
|
39 |
+
<args>
|
40 |
+
<module>Mage_Econda</module>
|
41 |
+
<frontName>econda</frontName>
|
42 |
+
</args>
|
43 |
+
</econda>
|
44 |
</routers>
|
45 |
</admin>
|
46 |
<adminhtml>
|
47 |
+
<translate>
|
48 |
+
<modules>
|
49 |
+
<Mage_Econda>
|
50 |
+
<files>
|
51 |
+
<default>Mage_Econda.csv</default>
|
52 |
+
</files>
|
53 |
+
</Mage_Econda>
|
54 |
+
</modules>
|
55 |
+
</translate>
|
56 |
+
<acl>
|
57 |
+
<resources>
|
58 |
+
<admin>
|
59 |
+
<children>
|
60 |
+
<system>
|
61 |
+
<children>
|
62 |
+
<config>
|
63 |
+
<children>
|
64 |
+
<econda>
|
65 |
+
<title>Econda Section</title>
|
66 |
+
</econda>
|
67 |
+
</children>
|
68 |
+
</config>
|
69 |
+
</children>
|
70 |
+
</system>
|
71 |
+
</children>
|
72 |
+
</admin>
|
73 |
+
</resources>
|
74 |
+
</acl>
|
75 |
+
<layout>
|
76 |
+
<updates>
|
77 |
+
<econda>
|
78 |
+
<file>econda.xml</file>
|
79 |
+
</econda>
|
80 |
+
</updates>
|
81 |
+
</layout>
|
82 |
</adminhtml>
|
83 |
<global>
|
84 |
<resources>
|
112 |
</econda>
|
113 |
</helpers>
|
114 |
</global>
|
115 |
+
</config>
|
app/code/local/Mage/Econda/etc/system.xml
CHANGED
@@ -1,91 +1,254 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
* Magento
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
7 |
*
|
8 |
-
* This source file is subject to the
|
9 |
-
* that is bundled with this package in the file
|
10 |
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://opensource.org/licenses/
|
12 |
* If you did not receive a copy of the license and are unable to
|
13 |
* obtain it through the world-wide-web, please send an email
|
14 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
*
|
16 |
-
*
|
17 |
-
*
|
18 |
-
*
|
19 |
-
*
|
20 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
-
*
|
22 |
-
* @category
|
23 |
-
* @package Econda_tracker
|
24 |
-
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
25 |
-
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
*/
|
27 |
-
-->
|
28 |
<config>
|
29 |
<sections>
|
30 |
-
|
31 |
-
<label>econda Web Controlling</label>
|
32 |
<tab>sales</tab>
|
33 |
<frontend_type>text</frontend_type>
|
34 |
-
<sort_order>
|
35 |
<show_in_default>1</show_in_default>
|
36 |
<show_in_website>1</show_in_website>
|
37 |
-
<show_in_store>0</show_in_store>
|
38 |
<groups>
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
<show_in_store>0</show_in_store>
|
45 |
<fields>
|
46 |
-
|
47 |
-
|
48 |
<comment>Select only the language, which at the time of initial activation of your econda product has been selected.</comment>
|
49 |
<frontend_type>select</frontend_type>
|
50 |
<source_model>econda/system_config_source_language</source_model>
|
51 |
<sort_order>1</sort_order>
|
52 |
-
<show_in_default>1</show_in_default>
|
53 |
-
<show_in_website>1</show_in_website>
|
54 |
-
<show_in_store>0</show_in_store>
|
55 |
-
</tracking_language>
|
56 |
-
<tracking_version>
|
57 |
-
<label>Tracking Version</label>
|
58 |
-
<comment>Only newer versions of the emos2.js file (received after September 2009) can handle Version 2. Copy your personal emos2.js file into the direcotory /js/tracker/.</comment>
|
59 |
-
<frontend_type>select</frontend_type>
|
60 |
-
<source_model>econda/system_config_source_tracking</source_model>
|
61 |
-
<sort_order>2</sort_order>
|
62 |
<show_in_default>1</show_in_default>
|
63 |
<show_in_website>1</show_in_website>
|
64 |
<show_in_store>0</show_in_store>
|
65 |
-
</
|
66 |
<tracking_siteid>
|
67 |
<label>Siteid</label>
|
68 |
-
<comment>Set Siteid manually. Only change this in agreement with econda. Leave empty, if not used.</comment>
|
69 |
<frontend_type>text</frontend_type>
|
70 |
-
<source_model>econda/system_config_source_siteid</source_model>
|
71 |
<sort_order>3</sort_order>
|
72 |
<show_in_default>1</show_in_default>
|
73 |
<show_in_website>1</show_in_website>
|
74 |
<show_in_store>0</show_in_store>
|
75 |
-
</tracking_siteid>
|
76 |
<billing_total>
|
77 |
<label>Billing and Prices</label>
|
78 |
-
<comment>Get Billing and Prices with or without Tax and Shipping</comment>
|
79 |
<frontend_type>select</frontend_type>
|
80 |
-
<source_model>econda/system_config_source_billing</source_model>
|
81 |
<sort_order>4</sort_order>
|
82 |
<show_in_default>1</show_in_default>
|
83 |
<show_in_website>1</show_in_website>
|
84 |
<show_in_store>0</show_in_store>
|
85 |
-
</billing_total>
|
86 |
-
</fields>
|
87 |
-
</
|
88 |
-
</groups>
|
89 |
-
|
90 |
</sections>
|
91 |
</config>
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<!--
|
3 |
/**
|
4 |
* Magento
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
7 |
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
* If you did not receive a copy of the license and are unable to
|
13 |
* obtain it through the world-wide-web, please send an email
|
14 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
*
|
16 |
+
* @category Mage
|
17 |
+
* @package Mage_Econda
|
18 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
*/
|
21 |
+
-->
|
22 |
<config>
|
23 |
<sections>
|
24 |
+
<econda module="econda">
|
25 |
+
<label>econda Web Shop Controlling</label>
|
26 |
<tab>sales</tab>
|
27 |
<frontend_type>text</frontend_type>
|
28 |
+
<sort_order>335</sort_order>
|
29 |
<show_in_default>1</show_in_default>
|
30 |
<show_in_website>1</show_in_website>
|
31 |
+
<show_in_store>0</show_in_store>
|
32 |
<groups>
|
33 |
+
<info translate="label">
|
34 |
+
<label>Info</label>
|
35 |
+
<sort_order>10</sort_order>
|
36 |
+
<frontend_type>text</frontend_type>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>0</show_in_store>
|
40 |
+
<comment><![CDATA[
|
41 |
+
<div style="font-family:Arial,sans-serif;background-color:white;color:#000000;font-size:13px;">
|
42 |
+
<table border="0" cellpadding="0" cellspacing="0" style="width:640px;padding:2px;margin:4px;">
|
43 |
+
<tr>
|
44 |
+
<td style="width:320px;padding-bottom:20px;">
|
45 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;font-weight:bold;">High-End Web-Analyse für Magento-Shops</p>Mit econda verfügt Market Ready Germany<br />über eine datenschutzkonforme High-End<br />Web-Analyse Lösung. Optimal abgestimmt<br />auf die Erfordernisse deutscher Online-Shop-<br />Betreiber und perfekt verzahnt mit Magento.
|
46 |
+
</td>
|
47 |
+
<td style="vertical-align:middle;">
|
48 |
+
<a href="http://www.econda.de/produkte/landing-page/partner/market-ready-germany.html?campaign=partner/MRG/01_econda_logo" target="_blank"><img src="http://www.econda.de/fileadmin/templates/econda/images/magento/econda_logo.jpg" width="173" height="63" border="0" /></a><p> </p>
|
49 |
+
</td>
|
50 |
+
</tr>
|
51 |
+
<tr>
|
52 |
+
<td>
|
53 |
+
<a href="http://www.econda.de/produkte/landing-page/partner/market-ready-germany.html?campaign=partner/MRG/02_aktionsbanner" target="_blank"><img style="padding-bottom:15px;" src="http://www.econda.de/fileadmin/templates/econda/images/magento/aktionsbanner.jpg" width="252" height="283" border="0" /></a>
|
54 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;font-weight: bold;">Umsatz hoch, Marketingkosten runter</p>econda ist bei über 1000 E-Commerce<br />Unternehmen erfolgreich im Einsatz und liefert<br />die Zahlen für nachhaltige Erfolgsoptimierung<br />und dauerhafte Umsatzsteigerung.
|
55 |
+
</td>
|
56 |
+
<td>
|
57 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;font-weight:bold;">Einfachste Aktivierung, sofort Ergebnisse</p>Jetzt integrieren und nach 5 Minuten eigene<br />Analysen sehen! Die Reporting-Kapitel sind<br />von Anfang an automatisch mit Ihren Daten<br />gefüllt.
|
58 |
+
<p> </p>
|
59 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;font-weight:bold;">TÜV zertifizierter Datenschutz</p>"econda ist eines der wenigen Webanalyse-Tools,<br />die laut einer Studie dem Kriterienkatalog der obersten<br />Datenschutzbehörden entsprechen und somit daten-<br />schutzkonform in Deutschland eingesetzt werden<br />können."<br /><em style="font-size:12px;">Thomas Karst, Geschäftsführer der Trusted Shops GmbH</em>
|
60 |
+
<p> </p>
|
61 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;font-weight:bold;">Sonderaktion für Magento mit Market Ready Germany</p>Jetzt 2 Wochen gratis testen und bei Buchung<br />die Einrichtungsgebühr sparen!
|
62 |
+
<p> </p>
|
63 |
+
<button style="" class="scalable" type="button" onclick="window.open('http://www.econda.de/produkte/landing-page/partner/market-ready-germany.html?campaign=partner/MRG/03_testbutton_1')"><span>Jetzt kostenlos testen!</span></button>
|
64 |
+
</td>
|
65 |
+
</tr>
|
66 |
+
</table>
|
67 |
+
</div>
|
68 |
+
<script type="text/javascript">
|
69 |
+
document.observe('dom:loaded', function(){
|
70 |
+
$('econda_info').style.display='block';
|
71 |
+
});
|
72 |
+
</script>
|
73 |
+
]]></comment>
|
74 |
+
</info>
|
75 |
+
<econda_details translate="label">
|
76 |
+
<label>Features</label>
|
77 |
+
<frontend_type>text</frontend_type>
|
78 |
+
<sort_order>11</sort_order>
|
79 |
+
<show_in_default>1</show_in_default>
|
80 |
+
<show_in_website>1</show_in_website>
|
81 |
+
<show_in_store>0</show_in_store>
|
82 |
+
<comment><![CDATA[
|
83 |
+
<div style="font-family:Arial,sans-serif;background-color:white;color:#000000;font-size:13px;">
|
84 |
+
<table border="0" cellpadding="0" cellspacing="0" style="width:640px;padding:2px;margin:4px;">
|
85 |
+
<tr>
|
86 |
+
<td style="width:320px;padding-bottom:20px;">
|
87 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;font-weight:bold;">econda Shop Monitor</p>Der econda Shop Monitor ist eine High-End<br />Web-Analyse Lösung, die exakt auf die An-<br />forderungen deutscher Online-Shop-Betreiber<br />und auf Magento zugeschnitten ist. Basierend<br />auf der wegweisenden econda r.a.c.e. technology<br />liefern die Web Controlling Lösungen rasante<br />Analyseauswertungen in Echtzeit bei maximaler<br />Flexibilität.
|
88 |
+
</td>
|
89 |
+
<td style="vertical-align:middle;">
|
90 |
+
<a href="http://www.econda.de/produkte/landing-page/partner/market-ready-germany.html?campaign=partner/MRG/04_screenshot_shop" target="_blank"><img src="http://www.econda.de/fileadmin/templates/econda/images/magento/screenshot_shop.jpg" width="307" height="136" border="0" /></a>
|
91 |
+
</td>
|
92 |
+
</tr>
|
93 |
+
<tr>
|
94 |
+
<td colspan="2" style="padding-bottom:20px;">
|
95 |
+
<p>Zielführende Analysen liefern den Shop- und Marketingverantwortlichen die Zahlen für dauerhafte<br />Umsatzsteigerung und nachhaltiges und erfolgsorientiertes Marketing.</p>
|
96 |
+
</td>
|
97 |
+
</tr>
|
98 |
+
<tr>
|
99 |
+
<td style="padding-bottom:20px;">
|
100 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;font-weight:bold;">econda Shop Monitor Features</p>
|
101 |
+
<ul style="list-style-type: disc;margin-left:14px">
|
102 |
+
<li>Realtime Tracking</li>
|
103 |
+
<li>High Performance Messung</li>
|
104 |
+
<li>Customer Journey Analyse</li>
|
105 |
+
<li>Online-Marketing Kontrolle</li>
|
106 |
+
<li>Freie Segmentierung nach Besuchergruppen</li>
|
107 |
+
<li>Multichannel Marketing Tracking</li>
|
108 |
+
<li>Umfassendes on-site Tracking</li>
|
109 |
+
<li>Detaillierte Bestellprozess-Analyse</li>
|
110 |
+
<li>TÜV geprüfter Datenschutz</li>
|
111 |
+
<li>A/B und Multivariates Testing</li>
|
112 |
+
<li>Automatische Alerts und Reports</li>
|
113 |
+
<li>Zahlreiche E-Commerce Plug-Ins</li>
|
114 |
+
</ul>
|
115 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;font-weight:bold;padding-top:10px;">Mehr infos finden Sie hier: <a href="http://www.econda.de/produkte/landing-page/partner/market-ready-germany.html?campaign=partner/MRG/06_Info-Link" target="_blank">www.econda.de/mrg</a></p>
|
116 |
+
</td>
|
117 |
+
<td style="vertical-align:middle;">
|
118 |
+
<a href="http://www.econda.de/produkte/landing-page/partner/market-ready-germany.html?campaign=partner/MRG/05_screenshot_click" target="_blank"><img src="http://www.econda.de/fileadmin/templates/econda/images/magento/screenshot_click.jpg" width="252" height="180" border="0" /></a>
|
119 |
+
</td>
|
120 |
+
</tr>
|
121 |
+
<tr>
|
122 |
+
<td style="padding-bottom:20px;">
|
123 |
+
<a href="http://www.econda.de/produkte/landing-page/partner/market-ready-germany.html?campaign=partner/MRG/07_TUEV" target="_blank"><img src="http://www.econda.de/fileadmin/templates/econda/images/magento/tuev.jpg" width="176" height="141" border="0" /></a>
|
124 |
+
</td>
|
125 |
+
<td>
|
126 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;font-weight: bold;">TÜV zertifizierter Datenschutz</p>Als erster Anbieter hat econda das TÜV Siegel<br />"Geprüfter Datenschutz" des TÜV Saarland für<br />den Bereich Web Shop Controlling erhalten und<br />bietet seinen Kunden damit höchste Sicherheit<br />und Professionalität im Umgang mit Daten.
|
127 |
+
</td>
|
128 |
+
</tr>
|
129 |
+
<tr>
|
130 |
+
<td colspan="2">
|
131 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;font-weight: bold;">Web-Analyse Expertenwissen und Beratung</p>Das econda-Experten-Team steht Kunden mit Web Analytics Expertise aus hunderten erfolgreichen Projekten beratend zur Seite.
|
132 |
+
<p> </p>
|
133 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;font-weight: bold;">Kostenlos testen – Sonderaktion für Magento mit Market Ready Germany</p>Jetzt 2 Wochen gratis testen und bei Buchung die Einrichtungsgebühr sparen!
|
134 |
+
<p> </p>
|
135 |
+
<button style="" class="scalable" type="button" onclick="window.open('http://www.econda.de/produkte/landing-page/partner/market-ready-germany.html?campaign=partner/MRG/08_testbutton_2')"><span>Jetzt kostenlos testen!</span></button>
|
136 |
+
</td>
|
137 |
+
</tr>
|
138 |
+
</table>
|
139 |
+
</div>
|
140 |
+
]]></comment>
|
141 |
+
</econda_details>
|
142 |
+
<econda_order translate="label">
|
143 |
+
<label>Test it for free</label>
|
144 |
+
<frontend_type>text</frontend_type>
|
145 |
+
<sort_order>12</sort_order>
|
146 |
+
<show_in_default>1</show_in_default>
|
147 |
+
<show_in_website>1</show_in_website>
|
148 |
+
<show_in_store>0</show_in_store>
|
149 |
+
<comment><![CDATA[
|
150 |
+
<div style="font-family:Arial,sans-serif;background-color:white;color:#000000;font-size:13px;">
|
151 |
+
<table border="0" cellpadding="0" cellspacing="0" style="width:640px;padding:2px;margin:4px;">
|
152 |
+
<tr>
|
153 |
+
<td style="padding-bottom:20px;">
|
154 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;font-weight: bold;">econda Web-Analyse – jetzt 2 Wochen gratis testen und Preisvorteil sichern</p>econda bietet Ihnen einen unverbindlichen und kostenlosen Test inklusive eines persönlichen Optimierungsgesprächs am Ende der Testphase an. Die econda Web-Controlling Experten stehen Ihnen während Ihrer Testphase gerne beratend zur Seite. Entscheiden Sie sich nach dem Test für die dauerhafte Nutzung des Shop Monitor, sparen Sie darüber hinaus als Magento Market Ready Germany Nutzer die Einrichtungsgebühr!
|
155 |
+
</td>
|
156 |
+
</tr>
|
157 |
+
<tr>
|
158 |
+
<td style="padding-bottom:20px;">
|
159 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;font-weight: bold;">Jetzt integrieren und nach 5 Minuten eigene Analysen sehen!</p>Testen Sie jetzt den Shop Monitor, die Datenzentrale für Ihren Erfolg im E-Commerce. Und erhalten Sie schon nach kürzester Zeit einen völlig neuen Blick auf das Potenzial Ihres Online-Shops! Über 1000 Kunden, darunter zahlreiche Unternehmen aus den Top 100 des deutschen Versandhandels, vertrauen bereits auf econda. Testen auch Sie jetzt!
|
160 |
+
</td>
|
161 |
+
</tr>
|
162 |
+
<tr>
|
163 |
+
<td>
|
164 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;font-weight: bold;">Kostenlos testen - Sonderaktion für Magento mit Market Ready Germany</p>Jetzt 2 Wochen gratis testen und bei Buchung die Einrichtungsgebühr sparen!
|
165 |
+
<p> </p>
|
166 |
+
<button style="" class="scalable" type="button" onclick="window.open('http://www.econda.de/produkte/landing-page/partner/market-ready-germany.html?campaign=partner/MRG/09_testbutton_3')"><span>Jetzt kostenlos testen!</span></button>
|
167 |
+
</td>
|
168 |
+
</tr>
|
169 |
+
</table>
|
170 |
+
</div>
|
171 |
+
]]></comment>
|
172 |
+
</econda_order>
|
173 |
+
<econda_activation translate="label">
|
174 |
+
<label>Activation</label>
|
175 |
+
<frontend_type>text</frontend_type>
|
176 |
+
<sort_order>13</sort_order>
|
177 |
+
<show_in_default>1</show_in_default>
|
178 |
+
<show_in_website>1</show_in_website>
|
179 |
+
<show_in_store>0</show_in_store>
|
180 |
+
<comment><![CDATA[
|
181 |
+
<div style="font-family:Arial,sans-serif;background-color:white;color:#000000;font-size:13px;">
|
182 |
+
<table border="0" cellpadding="0" cellspacing="0" style="width:640px;padding:2px;margin:4px;">
|
183 |
+
<tr>
|
184 |
+
<td style="padding-bottom:20px;">
|
185 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;">Nach der Bestellung Ihres <a href="http://www.econda.de/produkte/landing-page/partner/market-ready-germany.html?campaign=partner/MRG/10_Info-Link_2" target="_blank">econda Shop Monitor Testzugangs</a> erhalten Sie eine Aktivierungs-E-Mail mit den Informationen zur Aktivierung. Im Anhang der E-Mail finden Sie eine gepackte Datei, die die econda Tracking-Bibliothek "emos2.js" enthält. Zur Aktivierung kopieren diese "emos2.js" einfach in das Verzeichnis "/js/tracker" Ihres Magento Systems. Ab diesem Zeitpunkt werden bereits Daten von Ihrem Shop an econda übermittelt und sind innerhalb weniger Minuten in Ihrem econda Shop Monitor einsehbar.</p>
|
186 |
+
</td>
|
187 |
+
</tr>
|
188 |
+
<tr>
|
189 |
+
<td style="padding-bottom:20px;">
|
190 |
+
<p>Nach Wunsch können Sie ergänzend innerhalb des Abschnittes "Einstellungen" auf dieser Seite folgende Anpassungen vornehmen:</p>
|
191 |
+
</td>
|
192 |
+
</tr>
|
193 |
+
<tr>
|
194 |
+
<td style="padding-bottom:20px;">
|
195 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;">"Verwendete Sprache"</p>Hier können Sie festlegen, ob bestimmte Begriffe innerhalb Ihrer econda Auswertungen in deutscher oder englischer Sprache aufgeführt werden sollen. So kann zum Beispiel der Begriff "Warenkorb" auf Englisch als "Shopping Cart" angezeigt werden.
|
196 |
+
</td>
|
197 |
+
</tr>
|
198 |
+
<tr>
|
199 |
+
<td style="padding-bottom:20px;">
|
200 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;">"Siteid"</p>Wenn Sie mehrere verschiedene Shops auf unterschiedlichen Shopsystemen mit econda messen möchten, kann hier eine eindeutige Bezeichnung eingetragen werden, damit dieser Shop eindeutig identifiziert werden kann. In Verbindung mit einem alleinstehenden Magento oder Magento Multishop-System lassen Sie dieses Feld einfach leer, da hiermit dieser Wert automatisch ermittelt wird.
|
201 |
+
</td>
|
202 |
+
</tr>
|
203 |
+
<tr>
|
204 |
+
<td>
|
205 |
+
<p style="font-family:Arial;color:#000000;font-size:10pt;line-height:1.3em;">"Rechnung und Preise"</p>Hier können Sie bestimmen, ob die Rechnungspreise in Netto, Brutto oder in Brutto inklusive der Versandkosten an econda übermittelt werden und in die Konversionen einfließen sollen.
|
206 |
+
</td>
|
207 |
+
</tr>
|
208 |
+
</table>
|
209 |
+
</div>
|
210 |
+
]]></comment>
|
211 |
+
</econda_activation>
|
212 |
+
<econda_settings translate="label">
|
213 |
+
<label>Settings</label>
|
214 |
+
<sort_order>14</sort_order>
|
215 |
+
<show_in_default>1</show_in_default>
|
216 |
+
<show_in_website>1</show_in_website>
|
217 |
<show_in_store>0</show_in_store>
|
218 |
<fields>
|
219 |
+
<tracking_language>
|
220 |
+
<label>Used Language</label>
|
221 |
<comment>Select only the language, which at the time of initial activation of your econda product has been selected.</comment>
|
222 |
<frontend_type>select</frontend_type>
|
223 |
<source_model>econda/system_config_source_language</source_model>
|
224 |
<sort_order>1</sort_order>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
<show_in_default>1</show_in_default>
|
226 |
<show_in_website>1</show_in_website>
|
227 |
<show_in_store>0</show_in_store>
|
228 |
+
</tracking_language>
|
229 |
<tracking_siteid>
|
230 |
<label>Siteid</label>
|
231 |
+
<comment>Set Siteid manually. Only change this in agreement with econda. Leave empty, if not used.</comment>
|
232 |
<frontend_type>text</frontend_type>
|
233 |
+
<source_model>econda/system_config_source_siteid</source_model>
|
234 |
<sort_order>3</sort_order>
|
235 |
<show_in_default>1</show_in_default>
|
236 |
<show_in_website>1</show_in_website>
|
237 |
<show_in_store>0</show_in_store>
|
238 |
+
</tracking_siteid>
|
239 |
<billing_total>
|
240 |
<label>Billing and Prices</label>
|
241 |
+
<comment>Get Billing and Prices with or without Tax and Shipping</comment>
|
242 |
<frontend_type>select</frontend_type>
|
243 |
+
<source_model>econda/system_config_source_billing</source_model>
|
244 |
<sort_order>4</sort_order>
|
245 |
<show_in_default>1</show_in_default>
|
246 |
<show_in_website>1</show_in_website>
|
247 |
<show_in_store>0</show_in_store>
|
248 |
+
</billing_total>
|
249 |
+
</fields>
|
250 |
+
</econda_settings>
|
251 |
+
</groups>
|
252 |
+
</econda>
|
253 |
</sections>
|
254 |
</config>
|
app/design/adminhtml/default/default/layout/econda.xml
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout version="0.1.0">
|
3 |
-
<econda_adminhtml_econda_index>
|
4 |
-
<reference name="content">
|
5 |
-
<block type="econda/adminhtml_econda" name="econda" />
|
6 |
-
</reference>
|
7 |
-
</econda_adminhtml_econda_index>
|
8 |
-
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/layout/econda.xml
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category Mage
|
17 |
+
* @package Mage_Econda
|
18 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
+
<layout version="0.1.0">
|
23 |
+
<default>
|
24 |
+
<reference name="content">
|
25 |
+
<block type="econda/econda" before="-" name="econda">
|
26 |
+
<action method="setTemplate">
|
27 |
+
<template>econda/tracker.phtml</template>
|
28 |
+
</action>
|
29 |
+
</block>
|
30 |
+
</reference>
|
31 |
+
</default>
|
32 |
+
</layout>
|
app/design/frontend/base/default/template/econda/tracker.phtml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Mage
|
16 |
+
* @package Mage_Econda
|
17 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
echo $this->getEmos();
|
app/design/frontend/default/default/layout/econda.xml
CHANGED
@@ -1,30 +1,32 @@
|
|
1 |
-
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<layout version="0.1.0">
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
<block type="econda/econda" before="-" name="econda">
|
13 |
-
<action method="setTemplate"><template>econda/trackerms.phtml</template></action>
|
14 |
-
</block>
|
15 |
-
</reference>
|
16 |
-
</checkout_multishipping_success>
|
17 |
-
<checkout_onepage_success>
|
18 |
-
<reference name="content">
|
19 |
-
<block type="econda/econda" before="-" name="econda">
|
20 |
-
<action method="setTemplate"><template>econda/trackerms.phtml</template></action>
|
21 |
-
</block>
|
22 |
-
</reference>
|
23 |
-
</checkout_onepage_success>
|
24 |
-
<checkout_onepage_index>
|
25 |
-
<reference name="content">
|
26 |
-
<block type="econda/econda" before="-" name="trackerop" template="econda/trackerop.phtml">
|
27 |
-
</block>
|
28 |
-
</reference>
|
29 |
-
</checkout_onepage_index>
|
30 |
</layout>
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category Mage
|
17 |
+
* @package Mage_Econda
|
18 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
<layout version="0.1.0">
|
23 |
+
<default>
|
24 |
+
<reference name="content">
|
25 |
+
<block type="econda/econda" before="-" name="econda">
|
26 |
+
<action method="setTemplate">
|
27 |
+
<template>econda/tracker.phtml</template>
|
28 |
+
</action>
|
29 |
+
</block>
|
30 |
+
</reference>
|
31 |
+
</default>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
</layout>
|
app/design/frontend/default/default/template/econda/tracker.phtml
CHANGED
@@ -1,8 +1,20 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-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 |
+
* @category Mage
|
16 |
+
* @package Mage_Econda
|
17 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
echo $this->getEmos();
|
app/design/frontend/default/default/template/econda/trackerms.phtml
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
echo $this->getEmos();
|
3 |
-
?>
|
|
|
|
|
|
app/design/frontend/default/default/template/econda/trackerop.phtml
DELETED
@@ -1,131 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$realUrlOp = Mage::helper('core/url')->getCurrentUrl();
|
4 |
-
$opsession = Mage::getSingleton('checkout/session');
|
5 |
-
if(stristr($realUrlOp,'checkout/onepage/') != false) {
|
6 |
-
|
7 |
-
$storeIdOp = $this->getStore();
|
8 |
-
$emVersion = Mage::getStoreConfig('econda/econda/tracking_version', $storeIdOp);
|
9 |
-
|
10 |
-
$pathToEmos = $this->getJsUrl().'tracker/emos2.js';
|
11 |
-
$pathToOpJs = $this->getJsUrl().'tracker/emosop.js';
|
12 |
-
|
13 |
-
$emosInclude = "\n<script type=\"text/javascript\" src='".$pathToEmos."'></script>\n";
|
14 |
-
$opInclude = "<script type=\"text/javascript\" src='".$pathToOpJs."'></script>\n";
|
15 |
-
|
16 |
-
$getSessionData = $opsession->getData('econda_content');
|
17 |
-
$splitSessionData = explode(',',$getSessionData);
|
18 |
-
$customerId = md5(Mage::getSingleton('customer/session')->getCustomerId());
|
19 |
-
|
20 |
-
$setPageId = md5($splitSessionData[0]);
|
21 |
-
$setSiteID = dataFormat($splitSessionData[1],$emVersion);
|
22 |
-
$setLangID = $splitSessionData[2];
|
23 |
-
|
24 |
-
$langValueOP = 'econda/econda/tracking_language';
|
25 |
-
$langPathOp = Mage::getStoreConfig($langValueOP, $storeIdOp);
|
26 |
-
|
27 |
-
if($langPathOp == '0') {
|
28 |
-
$langFileOp = 'german';
|
29 |
-
}
|
30 |
-
else if($langPathOp == '1') {
|
31 |
-
$langFileOp = 'english';
|
32 |
-
}
|
33 |
-
else {
|
34 |
-
$langFileOp = 'german';
|
35 |
-
}
|
36 |
-
require_once ('app/code/local/Mage/Econda/Language/'.$langFileOp.'.php');
|
37 |
-
|
38 |
-
$langStep[0] = $eLang[0]; $langStep[1] = $eLang[43]; $langStep[2] = $eLang[2].'/'.$eLang[3];
|
39 |
-
$langStep[3] = $eLang[2].'/'.$eLang[4]; $langStep[4] = $eLang[5]; $langStep[5] = $eLang[42];
|
40 |
-
$langStep[6] = $eLang[43]; $langStep[7] = $eLang[32];
|
41 |
-
|
42 |
-
$emosLogin = "";
|
43 |
-
if(stristr($this->getMessagesBlock()->getGroupedHtml(),'error-msg') != false) {
|
44 |
-
$emosLogin .= " emospro.login = [['".$customerId."','1']];\n";
|
45 |
-
}
|
46 |
-
$isLoggedIn = Mage::getSingleton('customer/session')->isLoggedIn();
|
47 |
-
|
48 |
-
if($isLoggedIn == 1 && $opsession->getData('econda_logged') != 2) {
|
49 |
-
$emosLogin .= " emospro.login = [['".$customerId."','0']];\n";
|
50 |
-
$opsession->setData('econda_logged','2');
|
51 |
-
}
|
52 |
-
|
53 |
-
if($emVersion == '2') {
|
54 |
-
$emosOut = "\n<!-- Start Econda-Monitor M117 -->\n";
|
55 |
-
$emosOut .= "\n<script type=\"text/javascript\">\n//<![CDATA[\n";
|
56 |
-
$emosOut .= " window.emosTrackVersion = 2;\n";
|
57 |
-
$emosOut .= "//]]>\n</script>";
|
58 |
-
$emosOut .= $emosInclude;
|
59 |
-
$emosOut .= "<script type=\"text/javascript\">\n//<![CDATA[\n";
|
60 |
-
$emosOut .= " ecStep = new Array('".$langStep[0]."','".$langStep[1]."','".$langStep[2]."','".$langStep[3]."','".$langStep[4]."','".$langStep[5]."','".$langStep[6]."','".$langStep[7]."');\n";
|
61 |
-
$emosOut .= " var emospro = {};\n";
|
62 |
-
$emosOut .= " emospro.content = 'Start/".$eLang[38]."';\n";
|
63 |
-
$emosOut .= " emospro.pageId = '".$setPageId."';\n";
|
64 |
-
$emosOut .= " emospro.siteid = '".$setSiteID."';\n";
|
65 |
-
$emosOut .= " emospro.langid = '".$setLangID."';\n";
|
66 |
-
$emosOut .= $emosLogin;
|
67 |
-
}
|
68 |
-
else {
|
69 |
-
$emosOut = "\n<!-- Start Econda-Monitor M117 -->\n";
|
70 |
-
$emosOut .= "\n<a name=\"emos_name\" title=\"content\" rel=\"Start/".$eLang[38]."\" rev=\"\"></a>\n";
|
71 |
-
$emosOut .= "<script type=\"text/javascript\">\n//<![CDATA[\n";
|
72 |
-
$emosOut .= " window.emosPageId = '".$setPageId."'; \n";
|
73 |
-
$emosOut .= " ecStep = new Array('".$langStep[0]."','".$langStep[1]."','".$langStep[2]."','".$langStep[3]."','".$langStep[4]."','".$langStep[5]."','".$langStep[6]."','".$langStep[7]."');\n";
|
74 |
-
$emosOut .= " var emospro = {};\n";
|
75 |
-
$emosOut .= $emosLogin;
|
76 |
-
$emosOut .= "//]]>\n</script>";
|
77 |
-
$emosOut .= "\n<a name=\"emos_name\" title=\"siteid\" rel=\"".$setSiteID."\" rev=\"\"></a>";
|
78 |
-
$emosOut .= "\n<a name=\"emos_name\" title=\"langid\" rel=\"".$setLangID."\" rev=\"\"></a>";
|
79 |
-
}
|
80 |
-
|
81 |
-
echo $emosOut;
|
82 |
-
if($emVersion == '2') {
|
83 |
-
echo "//]]>\n</script>\n".$opInclude;
|
84 |
-
}
|
85 |
-
else {
|
86 |
-
echo $emosInclude;
|
87 |
-
echo $opInclude;
|
88 |
-
}
|
89 |
-
echo "\n<!-- End Econda-Monitor -->\n";
|
90 |
-
}
|
91 |
-
|
92 |
-
function dataFormat($str,$emVersion) {
|
93 |
-
if($emVersion == '2') {
|
94 |
-
$str = utf8_decode($str);
|
95 |
-
$str = html_entity_decode($str);
|
96 |
-
$str = utf8_encode($str);
|
97 |
-
$str = addcslashes($str, "\\\"'&<>]");
|
98 |
-
}
|
99 |
-
else {
|
100 |
-
$str = urldecode($str);
|
101 |
-
if (function_exists('htmlspecialchars_decode')) {
|
102 |
-
$str = htmlspecialchars_decode($str, ENT_QUOTES);
|
103 |
-
} else {
|
104 |
-
$str = $this->htmlspecialchars_decode_php4($str);
|
105 |
-
}
|
106 |
-
$str = html_entity_decode($str);
|
107 |
-
$str = strip_tags($str);
|
108 |
-
$str = trim($str);
|
109 |
-
$nbsp = chr(0xa0);
|
110 |
-
$str = str_replace($nbsp, " ", $str);
|
111 |
-
$str = str_replace("\"", "", $str);
|
112 |
-
$str = str_replace("'", "", $str);
|
113 |
-
$str = str_replace("%", "", $str);
|
114 |
-
$str = str_replace(",", "", $str);
|
115 |
-
$str = str_replace(";", "", $str);
|
116 |
-
while (true) {
|
117 |
-
$str_temp = $str;
|
118 |
-
$str = str_replace(" ", " ", $str);
|
119 |
-
if ($str == $str_temp) {
|
120 |
-
break;
|
121 |
-
}
|
122 |
-
}
|
123 |
-
$str = str_replace(" / ", "/", $str);
|
124 |
-
$str = str_replace(" /", "/", $str);
|
125 |
-
$str = str_replace("/ ", "/", $str);
|
126 |
-
$str = substr($str, 0, 254);
|
127 |
-
$str = rawurlencode($str);
|
128 |
-
}
|
129 |
-
return $str;
|
130 |
-
}
|
131 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/etc/modules/Mage_Econda.xml
CHANGED
@@ -1,9 +1,29 @@
|
|
1 |
-
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<config>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
</config>
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category Mage
|
17 |
+
* @package Mage_Econda
|
18 |
+
* @copyright Copyright (c) 2010 econda GmbH (http://www.econda.de)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
<config>
|
23 |
+
<modules>
|
24 |
+
<Mage_Econda>
|
25 |
+
<active>true</active>
|
26 |
+
<codePool>local</codePool>
|
27 |
+
</Mage_Econda>
|
28 |
+
</modules>
|
29 |
</config>
|
app/locale/de_AT/Mage_Econda.csv
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
-
"",""
|
2 |
"Used Language","Verwendete Sprache"
|
3 |
"Settings","Einstellungen"
|
4 |
"Select only the language, which at the time of initial activation of your econda product has been selected.","Nur die Sprache verwenden, welche bei der ersten Aktivierung Ihres econda Produktes ausgewählt wurde."
|
5 |
-
"Only newer versions of the emos2.js file (received after September 2009) can handle Version 2. Copy your personal emos2.js file into the direcotory /js/tracker/.","Nur neuere Versionen der emos2.js Datei (Erhalten ab September 2009) können mit Version 2 umgehen. Kopieren Sie Ihre personalisierte emos2.js Datei in das Verzeichnis /js/tracker/."
|
6 |
"Total Price (Grand Total)","Gesamtpreis (Grand Total)"
|
7 |
"Value of Goods without Tax (Subtotal)","Warenwert ohne Steuer (Subtotal)"
|
8 |
"Value of Goods with Tax (Subtotal + Tax)","Warenwert mit Steuer (Subtotal + Tax)"
|
9 |
"Get Billing and Prices with or without Tax and Shipping","Den Rechnungsbetrag und Preise mit oder ohne Steuer und Versandkosten übertragen"
|
10 |
"Billing and Prices","Rechnung und Preise"
|
11 |
-
"Set Siteid manually. Only change this in agreement with econda. Leave empty, if not used.","Manuelle Festlegung der Siteid. Nur in Abstimmung mit econda vornehmen. Frei lassen, falls nicht benötigt."
|
|
|
|
1 |
"Used Language","Verwendete Sprache"
|
2 |
"Settings","Einstellungen"
|
3 |
"Select only the language, which at the time of initial activation of your econda product has been selected.","Nur die Sprache verwenden, welche bei der ersten Aktivierung Ihres econda Produktes ausgewählt wurde."
|
|
|
4 |
"Total Price (Grand Total)","Gesamtpreis (Grand Total)"
|
5 |
"Value of Goods without Tax (Subtotal)","Warenwert ohne Steuer (Subtotal)"
|
6 |
"Value of Goods with Tax (Subtotal + Tax)","Warenwert mit Steuer (Subtotal + Tax)"
|
7 |
"Get Billing and Prices with or without Tax and Shipping","Den Rechnungsbetrag und Preise mit oder ohne Steuer und Versandkosten übertragen"
|
8 |
"Billing and Prices","Rechnung und Preise"
|
9 |
+
"Set Siteid manually. Only change this in agreement with econda. Leave empty, if not used.","Manuelle Festlegung der Siteid. Nur in Abstimmung mit econda vornehmen. Frei lassen, falls nicht benötigt."
|
10 |
+
"Test it for free","Jetzt kostenlos testen"
|
app/locale/de_CH/Mage_Econda.csv
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
-
"",""
|
2 |
"Used Language","Verwendete Sprache"
|
3 |
"Settings","Einstellungen"
|
4 |
"Select only the language, which at the time of initial activation of your econda product has been selected.","Nur die Sprache verwenden, welche bei der ersten Aktivierung Ihres econda Produktes ausgewählt wurde."
|
5 |
-
"Only newer versions of the emos2.js file (received after September 2009) can handle Version 2. Copy your personal emos2.js file into the direcotory /js/tracker/.","Nur neuere Versionen der emos2.js Datei (Erhalten ab September 2009) können mit Version 2 umgehen. Kopieren Sie Ihre personalisierte emos2.js Datei in das Verzeichnis /js/tracker/."
|
6 |
"Total Price (Grand Total)","Gesamtpreis (Grand Total)"
|
7 |
"Value of Goods without Tax (Subtotal)","Warenwert ohne Steuer (Subtotal)"
|
8 |
"Value of Goods with Tax (Subtotal + Tax)","Warenwert mit Steuer (Subtotal + Tax)"
|
9 |
"Get Billing and Prices with or without Tax and Shipping","Den Rechnungsbetrag und Preise mit oder ohne Steuer und Versandkosten übertragen"
|
10 |
"Billing and Prices","Rechnung und Preise"
|
11 |
-
"Set Siteid manually. Only change this in agreement with econda. Leave empty, if not used.","Manuelle Festlegung der Siteid. Nur in Abstimmung mit econda vornehmen. Frei lassen, falls nicht benötigt."
|
|
|
|
1 |
"Used Language","Verwendete Sprache"
|
2 |
"Settings","Einstellungen"
|
3 |
"Select only the language, which at the time of initial activation of your econda product has been selected.","Nur die Sprache verwenden, welche bei der ersten Aktivierung Ihres econda Produktes ausgewählt wurde."
|
|
|
4 |
"Total Price (Grand Total)","Gesamtpreis (Grand Total)"
|
5 |
"Value of Goods without Tax (Subtotal)","Warenwert ohne Steuer (Subtotal)"
|
6 |
"Value of Goods with Tax (Subtotal + Tax)","Warenwert mit Steuer (Subtotal + Tax)"
|
7 |
"Get Billing and Prices with or without Tax and Shipping","Den Rechnungsbetrag und Preise mit oder ohne Steuer und Versandkosten übertragen"
|
8 |
"Billing and Prices","Rechnung und Preise"
|
9 |
+
"Set Siteid manually. Only change this in agreement with econda. Leave empty, if not used.","Manuelle Festlegung der Siteid. Nur in Abstimmung mit econda vornehmen. Frei lassen, falls nicht benötigt."
|
10 |
+
"Test it for free","Jetzt kostenlos testen"
|
app/locale/de_DE/Mage_Econda.csv
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
-
"",""
|
2 |
"Used Language","Verwendete Sprache"
|
3 |
"Settings","Einstellungen"
|
4 |
"Select only the language, which at the time of initial activation of your econda product has been selected.","Nur die Sprache verwenden, welche bei der ersten Aktivierung Ihres econda Produktes ausgewählt wurde."
|
5 |
-
"Only newer versions of the emos2.js file (received after September 2009) can handle Version 2. Copy your personal emos2.js file into the direcotory /js/tracker/.","Nur neuere Versionen der emos2.js Datei (Erhalten ab September 2009) können mit Version 2 umgehen. Kopieren Sie Ihre personalisierte emos2.js Datei in das Verzeichnis /js/tracker/."
|
6 |
"Total Price (Grand Total)","Gesamtpreis (Grand Total)"
|
7 |
"Value of Goods without Tax (Subtotal)","Warenwert ohne Steuer (Subtotal)"
|
8 |
"Value of Goods with Tax (Subtotal + Tax)","Warenwert mit Steuer (Subtotal + Tax)"
|
9 |
"Get Billing and Prices with or without Tax and Shipping","Den Rechnungsbetrag und Preise mit oder ohne Steuer und Versandkosten übertragen"
|
10 |
"Billing and Prices","Rechnung und Preise"
|
11 |
-
"Set Siteid manually. Only change this in agreement with econda. Leave empty, if not used.","Manuelle Festlegung der Siteid. Nur in Abstimmung mit econda vornehmen. Frei lassen, falls nicht benötigt."
|
|
|
|
1 |
"Used Language","Verwendete Sprache"
|
2 |
"Settings","Einstellungen"
|
3 |
"Select only the language, which at the time of initial activation of your econda product has been selected.","Nur die Sprache verwenden, welche bei der ersten Aktivierung Ihres econda Produktes ausgewählt wurde."
|
|
|
4 |
"Total Price (Grand Total)","Gesamtpreis (Grand Total)"
|
5 |
"Value of Goods without Tax (Subtotal)","Warenwert ohne Steuer (Subtotal)"
|
6 |
"Value of Goods with Tax (Subtotal + Tax)","Warenwert mit Steuer (Subtotal + Tax)"
|
7 |
"Get Billing and Prices with or without Tax and Shipping","Den Rechnungsbetrag und Preise mit oder ohne Steuer und Versandkosten übertragen"
|
8 |
"Billing and Prices","Rechnung und Preise"
|
9 |
+
"Set Siteid manually. Only change this in agreement with econda. Leave empty, if not used.","Manuelle Festlegung der Siteid. Nur in Abstimmung mit econda vornehmen. Frei lassen, falls nicht benötigt."
|
10 |
+
"Test it for free","Jetzt kostenlos testen"
|
app/locale/en_US/Mage_Econda.csv
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
-
"",""
|
2 |
"Used Language","Used Language"
|
3 |
"Settings","Settings"
|
4 |
"Select only the language, which at the time of initial activation of your econda product has been selected.","Select only the language, which at the time of initial activation of your econda product has been selected."
|
5 |
-
"Only newer versions of the emos2.js file (received after September 2009) can handle Version 2. Copy your personal emos2.js file into the direcotory /js/tracker/.","Only newer versions of the emos2.js file (received after September 2009) can handle Version 2. Copy your personal emos2.js file into the direcotory /js/tracker/."
|
6 |
"Total Price (Grand Total)","Total Price (Grand Total)"
|
7 |
"Value of Goods without Tax (Subtotal)","Value of Goods without Tax (Subtotal)"
|
8 |
"Value of Goods with Tax (Subtotal + Tax)","Value of Goods with Tax (Subtotal + Tax)"
|
9 |
"Get Billing and Prices with or without Tax and Shipping","Get Billing and Prices with or without Tax and Shipping"
|
10 |
"Billing and Prices","Billing and Prices"
|
11 |
-
"Set Siteid manually. Only change this in agreement with econda. Leave empty, if not used.","Set Siteid manually. Only change this in agreement with econda. Leave empty, if not used."
|
|
|
|
1 |
"Used Language","Used Language"
|
2 |
"Settings","Settings"
|
3 |
"Select only the language, which at the time of initial activation of your econda product has been selected.","Select only the language, which at the time of initial activation of your econda product has been selected."
|
|
|
4 |
"Total Price (Grand Total)","Total Price (Grand Total)"
|
5 |
"Value of Goods without Tax (Subtotal)","Value of Goods without Tax (Subtotal)"
|
6 |
"Value of Goods with Tax (Subtotal + Tax)","Value of Goods with Tax (Subtotal + Tax)"
|
7 |
"Get Billing and Prices with or without Tax and Shipping","Get Billing and Prices with or without Tax and Shipping"
|
8 |
"Billing and Prices","Billing and Prices"
|
9 |
+
"Set Siteid manually. Only change this in agreement with econda. Leave empty, if not used.","Set Siteid manually. Only change this in agreement with econda. Leave empty, if not used."
|
10 |
+
"Test it for free","Test it for free"
|
js/tracker/emosop.js
CHANGED
@@ -1,7 +1,10 @@
|
|
|
|
|
|
1 |
var sendOne = 1;
|
2 |
var orderProcess = '';
|
3 |
var contentLabel = '';
|
4 |
|
|
|
5 |
if (document.addEventListener){
|
6 |
document.addEventListener("mousemove", onePageTracker, false);
|
7 |
}
|
@@ -13,17 +16,19 @@ function onePageTracker() {
|
|
13 |
|
14 |
orderProcess = '';
|
15 |
contentLabel = '';
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
19 |
orderProcess = '2_' + ecStep[0];
|
20 |
contentLabel = ecStep[0];
|
21 |
sendOne += 1;
|
22 |
}
|
23 |
}
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
27 |
orderProcess = '3_' + ecStep[1];
|
28 |
contentLabel = ecStep[6];
|
29 |
if(typeof(emospro.login) != 'undefined') {
|
@@ -35,17 +40,19 @@ function onePageTracker() {
|
|
35 |
sendOne += 1;
|
36 |
}
|
37 |
}
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
41 |
orderProcess = '4_' + ecStep[2];
|
42 |
contentLabel = ecStep[2];
|
43 |
sendOne += 1;
|
44 |
}
|
45 |
}
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
49 |
orderProcess = '4_' + ecStep[3];
|
50 |
contentLabel = ecStep[3];
|
51 |
if(sendOne == 3) {
|
@@ -54,23 +61,26 @@ function onePageTracker() {
|
|
54 |
sendOne += 1;
|
55 |
}
|
56 |
}
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
60 |
orderProcess = '5_' + ecStep[4];
|
61 |
contentLabel = ecStep[4];
|
62 |
sendOne += 1;
|
63 |
}
|
64 |
}
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
68 |
orderProcess = '6_' + ecStep[5];
|
69 |
contentLabel = ecStep[5];
|
70 |
sendOne += 1;
|
71 |
}
|
72 |
}
|
73 |
|
|
|
74 |
if (orderProcess != '') {
|
75 |
emospro.orderProcess=orderProcess;
|
76 |
emospro.content='Start/' + ecStep[7] + '/' + contentLabel;
|
@@ -78,6 +88,7 @@ function onePageTracker() {
|
|
78 |
}
|
79 |
}
|
80 |
|
|
|
81 |
function stristr(haystack,needle,bool) {
|
82 |
var pos = 0;
|
83 |
haystack += '';
|
@@ -91,4 +102,4 @@ function stristr(haystack,needle,bool) {
|
|
91 |
return haystack.slice(pos);
|
92 |
}
|
93 |
}
|
94 |
-
}
|
1 |
+
// econda one page checkout helper
|
2 |
+
// Copyright 2009-2020 econda GmnH
|
3 |
var sendOne = 1;
|
4 |
var orderProcess = '';
|
5 |
var contentLabel = '';
|
6 |
|
7 |
+
// set event handler
|
8 |
if (document.addEventListener){
|
9 |
document.addEventListener("mousemove", onePageTracker, false);
|
10 |
}
|
16 |
|
17 |
orderProcess = '';
|
18 |
contentLabel = '';
|
19 |
+
|
20 |
+
// content path for step 2 :login
|
21 |
+
if($('opc-login')) {
|
22 |
+
if(stristr($('opc-login').className,'active') != false && sendOne == 1) {
|
23 |
orderProcess = '2_' + ecStep[0];
|
24 |
contentLabel = ecStep[0];
|
25 |
sendOne += 1;
|
26 |
}
|
27 |
}
|
28 |
+
|
29 |
+
// content path for step 3 :billing
|
30 |
+
if($('opc-billing')) {
|
31 |
+
if(stristr($('opc-billing').className,'active') != false && (sendOne == 1 || sendOne == 2)) {
|
32 |
orderProcess = '3_' + ecStep[1];
|
33 |
contentLabel = ecStep[6];
|
34 |
if(typeof(emospro.login) != 'undefined') {
|
40 |
sendOne += 1;
|
41 |
}
|
42 |
}
|
43 |
+
|
44 |
+
// content path for step 4 :shipping
|
45 |
+
if($('opc-shipping')) {
|
46 |
+
if(stristr($('opc-shipping').className,'active') != false && sendOne == 3) {
|
47 |
orderProcess = '4_' + ecStep[2];
|
48 |
contentLabel = ecStep[2];
|
49 |
sendOne += 1;
|
50 |
}
|
51 |
}
|
52 |
+
|
53 |
+
// content path for step 4 :shipping/method
|
54 |
+
if($('opc-shipping_method')) {
|
55 |
+
if(stristr($('opc-shipping_method').className,'active') != false && (sendOne == 3 || sendOne == 4)) {
|
56 |
orderProcess = '4_' + ecStep[3];
|
57 |
contentLabel = ecStep[3];
|
58 |
if(sendOne == 3) {
|
61 |
sendOne += 1;
|
62 |
}
|
63 |
}
|
64 |
+
|
65 |
+
// content path for step 5 :payment
|
66 |
+
if($('opc-payment')) {
|
67 |
+
if(stristr($('opc-payment').className,'active') != false && sendOne == 5) {
|
68 |
orderProcess = '5_' + ecStep[4];
|
69 |
contentLabel = ecStep[4];
|
70 |
sendOne += 1;
|
71 |
}
|
72 |
}
|
73 |
+
|
74 |
+
// content path for step 6 :order review
|
75 |
+
if($('opc-review')) {
|
76 |
+
if(stristr($('opc-review').className,'active') != false && sendOne == 6) {
|
77 |
orderProcess = '6_' + ecStep[5];
|
78 |
contentLabel = ecStep[5];
|
79 |
sendOne += 1;
|
80 |
}
|
81 |
}
|
82 |
|
83 |
+
// send content path and order process step
|
84 |
if (orderProcess != '') {
|
85 |
emospro.orderProcess=orderProcess;
|
86 |
emospro.content='Start/' + ecStep[7] + '/' + contentLabel;
|
88 |
}
|
89 |
}
|
90 |
|
91 |
+
// stristr helper function
|
92 |
function stristr(haystack,needle,bool) {
|
93 |
var pos = 0;
|
94 |
haystack += '';
|
102 |
return haystack.slice(pos);
|
103 |
}
|
104 |
}
|
105 |
+
}
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Mage_Econda</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>Bindet econda Web Controlling in Magento ein. Inserts econda Web Contolling into Magento.</summary>
|
10 |
-
<description>Bindet econda Web Controlling in Magento ein. Weitere Informationen unter http://www.econda.de. Inserts econda Web Contolling into Magento. For further information visit http://www.econda.de/</description>
|
11 |
-
<notes>
|
12 |
<authors><author><name>ecdev</name><user>auto-converted</user><email>bebop30@gmx.net</email></author></authors>
|
13 |
-
<date>2010-
|
14 |
-
<time>
|
15 |
-
<contents><target name="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Mage_Econda</name>
|
4 |
+
<version>1.5.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Bindet econda Web Shop Controlling in Magento ein. Inserts econda Web Shop Contolling into Magento.</summary>
|
10 |
+
<description>Bindet econda Web Shop Controlling in Magento ein. Weitere Informationen unter http://www.econda.de. Inserts econda Web Shop Contolling into Magento. For further information visit http://www.econda.de/</description>
|
11 |
+
<notes>Integration of econda Web Controlling functions.</notes>
|
12 |
<authors><author><name>ecdev</name><user>auto-converted</user><email>bebop30@gmx.net</email></author></authors>
|
13 |
+
<date>2010-11-30</date>
|
14 |
+
<time>15:50:43</time>
|
15 |
+
<contents><target name="magelocale"><dir name="de_AT"><file name="Mage_Econda.csv" hash="3d7fa85b5b0937ed6aebdeacd4baee86"/></dir><dir name="de_CH"><file name="Mage_Econda.csv" hash="3d7fa85b5b0937ed6aebdeacd4baee86"/></dir><dir name="de_DE"><file name="Mage_Econda.csv" hash="3d7fa85b5b0937ed6aebdeacd4baee86"/></dir><dir name="en_US"><file name="Mage_Econda.csv" hash="19027c08d453acf6f88d9d4866203a94"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="econda.xml" hash="b0c38c0677e67f47a58598b2848b8a8d"/></dir><dir name="template"><dir name="econda"><file name="tracker.phtml" hash="949b7ba912ace52437b44bd1708f8e8d"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="econda.xml" hash="b0c38c0677e67f47a58598b2848b8a8d"/></dir><dir name="template"><dir name="econda"><file name="tracker.phtml" hash="949b7ba912ace52437b44bd1708f8e8d"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="tracker"><file name="emosop.js" hash="ef3953dc5307171d64044f289f41fdc5"/></dir></dir></target><target name="magelocal"><dir name="Mage"><dir name="Econda"><dir name="Block"><file name="Econda.php" hash="8d0df509aac1bc1f3528118829d91f48"/><file name="EcondaOp.php" hash="75ad6064344e41b3b4edb72bd5182fd7"/><file name="Emos.php" hash="800c128f4d25bd5de5d6c537add75c51"/></dir><dir name="etc"><file name="config.xml" hash="b19ee9b2d5e0abe817c7d7dbf02ecac6"/><file name="system.xml" hash="4db59b306e24dc6ca1337f78b2d4d371"/></dir><dir name="Helper"><file name="Data.php" hash="853ff137bd34927316c360f9bfd98b37"/></dir><dir name="Model"><file name="Base.php" hash="6ebd768c3c059a0a4f3ca8125be0257d"/><file name="Basket.php" hash="e780d6aed18b977c7aedd7844db2184d"/><file name="Item.php" hash="ec9e41386d7484523b4073a029774858"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Billing.php" hash="a7cabf3a167e3c2b4d38c70a3eeb8677"/><file name="Language.php" hash="a06353607d539124f6725ec66b4f923e"/><file name="Siteid.php" hash="e39acc175981011b1a6db39c78a43b44"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Econda.xml" hash="95c63a559ee5a021eba480dfbb72f7de"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|