<?php

/* @var $installer Mage_Customer_Model_Entity_Setup */
$installer = $this;
$installer->startSetup();
// Attributes
$attributeSetup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $attributeSetup->getEntityTypeId('customer');
$attributeSetId = $attributeSetup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $attributeSetup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$installer->addAttribute("customer", "customer_number", array("type" => "varchar", "label" => "Customer Number", "input" => "text", "visible" => true, "required" => false, "default" => "", "frontend" => "", "unique" => false, "note" => ""));
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "customer_number");
$attributeSetup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'customer_number', '400');
$used_in_forms = array();
$used_in_forms[] = "adminhtml_customer";
$attribute->setData("used_in_forms", $used_in_forms)->setData("is_used_for_customer_segment", false)->setData("is_system", 0)->setData("is_user_defined", 1)->setData("is_visible", 0)->setData("sort_order", 400);
$attribute->save();
$installer->endSetup();
<?php

$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('catalog_product');
$select = $this->_conn->select()->from($this->getTable('eav/attribute_set'))->where('entity_type_id = :entity_type_id');
$sets = $this->_conn->fetchAll($select, array('entity_type_id' => $entityTypeId));
foreach ($sets as $set) {
    $setup->updateAttributeGroup($entityTypeId, $set['attribute_set_id'], 'Payperrentals', 'attribute_group_name', 'Rental Bookings');
    $setup->addAttributeToGroup($entityTypeId, $set['attribute_set_id'], 'Prices', 'payperrentals_pricingtype');
    $setup->addAttributeToGroup($entityTypeId, $set['attribute_set_id'], 'Prices', 'payperrentals_deposit');
    $setup->addAttributeToGroup($entityTypeId, $set['attribute_set_id'], 'Inventory', 'allow_overbooking');
}
$installer->endSetup();
Example #3
0
<?php

/**
 * Created by PhpStorm.
 * User: pavel
 * Date: 18.11.2015
 * Time: 16:50
 */
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('customer');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$installer->addAttribute("customer", "points", array("type" => "decimal", "backend" => "", "label" => "Points for Order", "input" => "text", "source" => "", "visible" => true, "required" => false, "default" => "", "frontend" => "", "unique" => false, "note" => "Points for Order"));
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "points");
$setup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'points', '999');
$used_in_forms = array();
$used_in_forms[] = "adminhtml_customer";
$used_in_forms[] = "checkout_register";
$used_in_forms[] = "customer_account_create";
$used_in_forms[] = "customer_account_edit";
$used_in_forms[] = "adminhtml_checkout";
$attribute->setData("used_in_forms", $used_in_forms)->setData("is_used_for_customer_segment", true)->setData("is_system", 0)->setData("is_user_defined", 1)->setData("is_visible", 1)->setData("sort_order", 100);
$attribute->save();
$installer->endSetup();
<?php

$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('customer');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$installer->addAttribute("customer", "complete_sf_form", array("type" => "int", "backend" => "", "label" => "Completed SalesForce Form", "input" => "select", "source" => "eav/entity_attribute_source_boolean", "visible" => 1, "required" => 0, "default" => "0", "user_defined" => 1));
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "complete_sf_form");
$setup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'complete_sf_form', '999');
$used_in_forms = array();
$used_in_forms[] = "adminhtml_customer";
$attribute->setData("used_in_forms", $used_in_forms)->setData("is_used_for_customer_segment", true)->setData("is_system", 0)->setData("is_user_defined", 1)->setData("is_visible", 1)->setData("sort_order", 100);
$attribute->save();
$installer->endSetup();
<?php

/**
 * install-0.1.0.php created by a.voytik.
 * Date: 12/03/2012 06:28
 */
