'di', 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'), 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), 'EventHandlerClass' => Array('class'=>'DiscountItemsEventHandler','file'=>'discount_items_event_handler.php','build_event'=>'OnBuild'), 'TagProcessorClass' => Array('class'=>'DiscountItemsTagProcessor','file'=>'discount_items_tag_processor.php','build_event'=>'OnBuild'), 'AutoLoad' => true, 'Hooks' => Array( Array( 'Mode' => hAFTER, 'Conditional' => false, 'HookToPrefix' => 'p', 'HookToSpecial' => '-item', 'HookToEvent' => Array('OnAfterItemDelete'), 'DoPrefix' => '', 'DoSpecial' => '', 'DoEvent' => 'OnDeleteDiscountedItem', ), ), 'QueryString' => Array( 1 => 'id', 2 => 'page', 3 => 'event', ), 'IDField' => 'DiscountItemId', 'StatusField' => Array('Status'), 'TitleField' => 'Name', 'TableName' => TABLE_PREFIX.'ProductsDiscountItems', 'CalculatedFields' => Array( '' => Array( 'ProductId' => 'p.ProductId', 'ItemName' => 'IF(p.Name IS NULL,c.Name,p.l1_Name)', 'SKU' => 'p.SKU', 'Weight' => 'p.Weight', 'CreatedOn' => 'p.CreatedOn', 'BackOrderDate' => 'p.BackOrderDate', 'Status' => 'p.Status', 'CategoryId' => 'c.CategoryId', ), ), 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s FROM %1$s LEFT JOIN '.TABLE_PREFIX.'Products p ON %1$s.ItemResourceId = p.ResourceId LEFT JOIN '.TABLE_PREFIX.'Category c ON %1$s.ItemResourceId = c.ResourceId', ), // key - special, value - list select sql 'ItemSQLs' => Array( ''=>'SELECT * FROM %s', ), /*'BelongsTo' => Array( Array('prefix' => 'd', 'key' => 'DiscountId', 'ForeignKey' => 'DiscountId'), ),*/ 'ForeignKey' => 'DiscountId', 'ParentTableKey' => 'DiscountId', 'ParentPrefix' => 'd', 'AutoDelete' => true, 'AutoClone' => true, 'ListSortings' => Array( '' => Array( 'Sorting' => Array('ItemName' => 'asc'), ) ), 'Fields' => Array ( 'DiscountItemId' => Array(), 'DiscountId' => Array('default' => ''), 'ItemResourceId' => Array(), 'ItemType' => Array('formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array ( 1 => 'la_Product', 2 => 'la_Category', 0 => 'la_WholeOrder' )), ), 'VirtualFields' => Array( 'ProductId' => Array(), 'ItemName' => Array(), 'SKU' => Array(), 'Weight' => Array('type'=>'float', 'min_value_exc'=>0, 'formatter' => 'kFormatter', 'format' => '%0.2f'), 'CreatedOn' => Array('formatter' => 'kDateFormatter', 'default'=>'#NOW#' ), 'BackOrderDate' => Array('formatter' => 'kDateFormatter'), ), 'Grids' => Array( 'Default' => Array( 'Icons' => Array('default'=>'icon16_entire_order.gif'), 'Fields' => Array( 'ItemType' => Array( 'title'=>'la_col_ItemType', 'data_block' => 'grid_checkbox_td' ), ), ), 'DiscountItems' => Array( 'Icons' => Array('default'=>'icon16_custom.gif',1=>'icon16_product.gif',2=>'icon16_product_pending.gif',0=>'icon16_product_disabled.gif'), 'Fields' => Array( 'ProductId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_item_checkbox_td' ), 'ItemName' => Array( 'title'=>'la_col_ItemName' ), 'ItemType' => Array( 'title'=>'la_col_ItemType' ), ), ), ), ); ?>