Version Notes
Release 1.0.1
Release 1.0.2:
10.07.2014: fixed missing column definition in stores table
Release 1.0.3:
* added flat fee shipping (overrides the quotation module)
* added Carrier to States association
* show only enabled carriers on frontend
* stores fixes
* DB fixes and new columns
* general fixes
Download this release
Release Info
Developer | Michael Mussulis |
Extension | Xtreme_Livrarionline |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
- app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Livrarionline.php +11 -11
- app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Livrarionline/Edit.php +44 -44
- app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Livrarionline/Edit/Form.php +18 -18
- app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Livrarionline/Edit/Tab/Form.php +57 -57
- app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Livrarionline/Edit/Tabs.php +23 -23
- app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Livrarionline/Grid.php +115 -115
- app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Managecarriers.php +4 -4
- app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Managecarriers/Edit/Form.php +18 -18
- app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Managecarriers/Edit/Tab/Form.php +19 -15
- app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Managecarriers/Edit/Tabs.php +21 -21
- app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Managestores/Edit/Tab/Form.php +2 -2
- app/code/local/Xtreme/Livrarionline/Block/Livrarionline.php +16 -16
- app/code/local/Xtreme/Livrarionline/Helper/Data.php +57 -56
- app/code/local/Xtreme/Livrarionline/Model/Carrier/Livrarionline.php +22 -12
- app/code/local/Xtreme/Livrarionline/Model/Livrarionline.php +9 -9
- app/code/local/Xtreme/Livrarionline/Model/Mysql4/Carriers.php +9 -9
- app/code/local/Xtreme/Livrarionline/Model/Mysql4/Carriers/Collection.php +8 -8
- app/code/local/Xtreme/Livrarionline/Model/Mysql4/Livrarionline.php +9 -9
- app/code/local/Xtreme/Livrarionline/Model/Mysql4/Livrarionline/Collection.php +9 -9
- app/code/local/Xtreme/Livrarionline/Model/Mysql4/Stores/Collection.php +8 -8
- app/code/local/Xtreme/Livrarionline/controllers/Adminhtml/ManageawbController.php +3 -9
- app/code/local/Xtreme/Livrarionline/controllers/Adminhtml/ManagecarriersController.php +2 -1
- app/code/local/Xtreme/Livrarionline/etc/config.xml +1 -1
- app/code/local/Xtreme/Livrarionline/sql/livrarionline_setup/mysql4-install-0.1.0.php +5 -1
- package.xml +13 -5
app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Livrarionline.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
-
<?php
|
2 |
-
class Xtreme_Livrarionline_Block_Adminhtml_Livrarionline extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
-
{
|
4 |
-
public function __construct()
|
5 |
-
{
|
6 |
-
$this->_controller = 'adminhtml_livrarionline';
|
7 |
-
$this->_blockGroup = 'livrarionline';
|
8 |
-
$this->_headerText = Mage::helper('livrarionline')->__('Item Manager');
|
9 |
-
$this->_addButtonLabel = Mage::helper('livrarionline')->__('Add Item');
|
10 |
-
parent::__construct();
|
11 |
-
}
|
12 |
}
|
1 |
+
<?php
|
2 |
+
class Xtreme_Livrarionline_Block_Adminhtml_Livrarionline extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->_controller = 'adminhtml_livrarionline';
|
7 |
+
$this->_blockGroup = 'livrarionline';
|
8 |
+
$this->_headerText = Mage::helper('livrarionline')->__('Item Manager');
|
9 |
+
$this->_addButtonLabel = Mage::helper('livrarionline')->__('Add Item');
|
10 |
+
parent::__construct();
|
11 |
+
}
|
12 |
}
|
app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Livrarionline/Edit.php
CHANGED
@@ -1,45 +1,45 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Xtreme_Livrarionline_Block_Adminhtml_Livrarionline_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 = 'livrarionline';
|
11 |
-
$this->_controller = 'adminhtml_livrarionline';
|
12 |
-
|
13 |
-
$this->_updateButton('save', 'label', Mage::helper('livrarionline')->__('Save Item'));
|
14 |
-
$this->_updateButton('delete', 'label', Mage::helper('livrarionline')->__('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('livrarionline_content') == null) {
|
25 |
-
tinyMCE.execCommand('mceAddControl', false, 'livrarionline_content');
|
26 |
-
} else {
|
27 |
-
tinyMCE.execCommand('mceRemoveControl', false, 'livrarionline_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('livrarionline_data') && Mage::registry('livrarionline_data')->getId() ) {
|
40 |
-
return Mage::helper('livrarionline')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('livrarionline_data')->getTitle()));
|
41 |
-
} else {
|
42 |
-
return Mage::helper('livrarionline')->__('Add Item');
|
43 |
-
}
|
44 |
-
}
|
45 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Xtreme_Livrarionline_Block_Adminhtml_Livrarionline_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 = 'livrarionline';
|
11 |
+
$this->_controller = 'adminhtml_livrarionline';
|
12 |
+
|
13 |
+
$this->_updateButton('save', 'label', Mage::helper('livrarionline')->__('Save Item'));
|
14 |
+
$this->_updateButton('delete', 'label', Mage::helper('livrarionline')->__('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('livrarionline_content') == null) {
|
25 |
+
tinyMCE.execCommand('mceAddControl', false, 'livrarionline_content');
|
26 |
+
} else {
|
27 |
+
tinyMCE.execCommand('mceRemoveControl', false, 'livrarionline_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('livrarionline_data') && Mage::registry('livrarionline_data')->getId() ) {
|
40 |
+
return Mage::helper('livrarionline')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('livrarionline_data')->getTitle()));
|
41 |
+
} else {
|
42 |
+
return Mage::helper('livrarionline')->__('Add Item');
|
43 |
+
}
|
44 |
+
}
|
45 |
}
|
app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Livrarionline/Edit/Form.php
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Xtreme_Livrarionline_Block_Adminhtml_Livrarionline_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 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Xtreme_Livrarionline_Block_Adminhtml_Livrarionline_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/Xtreme/Livrarionline/Block/Adminhtml/Livrarionline/Edit/Tab/Form.php
CHANGED
@@ -1,58 +1,58 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Xtreme_Livrarionline_Block_Adminhtml_Livrarionline_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('livrarionline_form', array('legend'=>Mage::helper('livrarionline')->__('Item information')));
|
10 |
-
|
11 |
-
$fieldset->addField('title', 'text', array(
|
12 |
-
'label' => Mage::helper('livrarionline')->__('Title'),
|
13 |
-
'class' => 'required-entry',
|
14 |
-
'required' => true,
|
15 |
-
'name' => 'title',
|
16 |
-
));
|
17 |
-
|
18 |
-
$fieldset->addField('filename', 'file', array(
|
19 |
-
'label' => Mage::helper('livrarionline')->__('File'),
|
20 |
-
'required' => false,
|
21 |
-
'name' => 'filename',
|
22 |
-
));
|
23 |
-
|
24 |
-
$fieldset->addField('status', 'select', array(
|
25 |
-
'label' => Mage::helper('livrarionline')->__('Status'),
|
26 |
-
'name' => 'status',
|
27 |
-
'values' => array(
|
28 |
-
array(
|
29 |
-
'value' => 1,
|
30 |
-
'label' => Mage::helper('livrarionline')->__('Enabled'),
|
31 |
-
),
|
32 |
-
|
33 |
-
array(
|
34 |
-
'value' => 2,
|
35 |
-
'label' => Mage::helper('livrarionline')->__('Disabled'),
|
36 |
-
),
|
37 |
-
),
|
38 |
-
));
|
39 |
-
|
40 |
-
$fieldset->addField('content', 'editor', array(
|
41 |
-
'name' => 'content',
|
42 |
-
'label' => Mage::helper('livrarionline')->__('Content'),
|
43 |
-
'title' => Mage::helper('livrarionline')->__('Content'),
|
44 |
-
'style' => 'width:700px; height:500px;',
|
45 |
-
'wysiwyg' => false,
|
46 |
-
'required' => true,
|
47 |
-
));
|
48 |
-
|
49 |
-
if ( Mage::getSingleton('adminhtml/session')->getLivrarionlineData() )
|
50 |
-
{
|
51 |
-
$form->setValues(Mage::getSingleton('adminhtml/session')->getLivrarionlineData());
|
52 |
-
Mage::getSingleton('adminhtml/session')->setLivrarionlineData(null);
|
53 |
-
} elseif ( Mage::registry('livrarionline_data') ) {
|
54 |
-
$form->setValues(Mage::registry('livrarionline_data')->getData());
|
55 |
-
}
|
56 |
-
return parent::_prepareForm();
|
57 |
-
}
|
58 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Xtreme_Livrarionline_Block_Adminhtml_Livrarionline_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('livrarionline_form', array('legend'=>Mage::helper('livrarionline')->__('Item information')));
|
10 |
+
|
11 |
+
$fieldset->addField('title', 'text', array(
|
12 |
+
'label' => Mage::helper('livrarionline')->__('Title'),
|
13 |
+
'class' => 'required-entry',
|
14 |
+
'required' => true,
|
15 |
+
'name' => 'title',
|
16 |
+
));
|
17 |
+
|
18 |
+
$fieldset->addField('filename', 'file', array(
|
19 |
+
'label' => Mage::helper('livrarionline')->__('File'),
|
20 |
+
'required' => false,
|
21 |
+
'name' => 'filename',
|
22 |
+
));
|
23 |
+
|
24 |
+
$fieldset->addField('status', 'select', array(
|
25 |
+
'label' => Mage::helper('livrarionline')->__('Status'),
|
26 |
+
'name' => 'status',
|
27 |
+
'values' => array(
|
28 |
+
array(
|
29 |
+
'value' => 1,
|
30 |
+
'label' => Mage::helper('livrarionline')->__('Enabled'),
|
31 |
+
),
|
32 |
+
|
33 |
+
array(
|
34 |
+
'value' => 2,
|
35 |
+
'label' => Mage::helper('livrarionline')->__('Disabled'),
|
36 |
+
),
|
37 |
+
),
|
38 |
+
));
|
39 |
+
|
40 |
+
$fieldset->addField('content', 'editor', array(
|
41 |
+
'name' => 'content',
|
42 |
+
'label' => Mage::helper('livrarionline')->__('Content'),
|
43 |
+
'title' => Mage::helper('livrarionline')->__('Content'),
|
44 |
+
'style' => 'width:700px; height:500px;',
|
45 |
+
'wysiwyg' => false,
|
46 |
+
'required' => true,
|
47 |
+
));
|
48 |
+
|
49 |
+
if ( Mage::getSingleton('adminhtml/session')->getLivrarionlineData() )
|
50 |
+
{
|
51 |
+
$form->setValues(Mage::getSingleton('adminhtml/session')->getLivrarionlineData());
|
52 |
+
Mage::getSingleton('adminhtml/session')->setLivrarionlineData(null);
|
53 |
+
} elseif ( Mage::registry('livrarionline_data') ) {
|
54 |
+
$form->setValues(Mage::registry('livrarionline_data')->getData());
|
55 |
+
}
|
56 |
+
return parent::_prepareForm();
|
57 |
+
}
|
58 |
}
|
app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Livrarionline/Edit/Tabs.php
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Xtreme_Livrarionline_Block_Adminhtml_Livrarionline_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
-
{
|
5 |
-
|
6 |
-
public function __construct()
|
7 |
-
{
|
8 |
-
parent::__construct();
|
9 |
-
$this->setId('livrarionline_tabs');
|
10 |
-
$this->setDestElementId('edit_form');
|
11 |
-
$this->setTitle(Mage::helper('livrarionline')->__('Item Information'));
|
12 |
-
}
|
13 |
-
|
14 |
-
protected function _beforeToHtml()
|
15 |
-
{
|
16 |
-
$this->addTab('form_section', array(
|
17 |
-
'label' => Mage::helper('livrarionline')->__('Item Information'),
|
18 |
-
'title' => Mage::helper('livrarionline')->__('Item Information'),
|
19 |
-
'content' => $this->getLayout()->createBlock('livrarionline/adminhtml_livrarionline_edit_tab_form')->toHtml(),
|
20 |
-
));
|
21 |
-
|
22 |
-
return parent::_beforeToHtml();
|
23 |
-
}
|
24 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Xtreme_Livrarionline_Block_Adminhtml_Livrarionline_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
+
$this->setId('livrarionline_tabs');
|
10 |
+
$this->setDestElementId('edit_form');
|
11 |
+
$this->setTitle(Mage::helper('livrarionline')->__('Item Information'));
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _beforeToHtml()
|
15 |
+
{
|
16 |
+
$this->addTab('form_section', array(
|
17 |
+
'label' => Mage::helper('livrarionline')->__('Item Information'),
|
18 |
+
'title' => Mage::helper('livrarionline')->__('Item Information'),
|
19 |
+
'content' => $this->getLayout()->createBlock('livrarionline/adminhtml_livrarionline_edit_tab_form')->toHtml(),
|
20 |
+
));
|
21 |
+
|
22 |
+
return parent::_beforeToHtml();
|
23 |
+
}
|
24 |
}
|
app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Livrarionline/Grid.php
CHANGED
@@ -1,116 +1,116 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Xtreme_Livrarionline_Block_Adminhtml_Livrarionline_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
$this->setId('livrarionlineGrid');
|
9 |
-
$this->setDefaultSort('livrarionline_id');
|
10 |
-
$this->setDefaultDir('ASC');
|
11 |
-
$this->setSaveParametersInSession(true);
|
12 |
-
}
|
13 |
-
|
14 |
-
protected function _prepareCollection()
|
15 |
-
{
|
16 |
-
$collection = Mage::getModel('livrarionline/livrarionline')->getCollection();
|
17 |
-
$this->setCollection($collection);
|
18 |
-
return parent::_prepareCollection();
|
19 |
-
}
|
20 |
-
|
21 |
-
protected function _prepareColumns()
|
22 |
-
{
|
23 |
-
$this->addColumn('livrarionline_id', array(
|
24 |
-
'header' => Mage::helper('livrarionline')->__('ID'),
|
25 |
-
'align' =>'right',
|
26 |
-
'width' => '50px',
|
27 |
-
'index' => 'livrarionline_id',
|
28 |
-
));
|
29 |
-
|
30 |
-
$this->addColumn('title', array(
|
31 |
-
'header' => Mage::helper('livrarionline')->__('Title'),
|
32 |
-
'align' =>'left',
|
33 |
-
'index' => 'title',
|
34 |
-
));
|
35 |
-
|
36 |
-
/*
|
37 |
-
$this->addColumn('content', array(
|
38 |
-
'header' => Mage::helper('livrarionline')->__('Item Content'),
|
39 |
-
'width' => '150px',
|
40 |
-
'index' => 'content',
|
41 |
-
));
|
42 |
-
*/
|
43 |
-
|
44 |
-
$this->addColumn('status', array(
|
45 |
-
'header' => Mage::helper('livrarionline')->__('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('livrarionline')->__('Action'),
|
59 |
-
'width' => '100',
|
60 |
-
'type' => 'action',
|
61 |
-
'getter' => 'getId',
|
62 |
-
'actions' => array(
|
63 |
-
array(
|
64 |
-
'caption' => Mage::helper('livrarionline')->__('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('livrarionline')->__('CSV'));
|
76 |
-
$this->addExportType('*/*/exportXml', Mage::helper('livrarionline')->__('XML'));
|
77 |
-
|
78 |
-
return parent::_prepareColumns();
|
79 |
-
}
|
80 |
-
|
81 |
-
protected function _prepareMassaction()
|
82 |
-
{
|
83 |
-
$this->setMassactionIdField('livrarionline_id');
|
84 |
-
$this->getMassactionBlock()->setFormFieldName('livrarionline');
|
85 |
-
|
86 |
-
$this->getMassactionBlock()->addItem('delete', array(
|
87 |
-
'label' => Mage::helper('livrarionline')->__('Delete'),
|
88 |
-
'url' => $this->getUrl('*/*/massDelete'),
|
89 |
-
'confirm' => Mage::helper('livrarionline')->__('Are you sure?')
|
90 |
-
));
|
91 |
-
|
92 |
-
$statuses = Mage::getSingleton('livrarionline/status')->getOptionArray();
|
93 |
-
|
94 |
-
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
95 |
-
$this->getMassactionBlock()->addItem('status', array(
|
96 |
-
'label'=> Mage::helper('livrarionline')->__('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('livrarionline')->__('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 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Xtreme_Livrarionline_Block_Adminhtml_Livrarionline_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId('livrarionlineGrid');
|
9 |
+
$this->setDefaultSort('livrarionline_id');
|
10 |
+
$this->setDefaultDir('ASC');
|
11 |
+
$this->setSaveParametersInSession(true);
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _prepareCollection()
|
15 |
+
{
|
16 |
+
$collection = Mage::getModel('livrarionline/livrarionline')->getCollection();
|
17 |
+
$this->setCollection($collection);
|
18 |
+
return parent::_prepareCollection();
|
19 |
+
}
|
20 |
+
|
21 |
+
protected function _prepareColumns()
|
22 |
+
{
|
23 |
+
$this->addColumn('livrarionline_id', array(
|
24 |
+
'header' => Mage::helper('livrarionline')->__('ID'),
|
25 |
+
'align' =>'right',
|
26 |
+
'width' => '50px',
|
27 |
+
'index' => 'livrarionline_id',
|
28 |
+
));
|
29 |
+
|
30 |
+
$this->addColumn('title', array(
|
31 |
+
'header' => Mage::helper('livrarionline')->__('Title'),
|
32 |
+
'align' =>'left',
|
33 |
+
'index' => 'title',
|
34 |
+
));
|
35 |
+
|
36 |
+
/*
|
37 |
+
$this->addColumn('content', array(
|
38 |
+
'header' => Mage::helper('livrarionline')->__('Item Content'),
|
39 |
+
'width' => '150px',
|
40 |
+
'index' => 'content',
|
41 |
+
));
|
42 |
+
*/
|
43 |
+
|
44 |
+
$this->addColumn('status', array(
|
45 |
+
'header' => Mage::helper('livrarionline')->__('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('livrarionline')->__('Action'),
|
59 |
+
'width' => '100',
|
60 |
+
'type' => 'action',
|
61 |
+
'getter' => 'getId',
|
62 |
+
'actions' => array(
|
63 |
+
array(
|
64 |
+
'caption' => Mage::helper('livrarionline')->__('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('livrarionline')->__('CSV'));
|
76 |
+
$this->addExportType('*/*/exportXml', Mage::helper('livrarionline')->__('XML'));
|
77 |
+
|
78 |
+
return parent::_prepareColumns();
|
79 |
+
}
|
80 |
+
|
81 |
+
protected function _prepareMassaction()
|
82 |
+
{
|
83 |
+
$this->setMassactionIdField('livrarionline_id');
|
84 |
+
$this->getMassactionBlock()->setFormFieldName('livrarionline');
|
85 |
+
|
86 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
87 |
+
'label' => Mage::helper('livrarionline')->__('Delete'),
|
88 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
89 |
+
'confirm' => Mage::helper('livrarionline')->__('Are you sure?')
|
90 |
+
));
|
91 |
+
|
92 |
+
$statuses = Mage::getSingleton('livrarionline/status')->getOptionArray();
|
93 |
+
|
94 |
+
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
95 |
+
$this->getMassactionBlock()->addItem('status', array(
|
96 |
+
'label'=> Mage::helper('livrarionline')->__('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('livrarionline')->__('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/Xtreme/Livrarionline/Block/Adminhtml/Managecarriers.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<?php
|
2 |
class Xtreme_Livrarionline_Block_Adminhtml_Managecarriers extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
{
|
4 |
public function __construct()
|
@@ -6,7 +6,7 @@ class Xtreme_Livrarionline_Block_Adminhtml_Managecarriers extends Mage_Adminhtml
|
|
6 |
$this->_controller = 'adminhtml_managecarriers';
|
7 |
$this->_blockGroup = 'livrarionline';
|
8 |
$this->_headerText = Mage::helper('livrarionline')->__('Carriers Manager');
|
9 |
-
$this->_addButtonLabel = Mage::helper('livrarionline')->__('Add Carrier');
|
10 |
-
parent::__construct();
|
11 |
-
}
|
12 |
}
|
1 |
+
<?php
|
2 |
class Xtreme_Livrarionline_Block_Adminhtml_Managecarriers extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
{
|
4 |
public function __construct()
|
6 |
$this->_controller = 'adminhtml_managecarriers';
|
7 |
$this->_blockGroup = 'livrarionline';
|
8 |
$this->_headerText = Mage::helper('livrarionline')->__('Carriers Manager');
|
9 |
+
$this->_addButtonLabel = Mage::helper('livrarionline')->__('Add Carrier');
|
10 |
+
parent::__construct();
|
11 |
+
}
|
12 |
}
|
app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Managecarriers/Edit/Form.php
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Xtreme_Livrarionline_Block_Adminhtml_Managecarriers_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 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Xtreme_Livrarionline_Block_Adminhtml_Managecarriers_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/Xtreme/Livrarionline/Block/Adminhtml/Managecarriers/Edit/Tab/Form.php
CHANGED
@@ -29,11 +29,25 @@ class Xtreme_Livrarionline_Block_Adminhtml_Managecarriers_Edit_Tab_Form extends
|
|
29 |
'name' => 'shipping_company_id',
|
30 |
));
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
$fieldset->addField('status', 'select', array(
|
38 |
'label' => Mage::helper('livrarionline')->__('Status'),
|
39 |
'name' => 'status',
|
@@ -50,16 +64,6 @@ class Xtreme_Livrarionline_Block_Adminhtml_Managecarriers_Edit_Tab_Form extends
|
|
50 |
),
|
51 |
));
|
52 |
|
53 |
-
/*$fieldset->addField('description', 'editor', array(
|
54 |
-
'name' => 'description',
|
55 |
-
'label' => Mage::helper('livrarionline')->__('Description'),
|
56 |
-
'title' => Mage::helper('livrarionline')->__('Description'),
|
57 |
-
'style' => 'width:300px; height:100px;',
|
58 |
-
'wysiwyg' => false,
|
59 |
-
'required' => true,
|
60 |
-
));*/
|
61 |
-
|
62 |
-
|
63 |
if ( Mage::getSingleton('adminhtml/session')->getCarrierData() )
|
64 |
{
|
65 |
$form->setValues(Mage::getSingleton('adminhtml/session')->getCarrierData());
|
29 |
'name' => 'shipping_company_id',
|
30 |
));
|
31 |
|
32 |
+
$fieldset->addField('flat_fee', 'text', array(
|
33 |
+
'label' => Mage::helper('livrarionline')->__('Flat Fee'),
|
34 |
+
'required' => true,
|
35 |
+
'name' => 'flat_fee',
|
36 |
+
'note' => Mage::helper('livrarionline')->__('Any negative number if you don\'t want to use quotation module (eg: -1)'),
|
37 |
+
'value' => -1.00
|
38 |
+
));
|
39 |
+
|
40 |
+
$states = Mage::getModel('directory/country')->load('RO')->getRegions()->toOptionArray();
|
41 |
+
array_shift($states);
|
42 |
+
$fieldset->addField('applicable_states', 'multiselect', array(
|
43 |
+
'label' => Mage::helper('livrarionline')->__('Applicable to the following states'),
|
44 |
+
'class' => 'required-entry',
|
45 |
+
'required' => true,
|
46 |
+
'name' => 'applicable_states',
|
47 |
+
'values' => $states,
|
48 |
+
'note' => Mage::helper('livrarionline')->__('CTRL + click for multiple select')
|
49 |
+
));
|
50 |
+
|
51 |
$fieldset->addField('status', 'select', array(
|
52 |
'label' => Mage::helper('livrarionline')->__('Status'),
|
53 |
'name' => 'status',
|
64 |
),
|
65 |
));
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
if ( Mage::getSingleton('adminhtml/session')->getCarrierData() )
|
68 |
{
|
69 |
$form->setValues(Mage::getSingleton('adminhtml/session')->getCarrierData());
|
app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Managecarriers/Edit/Tabs.php
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Xtreme_Livrarionline_Block_Adminhtml_Managecarriers_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
-
{
|
5 |
-
|
6 |
-
public function __construct()
|
7 |
-
{
|
8 |
-
parent::__construct();
|
9 |
$this->setId('livrarionline_tabs');
|
10 |
$this->setDestElementId('edit_form');
|
11 |
-
$this->setTitle(Mage::helper('livrarionline')->__('Carrier Information'));
|
12 |
-
}
|
13 |
-
|
14 |
-
protected function _beforeToHtml()
|
15 |
-
{
|
16 |
-
$this->addTab('form_section', array(
|
17 |
-
'label' => Mage::helper('livrarionline')->__('Carrier Information'),
|
18 |
-
'title' => Mage::helper('livrarionline')->__('Carrier Information'),
|
19 |
-
'content' => $this->getLayout()->createBlock('livrarionline/adminhtml_managecarriers_edit_tab_form')->toHtml(),
|
20 |
-
));
|
21 |
-
|
22 |
-
return parent::_beforeToHtml();
|
23 |
-
}
|
24 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Xtreme_Livrarionline_Block_Adminhtml_Managecarriers_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
$this->setId('livrarionline_tabs');
|
10 |
$this->setDestElementId('edit_form');
|
11 |
+
$this->setTitle(Mage::helper('livrarionline')->__('Carrier Information'));
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _beforeToHtml()
|
15 |
+
{
|
16 |
+
$this->addTab('form_section', array(
|
17 |
+
'label' => Mage::helper('livrarionline')->__('Carrier Information'),
|
18 |
+
'title' => Mage::helper('livrarionline')->__('Carrier Information'),
|
19 |
+
'content' => $this->getLayout()->createBlock('livrarionline/adminhtml_managecarriers_edit_tab_form')->toHtml(),
|
20 |
+
));
|
21 |
+
|
22 |
+
return parent::_beforeToHtml();
|
23 |
+
}
|
24 |
}
|
app/code/local/Xtreme/Livrarionline/Block/Adminhtml/Managestores/Edit/Tab/Form.php
CHANGED
@@ -111,8 +111,8 @@ class Xtreme_Livrarionline_Block_Adminhtml_Managestores_Edit_Tab_Form extends Ma
|
|
111 |
|
112 |
$fieldset->addField('phone', 'text', array(
|
113 |
'label' => Mage::helper('livrarionline')->__('Phone'),
|
114 |
-
|
115 |
-
'required' =>
|
116 |
'name' => 'phone',
|
117 |
));
|
118 |
|
111 |
|
112 |
$fieldset->addField('phone', 'text', array(
|
113 |
'label' => Mage::helper('livrarionline')->__('Phone'),
|
114 |
+
'class' => 'required-entry',
|
115 |
+
'required' => true,
|
116 |
'name' => 'phone',
|
117 |
));
|
118 |
|
app/code/local/Xtreme/Livrarionline/Block/Livrarionline.php
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
<?php
|
2 |
-
class Xtreme_Livrarionline_Block_Livrarionline extends Mage_Core_Block_Template
|
3 |
-
{
|
4 |
-
public function _prepareLayout()
|
5 |
-
{
|
6 |
-
return parent::_prepareLayout();
|
7 |
-
}
|
8 |
-
|
9 |
-
public function getLivrarionline()
|
10 |
-
{
|
11 |
-
if (!$this->hasData('livrarionline')) {
|
12 |
-
$this->setData('livrarionline', Mage::registry('livrarionline'));
|
13 |
-
}
|
14 |
-
return $this->getData('livrarionline');
|
15 |
-
|
16 |
-
}
|
17 |
}
|
1 |
+
<?php
|
2 |
+
class Xtreme_Livrarionline_Block_Livrarionline extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public function _prepareLayout()
|
5 |
+
{
|
6 |
+
return parent::_prepareLayout();
|
7 |
+
}
|
8 |
+
|
9 |
+
public function getLivrarionline()
|
10 |
+
{
|
11 |
+
if (!$this->hasData('livrarionline')) {
|
12 |
+
$this->setData('livrarionline', Mage::registry('livrarionline'));
|
13 |
+
}
|
14 |
+
return $this->getData('livrarionline');
|
15 |
+
|
16 |
+
}
|
17 |
}
|
app/code/local/Xtreme/Livrarionline/Helper/Data.php
CHANGED
@@ -23,7 +23,8 @@ class Xtreme_Livrarionline_Helper_Data extends Mage_Core_Helper_Abstract
|
|
23 |
$name = $store->getName();
|
24 |
|
25 |
$price = 0;
|
26 |
-
|
|
|
27 |
$f_request_awb = array();
|
28 |
$f_request_awb['f_shipping_company_id'] = (int) $carrier->getShippingCompanyId(); // int obligatoriu
|
29 |
$f_request_awb['request_data_ridicare'] = '2013-11-28'; // date Y-m-d optional
|
@@ -37,49 +38,49 @@ class Xtreme_Livrarionline_Helper_Data extends Mage_Core_Helper_Abstract
|
|
37 |
$f_request_awb['referinta_expeditor'] = $awb->getReference(); // varchar(255) Obligatoriu
|
38 |
$f_request_awb['valoare_declarata'] = $awb->getDeclaredValue(); // decimal(10,2) Obligatoriu
|
39 |
$f_request_awb['ramburs'] = $awb->getCod(); // decimal(10,2) Obligatoriu
|
40 |
-
$f_request_awb['asigurare_la_valoarea_declarata'] = (
|
41 |
-
$f_request_awb['retur_documente'] = (
|
42 |
-
$f_request_awb['retur_documente_bancare'] = (
|
43 |
-
$f_request_awb['confirmare_livrare'] = (
|
44 |
-
$f_request_awb['livrare_sambata'] = (
|
45 |
$f_request_awb['currency'] = ($awb->getDeclaredValue() > 0) ? $awb->getCurrency() : ''; // char(3) Obligatoriu cand "valoare_declarata" > 0
|
46 |
-
$f_request_awb['currency_ramburs'] = ($awb->getCod() > 0) ? $awb->
|
47 |
-
$f_request_awb['notificare_email']= (
|
48 |
-
$f_request_awb['notificare_sms'] = (
|
49 |
-
$f_request_awb['cine_plateste'] = $awb->getPayee(); // 0 - merchant,2 - destinatar,1 - expeditor Obligatoriu
|
50 |
$f_request_awb['serviciuid']= (int) $carrier->getServiceId(); // int Obligatoriu
|
51 |
-
$f_request_awb['request_mpod'] =
|
52 |
|
53 |
$colete = array();
|
54 |
foreach($parcels as $item)
|
55 |
{
|
56 |
$colete[] = array(
|
57 |
'greutate'=> (float) (($item->getWeight() > 0) ? $item->getWeight() : 1), // decimal 10,2 kg
|
58 |
-
'lungime'=> ($item->getLength() > 0) ? $item->getLength() : 1, // integer cm
|
59 |
-
'latime'=> ($item->getWidth() > 0) ? $item->getWidth() : 1, // integer cm
|
60 |
-
'inaltime'=> ($item->getHeight() > 0) ? $item->getHeight() : 1, // integer cm
|
61 |
-
'continut'=> $item->getContent(), // int 1;"Acte" 2;"Tipizate" 3;"Fragile" 4;"Generale"
|
62 |
-
'tipcolet'=> $item->getParcelType() // int 1;"Plic"2;"Colet"3;"Palet"11
|
63 |
);
|
64 |
}
|
65 |
|
66 |
$f_request_awb['colete'] = $colete;
|
67 |
|
68 |
$f_request_awb['destinatar'] = array(
|
69 |
-
'first_name' => $billing->getFirstname(), //Obligatoriu
|
70 |
-
'last_name'=> $billing->getLastname(), //Obligatoriu
|
71 |
-
'email' => $billing->getEmail(), //Obligatoriu
|
72 |
-
'phone' => $billing->getTelephone(), //phone sau mobile Obligatoriu
|
73 |
'mobile' => '',
|
74 |
'lang' => 'ro', //Obligatoriu ro/en
|
75 |
-
'company_name' => ($
|
76 |
'j' => '', //optional
|
77 |
-
'bank_account' =>
|
78 |
-
'bank_name' =>
|
79 |
-
'cui' =>
|
80 |
);
|
81 |
|
82 |
-
|
83 |
$country = Mage::getModel('directory/country')->loadByCode($shipping->getCountryId());
|
84 |
//$street = explode("\n", $shipping->getStreet());
|
85 |
$street = $shipping->getStreet();
|
@@ -87,13 +88,13 @@ class Xtreme_Livrarionline_Helper_Data extends Mage_Core_Helper_Abstract
|
|
87 |
//Obligatoriu
|
88 |
'address1' => $street[0],
|
89 |
'address2' => (count($street) == 2) ? $street[1] : '',
|
90 |
-
'city' =>
|
91 |
//'state' => iconv("UTF-8", "ISO-8859-1//TRANSLIT", $region->getName()),
|
92 |
-
'state' =>
|
93 |
'zip' => $shipping->getPostcode(),
|
94 |
-
'country' =>
|
95 |
'phone' => $shipping->getTelephone(),
|
96 |
-
'observatii'=> '
|
97 |
);
|
98 |
|
99 |
//$region = Mage::getModel('directory/region')->load($request->getRegionId());
|
@@ -103,7 +104,7 @@ class Xtreme_Livrarionline_Helper_Data extends Mage_Core_Helper_Abstract
|
|
103 |
{
|
104 |
$region = Mage::getModel('directory/region')->loadByCode($lo_store->getState(), $lo_store->getCountry())->getName();
|
105 |
$country = Mage::getModel('directory/country')->loadByCode($lo_store->getCountry());
|
106 |
-
$country =
|
107 |
}
|
108 |
$f_request_awb['shipFROMaddress'] = array(
|
109 |
'email' => $lo_store->getEmail(),
|
@@ -111,25 +112,23 @@ class Xtreme_Livrarionline_Helper_Data extends Mage_Core_Helper_Abstract
|
|
111 |
'last_name' => $lo_store->getLastname(),
|
112 |
'mobile' => '',
|
113 |
'main_address' => $lo_store->getAddress1(),
|
114 |
-
'city' =>
|
115 |
'state' => $region,
|
116 |
'zip' => $lo_store->getZipcode(),
|
117 |
'country' => $country,
|
118 |
'phone' => $lo_store->getPhone(),
|
119 |
'instructiuni' => ''
|
120 |
);
|
121 |
-
|
122 |
-
//
|
123 |
|
124 |
-
Mage::log(var_export($f_request_awb, true));
|
125 |
-
|
126 |
-
$lo = new LO ();
|
127 |
|
128 |
$lo->f_login = $login_id;
|
129 |
$lo->setRSAKey($security_key);
|
130 |
|
131 |
$response_awb = $lo->GenerateAwb($f_request_awb);
|
132 |
-
Mage::log($response_awb);
|
133 |
|
134 |
//raspuns generare AWB
|
135 |
if ((isset($response_awb->status) && $response_awb->status == 'error') || empty($response_awb))
|
@@ -203,7 +202,7 @@ class Xtreme_Livrarionline_Helper_Data extends Mage_Core_Helper_Abstract
|
|
203 |
foreach ($cartItems as $item)
|
204 |
{
|
205 |
$colete[] = array(
|
206 |
-
'greutate' =>
|
207 |
'lungime' => ($item->getLength() > 0) ? $item->getLength() : 1, // integer cm
|
208 |
'latime' => ($item->getWidth() > 0) ? $item->getWidth() : 1, // integer cm
|
209 |
'inaltime' => ($item->getHeight() > 0) ? $item->getHeight() : 1, // integer cm
|
@@ -214,14 +213,16 @@ class Xtreme_Livrarionline_Helper_Data extends Mage_Core_Helper_Abstract
|
|
214 |
|
215 |
$f_request_awb['colete'] = $colete;
|
216 |
|
|
|
|
|
217 |
$f_request_awb['destinatar'] = array(
|
218 |
-
'first_name' => $billing->getFirstname(), //Obligatoriu
|
219 |
-
'last_name'=> $billing->getLastname(), //Obligatoriu
|
220 |
-
'email' => $billing->getEmail(), //Obligatoriu
|
221 |
-
'phone' => $billing->getTelephone(), //phone sau mobile Obligatoriu
|
222 |
'mobile' => '',
|
223 |
'lang' => 'ro', //Obligatoriu ro/en
|
224 |
-
'company_name' =>
|
225 |
'j' => '', //optional
|
226 |
'bank_account' => '', //optional
|
227 |
'bank_name' => '', //optional
|
@@ -236,13 +237,13 @@ class Xtreme_Livrarionline_Helper_Data extends Mage_Core_Helper_Abstract
|
|
236 |
//Obligatoriu
|
237 |
'address1' => $street[0],
|
238 |
'address2' => (count($street) == 2) ? $street[1] : '',
|
239 |
-
'city' =>
|
240 |
-
'state' =>
|
241 |
-
'state' => self::toLatin1($region->getName()),
|
242 |
'zip' => $shipping->getPostcode(),
|
243 |
-
'country' =>
|
244 |
'phone' => $shipping->getTelephone(),
|
245 |
-
'observatii'=> '
|
246 |
);
|
247 |
|
248 |
$region = $country = '';
|
@@ -250,15 +251,15 @@ class Xtreme_Livrarionline_Helper_Data extends Mage_Core_Helper_Abstract
|
|
250 |
{
|
251 |
$region = Mage::getModel('directory/region')->loadByCode($default_store->getState(), $default_store->getCountry())->getName();
|
252 |
$country = Mage::getModel('directory/country')->loadByCode($default_store->getCountry());
|
253 |
-
$country =
|
254 |
}
|
255 |
$f_request_awb['shipFROMaddress'] = array(
|
256 |
-
'email' =>
|
257 |
-
'first_name' =>
|
258 |
-
'last_name' =>
|
259 |
'mobile' => '',
|
260 |
'main_address' => $default_store->getAddress1(),
|
261 |
-
'city' =>
|
262 |
'state' => $region,
|
263 |
'zip' => $default_store->getZipcode(),
|
264 |
'country' => $country,
|
@@ -276,7 +277,7 @@ class Xtreme_Livrarionline_Helper_Data extends Mage_Core_Helper_Abstract
|
|
276 |
$lo->setRSAKey($security_key);
|
277 |
|
278 |
$response_awb = $lo->EstimeazaPret($f_request_awb);
|
279 |
-
Mage::log($response_awb);
|
280 |
|
281 |
//raspuns generare AWB
|
282 |
if ((isset($response_awb->status) && $response_awb->status == 'error') || empty($response_awb))
|
@@ -318,7 +319,7 @@ class Xtreme_Livrarionline_Helper_Data extends Mage_Core_Helper_Abstract
|
|
318 |
$lo->setRSAKey($security_key);
|
319 |
|
320 |
$response_cancel = $lo->CancelLivrare($f_request_cancel);
|
321 |
-
Mage::log($response_cancel);
|
322 |
|
323 |
//raspuns generare AWB
|
324 |
if ((isset($response_cancel->status) && $response_cancel->status == 'error') || empty($response_cancel))
|
@@ -346,7 +347,7 @@ class Xtreme_Livrarionline_Helper_Data extends Mage_Core_Helper_Abstract
|
|
346 |
$lo->setRSAKey($security_key);
|
347 |
|
348 |
$response = $lo->Tracking($f_request_cancel);
|
349 |
-
Mage::log($response);
|
350 |
|
351 |
//raspuns generare AWB
|
352 |
if ((isset($response->status) && $response->status == 'error') || empty($response))
|
23 |
$name = $store->getName();
|
24 |
|
25 |
$price = 0;
|
26 |
+
$lo = new LO ();
|
27 |
+
|
28 |
$f_request_awb = array();
|
29 |
$f_request_awb['f_shipping_company_id'] = (int) $carrier->getShippingCompanyId(); // int obligatoriu
|
30 |
$f_request_awb['request_data_ridicare'] = '2013-11-28'; // date Y-m-d optional
|
38 |
$f_request_awb['referinta_expeditor'] = $awb->getReference(); // varchar(255) Obligatoriu
|
39 |
$f_request_awb['valoare_declarata'] = $awb->getDeclaredValue(); // decimal(10,2) Obligatoriu
|
40 |
$f_request_awb['ramburs'] = $awb->getCod(); // decimal(10,2) Obligatoriu
|
41 |
+
$f_request_awb['asigurare_la_valoarea_declarata'] = $lo->checkboxSelected($awb->getInsurance()); // Boolean Obligatoriu
|
42 |
+
$f_request_awb['retur_documente'] = $lo->checkboxSelected($awb->getReturndocs()); // boolean optional
|
43 |
+
$f_request_awb['retur_documente_bancare'] = $lo->checkboxSelected($awb->getReturndocsbank()); // boolean optional
|
44 |
+
$f_request_awb['confirmare_livrare'] = $lo->checkboxSelected($awb->getDeliveryconf()); // boolean optional
|
45 |
+
$f_request_awb['livrare_sambata'] = $lo->checkboxSelected($awb->getDeliverysat()); // Boolean optional
|
46 |
$f_request_awb['currency'] = ($awb->getDeclaredValue() > 0) ? $awb->getCurrency() : ''; // char(3) Obligatoriu cand "valoare_declarata" > 0
|
47 |
+
$f_request_awb['currency_ramburs'] = ($awb->getCod() > 0) ? $awb->getCurrency() : ''; // char(3) Obligatoriu cand "ramburs" > 0
|
48 |
+
$f_request_awb['notificare_email']= $lo->checkboxSelected($awb->getEmailnotify()); // Boolean optional
|
49 |
+
$f_request_awb['notificare_sms'] = $lo->checkboxSelected($awb->getSmsnotify()); // Boolean optional
|
50 |
+
$f_request_awb['cine_plateste'] = (int) $awb->getPayee(); // 0 - merchant,2 - destinatar,1 - expeditor Obligatoriu
|
51 |
$f_request_awb['serviciuid']= (int) $carrier->getServiceId(); // int Obligatoriu
|
52 |
+
$f_request_awb['request_mpod'] = $lo->checkboxSelected($awb->getDeliveryconfmerchant()); // Boolean optional
|
53 |
|
54 |
$colete = array();
|
55 |
foreach($parcels as $item)
|
56 |
{
|
57 |
$colete[] = array(
|
58 |
'greutate'=> (float) (($item->getWeight() > 0) ? $item->getWeight() : 1), // decimal 10,2 kg
|
59 |
+
'lungime'=> (float)(($item->getLength() > 0) ? $item->getLength() : 1), // integer cm
|
60 |
+
'latime'=> (float)(($item->getWidth() > 0) ? $item->getWidth() : 1), // integer cm
|
61 |
+
'inaltime'=> (float)(($item->getHeight() > 0) ? $item->getHeight() : 1), // integer cm
|
62 |
+
'continut'=> (int)$item->getContent(), // int 1;"Acte" 2;"Tipizate" 3;"Fragile" 4;"Generale"
|
63 |
+
'tipcolet'=> (int)$item->getParcelType() // int 1;"Plic"2;"Colet"3;"Palet"11
|
64 |
);
|
65 |
}
|
66 |
|
67 |
$f_request_awb['colete'] = $colete;
|
68 |
|
69 |
$f_request_awb['destinatar'] = array(
|
70 |
+
'first_name' => ($shipping->getFirstname()) ? $shipping->getFirstname() : $billing->getFirstname(), //Obligatoriu
|
71 |
+
'last_name'=> ($shipping->getLastname()) ? $shipping->getLastname() : $billing->getLastname(), //Obligatoriu
|
72 |
+
'email' => ($shipping->getEmail()) ? $shipping->getEmail() : $billing->getEmail(), //Obligatoriu
|
73 |
+
'phone' => ($shipping->getTelephone()) ? $shipping->getTelephone() : $billing->getTelephone(), //phone sau mobile Obligatoriu
|
74 |
'mobile' => '',
|
75 |
'lang' => 'ro', //Obligatoriu ro/en
|
76 |
+
'company_name' => ($shipping->getCompany()) ? $shipping->getCompany() : $billing->getCompany(), //optional
|
77 |
'j' => '', //optional
|
78 |
+
'bank_account' => ($shipping->getIban()) ? $shipping->getIban() : $billing->getIban(), //optional
|
79 |
+
'bank_name' => ($shipping->getBanca()) ? $shipping->getBanca() : $billing->getBanca(), //optional
|
80 |
+
'cui' => ($shipping->getCif()) ? $shipping->getCif() : $billing->getCif()//optional
|
81 |
);
|
82 |
|
83 |
+
$region = Mage::getModel('directory/region')->load($shipping->getRegionId());
|
84 |
$country = Mage::getModel('directory/country')->loadByCode($shipping->getCountryId());
|
85 |
//$street = explode("\n", $shipping->getStreet());
|
86 |
$street = $shipping->getStreet();
|
88 |
//Obligatoriu
|
89 |
'address1' => $street[0],
|
90 |
'address2' => (count($street) == 2) ? $street[1] : '',
|
91 |
+
'city' => $shipping->getCity(),
|
92 |
//'state' => iconv("UTF-8", "ISO-8859-1//TRANSLIT", $region->getName()),
|
93 |
+
'state' => $region->getName(),
|
94 |
'zip' => $shipping->getPostcode(),
|
95 |
+
'country' => $country->getName(),
|
96 |
'phone' => $shipping->getTelephone(),
|
97 |
+
'observatii'=> ''
|
98 |
);
|
99 |
|
100 |
//$region = Mage::getModel('directory/region')->load($request->getRegionId());
|
104 |
{
|
105 |
$region = Mage::getModel('directory/region')->loadByCode($lo_store->getState(), $lo_store->getCountry())->getName();
|
106 |
$country = Mage::getModel('directory/country')->loadByCode($lo_store->getCountry());
|
107 |
+
$country = $country->getName();
|
108 |
}
|
109 |
$f_request_awb['shipFROMaddress'] = array(
|
110 |
'email' => $lo_store->getEmail(),
|
112 |
'last_name' => $lo_store->getLastname(),
|
113 |
'mobile' => '',
|
114 |
'main_address' => $lo_store->getAddress1(),
|
115 |
+
'city' => $lo_store->getCity(),
|
116 |
'state' => $region,
|
117 |
'zip' => $lo_store->getZipcode(),
|
118 |
'country' => $country,
|
119 |
'phone' => $lo_store->getPhone(),
|
120 |
'instructiuni' => ''
|
121 |
);
|
122 |
+
//echo '<pre>';
|
123 |
+
//var_dump($f_request_awb);exit;
|
124 |
|
125 |
+
//Mage::log(var_export($f_request_awb, true));
|
|
|
|
|
126 |
|
127 |
$lo->f_login = $login_id;
|
128 |
$lo->setRSAKey($security_key);
|
129 |
|
130 |
$response_awb = $lo->GenerateAwb($f_request_awb);
|
131 |
+
//Mage::log($response_awb);
|
132 |
|
133 |
//raspuns generare AWB
|
134 |
if ((isset($response_awb->status) && $response_awb->status == 'error') || empty($response_awb))
|
202 |
foreach ($cartItems as $item)
|
203 |
{
|
204 |
$colete[] = array(
|
205 |
+
'greutate' => 1, // decimal 10,2 kg
|
206 |
'lungime' => ($item->getLength() > 0) ? $item->getLength() : 1, // integer cm
|
207 |
'latime' => ($item->getWidth() > 0) ? $item->getWidth() : 1, // integer cm
|
208 |
'inaltime' => ($item->getHeight() > 0) ? $item->getHeight() : 1, // integer cm
|
213 |
|
214 |
$f_request_awb['colete'] = $colete;
|
215 |
|
216 |
+
$shipping = $quote->getShippingAddress();
|
217 |
+
|
218 |
$f_request_awb['destinatar'] = array(
|
219 |
+
'first_name' => ($shipping->getFirstname()) ? $shipping->getFirstname() : $billing->getFirstname(), //Obligatoriu
|
220 |
+
'last_name'=> ($shipping->getLastname()) ? $shipping->getLastname() : $billing->getLastname(), //Obligatoriu
|
221 |
+
'email' => ($shipping->getEmail()) ? $shipping->getEmail() : $billing->getEmail(), //Obligatoriu
|
222 |
+
'phone' => ($shipping->getTelephone()) ? $shipping->getTelephone() : $billing->getTelephone(), //phone sau mobile Obligatoriu
|
223 |
'mobile' => '',
|
224 |
'lang' => 'ro', //Obligatoriu ro/en
|
225 |
+
'company_name' => '', //optional
|
226 |
'j' => '', //optional
|
227 |
'bank_account' => '', //optional
|
228 |
'bank_name' => '', //optional
|
237 |
//Obligatoriu
|
238 |
'address1' => $street[0],
|
239 |
'address2' => (count($street) == 2) ? $street[1] : '',
|
240 |
+
'city' => $shipping->getCity(),
|
241 |
+
'state' => $region->getName(),
|
242 |
+
//'state' => self::toLatin1($region->getName()),
|
243 |
'zip' => $shipping->getPostcode(),
|
244 |
+
'country' => $country->getName(),
|
245 |
'phone' => $shipping->getTelephone(),
|
246 |
+
'observatii'=> ''
|
247 |
);
|
248 |
|
249 |
$region = $country = '';
|
251 |
{
|
252 |
$region = Mage::getModel('directory/region')->loadByCode($default_store->getState(), $default_store->getCountry())->getName();
|
253 |
$country = Mage::getModel('directory/country')->loadByCode($default_store->getCountry());
|
254 |
+
$country = $country->getName();
|
255 |
}
|
256 |
$f_request_awb['shipFROMaddress'] = array(
|
257 |
+
'email' => $default_store->getEmail(),
|
258 |
+
'first_name' => $default_store->getFirstname(),
|
259 |
+
'last_name' => $default_store->getLastname(),
|
260 |
'mobile' => '',
|
261 |
'main_address' => $default_store->getAddress1(),
|
262 |
+
'city' => $default_store->getCity(),
|
263 |
'state' => $region,
|
264 |
'zip' => $default_store->getZipcode(),
|
265 |
'country' => $country,
|
277 |
$lo->setRSAKey($security_key);
|
278 |
|
279 |
$response_awb = $lo->EstimeazaPret($f_request_awb);
|
280 |
+
//Mage::log($response_awb);
|
281 |
|
282 |
//raspuns generare AWB
|
283 |
if ((isset($response_awb->status) && $response_awb->status == 'error') || empty($response_awb))
|
319 |
$lo->setRSAKey($security_key);
|
320 |
|
321 |
$response_cancel = $lo->CancelLivrare($f_request_cancel);
|
322 |
+
//Mage::log($response_cancel);
|
323 |
|
324 |
//raspuns generare AWB
|
325 |
if ((isset($response_cancel->status) && $response_cancel->status == 'error') || empty($response_cancel))
|
347 |
$lo->setRSAKey($security_key);
|
348 |
|
349 |
$response = $lo->Tracking($f_request_cancel);
|
350 |
+
//Mage::log($response);
|
351 |
|
352 |
//raspuns generare AWB
|
353 |
if ((isset($response->status) && $response->status == 'error') || empty($response))
|
app/code/local/Xtreme/Livrarionline/Model/Carrier/Livrarionline.php
CHANGED
@@ -16,20 +16,30 @@ implements Mage_Shipping_Model_Carrier_Interface {
|
|
16 |
$handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
|
17 |
$result = Mage::getModel('shipping/rate_result');
|
18 |
$show = true;
|
19 |
-
$carriers = Mage::getModel('livrarionline/carriers')->getCollection();
|
20 |
foreach($carriers as $carrier)
|
21 |
{
|
22 |
-
$
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
/*else
|
35 |
{
|
16 |
$handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
|
17 |
$result = Mage::getModel('shipping/rate_result');
|
18 |
$show = true;
|
19 |
+
$carriers = Mage::getModel('livrarionline/carriers')->getCollection()->addFieldToFilter('`status`', 1);
|
20 |
foreach($carriers as $carrier)
|
21 |
{
|
22 |
+
$flat_fee = $carrier->getFlatFee(); //preiau valoarea flat fee
|
23 |
+
$shippingStateConfig = explode(',', $carrier->getApplicableStates()); // preiau judetele pe care se aplica serviciul
|
24 |
+
$destState = $request->getDestRegionId(); // preiau judetul destinatie
|
25 |
+
|
26 |
+
if (in_array($destState, $shippingStateConfig)) {
|
27 |
+
if ($flat_fee && $flat_fee>=0) {
|
28 |
+
$price_res = $flat_fee; //daca avem flat fee setat
|
29 |
+
} else {
|
30 |
+
$price_res = Mage::helper('livrarionline')->getEstimate($carrier, $quote);
|
31 |
+
}
|
32 |
+
|
33 |
+
if($price_res){
|
34 |
+
$method = Mage::getModel('shipping/rate_result_method');
|
35 |
+
$method->setCarrier($this->_code);
|
36 |
+
$method->setMethod($this->_code."_".$carrier->getCarrierId());
|
37 |
+
$method->setCarrierTitle(Mage::getStoreConfig('carriers/'.$this->_code.'/title'));
|
38 |
+
$method->setMethodTitle($carrier->getName());
|
39 |
+
$method->setPrice($price_res);
|
40 |
+
$method->setCost($price_res);
|
41 |
+
$result->append($method);
|
42 |
+
}
|
43 |
}
|
44 |
/*else
|
45 |
{
|
app/code/local/Xtreme/Livrarionline/Model/Livrarionline.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Xtreme_Livrarionline_Model_Livrarionline extends Mage_Core_Model_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
-
$this->_init('livrarionline/livrarionline');
|
9 |
-
}
|
10 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Xtreme_Livrarionline_Model_Livrarionline extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('livrarionline/livrarionline');
|
9 |
+
}
|
10 |
}
|
app/code/local/Xtreme/Livrarionline/Model/Mysql4/Carriers.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Xtreme_Livrarionline_Model_Mysql4_Carriers extends Mage_Core_Model_Mysql4_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
// Note that the livrarionline_id refers to the key field in your database table.
|
8 |
-
$this->_init('livrarionline/carriers', 'carrier_id');
|
9 |
-
}
|
10 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Xtreme_Livrarionline_Model_Mysql4_Carriers extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
// Note that the livrarionline_id refers to the key field in your database table.
|
8 |
+
$this->_init('livrarionline/carriers', 'carrier_id');
|
9 |
+
}
|
10 |
}
|
app/code/local/Xtreme/Livrarionline/Model/Mysql4/Carriers/Collection.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Xtreme_Livrarionline_Model_Mysql4_Carriers_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
$this->_init('livrarionline/carriers');
|
9 |
-
}
|
10 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Xtreme_Livrarionline_Model_Mysql4_Carriers_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
$this->_init('livrarionline/carriers');
|
9 |
+
}
|
10 |
}
|
app/code/local/Xtreme/Livrarionline/Model/Mysql4/Livrarionline.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Xtreme_Livrarionline_Model_Mysql4_Livrarionline extends Mage_Core_Model_Mysql4_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
// Note that the livrarionline_id refers to the key field in your database table.
|
8 |
-
$this->_init('livrarionline/livrarionline', 'livrarionline_id');
|
9 |
-
}
|
10 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Xtreme_Livrarionline_Model_Mysql4_Livrarionline extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
// Note that the livrarionline_id refers to the key field in your database table.
|
8 |
+
$this->_init('livrarionline/livrarionline', 'livrarionline_id');
|
9 |
+
}
|
10 |
}
|
app/code/local/Xtreme/Livrarionline/Model/Mysql4/Livrarionline/Collection.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Xtreme_Livrarionline_Model_Mysql4_Livrarionline_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
-
$this->_init('livrarionline/livrarionline');
|
9 |
-
}
|
10 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Xtreme_Livrarionline_Model_Mysql4_Livrarionline_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('livrarionline/livrarionline');
|
9 |
+
}
|
10 |
}
|
app/code/local/Xtreme/Livrarionline/Model/Mysql4/Stores/Collection.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Xtreme_Livrarionline_Model_Mysql4_Stores_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
$this->_init('livrarionline/stores');
|
9 |
-
}
|
10 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Xtreme_Livrarionline_Model_Mysql4_Stores_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
$this->_init('livrarionline/stores');
|
9 |
+
}
|
10 |
}
|
app/code/local/Xtreme/Livrarionline/controllers/Adminhtml/ManageawbController.php
CHANGED
@@ -156,18 +156,12 @@ class Xtreme_Livrarionline_Adminhtml_ManageawbController extends Mage_Adminhtml_
|
|
156 |
public function printAction() {
|
157 |
if( $this->getRequest()->getParam('id') > 0 ) {
|
158 |
try {
|
159 |
-
$model = Mage::getModel('livrarionline/awb')->load($this->getRequest()->getParam('id'));
|
160 |
-
|
161 |
-
{
|
162 |
$html = Mage::helper('livrarionline')->printAWB($model->getAwbId());
|
163 |
echo $html;
|
164 |
exit;
|
165 |
-
|
166 |
-
else
|
167 |
-
{
|
168 |
-
echo "Missing AWB No";
|
169 |
-
exit;
|
170 |
-
}
|
171 |
//Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__($msg));
|
172 |
//$this->_redirect('*/*/');
|
173 |
} catch (Exception $e) {
|
156 |
public function printAction() {
|
157 |
if( $this->getRequest()->getParam('id') > 0 ) {
|
158 |
try {
|
159 |
+
$model = Mage::getModel('livrarionline/awb')->load($this->getRequest()->getParam('id'));
|
160 |
+
|
|
|
161 |
$html = Mage::helper('livrarionline')->printAWB($model->getAwbId());
|
162 |
echo $html;
|
163 |
exit;
|
164 |
+
|
|
|
|
|
|
|
|
|
|
|
165 |
//Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__($msg));
|
166 |
//$this->_redirect('*/*/');
|
167 |
} catch (Exception $e) {
|
app/code/local/Xtreme/Livrarionline/controllers/Adminhtml/ManagecarriersController.php
CHANGED
@@ -22,6 +22,7 @@ class Xtreme_Livrarionline_Adminhtml_ManagecarriersController extends Mage_Admin
|
|
22 |
|
23 |
if ($model->getId() || $id == 0) {
|
24 |
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
|
|
25 |
if (!empty($data)) {
|
26 |
$model->setData($data);
|
27 |
}
|
@@ -79,7 +80,7 @@ class Xtreme_Livrarionline_Adminhtml_ManagecarriersController extends Mage_Admin
|
|
79 |
//this way the name is saved in DB
|
80 |
$data['filename'] = $_FILES['filename']['name'];
|
81 |
}*/
|
82 |
-
|
83 |
$model = Mage::getModel('livrarionline/carriers');
|
84 |
$model->setData($data)
|
85 |
->setId($this->getRequest()->getParam('id'));
|
22 |
|
23 |
if ($model->getId() || $id == 0) {
|
24 |
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
25 |
+
|
26 |
if (!empty($data)) {
|
27 |
$model->setData($data);
|
28 |
}
|
80 |
//this way the name is saved in DB
|
81 |
$data['filename'] = $_FILES['filename']['name'];
|
82 |
}*/
|
83 |
+
$data['applicable_states'] = implode(',',$data['applicable_states']);
|
84 |
$model = Mage::getModel('livrarionline/carriers');
|
85 |
$model->setData($data)
|
86 |
->setId($this->getRequest()->getParam('id'));
|
app/code/local/Xtreme/Livrarionline/etc/config.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Xtreme_Livrarionline>
|
13 |
-
<version>1.0.
|
14 |
</Xtreme_Livrarionline>
|
15 |
</modules>
|
16 |
<frontend>
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Xtreme_Livrarionline>
|
13 |
+
<version>1.0.3</version>
|
14 |
</Xtreme_Livrarionline>
|
15 |
</modules>
|
16 |
<frontend>
|
app/code/local/Xtreme/Livrarionline/sql/livrarionline_setup/mysql4-install-0.1.0.php
CHANGED
@@ -24,6 +24,8 @@ CREATE TABLE IF NOT EXISTS {$this->getTable('livrarionline_carriers')} (
|
|
24 |
`name` varchar(255) NOT NULL default '',
|
25 |
`service_id` int(11) unsigned NOT NULL,
|
26 |
`shipping_company_id` int(11) unsigned NOT NULL,
|
|
|
|
|
27 |
`status` smallint(6) NOT NULL default '0',
|
28 |
`created_time` datetime NULL,
|
29 |
`updated_time` datetime NULL,
|
@@ -50,6 +52,7 @@ CREATE TABLE IF NOT EXISTS {$this->getTable('livrarionline_stores')} (
|
|
50 |
`firstname` varchar(255) default NULL,
|
51 |
`lastname` varchar(255) default NULL,
|
52 |
`comment` text default NULL,
|
|
|
53 |
`status` smallint(6) NOT NULL default '0',
|
54 |
`created_time` datetime NULL,
|
55 |
`updated_time` datetime NULL,
|
@@ -62,6 +65,7 @@ CREATE TABLE IF NOT EXISTS {$this->getTable('livrarionline_stores')} (
|
|
62 |
#DROP TABLE IF EXISTS {$this->getTable('livrarionline_awb')};
|
63 |
CREATE TABLE IF NOT EXISTS {$this->getTable('livrarionline_awb')} (
|
64 |
`awb_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
65 |
`order_id` int(11) unsigned NOT NULL,
|
66 |
`service_id` int(11) unsigned NOT NULL,
|
67 |
`description` text NOT NULL,
|
@@ -112,5 +116,5 @@ ALTER TABLE {$this->getTable('livrarionline_awb_parcels')}
|
|
112 |
ADD CONSTRAINT `FK_AWB_ID` FOREIGN KEY (`awb_id`) REFERENCES {$this->getTable('livrarionline_awb')} (`awb_id`) ON DELETE CASCADE;
|
113 |
|
114 |
");
|
115 |
-
|
116 |
$installer->endSetup();
|
24 |
`name` varchar(255) NOT NULL default '',
|
25 |
`service_id` int(11) unsigned NOT NULL,
|
26 |
`shipping_company_id` int(11) unsigned NOT NULL,
|
27 |
+
`flat_fee` DECIMAL(10,2) NULL DEFAULT NULL,
|
28 |
+
`applicable_states` text NOT NULL,
|
29 |
`status` smallint(6) NOT NULL default '0',
|
30 |
`created_time` datetime NULL,
|
31 |
`updated_time` datetime NULL,
|
52 |
`firstname` varchar(255) default NULL,
|
53 |
`lastname` varchar(255) default NULL,
|
54 |
`comment` text default NULL,
|
55 |
+
`default` tinyint(1) NOT NULL default '0',
|
56 |
`status` smallint(6) NOT NULL default '0',
|
57 |
`created_time` datetime NULL,
|
58 |
`updated_time` datetime NULL,
|
65 |
#DROP TABLE IF EXISTS {$this->getTable('livrarionline_awb')};
|
66 |
CREATE TABLE IF NOT EXISTS {$this->getTable('livrarionline_awb')} (
|
67 |
`awb_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
68 |
+
`awb_no` varchar(50) NOT NULL,
|
69 |
`order_id` int(11) unsigned NOT NULL,
|
70 |
`service_id` int(11) unsigned NOT NULL,
|
71 |
`description` text NOT NULL,
|
116 |
ADD CONSTRAINT `FK_AWB_ID` FOREIGN KEY (`awb_id`) REFERENCES {$this->getTable('livrarionline_awb')} (`awb_id`) ON DELETE CASCADE;
|
117 |
|
118 |
");
|
119 |
+
|
120 |
$installer->endSetup();
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Xtreme_Livrarionline</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>AFL</license>
|
7 |
<channel>community</channel>
|
@@ -11,11 +11,19 @@
|
|
11 |
<notes>Release 1.0.1
|
12 |

|
13 |
Release 1.0.2:
|
14 |
-
10.07.2014: fixed missing column definition in stores table
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
<authors><author><name>Michael Mussulis</name><user>mpgjunky</user><email>michael@xtreme-vision.net</email></author></authors>
|
16 |
-
<date>2014-07-
|
17 |
-
<time>13:
|
18 |
-
<contents><target name="magelocal"><dir name="Xtreme"><dir name="Livrarionline"><dir name="Block"><dir name="Adminhtml"><file name="Awb.php" hash="9d2d4cfc6234d28d2edd1a1ff6358aab"/><dir name="Livrarionline"><dir name="Edit"><file name="Form.php" hash="
|
19 |
<compatible/>
|
20 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
21 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Xtreme_Livrarionline</name>
|
4 |
+
<version>1.0.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>AFL</license>
|
7 |
<channel>community</channel>
|
11 |
<notes>Release 1.0.1
|
12 |

|
13 |
Release 1.0.2:
|
14 |
+
10.07.2014: fixed missing column definition in stores table
|
15 |
+

|
16 |
+
Release 1.0.3:
|
17 |
+
* added flat fee shipping (overrides the quotation module)
|
18 |
+
* added Carrier to States association
|
19 |
+
* show only enabled carriers on frontend
|
20 |
+
* stores fixes
|
21 |
+
* DB fixes and new columns
|
22 |
+
* general fixes</notes>
|
23 |
<authors><author><name>Michael Mussulis</name><user>mpgjunky</user><email>michael@xtreme-vision.net</email></author></authors>
|
24 |
+
<date>2014-07-22</date>
|
25 |
+
<time>13:44:35</time>
|
26 |
+
<contents><target name="magelocal"><dir name="Xtreme"><dir name="Livrarionline"><dir name="Block"><dir name="Adminhtml"><file name="Awb.php" hash="9d2d4cfc6234d28d2edd1a1ff6358aab"/><dir name="Livrarionline"><dir name="Edit"><file name="Form.php" hash="bf1823c245e0c6bcada915b4dc3081bc"/><dir name="Tab"><file name="Form.php" hash="981acc97b55f166cafb481f28ed5a62c"/></dir><file name="Tabs.php" hash="915a3279629c1261537e7818cd78c358"/></dir><file name="Edit.php" hash="f5f051036161ebc6afaa4868c3e192af"/><file name="Grid.php" hash="6ab424f1976a0ec6d2480280d2f5e671"/></dir><file name="Livrarionline.php" hash="08390beae8a71c4d681c7fe955c4743f"/><dir name="Manageawb"><dir name="Edit"><file name="Form.php" hash="8fa5b897bea24b00038167a505a98a95"/><dir name="Tab"><file name="Form.php" hash="38ad835938c854f4abe293cb6a5afb47"/></dir><file name="Tabs.php" hash="cff04c9f6b112142eb7e1aa89d0a3f0b"/></dir><file name="Edit.php" hash="a0f548bfaaf8fcc11162a498de94cd2c"/><file name="Grid.php" hash="90c27e079c0005a4988e977e4324a1a1"/></dir><file name="Manageawb.php" hash="f60a4880954ad6ba8dfcdd67c0bb2524"/><dir name="Managecarriers"><dir name="Edit"><file name="Form.php" hash="be8666163cfb3577484b371b220d3294"/><dir name="Tab"><file name="Form.php" hash="15eef00beb42c159580d88f3040bed2b"/></dir><file name="Tabs.php" hash="30646be88956490f3042c4618dba2a0a"/></dir><file name="Edit.php" hash="aff65206eed9c258d88deadf89ee259c"/><file name="Grid.php" hash="ae3dd07c521b0104181a9b2f2a2710c6"/></dir><file name="Managecarriers.php" hash="d59e965331e28d4367fcb652bb6ab523"/><dir name="Managestores"><dir name="Edit"><file name="Form.php" hash="5a791afbaa1f5b4e48a303b203ccdea1"/><dir name="Tab"><file name="Form.php" hash="ab3608ddd6ddfcd567ba356119569f2a"/></dir><file name="Tabs.php" hash="ca6fd50a89122bbd45385f3f4b9748c0"/></dir><file name="Edit.php" hash="16e33bfa34331a52b3640271b6d75b96"/><file name="Grid.php" hash="582095e1428fee02febec372ff6208b1"/></dir><file name="Managestores.php" hash="67a1b7ef9e0a521083cc7a9f28b2e622"/><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Loawb.php" hash="9e545a4a4ce88e15c82db856a87aec22"/></dir></dir><file name="View.php" hash="4a0ae6997cb0298e8014edfb60dd9570"/></dir></dir></dir><file name="Livrarionline.php" hash="d8fc50fb2d699c300a209e1bfc652857"/></dir><dir name="Helper"><file name="Data.php" hash="c016967cd0b92a500762f59a68aa5a46"/></dir><dir name="Model"><dir name="Awb"><file name="Parcels.php" hash="0704d7f1c015118bcef206f2487dcd74"/></dir><file name="Awb.php" hash="d15234238a4cf15d9f8811a76b4471e9"/><dir name="Carrier"><file name="Livrarionline.php" hash="83a32caf058fd35fc9869a75ba07c5b7"/></dir><file name="Carriers.php" hash="1178ea1257801b9acdf17cea64a35c31"/><file name="Livrarionline.php" hash="e72f4f2a4e183b5598e68e4fab739840"/><dir name="Mysql4"><dir name="Awb"><file name="Collection.php" hash="c82f68e46b8f3e88615a1ee42d566207"/><dir name="Parcels"><file name="Collection.php" hash="aaad8936e0ed7d0db5359fcdad4cc769"/></dir><file name="Parcels.php" hash="917aa1999a7a932df1d9464297e2ca46"/></dir><file name="Awb.php" hash="c91e1669113296c4d1a6a47a190757d6"/><dir name="Carriers"><file name="Collection.php" hash="514b2a8411008d848f905fc9b6507ffc"/></dir><file name="Carriers.php" hash="6a956c056063c376814e316ec2ee8f7a"/><dir name="Livrarionline"><file name="Collection.php" hash="fcbfaa1e7aeca009f1919f9f2f03da3f"/></dir><file name="Livrarionline.php" hash="4430cd3a07e11b469c0bb791f3f41467"/><dir name="Stores"><file name="Collection.php" hash="4d1eb2ccf3cd29bac010be39471d687e"/></dir><file name="Stores.php" hash="8fe740e7b14868e9e5d940676530251e"/></dir><file name="Payee.php" hash="19bd933b29a0e5e9ca98061fa8140fae"/><file name="Status.php" hash="fae197ad04c91f5358f2f3633a39e91d"/><file name="Stores.php" hash="36fe8bb37ea66982cc014282dbe3d288"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="AwbController.php" hash="3574d705b941ad7e642375d730d17bb5"/><file name="LivrarionlineController.php" hash="2a68a6dd408f4055e18e13c79cb7e464"/><file name="ManageawbController.php" hash="d107224fe5309dbe2c5a682c341ae591"/><file name="ManagecarriersController.php" hash="d3df5737032b67d6430af055bb024b52"/><file name="ManagestoresController.php" hash="d9864145b3236dd528aa7be7eab5c564"/></dir><file name="IndexController.php" hash="e12312e570bcd609192b7bbf8cfc2f56"/></dir><dir name="etc"><file name="config.xml" hash="9d1642d0a939d8835d89920d46f3f432"/><file name="system.xml" hash="bf47955d6c6f11507d85be989319eacb"/></dir><dir name="sql"><dir name="livrarionline_setup"><file name="mysql4-install-0.1.0.php" hash="c846f84d70d6e51e299396d1562bceeb"/><file name="mysql4-upgrade-0.1.0-1.0.2.php" hash="0159b6315d2b0410409b9e383db13cca"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="livrarionline.xml" hash="9d33c282fd0e0af9c282431eb8d80e80"/></dir><dir name="template"><dir name="livrarionline"><file name="awb.phtml" hash="bcc4c6f547812c083454a9de591bd773"/><dir name="order"><dir name="view"><dir name="tab"><file name="info.phtml" hash="73d7d9641f299b84a52416cc9ea9cc30"/></dir></dir></dir><dir name="sales"><dir name="order"><dir name="view"><file name="loawb.phtml" hash="5d41402abc4b2a76b9719d911017c592"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Xtreme_Livrarionline.xml" hash="709a231ce665b518e80d639e1bbb36bd"/></dir></target><target name="magelib"><dir name="LivrariOnline"><file name="AES.php" hash="785bce6a6f16a78257982888eef38c3f"/><file name="AES_Encryption.php" hash="2379c56d7fead575e314a729eb08c45a"/><file name="Base.php" hash="8414fe454de0aa9bb687d7be5ebc1a1d"/><file name="BigInteger.php" hash="282833739198737256f5daa5a4980344"/><file name="Blowfish.php" hash="75b9feccd3f0d730c585eedc39f7c562"/><file name="DES.php" hash="f8ea721c854715e12c402557c9bcbc65"/><file name="Hash.php" hash="27610ff89b06ea1cf65dc4df11f8b151"/><file name="RC2.php" hash="8524a6ef91d36a6d66b480b2ec35912b"/><file name="RC4.php" hash="3071a0f1750888c542727abf7c5efa0a"/><file name="RSA.php" hash="386f427d09844d490e5e2fe9c2cb02c1"/><file name="Random.php" hash="49d2afb2e4b5e0b74810841c8c1358d9"/><file name="Rijndael.php" hash="563223c4317a65524cd835139a95fe51"/><file name="TripleDES.php" hash="6db830eb88670893fc0b2bc45383b9ee"/><file name="Twofish.php" hash="144f4213aae9f769d5a9e0e769ca1c7f"/><file name="curl.php" hash="b16cd9067b84c48faf7b8bc787d92a5b"/><file name="lo.php" hash="d956c94099d41c190d474e23c92b0bc5"/><file name="padCrypt.php" hash="6d8f31d865a5011abbc02206df45f165"/></dir></target><target name="mage"><dir name="js"><dir name="livrarionline"><file name="jquery-1.11.1.min.js" hash="8101d596b2b8fa35fe3a634ea342d7c3"/><file name="jquery.noconflict.js" hash="10bdc1b7f2effa529e5baae786007688"/></dir></dir></target></contents>
|
27 |
<compatible/>
|
28 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
29 |
</package>
|