/* @var $installer Dutycalculator_Charge_Model_Resource_Setup */
$installer = $this;
$productAttributesSetup = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$productAttributesSetup->addAttribute('catalog_product', 'dc_product_id', array('backend' => '', 'type' => 'int', 'frontend' => '', 'input' => 'text', 'label' => 'DutyCalculator Category', 'frontend_class' => '', 'source' => '', 'required' => false, 'user_defined' => true, 'default' => 0, 'unique' => 0, 'note' => '', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE));
$productAttributesSetup->addAttributeToGroup('catalog_product', 'Default', 'Prices', 'dc_product_id', 100);
$installer->getConnection()->addColumn($this->getTable('sales/order'), 'dc_order_id', 'int(11) NOT NULL DEFAULT 0');
$installer->getConnection()->addColumn($this->getTable('sales/invoice'), 'dc_order_id', 'int(11) NOT NULL DEFAULT 0');
$installer->getConnection()->addColumn($this->getTable('sales/quote'), 'dc_order_id', 'int(11) NOT NULL DEFAULT 0');
$installer->getConnection()->addColumn($this->getTable('sales/shipment'), 'commercial_invoice_url', 'varchar(255) NULL DEFAULT NULL');
$installer->getConnection()->addColumn($this->getTable('sales/shipment'), 'packing_list_url', 'varchar(255) NULL DEFAULT NULL');
$installer->getConnection()->addColumn($this->getTable('sales/order'), 'delivery_duty_type', "varchar(25) NOT NULL DEFAULT '" . Dutycalculator_Charge_Helper_Data::DC_DELIVERY_TYPE_DDU . "'");
$installer->getConnection()->addColumn($this->getTable('sales/quote'), 'delivery_duty_type', "varchar(25) NOT NULL DEFAULT '" . Dutycalculator_Charge_Helper_Data::DC_DELIVERY_TYPE_DDU . "'");
$installer->getConnection()->addColumn($this->getTable('sales/quote_address'), 'delivery_duty_type', "varchar(25) NOT NULL DEFAULT '" . Dutycalculator_Charge_Helper_Data::DC_DELIVERY_TYPE_DDU . "'");
$installer->getConnection()->addColumn($this->getTable('sales/invoice'), 'delivery_duty_type', "varchar(25) NOT NULL DEFAULT '" . Dutycalculator_Charge_Helper_Data::DC_DELIVERY_TYPE_DDU . "'");
$installer->getConnection()->addColumn($this->getTable('sales/creditmemo'), 'delivery_duty_type', "varchar(25) NOT NULL DEFAULT '" . Dutycalculator_Charge_Helper_Data::DC_DELIVERY_TYPE_DDU . "'");
$installer->getConnection()->addColumn($this->getTable('sales/shipment'), 'delivery_duty_type', "varchar(25) NOT NULL DEFAULT '" . Dutycalculator_Charge_Helper_Data::DC_DELIVERY_TYPE_DDU . "'");
$installer->getConnection()->addColumn($this->getTable('sales/quote'), 'import_duty_tax', 'decimal(10, 2) NOT NULL DEFAULT 0');
$installer->getConnection()->addColumn($this->getTable('sales/quote'), 'base_import_duty_tax', 'decimal(10, 2) NOT NULL DEFAULT 0');
$installer->getConnection()->addColumn($this->getTable('sales/quote_item'), 'import_duty_tax', 'decimal(10, 2) NOT NULL DEFAULT 0');
$installer->getConnection()->addColumn($this->getTable('sales/quote_item'), 'base_import_duty_tax', 'decimal(10, 2) NOT NULL DEFAULT 0');
$installer->getConnection()->addColumn($this->getTable('sales/order'), 'import_duty_tax', 'decimal(10, 2) NOT NULL DEFAULT 0');
$installer->getConnection()->addColumn($this->getTable('sales/order'), 'base_import_duty_tax', 'decimal(10, 2) NOT NULL DEFAULT 0');
$installer->getConnection()->addColumn($this->getTable('sales/order'), 'import_duty_tax_invoiced', 'decimal(10, 2) NOT NULL DEFAULT 0');
$installer->getConnection()->addColumn($this->getTable('sales/order'), 'base_import_duty_tax_invoiced', 'decimal(10, 2) NOT NULL DEFAULT 0');
Example #6
0
<?php

