Commit a4394dc9 by netz.coop

GPL

0 parents
Showing with 1819 additions and 0 deletions
This diff is collapsed. Click to expand it.
/**
* @category freeSN
* @mailto code [at] netz.coop
* @version 0.4.200901
* @link http://netz.coop
*
* @copyright Copyright by netz.coop e.G. 2015
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
\ No newline at end of file
ln -s /var/www/Magento/AncLib/app/design/adminhtml/layout/lib.xml /var/www/Magento/Magento19/app/design/adminhtml/default/default/layout/anc/
\ No newline at end of file
select "-- AncPricespercustomer lösche Datenbank Tabellen";
select "-- lösche mag_core_resource / anc_pricespercustomer_setup";
DELETE FROM `mag_core_resource` WHERE `mag_core_resource`.`code` = 'anc_pricespercustomer_setup';
select "-- lösche mag_anc_pricespercustomer_entity";
DROP TABLE mag_anc_pricespercustomer_entity;
#!/bin/bash
APPBASE="Anc"
APPNAME="Pricespercustomer"
APPBASELC="anc"
APPNAMELC="pricespercustomer"
APPDIR="/var/www/$2/${APPBASE}${APPNAME}"
echo "############"
echo "###########"
echo "########## ${APPBASE}${APPNAME} SETUP SCRIPT"
####
#
#
##
if [ "$3" = "TRUE" ];then
echo '*** !!! ACHTUNG NEWINSTALL = TRUE Datenbanken und Verzeichnisse der ${APPBASE}${APPNAME} werden gelöscht'
# CODE
echo "Lösche: rm -R $1/app/code/local/${APPBASE}/${APPNAME}"
rm -R "$1/app/code/local/${APPBASE}/${APPNAME}"
#ETC
echo "Lösche: $1/app/etc/modules/${APPBASE}_${APPNAME}.xml"
rm -R "$1/app/etc/modules/${APPBASE}_${APPNAME}.xml"
#Design Adminhtml
echo "Lösche: $1/app/design/adminhtml/default/default/layout/${APPBASELC}/${APPNAMELC}.xml"
rm -R "$1/app/design/adminhtml/default/default/layout/${APPBASELC}/${APPNAMELC}.xml"
echo "Lösche: $1/app/design/adminhtml/default/default/template/${APPBASELC}/${APPNAMELC}"
rm -R "$1/app/design/adminhtml/default/default/template/${APPBASELC}/${APPNAMELC}"
#Design Frontend
echo "Lösche: $1/app/design/frontend/default/default/layout/${APPBASELC}/${APPNAMELC}.xml"
rm -R "$1/app/design/frontend/default/default/layout/${APPBASELC}/${APPNAMELC}.xml"
echo "Lösche: $1/app/design/frontend/default/default/template/${APPBASELC}/${APPNAMELC}"
rm -R "$1/app/design/frontend/default/default/template/${APPBASELC}/${APPNAMELC}"
exit 0
fi
###
# Code Local
#
##
if [ ! -d "$1/app/code/local/${APPBASE}" ];then
echo "*** Erstelle das Verzeichniss: $1/app/code/local/${APPBASE}"
mkdir "$1/app/code/local/${APPBASE}"
fi
if [ ! -d "$1/app/code/local/${APPBASE}/${APPNAME}" ];then
echo "*** Verlinke Verzeichniss: $APPDIR/app/code/local/${APPBASE}/${APPNAME} $1/app/code/local/${APPBASE}/${APPNAME}"
ln -s $APPDIR/app/code/local/${APPBASE}/${APPNAME} $1/app/code/local/${APPBASE}/${APPNAME}
fi
###
# etc
#
##
if [ ! -f "$1/app/etc/modules/${APPBASE}_${APPNAME}.xml" ];then
echo "*** Verlinke Datei: $1/app/etc/modules/${APPBASE}_${APPNAME}.xml"
ln -s $APPDIR/app/etc/modules/${APPBASE}_${APPNAME}.xml $1/app/etc/modules/${APPBASE}_${APPNAME}.xml
fi
###
# Design Adminhtml
#
##
if [ ! -d "$1/app/design/frontend/default/default/layout" ];then
echo "*** Erstelle das Verzeichniss: $1/app/design/frontend/default/default/layout"
mkdir "$1/app/design/frontend/default/default/layout"
fi
if [ ! -d "$1/app/design/adminhtml/default/default/layout/${APPBASELC}" ];then
echo "*** Erstelle das Verzeichniss: $1/app/design/adminhtml/default/default/layout/${APPBASELC}"
mkdir "$1/app/design/adminhtml/default/default/layout/${APPBASELC}"
fi
if [ ! -f "$1/app/design/adminhtml/default/default/layout/${APPBASELC}/${APPNAMELC}.xml" ];then
echo "*** Verlinke Datei: $APPDIR/app/design/adminhtml/layout/${APPBASELC}/${APPNAMELC}.xml $1/app/design/adminhtml/default/default/layout/${APPBASELC}/${APPNAMELC}.xml"
ln -s $APPDIR/app/design/adminhtml/default/default/layout//${APPBASELC}/${APPNAMELC}.xml $1/app/design/adminhtml/default/default/layout/${APPBASELC}/${APPNAMELC}.xml
fi
if [ ! -d "$1/app/design/adminhtml/default/default/template/${APPBASELC}" ];then
echo "*** Erstelle das Verzeichniss: $1/app/design/adminhtml/default/default/template/${APPBASELC}"
mkdir "$1/app/design/adminhtml/default/default/template/${APPBASELC}"
fi
if [ ! -d "$1/app/design/adminhtml/default/default/template/${APPBASELC}/${APPNAMELC}" ];then
echo "*** Verlinke Datei: $APPDIR/app/design/adminhtml/template/${APPBASELC}/${APPNAMELC}.xml $1/app/design/adminhtml/default/default/template/${APPBASELC}/${APPNAMELC}.xml"
ln -s $APPDIR/app/design/adminhtml/default/default/template/${APPBASELC}/${APPNAMELC} $1/app/design/adminhtml/default/default/template/${APPBASELC}/${APPNAMELC}
fi
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Block_Adminhtml_Customer_Edit_Tab_Pricespercustomer extends Mage_Adminhtml_Block_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface {
public function __construct() {
$this->_blockGroup = 'anc_pricespercustomer';
$this->_controller = 'adminhtml_pricespercustomer';
$this->_headerText = Mage::helper('pricespercustomer')->__('Manage Prices TTT');
$this->_addButtonLabel = Mage::helper('pricespercustomer')->__('Add Item');
parent::__construct();
}
public function getCustomtabInfo() {
$customtab = 'Inhalt wird hier angezeigt';
return $customtab;
}
public function getCustomerId() {
return Mage::registry('current_customer')->getId();
}
/**
* @return string
*/
public function getTabLabel() {
return $this->__('prices for clients');
}
/**
* @return string
*/
public function getTabTitle() {
return $this->__('price tab');
}
/**
* Can show tab in tabs
* @return boolean
*/
public function canShowTab() {
return true;
}
/**
* @return boolean
*/
public function isHidden() {
return false;
}
/**
* @return string
*/
public function getAfter() {
return 'tags';
}
/**
* by uj for options.phtml
*/
public function getCustomerPrices() {
$params = $this->getRequest()->getParams();
$collection = Mage::getModel('anc_pricespercustomer/entity')->getCollection();
$collection->addFieldToFilter('customer_id', $params['id']);
return $collection;
}
}
?>
\ No newline at end of file
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Block_Adminhtml_Customer_Edit_Tab_Pricespercustomer_List extends Mage_Adminhtml_Block_Widget_Grid {
public function __construct() {
$this->_blockGroup = 'anc_pricespercustomer';
$this->_controller = 'adminhtml_pricespercustomer';
$this->_headerText = Mage::helper('pricespercustomer')->__('Manage Prices TTT');
parent::__construct();
}
protected function _prepareCollection() {
$collection = Mage::getModel('anc_pricespercustomer/entity')
->getCollection()
->addFieldToFilter('main_table.customer_id', $this->getRequest()->getParam('id'));
$this->setCollection($collection);
return parent::_prepareCollection();
}
public function getAddButtonHtml() {
return $this->getChildHtml('addButton');
}
protected function _prepareColumns() {
$this->addColumn('entity_id', array(
'header' => Mage::helper('pricespercustomer')->__('Id'),
'width' => 50,
'index' => 'entity_id',
'sortable' => false,
));
$this->addColumn('product_id', array(
'header' => Mage::helper('pricespercustomer')->__('product id'),
'index' => 'product_id',
'sortable' => false,
));
$this->addColumn('price_adjustment', array(
'header' => Mage::helper('pricespercustomer')->__('Price'),
'index' => 'price_adjustment',
'sortable' => false,
));
$this->addColumn('price_adjustment_type', array(
'header' => Mage::helper('pricespercustomer')->__('pricetyp'),
'index' => 'price_adjustment_type',
'sortable' => false,
));
$this->addColumn('created_at', array(
'header' => Mage::helper('pricespercustomer')->__('created'),
'index' => 'created_at',
'sortable' => false,
));
$this->addColumn('action', array(
'header' => Mage::helper('pricespercustomer')->__('Action'),
'width' => '50px',
'type' => 'action',
'getter' => 'getId',
'actions' => array(
array(
'caption' => Mage::helper('pricespercustomer')->__('Edit'),
'url' => array(
'base' => '*/pricespercustomer/edit',
'params' => array('store' => $this->getRequest()->getParam('store'))
),
'field' => 'id'
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
));
return parent::_prepareColumns();
}
public function getRowUrl($row) {
$link = $this->getUrl('*/pricespercustomer/edit', array(
'id' => $row->getEntityId(),
'customer_id' => $row->getCustomerId(),
)
);
return $link;
}
public function getMainButtonsHtml() {
$html = parent::getMainButtonsHtml(); //get the parent class buttons
$addButton = $this->getLayout()->createBlock('adminhtml/widget_button') //create the add button
->setData(array(
'label' => Mage::helper('adminhtml')->__('create new price'),
'onclick' => "setLocation('" . $this->getUrl('adminhtml/pricespercustomer/new', array('customerid' => Mage::registry('current_customer')->getId())) . "')",
'class' => 'task'
))->toHtml();
return $addButton . $html;
}
}
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Block_Adminhtml_Ncpriceslists extends Mage_Adminhtml_Block_Widget_Grid_Container {
public function __construct() {
$this->_controller = 'adminhtml_ncpriceslists';
$this->_blockGroup = 'pricespercustomer';
$this->_headerText = Mage::helper('pricespercustomer/data')->__('manage prices');
parent::__construct();
$this->_removeButton('add');
}
public function getCreateUrl() {
$varParam = $this->getRequest()->getParams();
$var_album = '';
if (array_key_exists('albumid', $varParam)) {
$var_album = '/albumid/' . $varParam['albumid'];
}
if (array_key_exists('imageid', $varParam)) {
$var_album = '/imageid/' . $varParam['imageid'];
}
if (array_key_exists('textid', $varParam)) {
$var_album = '/textid/' . $varParam['textid'];
}
if (array_key_exists('siteid', $varParam)) {
$var_album = '/siteid/' . $varParam['siteid'];
}
/**
* Wichtig für Add Button
*/
return $this->getUrl(
'*/*/*/adminhtml/pricespercustomer/new' . $var_album
);
}
}
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Block_Adminhtml_Ncpriceslists_Grid extends Mage_Adminhtml_Block_Widget_Grid {
public function __construct() {
parent::__construct();
$this->setId('pricespercustomer_ncpriceslists_grid');
$this->setDefaultSort('entity_id');
$this->setDefaultDir('DESC');
$this->setSaveParametersInSession(true);
}
protected function _prepareCollection() {
$collection = Mage::getModel('anc_pricespercustomer/entity')->getCollection();
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns() {
$this->addColumn('entity_id', array(
'header' => Mage::helper('pricespercustomer/data')->__('Id'),
'align' => 'right',
'width' => '50px',
'index' => 'entity_id',
));
$this->addColumn('customer_id', array(
'header' => Mage::helper('pricespercustomer/data')->__('customer id'),
'align' => 'left',
'index' => 'customer_id',
));
$this->addColumn('product_id', array(
'header' => Mage::helper('pricespercustomer/data')->__('product id'),
'align' => 'left',
'index' => 'product_id',
));
$this->addColumn('price_adjustment', array(
'header' => Mage::helper('pricespercustomer/data')->__('price adjustment'),
'align' => 'left',
'index' => 'price_adjustment',
));
$this->addColumn('price_adjustment_type', array(
'header' => Mage::helper('pricespercustomer/data')->__('pricetyp'),
'align' => 'left',
'index' => 'price_adjustment_type',
));
$this->addColumn('created_at', array(
'header' => Mage::helper('pricespercustomer/data')->__('created'),
'align' => 'left',
'index' => 'created_at',
));
return parent::_prepareColumns();
}
public function getRowUrl($row) {
return $this->getUrl('adminhtml/pricespercustomer/edit', array('id' => $row->getId()));
}
public function getMainButtonsHtml() {
$html = parent::getMainButtonsHtml(); //get the parent class buttons
$addButton = $this->getLayout()->createBlock('adminhtml/widget_button') //create the add button
->setData(array(
'label' => Mage::helper('adminhtml')->__('create new price'),
'onclick' => "setLocation('" . $this->getUrl('adminhtml/pricespercustomer/new', array()) . "')",
'class' => 'task'
))->toHtml();
return $addButton . $html;
}
}
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Block_Adminhtml_Pricespercustomer_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
public function __construct() {
parent::__construct();
$this->_objectId = 'id';
$this->_blockGroup = 'pricespercustomer';
$this->_controller = 'adminhtml_pricespercustomer';
$this->_mode = 'edit';
$this->_addButton('goback', array(
'label' => Mage::helper('adminhtml')->__('Back'),
'onclick' => 'back()',
'class' => 'back',
), 20, -20);
/**
* Entfernen vom zurück und Zurücksetzen Button
*/
$this->removeButton('back');
$this->removeButton('reset');
$this->_updateButton('save', 'label', Mage::helper('pricespercustomer')->__('Save'));
$this->_updateButton('delete', 'label', Mage::helper('pricespercustomer')->__('Delete'));
$this->_addButton('saveandcontinue', array(
'label' => Mage::helper('adminhtml')->__('save and continue edit'),
'onclick' => 'saveAndContinueEdit()',
'class' => 'save',
), -100);
$this->_formScripts[] = "
function toggleEditor() {
if (tinyMCE.getInstanceById('pricespercustomer_content') == null) {
tinyMCE.execCommand('mceAddControl', false, 'pricespercustomer_content');
} else {
tinyMCE.execCommand('mceRemoveControl', false, 'pricespercustomer_content');
}
}
function saveAndContinueEdit(){
editForm.submit($('edit_form').action+'back/edit/');
}
";
}
public function getHeaderText() {
if (Mage::registry('pricespercustomer_data') && Mage::registry('pricespercustomer_data')->getId()) {
return Mage::helper('pricespercustomer')->__("Edit", $this->htmlEscape(Mage::registry('pricespercustomer_data')->getTitle()));
} else {
return Mage::helper('pricespercustomer')->__('Add');
}
}
}
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Block_Adminhtml_Pricespercustomer_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {
protected function _prepareForm() {
$this->setChild('backButton', $this->getLayout()->createBlock('adminhtml/widget_button')
->setData(array(
'label' => Mage::helper('adminhtml')->__('Back'),
'onclick' => 'window.location.href=\'' . $this->getUrl('customer/edit/') . '\'',
'class' => 'back'
))
);
$form = new Varien_Data_Form(array(
'id' => 'edit_form',
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
'method' => 'post',
'enctype' => 'multipart/form-data'
));
$form->setUseContainer(true);
$this->setForm($form);
if (Mage::getSingleton('adminhtml/session')->getFormData()) {
$data = Mage::getSingleton('adminhtml/session')->getFormData();
Mage::getSingleton('adminhtml/session')->setFormData(null);
} elseif (Mage::registry('pricespercustomer_data')) {
$data = Mage::registry('pricespercustomer_data')->getData();
}
$fieldset = $form->addFieldset('pricespercustomer_form', array('legend' => Mage::helper('pricespercustomer')->__('customer prices information')));
$actionname = $this->getRequest()->getActionName();
if ($actionname == 'new') {
$form->setValues($data);
}
$fieldset->addField('customer_id', 'text', array(
'label' => Mage::helper('pricespercustomer')->__('customer id'),
'required' => false,
'name' => 'customer_id',
'value' => $this->getRequest()->getParam('customerid'),
));
$fieldset->addField('product_id', 'text', array(
'label' => Mage::helper('pricespercustomer')->__('product id'),
'required' => false,
'name' => 'product_id',
'title' => 'Produkt ID',
));
$fieldset->addField('price_adjustment', 'text', array(
'label' => Mage::helper('pricespercustomer')->__('Price'),
'required' => false,
'name' => 'price_adjustment',
'title' => '0.00',
));
$fieldset->addField('price_adjustment_type', 'select', array(
'label' => Mage::helper('pricespercustomer')->__('pricetyp'),
'required' => false,
'name' => 'price_adjustment_type',
'values' => array('1' => array(
'value' => 'fix',
'label' => 'Fix'
),
)
));
if ($actionname == 'edit') {
$fieldset->addField('created_at', 'text', array(
'label' => Mage::helper('pricespercustomer')->__('created'),
'required' => false,
'name' => 'created_at',
));
}
if ($actionname == 'edit') {
$form->setValues($data);
}
return parent::_prepareForm();
}
}
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Block_Adminhtml_Pricespercustomer_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
public function __construct() {
parent::__construct();
$this->setId('pricespercustomer_tabs');
$this->setDestElementId('edit_form');
$this->setTitle(Mage::helper('pricespercustomer')->__('Item Information'));
}
protected function _beforeToHtml() {
$this->addTab('form_section', array(
'label' => Mage::helper('pricespercustomer')->__('Item Information'),
'title' => Mage::helper('pricespercustomer')->__('Item Information'),
'content' => $this->getLayout()->createBlock('pricespercustomer/adminhtml_pricespercustomer_edit_tab_form')->toHtml(),
));
return parent::_beforeToHtml();
}
}
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Block_Adminhtml_Pricespercustomer_New extends Mage_Adminhtml_Block_Widget_Form_Container {
public function __construct() {
parent::__construct();
$this->_objectId = 'id';
$this->_blockGroup = 'pricespercustomer';
$this->_controller = 'adminhtml_pricespercustomer';
$this->_mode = 'edit';
$this->_addButton('goback', array(
'label' => Mage::helper('adminhtml')->__('Back'),
'onclick' => 'back()',
'class' => 'back',
), 20, -20);
/**
* Entfernen vom zurück und Zurücksetzen Button
*/
$this->removeButton('back');
$this->removeButton('reset');
$this->_updateButton('save', 'label', Mage::helper('pricespercustomer')->__('Save'));
$this->_updateButton('delete', 'label', Mage::helper('pricespercustomer')->__('Delete'));
$this->_addButton('saveandcontinue', array(
'label' => Mage::helper('adminhtml')->__('save and continue edit'),
'onclick' => 'saveAndContinueEdit()',
'class' => 'save',
), -100);
$this->_formScripts[] = "
function toggleEditor() {
if (tinyMCE.getInstanceById('pricespercustomer_content') == null) {
tinyMCE.execCommand('mceAddControl', false, 'pricespercustomer_content');
} else {
tinyMCE.execCommand('mceRemoveControl', false, 'pricespercustomer_content');
}
}
function saveAndContinueEdit(){
editForm.submit($('edit_form').action+'back/edit/');
}
";
}
public function getHeaderText() {
if (Mage::registry('pricespercustomer_data') && Mage::registry('pricespercustomer_data')->getId()) {
return Mage::helper('pricespercustomer')->__("Edit", $this->htmlEscape(Mage::registry('pricespercustomer_data')->getTitle()));
} else {
return Mage::helper('pricespercustomer')->__('Add');
}
}
}
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Helper_Data extends Mage_Core_Helper_Abstract {
public function __construct() {
}
}
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Model_Entity extends Mage_Core_Model_Abstract {
public function _construct() {
$this->_init('anc_pricespercustomer/entity');
}
}
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Model_Entity extends Mage_Core_Model_Abstract {
protected function _construct() {
parent::_construct();
$this->_init('anc_pricespercustomer/entity');
}
}
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Model_Mysql4_Entity extends Mage_Core_Model_Mysql4_Abstract {
protected function _construct() {
$this->_init('anc_pricespercustomer/entity', 'entity_id');
}
protected function _beforeSave(Mage_Core_Model_Abstract $ncprice) {
if (!$ncprice->getId()) {
$ncprice->setCreatedAt(now());
}
$ncprice->setUpdatedAt(now());
return parent::_beforeSave($ncprice);
}
}
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Model_Mysql4_Entity_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
public function _construct() {
$this->_init('anc_pricespercustomer/entity');
parent::_construct();
}
}
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Model_Observer {
public function catalogProductCollectionLoadAfter($observer) {
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
foreach ($observer->getEvent()->getCollection() as $product) {
$customer = Mage::getSingleton('customer/session')->getCustomer();
$adjustment = $this->getCustomerPrices($customer->getEntityId(), $product->getEntityId());
/*
* Wenn price und final_price sich unterscheiden wird letzterer als sonderpreis angezeigt.
* Der Kundenrabatt muss deswegen auf beide angewendet werden.
*/
$finalPrice = $this->_adjustPrice($adjustment, $product->getFinalPrice());
$product->setFinalPrice($finalPrice);
}
}
}
/**
* Anwenden der Preisanpassung des aktuellen Kunden auf der Product Detailseite
*
* @param Varien_Event_Observer $observer
*/
public function catalogProductLoadAfter($observer) {
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
$product = $observer->getEvent()->getProduct();
$id = $product->getEntityId();
$customer = Mage::getSingleton('customer/session')->getCustomer();
$adjustment = $this->getCustomerPrices($customer->getEntityId(), $product->getEntityId());
/*
* Zuerst final_price setzen, da sonst bei der Berechnung der schon rabattierte "normale" preis verwendet wird
* und der Rabatt zwei mal angewendet wird.
*/
$finalPrice = $this->_adjustPrice($adjustment, $product->getFinalPrice());
$product->setFinalPrice($finalPrice);
}
}
/**
* Berechnen der Preisanpassung nach Typ.
*
* @param float $adjustment
* @param float $price
* @param string $type 'fix' or 'percent'
* @return float
*/
protected function _adjustPrice($adjustment, $price) {
if (key_exists('price_adjustment', $adjustment) && $adjustment['price_adjustment']) {
if ($adjustment['price_adjustment_type'] == 'Fix' || $adjustment['price_adjustment_type'] == 'fix') {
if ($adjustment['price_adjustment'] < $price) {
$price = $adjustment['price_adjustment'];
}
} else {
$price -= $price * ($adjustment['price_adjustment'] / 100);
}
}
return $price;
}
public function getCustomerPrices($cid, $pid) {
$collection = Mage::getModel('anc_pricespercustomer/entity')
->getCollection()
->addFieldToFilter('main_table.customer_id', $cid)
->addFieldToFilter('main_table.product_id', $pid)
->setOrder('main_table.created_at', 'ASC');
$collection->load();
$array = array();
$i = 0;
foreach ($collection as $price) {
$array[$i]['entity_id'] = $price->getEntityId();
$array[$i]['customer_id'] = $price->getCustomerId();
$array[$i]['product_id'] = $price->getProductId();
$array[$i]['price_adjustment'] = $price->getPriceAdjustment();
$array[$i]['price_adjustment_type'] = $price->getPriceAdjustmentType();
$array[$i]['created_at'] = $price->getCreatedAt();
$i++;
}
if (array_key_exists('0', $array)) {
return $array[0];
}
return $array;
}
}
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Adminhtml_PriceslistsController extends Mage_Adminhtml_Controller_Action {
public function listAction() {
$rightsBlock = $this->getLayout()->createBlock('pricespercustomer/adminhtml_ncpriceslists');
$this->loadLayout()
->_addContent($rightsBlock)
->renderLayout();
}
protected function _initAction() {
$this->loadLayout()->_setActiveMenu('anc_pricespercustomer/ANC')
->_addBreadcrumb('test Manager', 'test Manager');
return $this;
}
public function indexAction() {
$this->_initAction();
$this->renderLayout();
}
public function editAction() {
$var_params = $this->getRequest()->getParams();
$this->_redirect('*/admin/pricespercustomer/edit', $arrayurl);
}
public function newAction() {
$this->_forward('edit');
}
public function saveAction() {
if ($this->getRequest()->getPost()) {
try {
$postData = $this->getRequest()->getPost();
$testModel = Mage::getModel('anc_pricespercustomer/ncpriceslists');
if ($this->getRequest()->getParam('id') <= 0)
$testModel->setCreatedTime(
Mage::getSingleton('core/date')
->gmtDate()
);
$testModel
->addData($postData)
->setUpdateTime(
Mage::getSingleton('core/date')
->gmtDate())
->setId($this->getRequest()->getParam('id'))
->save();
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully saved');
Mage::getSingleton('adminhtml/session')
->settestData(false);
if ($postData['albumid'] > 0) {
$param_where = array("entity_id" => $postData['albumid']);
Mage::helper('anc_pricespercustomer/sql')->updateOneCell('anc_album_ncalbum', 'ncright_id', $testModel->getData('entity_id'), $param_where);
$this->_redirect('*/*/list');
$this->_redirect('album/adminhtml_album/edit', array('id' => $postData['albumid']));
return;
}
$this->_redirect('*/*/list');
return;
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')
->addError($e->getMessage());
Mage::getSingleton('adminhtml/session')
->settestData($this->getRequest()
->getPost()
);
$this->_redirect('*/*/edit', array('id' => $this->getRequest()
->getParam('id')));
return;
}
}
$this->_redirect('*/*/');
}
public function deleteAction() {
if ($this->getRequest()->getParam('id') > 0) {
try {
$testModel = Mage::getModel('anc_pricespercustomer/ncpriceslists');
$testModel->setId($this->getRequest()
->getParam('id'))
->delete();
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully deleted');
$this->_redirect('*/*/');
$this->_redirect('*/*/list');
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')
->addError($e->getMessage());
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
}
}
$this->_redirect('*/*/list');
}
protected function _isAllowed() {
return Mage::getSingleton('admin/session')->isAllowed('ncpriceslists/form');
}
public function customergridAction() {
$this->loadLayout();
$this->getLayout()->getBlock('customer.grid')
->setCustomers($this->getRequest()->getPost('customers', null));
$this->renderLayout();
}
public function customerAction() {
$this->loadLayout();
$this->getLayout()->getBlock('customer.grid')
->setCustomers($this->getRequest()->getPost('customers', null));
$this->renderLayout();
}
}
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Anc_Pricespercustomer_Adminhtml_PricespercustomerController extends Mage_Adminhtml_Controller_Action {
public function listAction() {
$rightsBlock = $this->getLayout()->createBlock('pricespercustomer/adminhtml_ncpriceslists');
$this->loadLayout()
->_addContent($rightsBlock)
->renderLayout();
}
private static $customerid;
protected function _initAction() {
$this->loadLayout();
return $this;
}
public function indexAction() {
$this->_initAction();
$this->renderLayout();
return $this;
}
public function newAction() {
$id = $this->getRequest()->getParam('id', null);
$model = Mage::getModel('anc_pricespercustomer/entity');
if ($id) {
$model->load((int) $id);
if ($model->getId()) {
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
if ($data) {
$model->setData($data);
}
} else {
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('pricespercustomer')->__('item does not exist'));
$this->_redirect('*/*/');
}
}
Mage::register('pricespercustomer_data', $model);
$this->_title($this->__('price'))->_title($this->__('Edit'));
$this->loadLayout();
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
$this->renderLayout();
}
public function editAction2() {
$id = $this->getRequest()->getParam('id', null);
$registry = Mage::getModel('anc_pricespercustomer/entity');
if ($id) {
$registry->load((int) $id);
if ($registry->getId()) {
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
if ($data) {
$registry->setData($data)->setId($id);
}
} else {
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('pricespercustomer')->__('item does not exist'));
$this->_redirect('*/*/');
}
}
Mage::register('pricespercustomer_data', $registry);
$this->loadLayout();
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
$this->renderLayout();
}
public function editAction() {
$id = $this->getRequest()->getParam('id', null);
$model = Mage::getModel('anc_pricespercustomer/entity');
if ($id) {
$model->load((int) $id);
if ($model->getId()) {
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
if ($data) {
$model->setData($data);
}
} else {
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('pricespercustomer')->__('Item Does niot exist'));
$this->_redirect('*/*/');
}
}
Mage::register('pricespercustomer_data', $model);
$this->_title($this->__('price'))->_title($this->__('Edit'));
$this->loadLayout();
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
$this->renderLayout();
}
public function saveAction() {
if ($data = $this->getRequest()->getPost()) {
$model = Mage::getModel('anc_pricespercustomer/entity');
$id = $this->getRequest()->getParam('id');
if ($key = 'entity_id' && !$value) {
unset($data[$key]);
}
foreach ($data as $key => $value) {
if (is_array($value)) {
$data[$key] = implode(',', $this->getRequest()->getParam($key));
}
if ($key == 'customer_id') {
$customerid = $data['customer_id'];
self::$customerid = $customerid;
}
}
if ($id) {
$model->load($id);
}
$model->setData($data);
Mage::getSingleton('adminhtml/session')->setFormData($data);
try {
if ($id) {
$model->setId($id);
}
$model->save();
if (!$model->getId()) {
Mage::throwException(Mage::helper('pricespercustomer')->__('error saving price'));
}
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('pricespercustomer')->__('Price was successfully saved.'));
Mage::getSingleton('adminhtml/session')->setFormData(false);
if ($this->getRequest()->getParam('back')) {
$this->_redirect('*/*/edit', array('id' => $model->getId()));
} else {
$this->_redirect('*/*/edit', array('id' => $model->getId()));
if ($customerid) {
$this->_redirect('/customer/edit/id/' . $customerid . '/key/' . Mage::getSingleton('adminhtml/url')->getSecretKey('adminhtml_customer', 'edit') . '/');
} else {
$this->_redirect('*/*/edit', array('id' => $model->getId()));
}
}
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
if ($model && $model->getId()) {
$this->_redirect('*/*/edit', array('id' => $model->getId()));
} else {
$this->_redirect('*/*/');
}
}
return;
}
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('pricespercustomer')->__('no data found to save'));
$this->_redirect('*/*/');
}
public function deleteAction() {
try {
$id = $this->getRequest()->getParam('id', null);
$model = Mage::getModel('anc_pricespercustomer/entity')->load($id);
$model->delete();
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('pricespercustomer')->__('The price has been deleted.'));
} catch (Exception $ex) {
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
}
$this->_redirect('/customer/index/key/' . Mage::getSingleton('adminhtml/url')->getSecretKey('adminhtml_customer', 'index') . '/');
return;
}
}
<?xml version="1.0"?>
<!--/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/-->
<config>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<system>
<children>
<config>
<children>
<pricespercustomer translate="title">
<title>Pricespercustomer</title>
<sort_order>101</sort_order>
</pricespercustomer>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</config>
\ No newline at end of file
<?xml version="1.0"?>
<!--/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/-->
<config>
<modules>
<Anc_Pricespercustomer>
<version>0.1.0</version>
</Anc_Pricespercustomer>
</modules>
<frontend>
<events>
<catalog_product_collection_load_after>
<observers>
<pricespercustomer>
<type>singleton</type>
<class>anc_pricespercustomer/observer</class>
<method>catalogProductCollectionLoadAfter</method>
</pricespercustomer>
</observers>
</catalog_product_collection_load_after>
<catalog_product_get_final_price>
<observers>
<pricespercustomer>
<type>singleton</type>
<class>anc_pricespercustomer/observer</class>
<method>catalogProductLoadAfter</method>
</pricespercustomer>
</observers>
</catalog_product_get_final_price>
</events>
</frontend>
<admin>
<routers>
<anc_pricespercustomer>
<use>admin</use>
<args>
<module>Anc_Pricespercustomer</module>
<frontName>pricespercustomer</frontName>
</args>
</anc_pricespercustomer>
<adminhtml>
<args>
<modules>
<anc_pricespercustomer before="Mage_Adminhtml">Anc_Pricespercustomer_Adminhtml</anc_pricespercustomer>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<adminhtml>
<menu>
<Anc_Anc module="pricespercustomer">
<title>ANC</title>
<sort_order>71</sort_order>
<children>
<items module="pricespercustomer">
<title>Kundenpreise</title>
<sort_order>6</sort_order>
<action>pricespercustomer/adminhtml_priceslists/list</action>
</items>
</children>
</Anc_Anc>
</menu>
<layout>
<updates>
<pricespercustomer>
<file>anc/pricespercustomer.xml</file>
</pricespercustomer>
</updates>
</layout>
<translate>
<modules>
<Anc_Pricespercustomer>
<files>
<default>anc/pricepercustomer.csv</default>
</files>
</Anc_Pricespercustomer>
</modules>
</translate>
</adminhtml>
<global>
<models>
<anc_pricespercustomer>
<class>Anc_Pricespercustomer_Model</class>
<resourceModel>anc_pricespercustomer_mysql4</resourceModel>
</anc_pricespercustomer>
<anc_pricespercustomer_mysql4>
<class>Anc_Pricespercustomer_Model_Mysql4</class>
<entities>
<entity>
<table>anc_pricespercustomer_entity</table>
</entity>
</entities>
</anc_pricespercustomer_mysql4>
</models>
<resources>
<anc_pricespercustomer_setup>
<setup>
<module>Anc_Pricespercustomer</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</anc_pricespercustomer_setup>
<anc_pricespercustomer_write>
<connection>
<use>core_write</use>
</connection>
</anc_pricespercustomer_write>
<anc_pricespercustomer_read>
<connection>
<use>core_read</use>
</connection>
</anc_pricespercustomer_read>
</resources>
<blocks>
<pricespercustomer>
<class>Anc_Pricespercustomer_Block</class>
</pricespercustomer>
<pricespercustomer_adminhtml>
<class>Anc_Pricespercustomer_Block_Adminhtml</class>
</pricespercustomer_adminhtml>
</blocks>
<helpers>
<pricespercustomer>
<class>Anc_Pricespercustomer_Helper</class>
</pricespercustomer>
</helpers>
</global>
</config>
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
$installer = $this;
$installer->startSetup();
$tableName = $installer->getTable('anc_pricespercustomer/entity');
if ($installer->getConnection()->isTableExists($tableName) != true) {
$table = $installer->getConnection()->newTable($tableName)
->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true,), 'Entity Id')
->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => false, 'default' => '0',), 'Customer Id')
->addColumn('product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => false, 'default' => '0',), 'Product Id')
->addColumn('price_adjustment', Varien_Db_Ddl_Table::TYPE_DECIMAL, '12,4', array('default' => '0.0',), 'Price Adjustment')
->addColumn('price_adjustment_type', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(), 'Price Adjustment Type')
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array('nullable' => false,), 'Created At')
->addIndex($installer->getIdxName('anc_pricespercustomer/entity', array('customer_id')), array('customer_id'))
->addIndex($installer->getIdxName('anc_pricespercustomer/entity', array('product_id')), array('product_id'))
->addForeignKey($installer->getFkName('anc_pricespercustomer/entity', 'customer_id', 'customer/entity', 'entity_id'), 'customer_id', $installer->getTable('customer/entity'), 'entity_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
->addForeignKey($installer->getFkName('anc_pricespercustomer/entity', 'product_id', 'catalog/product', 'entity_id'), 'product_id', $installer->getTable('catalog/product'), 'entity_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
;
$installer->getConnection()->createTable($table);
}
$installer->endSetup();
<?xml version="1.0"?>
<!--/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/-->
<layout version="0.1.0">
<adminhtml_customer_edit>
<reference name="left">
<reference name="customer_edit_tabs">
<block type="pricespercustomer/adminhtml_customer_edit_tab_pricespercustomer" name="tab_pricespercustomer_pricespercustomer" template="anc/pricespercustomer/customer/options.phtml">
<block type="pricespercustomer/adminhtml_customer_edit_tab_pricespercustomer_list" name="tab_pricespercustomer_list" as="tab_pricespercustomer_list" />
</block>
<action method="addTab">
<name>customer_edit_tab_main</name>
<block>tab_pricespercustomer_pricespercustomer</block>
</action>
</reference>
</reference>
</adminhtml_customer_edit>
<adminhtml_pricespercustomer_index>
<reference name="content">
<block type="pricespercustomer/adminhtml_tab_pricespercustomer" name="pricespercustomer" />
</reference>
</adminhtml_pricespercustomer_index>
<adminhtml_pricespercustomer_edit>
<reference name="content">
<block type="pricespercustomer/adminhtml_pricespercustomer_edit" name="new_pricespercustomer_tabs" />
</reference>
</adminhtml_pricespercustomer_edit>
<adminhtml_priceslists_edit>
<reference name="content">
<block type="pricespercustomer/adminhtml_pricespercustomer_edit" name="new_pricespercustomer_tabs" />
</reference>
</adminhtml_priceslists_edit>
<adminhtml_pricespercustomer_new>
<reference name="content">
<block type="pricespercustomer/adminhtml_pricespercustomer_new" name="new_pricespercustomer_tabs" />
</reference>
</adminhtml_pricespercustomer_new>
</layout>
\ No newline at end of file
<?php
/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<div class="entry-edit">
<div class="entry-edit-head">
<h4 class="icon-head head-customer-view"><?php echo $this->__('special prises for clients') ?></h4>
</div>
<?php
?></p>
<?php echo $this->getChildHtml('tab_pricespercustomer_list'); ?>
</div>
<?xml version="1.0"?>
<!--/**
* @package magento
* @subpackage AncPricepercustomer
*
* @author netz.coop code[at]netz.coop
*
* @license http://www.gnu.org/licenses/gpl-3.0.de.html GNU GENERAL PUBLIC LICENSE VERSION 3
* @copyright (C) 2015 netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/-->
<config>
<modules>
<Anc_Pricespercustomer>
<active>true</active>
<codePool>community</codePool>
<depends>
</depends>
</Anc_Pricespercustomer>
</modules>
</config>
"customer id","Kundennr."
"Manage Prices TTT","#A#"
"product id","Artikelnr."
"pricetyp","Preisart"
"create new price","Neuen Preis erstellen"
"Add Item","Eintrag hinzufügen"
"prices for clients","Kundenpreise"
"price tab","Preis Tab"
"price adjustment","Preisänderung"
"created","erstellt"
"manage prices","Preise verwalten"
"customer prices information","#C#"
"item information","#D#"
"save and continue edit","Speichern und weiter bearbeiten"
"item does not exist","Eintrag existiert nicht"
"error saving price","Fehler beim Speichern des Preises"
"Price was successfully saved.","Preis wurde erfolgreich gespeichert"
"no data found to save","keine Daten zum Speichern"
"The price has been deleted.","Der Preis wurde gelöscht."
"special prises for clients","Kundenspezifische Preise"
copy.src.files=false
copy.src.on.open=false
copy.src.target=
index.file=app/design/adminhtml/default/default/layout/anc/pricespercustomer.xml
run.as=LOCAL
url=http://localhost/AncPricespercustomer/
include.path=${php.global.include.path}
php.version=PHP_54
source.encoding=UTF-8
src.dir=.
tags.asp=false
tags.short=false
web.root=.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>AncPricespercustomer</name>
</data>
</configuration>
</project>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!