<?php

$installer = $this;
$installer->startSetup();
/**
 * SQL Table for delivery restriction 
 * Data from CSV
 */
$installer->run("\nDROP TABLE IF EXISTS `{$installer->getTable('balticode_dpd_delivery_price')}`;\nCREATE TABLE `{$installer->getTable('balticode_dpd_delivery_price')}` (\n    `id_dpd_delivery_price` int(11) NOT NULL AUTO_INCREMENT,\n    `postcode` int(11) NOT NULL,\n    `price` text NOT NULL,\n    `free_from_price` text NULL,\n    `carrier_id` text NOT NULL,\n    `weight` text NULL,\n    `height` text NULL,\n    `width` text NULL,\n    `depth` text NULL,\n    `oversized_price` text NULL,\n    `overweight_price` text NULL,\n    `id_shop` int(11) NOT NULL,\n    PRIMARY KEY (`id_dpd_delivery_price`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='DPD Delivery Price by Postcode';\n");
/**
 * SQL Table for delivery points
 * Data from DPD API about Parcel Store places
 */
$installer->run("\nDROP TABLE IF EXISTS `{$installer->getTable('balticode_dpd_delivery_point')}`;\nCREATE TABLE `{$installer->getTable('balticode_dpd_delivery_point')}` (\n    `id_dpd_delivery_points` int(11) NOT NULL AUTO_INCREMENT,\n    `parcelshop_id` int(11) NOT NULL,\n    `company` text NOT NULL,\n    `city` text NOT NULL,\n    `pcode` text NOT NULL,\n    `street` text NOT NULL,\n    `country` text NOT NULL,\n    `email` text NOT NULL,\n    `phone` text NOT NULL,\n    `comment` text NOT NULL,\n    `created_time` text NOT NULL,\n    `update_time` text NOT NULL,\n    `active` int(1) DEFAULT '1',\n    `deleted` int(1) DEFAULT '0',\n    PRIMARY KEY (`id_dpd_delivery_points`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='DPD Delivery Points Data';\n");
$installer->endSetup();
/** 
 * Add Attribute to Order to save order options
 */
$setup = new Mage_Sales_Model_Resource_Setup('core_setup');
$setup->startSetup();
$setup->addAttribute('order', 'dpd_delivery_options', array('type' => 'varchar', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 'default' => null));
$setup->addAttribute('quote', 'dpd_delivery_options', array('type' => 'varchar', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 'default' => null));
$setup->endSetup();
$installer = new Mage_Sales_Model_Resource_Setup('core_setup');
$installer->startSetup();
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'package_height', array('label' => Mage::helper('adminhtml')->__('Height'), 'group' => 'General', 'type' => 'decimal', 'input' => 'text', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, 'user_defined' => false, 'required' => false, 'visible' => true, 'source' => null, 'backend' => null, 'searchable' => false, 'visible_in_advanced_search' => false, 'visible_on_front' => false, 'is_configurable' => false, 'is_html_allowed_on_front' => false, 'sort_order' => '5', 'apply_to' => 'simple'));
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'package_width', array('label' => Mage::helper('adminhtml')->__('Width'), 'group' => 'General', 'type' => 'decimal', 'input' => 'text', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, 'user_defined' => false, 'required' => false, 'visible' => true, 'source' => null, 'backend' => null, 'searchable' => false, 'visible_in_advanced_search' => false, 'visible_on_front' => false, 'is_configurable' => false, 'is_html_allowed_on_front' => false, 'sort_order' => '5', 'apply_to' => 'simple'));
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'package_depth', array('label' => Mage::helper('adminhtml')->__('Depth'), 'group' => 'General', 'type' => 'decimal', 'input' => 'text', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, 'user_defined' => false, 'required' => false, 'visible' => true, 'source' => null, 'backend' => null, 'searchable' => false, 'visible_in_advanced_search' => false, 'visible_on_front' => false, 'is_configurable' => false, 'is_html_allowed_on_front' => false, 'sort_order' => '5', 'apply_to' => 'simple'));
$installer->endSetup();
<?php

//Für das anlegen des Cookie Attributes bei Bestellungen siehe Affiliate
$setup = new Mage_Sales_Model_Resource_Setup();
$setup->startSetup();
//EAN
$setup->addAttribute('quote', "customer_source", array('type' => 'text', 'visible' => true, 'backend_type' => 'text', 'frontend_input' => 'text', 'label' => 'Costumer Source', 'input' => 'text', 'required' => false, 'user_defined' => true, 'default' => NULL, 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, 'searchable' => false, 'is_configurable' => false));
$setup->endSetup();