$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('customer');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$installer->addAttribute("customer", "couponsSent", array("type" => "varchar", "backend" => "", "label" => "Coupons Sent", "input" => "text", "source" => "", "visible" => true, "required" => false, "default" => "", "frontend" => "", "unique" => false, "note" => "Coupons Sent"));
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "couponsSent");
$setup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'couponsSent', '999');
$installer->run("ALTER TABLE {$this->getTable('rewardpoints_account')} ADD COLUMN `rewardpoints_status` VARCHAR( 255 ) NULL;");
$installer->run("ALTER TABLE {$this->getTable('rewardpoints_account')} ADD COLUMN `rewardpoints_state` VARCHAR( 255 ) NULL AFTER `rewardpoints_status`;");
$installer->run("ALTER TABLE {$this->getTable('rewardpoints_account')} ADD COLUMN `date_order` DATETIME NULL AFTER `rewardpoints_state`;");
$installer->run("ALTER TABLE {$this->getTable('rewardpoints_account')} ADD COLUMN `date_insertion` DATETIME NULL AFTER `date_order`;");
$installer->run("ALTER TABLE {$this->getTable('rewardpoints_account')} ADD COLUMN `period` DATE NULL AFTER `date_insertion`;");
$installer->run("ALTER TABLE {$this->getTable('rewardpoints_account')} ADD COLUMN `object_name` VARCHAR( 255 ) NULL AFTER `period`;");
$installer->run("ALTER TABLE {$this->getTable('rewardpoints_account')} ADD INDEX `rewardpoints_status` (`rewardpoints_status`);");
$installer->run("ALTER TABLE {$this->getTable('rewardpoints_account')} ADD INDEX `rewardpoints_state` (`rewardpoints_state`);");
$installer->run("ALTER TABLE {$this->getTable('rewardpoints_account')} ADD INDEX `object_name` (`object_name`);");
if (version_compare(Mage::getVersion(), '1.4.0', '>=')) {
    $installer->run("UPDATE {$this->getTable('rewardpoints_account')} SET   `rewardpoints_status` = (SELECT `status` FROM {$this->getTable('sales/order')} WHERE {$this->getTable('sales/order')}.increment_id = {$this->getTable('rewardpoints_account')}.order_id), \n                                                                            `rewardpoints_state` = (SELECT `state` FROM {$this->getTable('sales/order')} WHERE {$this->getTable('sales/order')}.increment_id = {$this->getTable('rewardpoints_account')}.order_id),\n                                                                            `date_order` = (SELECT {$this->getTable('sales/order')}.`created_at` FROM {$this->getTable('sales/order')} WHERE {$this->getTable('sales/order')}.increment_id = {$this->getTable('rewardpoints_account')}.order_id),\n                                                                            `date_insertion` = (SELECT {$this->getTable('sales/order')}.`created_at` FROM {$this->getTable('sales/order')} WHERE {$this->getTable('sales/order')}.increment_id = {$this->getTable('rewardpoints_account')}.order_id),\n                                                                            `period` = (SELECT {$this->getTable('sales/order')}.`created_at` FROM {$this->getTable('sales/order')} WHERE {$this->getTable('sales/order')}.increment_id = {$this->getTable('rewardpoints_account')}.order_id);");
} else {
    $table_sales_order = $this->getTable('sales/order') . '_varchar';
    $states = array(Mage_Sales_Model_Order::STATE_NEW, Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Sales_Model_Order::STATE_COMPLETE, Mage_Sales_Model_Order::STATE_CLOSED, Mage_Sales_Model_Order::STATE_CANCELED, Mage_Sales_Model_Order::STATE_HOLDED);
    $installer->run("UPDATE {$this->getTable('rewardpoints_account')} SET   `rewardpoints_state` = (   SELECT order_state.value \n                                                                                                        FROM {$table_sales_order} as order_state \n                                                                                                        WHERE order_state.entity_id IN ( \n                                                                                                            SELECT orders.entity_id FROM {$this->getTable('sales/order')} as orders \n                                                                                                            WHERE orders.increment_id = {$this->getTable('rewardpoints_account')}.order_id\n                                                                                                        )\n                                                                                                        WHERE order_state.value in ('" . implode("','", $states) . "') ORDER BY value_id DESC\n                                                                                                        LIMIT 1\n                                                                                                     ),\n                                                                            `date_order` = (SELECT {$this->getTable('sales/order')}.`created_at` FROM {$this->getTable('sales/order')} WHERE {$this->getTable('sales/order')}.increment_id = {$this->getTable('rewardpoints_account')}.order_id),\n                                                                            `date_insertion` = (SELECT {$this->getTable('sales/order')}.`created_at` FROM {$this->getTable('sales/order')} WHERE {$this->getTable('sales/order')}.increment_id = {$this->getTable('rewardpoints_account')}.order_id),\n                                                                            `period` = (SELECT {$this->getTable('sales/order')}.`created_at` FROM {$this->getTable('sales/order')} WHERE {$this->getTable('sales/order')}.increment_id = {$this->getTable('rewardpoints_account')}.order_id);");
}
$installer->run("ALTER TABLE {$this->getTable('rewardpoints_flat_account')} ADD COLUMN `notification_date` DATETIME NULL AFTER `points_lost`;");
$installer->run("ALTER TABLE {$this->getTable('rewardpoints_flat_account')} ADD COLUMN `notification_qty` integer(10) unsigned NOT NULL default '0' AFTER `points_lost`;");
// /end get all invoices and update rewardpoints & rewardpoints_gathered (from rewardpoints_account table)
//Mage_Customer_Model_Entity_Setup
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('customer');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$setup->addAttribute('customer', 'rewardpoints_referrer', array('label' => 'Reward Points Referrer ID', 'input' => 'text', 'type' => 'int', 'visible' => 1, 'required' => 0, 'user_defined' => 1));
$setup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'rewardpoints_referrer', '999');
$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'rewardpoints_referrer');
$oAttribute->setData('used_in_forms', array('adminhtml_customer'));
$oAttribute->save();
//$setup->endSetup();
$installer->endSetup();
<?php

/* @var $installer Mage_Customer_Model_Entity_Setup */
$installer = $this;
$installer->startSetup();
// Attributes
$attributeSetup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $attributeSetup->getEntityTypeId('customer');
$attributeSetId = $attributeSetup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $attributeSetup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$installer->addAttribute("customer", "display_price_type", ["type" => "varchar", "label" => "Display Price Type", "input" => "text", "visible" => true, "required" => false, "default" => "0", "frontend" => "", "unique" => false, "note" => "This value indicates which price type is displayed to the customer (B2B-Store only). (0=both, 1=purchase price, 2=retail price)"]);
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "display_price_type");
$attributeSetup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'display_price_type', '600');
$attribute->setData("used_in_forms", ["adminhtml_customer"])->setData("is_used_for_customer_segment", false)->setData("is_system", 0)->setData("is_user_defined", 1)->setData("is_visible", 0)->setData("sort_order", 600);
$attribute->save();
$installer->endSetup();
<?php

/**
 * Dc_BrandManager
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 *
 * @category   Dc
 * @package    Dc_BrandManager
 * @copyright  Copyright (c) 2012-2015 Damián Culotta. (http://www.damianculotta.com.ar/)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->addAttributeGroup(Mage_Catalog_Model_Category::ENTITY, 'Default', 'Extra Options', 10);
$_attribute_set_id = $setup->getDefaultAttributeSetId(Mage_Catalog_Model_Category::ENTITY);
$_attribute_group_id = $setup->getAttributeGroupId(Mage_Catalog_Model_Category::ENTITY, $_attribute_set_id, 'Extra Options');
$setup->addAttribute('catalog_category', 'brand_icon', array('type' => 'varchar', 'backend' => 'catalog/category_attribute_backend_image', 'frontend' => '', 'label' => 'Brand Icon', 'input' => 'image', 'class' => '', 'source' => '', 'global' => 0, 'visible' => 1, 'required' => 0, 'user_defined' => 1, 'default' => 0, 'searchable' => 0, 'filterable' => 0, 'comparable' => 0, 'visible_on_front' => 1, 'unique' => 0, 'position' => 1));
$setup->addAttributeToGroup(Mage_Catalog_Model_Category::ENTITY, $_attribute_set_id, $_attribute_group_id, 'brand_icon', '10');
$installer->endSetup();
Example #10
0
<?php

$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('customer');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$setup->addAttribute('customer', 'master_customer', array('input' => 'select', 'type' => 'text', 'label' => 'DEALER', 'source' => 'brandattr/product_attribute_source_unit', 'backend' => '', 'visible' => 1, 'required' => 0, 'user_defined' => 1));
$setup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'master_customer', '999');
$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'master_customer');
$oAttribute->setData('used_in_forms', array('adminhtml_customer'));
$oAttribute->save();
$installer->endSetup();
<?php

/* @var $installer Mage_Customer_Model_Entity_Setup */
$installer = $this;
$installer->startSetup();
// Attributes
$attributeSetup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $attributeSetup->getEntityTypeId('customer');
$attributeSetId = $attributeSetup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $attributeSetup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$installer->addAttribute("customer", "purchase_price_list", ["type" => "varchar", "label" => "Purchase Price List", "input" => "text", "visible" => true, "required" => false, "default" => "", "frontend" => "", "unique" => false, "note" => ""]);
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "purchase_price_list");
$attributeSetup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'purchase_price_list', '500');
$attribute->setData("used_in_forms", ["adminhtml_customer"])->setData("is_used_for_customer_segment", false)->setData("is_system", 0)->setData("is_user_defined", 1)->setData("is_visible", 0)->setData("sort_order", 500);
$attribute->save();
$installer->endSetup();
Example #12
0
<?php

/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
$attributeCode = 'complete_profile_sent';
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('customer');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$setup->addAttribute('customer', $attributeCode, array('label' => 'Complete Profile Mail Sent', 'input' => 'select', 'type' => 'int', 'visible' => 1, 'required' => 0, 'user_defined' => 0, 'sort_order' => 999, 'source' => 'eav/entity_attribute_source_boolean'));
$setup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, $attributeCode, '999');
$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', $attributeCode);
$oAttribute->setData('used_in_forms', array('adminhtml_customer', 'adminhtml_checkout'));
$oAttribute->setData('sort_order', 999);
$oAttribute->save();
$setup->endSetup();
<?php

/**
 * Author : Nguyen Trung Hieu
 * Email : hieunt@smartosc.com
 * Date: 8/29/12
 * Time: 1:18 PM
 */
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('customer');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$setup->addAttribute('customer', 'fullname', array('input' => 'text', 'type' => 'text', 'label' => 'Full Name', 'visible' => 1, 'required' => 1, 'user_defined' => 1));
$setup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'fullname', '999');
$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'fullname');
$oAttribute->setData('used_in_forms', array('adminhtml_customer'));
$oAttribute->save();
$installer->endSetup();
<?php

$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('catalog_product');
$select = $this->_conn->select()->from($this->getTable('eav/attribute_set'))->where('entity_type_id = :entity_type_id');
$sets = $this->_conn->fetchAll($select, array('entity_type_id' => $entityTypeId));
foreach ($sets as $set) {
    $setup->addAttributeToGroup('catalog_product', $set['attribute_set_id'], 'Prices', 'payperrentals_buyoutprice');
    $setup->addAttributeToGroup('catalog_product', $set['attribute_set_id'], 'Prices', 'payperrentals_enable_extend');
    $setup->addAttributeToGroup('catalog_product', $set['attribute_set_id'], 'Prices', 'payperrentals_enable_buyout');
    $setup->addAttributeToGroup('catalog_product', $set['attribute_set_id'], 'Prices', 'payperrentals_buyout_onproduct');
    $setup->addAttributeToGroup('catalog_product', $set['attribute_set_id'], 'Prices', 'bundle_pricingtype');
}
$installer->endSetup();
<?php

$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('customer');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$setup->addAttribute('customer', 'crossfitid', array('input' => 'text', 'type' => 'text', 'label' => 'CrossFit ID', 'visible' => 1, 'required' => 0, 'user_defined' => 1));
$setup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'crossfitid', '999');
$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'crossfitid');
$oAttribute->setData('used_in_forms', array('adminhtml_customer'));
$oAttribute->save();
$installer->endSetup();
Example #16
0
<?php

$installer = $this;
$newstoreMembersTable = $installer->getTable('ism_newstore_members/newstore_members');
$installer->startSetup();
$installer->getConnection()->dropTable($newstoreMembersTable);
$table = $installer->getConnection()->newTable($newstoreMembersTable)->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('identity' => true, 'nullable' => false, 'primary' => true))->addColumn('unique_key', Varien_Db_Ddl_Table::TYPE_VARCHAR, '255', array('nullable' => false))->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER, array('nullable' => false))->addColumn('expire_date', Varien_Db_Ddl_Table::TYPE_DATE, array('nullable' => false))->addColumn('post_code', Varien_Db_Ddl_Table::TYPE_VARCHAR, '255', array('nullable' => false, 'default' => ''))->addColumn('activated', Varien_Db_Ddl_table::TYPE_TINYINT, null, array('nullable' => false, 'defalut' => 0))->addForeignKey($installer->getFkName('ism_newstore_members/newstore_members', 'customer_id', 'customer/entity', 'entity_id'), 'customer_id', $installer->getTable('customer/entity'), 'entity_id', Varien_Db_Ddl_Table::ACTION_SET_NULL, Varien_Db_Ddl_Table::ACTION_SET_NULL);
$installer->getConnection()->createTable($table);
$installer->getConnection()->addColumn('sales_flat_quote', 'newstore_member_code', array('nullable' => true, 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, 'length' => 256, 'comment' => 'Newstore Meber Code'));
$installer->getConnection()->addColumn('sales_flat_order', 'newstore_member_code', array('nullable' => true, 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, 'length' => 256, 'comment' => 'Newstore Member Code'));
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->addAttribute('customer', 'prev_group_id', array('type' => 'int'));
$entityTypeId = $setup->getEntityTypeId('customer');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$setup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'prev_group_id', '999');
$installer->endSetup();
Example #17
0
$config = array('position' => 1, 'required' => 0, 'label' => 'Comprimento (cm)', 'type' => 'int', 'input' => 'text', 'apply_to' => 'simple,bundle,grouped,configurable', 'note' => 'Comprimento da embalagem do produto (Para cálculo dos Correios)');
$setup->addAttribute('catalog_product', $codigo, $config);
// Add volume to prduct attribute set
$codigo = 'volume_altura';
$config = array('position' => 1, 'required' => 0, 'label' => 'Altura (cm)', 'type' => 'int', 'input' => 'text', 'apply_to' => 'simple,bundle,grouped,configurable', 'note' => 'Altura da embalagem do produto (Para cálculo dos Correios)');
$setup->addAttribute('catalog_product', $codigo, $config);
// Add volume to prduct attribute set
$codigo = 'volume_largura';
$config = array('position' => 1, 'required' => 0, 'label' => 'Largura (cm)', 'type' => 'int', 'input' => 'text', 'apply_to' => 'simple,bundle,grouped,configurable', 'note' => 'Largura da embalagem do produto (Para cálculo dos Correios)');
$setup->addAttribute('catalog_product', $codigo, $config);
$codigo = 'postmethods';
$config = array('position' => 1, 'required' => 0, 'label' => 'Serviços de Entrega', 'type' => 'text', 'input' => 'multiselect', 'source' => 'pedroteixeira_correios/source_postMethods', 'backend' => 'eav/entity_attribute_backend_array', 'apply_to' => 'simple,bundle,grouped,configurable', 'note' => 'Selecione os serviços apropriados para o produto.');
$setup->addAttribute('catalog_product', $codigo, $config);
$codigo = 'fit_size';
$config = array('position' => 1, 'required' => 0, 'label' => 'Diferença do Encaixe (cm)', 'type' => 'varchar', 'input' => 'text', 'apply_to' => 'simple,bundle,grouped,configurable', 'note' => 'Exemplo: Se 1 item mede 10cm de altura, e 2 itens encaixados medem 11cm. A diferença é de 1cm.');
$setup->addAttribute('catalog_product', $codigo, $config);
$codigo = 'posting_days';
$config = array('position' => 1, 'required' => 0, 'label' => 'Prazo de Postagem', 'type' => 'int', 'input' => 'text', 'apply_to' => 'simple,bundle,grouped,configurable', 'note' => 'O prazo total é o Prazo dos Correios acrescido do maior Prazo de Postagem dos produtos no carrinho.');
$setup->addAttribute('catalog_product', $codigo, $config);
// Add Correios Tab
$setIds = $setup->getAllAttributeSetIds('catalog_product');
$attributes = array('volume_comprimento', 'volume_altura', 'volume_largura', 'postmethods', 'fit_size', 'posting_days');
foreach ($setIds as $setId) {
    $setup->addAttributeGroup('catalog_product', $setId, 'Correios', 2);
    $groupId = $setup->getAttributeGroupId('catalog_product', $setId, 'Correios');
    foreach ($attributes as $attribute) {
        $attributeId = $setup->getAttributeId('catalog_product', $attribute);
        $setup->addAttributeToGroup('catalog_product', $setId, $groupId, $attributeId);
    }
}
$installer->endSetup();
<?php

$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('customer');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$setup->addAttribute('customer', 'dotmailer_contact_id', array('input' => 'text', 'type' => 'int', 'label' => 'Connector Contact ID', 'visible' => 1, 'required' => 0, 'user_defined' => 0, ''));
$setup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'dotmailer_contact_id', '999');
$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'dotmailer_contact_id');
$oAttribute->setData('used_in_forms', array('adminhtml_customer'));
$oAttribute->save();
$adminData = array();
$adminData[] = array('severity' => 4, 'date_added' => gmdate('Y-m-d H:i:s', time()), 'title' => 'Email Connector Was Installed. Please Enter Your API Credentials & Ensure Cron Jobs Are Running On Your Site (Find Out More)', 'description' => 'Email Connector Was Installed. Please Enter Your API Credentials & Ensure Cron Jobs Are Running On Your Site.', 'url' => 'http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/how_to_setup_a_cron_job');
Mage::getModel('adminnotification/inbox')->parse($adminData);
$setup->endSetup();
<?php

/**
 * Provides a custom SOAP client to enable communication with Streicher's
 * Microsoft Dynamics Navision (NAV) ERP system via web services (SOAP/XMLRPC)
 *
 * @category    Spe
 * @package     Spe_NavisionConnector
 * @copyright   Copyright (c) 2015 August Ash, Inc. (http://www.augustash.com)
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
/** @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
// Begin transaction
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('catalog_category');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$setup->addAttribute('catalog_category', 'thumbnail', array('type' => 'varchar', 'input' => 'image', 'backend' => 'catalog/category_attribute_backend_image', 'group' => 'General Information', 'label' => 'Thumbnail', 'visible' => 1, 'required' => 0, 'user_defined' => 1, 'frontend_input' => '', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, 'visible_on_front' => 1));
$setup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'thumbnail', '5');
// End transaction
$installer->endSetup();
<?php

/* @var $installer Mage_Customer_Model_Entity_Setup */
$installer = $this;
$installer->startSetup();
// Attributes
$attributeSetup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $attributeSetup->getEntityTypeId('customer');
$attributeSetId = $attributeSetup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $attributeSetup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$installer->addAttribute("customer", "is_b2b_approved", ["type" => "int", "label" => "Is B2B Approved?", "input" => "select", "visible" => false, "required" => false, "default" => 0, "source" => "eav/entity_attribute_source_boolean", "unique" => false, "note" => ""]);
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "is_b2b_approved");
$attributeSetup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'is_b2b_approved', '560');
$attribute->setData("used_in_forms", ["adminhtml_customer"])->setData("is_used_for_customer_segment", false)->setData("is_system", 0)->setData("is_user_defined", 1)->setData("is_visible", 0)->setData("sort_order", 560);
$attribute->save();
$installer->endSetup();
Example #21
0
<?php

$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('customer');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$setup->addAttribute('customer', 'linkedin_profile', array('label' => 'LinkedIn Profile URL', 'input' => 'text', 'type' => 'varchar', 'frontend_class' => 'validate-url validate-length maximum-length-250', 'visible' => true, 'visible_on_front' => true, 'adminhtml_only' => false, 'required' => false, 'user_defined' => true));
$setup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'linkedin_profile', '900');
$attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'linkedin_profile');
$attribute->setData('used_in_forms', array('customer_account_create', 'customer_account_edit', 'adminhtml_customer'));
$attribute->save();
$setup->endSetup();
<?php

$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('customer_address');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$setup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'tax_invoice', '999');
$setup->endSetup();
$installer->endSetup();
<?php

/* @var $installer Mage_Customer_Model_Entity_Setup */
$installer = $this;
$installer->startSetup();
// Attributes
$attributeSetup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $attributeSetup->getEntityTypeId('customer');
$attributeSetId = $attributeSetup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $attributeSetup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$installer->addAttribute("customer", "is_b2b_blocked", ["type" => "int", "label" => "Is B2B Blocked?", "input" => "select", "visible" => false, "required" => false, "default" => 0, "source" => "eav/entity_attribute_source_boolean", "unique" => false, "note" => ""]);
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "is_b2b_blocked");
$attributeSetup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, "is_b2b_blocked", "570");
$attribute->setData("used_in_forms", ["adminhtml_customer"])->setData("is_used_for_customer_segment", false)->setData("is_system", 0)->setData("is_user_defined", 1)->setData("is_visible", 0)->setData("sort_order", 570);
$attribute->save();
$installer->endSetup();
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = $this;
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
/**
 * Adding a lookup table for Divido
 */
$conn = $installer->getConnection();
$lookup_table = $conn->newTable($installer->getTable('callback/lookup'));
$lookup_table->addColumn('lookup_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true), 'Id')->addColumn('salt', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array('nullable' => false), 'Salt')->addColumn('quote_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('nullable' => false, 'unsigned' => true), 'Quote ID');
$lookup_table->addIndex($installer->getIdxName('callback/lookup', array('quote_id'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), array('quote_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE));
$conn->createTable($lookup_table);
/**
 * Adding Divido attributes to products
 */
$groupName = 'Divido';
$entityTypeId = $setup->getEntityTypeId('catalog_product');
$defaultAttrSetId = $setup->getDefaultAttributeSetId($entityTypeId);
// adding attribute group
$setup->addAttributeGroup($entityTypeId, $defaultAttrSetId, $groupName, 1000);
$groupId = $setup->getAttributeGroupId($entityTypeId, $defaultAttrSetId, $groupName);
// Add attributes
$planOptionAttrCode = 'divido_plan_option';
$setup->addAttribute($entityTypeId, $planOptionAttrCode, array('label' => 'Available on finance', 'type' => 'varchar', 'input' => 'select', 'backend' => 'eav/entity_attribute_backend_array', 'frontend' => '', 'source' => 'pay/source_option', 'default' => 'default_plans', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, 'visible' => true, 'required' => true, 'user_defined' => true, 'searchable' => true, 'filterable' => false, 'comparable' => false, 'visible_on_front' => true, 'unique' => false));
$planOptionAttrId = $setup->getAttributeId($entityTypeId, $planOptionAttrCode);
$setup->addAttributeToGroup($entityTypeId, $defaultAttrSetId, $groupId, $planOptionAttrId, null);
$planSelectionAttrCode = 'divido_plan_selection';
$setup->addAttribute($entityTypeId, $planSelectionAttrCode, array('label' => 'Selected plans', 'type' => 'varchar', 'input' => 'multiselect', 'backend' => 'eav/entity_attribute_backend_array', 'frontend' => '', 'source' => 'pay/source_defaultprodplans', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, 'visible' => true, 'required' => false, 'user_defined' => true, 'searchable' => true, 'filterable' => false, 'comparable' => false, 'visible_on_front' => true, 'unique' => false));
$planSelectionAttrId = $setup->getAttributeId($entityTypeId, $planSelectionAttrCode);
$setup->addAttributeToGroup($entityTypeId, $defaultAttrSetId, $groupId, $planSelectionAttrId, null);
$installer->endSetup();
<?php

$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('catalog_product');
$select = $this->_conn->select()->from($this->getTable('eav/attribute_set'))->where('entity_type_id = :entity_type_id');
$sets = $this->_conn->fetchAll($select, array('entity_type_id' => $entityTypeId));
foreach ($sets as $set) {
    $setup->addAttributeToGroup('catalog_product', $set['attribute_set_id'], 'Prices', 'res_prices');
    $setup->addAttributeGroup('catalog_product', $set['attribute_set_id'], 'Inventory');
    $setup->addAttributeToGroup('catalog_product', $set['attribute_set_id'], 'Inventory', 'payperrentals_quantity');
    $setup->addAttributeToGroup('catalog_product', $set['attribute_set_id'], 'Inventory', 'payperrentals_use_serials');
    $setup->addAttributeToGroup('catalog_product', $set['attribute_set_id'], 'Inventory', 'res_serialnumbers');
}
$installer->endSetup();
 public function importAttributeInsideGroup($attribute_group_id, $attributeSetId, $attribute_code, $attribute_sort_order)
 {
     $mapobj = Mage::getModel('customimport/customimport');
     $attributeGroupId = $mapobj->getAttributeGroupByExternalId($attribute_group_id, $attributeSetId);
     // $attribute_group_id is external group id
     if ($attributeGroupId) {
         $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
         $attribute_id = $setup->getAttributeId('catalog_product', $attribute_code);
         if (!$attribute_id) {
             $this->customHelper->reportError($this->customHelper->__("Attribute code %s is missing during attribute group %s import", $attribute_code, $attribute_group_id));
         } else {
             $attribute_exists = $mapobj->isAttributeExistsInGroup($attribute_id, $attributeGroupId);
             if ($attribute_exists) {
                 $mapobj->updateSequenceOfAttribute($attributeGroupId, $attribute_id, $attribute_sort_order, $attribute_code, $attribute_group_id);
             } else {
                 $setup->addAttributeToGroup('catalog_product', $attributeSetId, $attributeGroupId, $attribute_id, $attribute_sort_order);
             }
         }
     }
 }
<?php

/* @var $installer Mage_Customer_Model_Entity_Setup */
$installer = $this;
$installer->startSetup();
// Attributes
$attributeSetup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $attributeSetup->getEntityTypeId('customer');
$attributeSetId = $attributeSetup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $attributeSetup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$installer->addAttribute("customer", "retail_price_list", ["type" => "varchar", "label" => "Retail Price List", "input" => "text", "visible" => true, "required" => false, "default" => "", "frontend" => "", "unique" => false, "note" => ""]);
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "retail_price_list");
$attributeSetup->addAttributeToGroup($entityTypeId, $attributeSetId, $attributeGroupId, 'retail_price_list', '550');
$attribute->setData("used_in_forms", ["adminhtml_customer"])->setData("is_used_for_customer_segment", false)->setData("is_system", 0)->setData("is_user_defined", 1)->setData("is_visible", 0)->setData("sort_order", 550);
$attribute->save();
$installer->endSetup();