'coup', 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'), 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), 'EventHandlerClass' => Array('class'=>'CouponsEventHandler','file'=>'coupons_event_handler.php','build_event'=>'OnBuild'), 'TagProcessorClass' => Array('class'=>'CouponsTagProcessor','file'=>'coupons_tag_processor.php','build_event'=>'OnBuild'), 'AutoLoad' => true, 'Hooks' => Array( Array( 'Mode' => hBEFORE, 'Conditional' => false, 'HookToPrefix' => 'ord', 'HookToSpecial' => '', 'HookToEvent' => Array( 'OnUpdateCart', 'OnCheckout' ), 'DoPrefix' => '', 'DoSpecial' => '', 'DoEvent' => 'OnApplyCoupon', ), ), 'QueryString' => Array( 1 => 'id', 2 => 'page', 3 => 'event', 4 => 'mode', // 't' for temp '' for normal ), 'IDField' => 'CouponId', 'StatusField' => Array('Status'), 'TitleField' => 'Name', 'TableName' => TABLE_PREFIX.'ProductsCoupons', 'SubItems' => Array('coupi'), 'TitlePresets' => Array( 'default' => Array( 'new_status_labels' => Array('coup'=>'!la_title_Adding_Coupon!'), 'edit_status_labels' => Array('coup'=>'!la_title_Editing_Coupon!'), 'new_titlefield' => Array('coup'=>'!la_title_New_Coupon!'), ), 'coupons_list'=>Array('prefixes' => Array('coup_List'), 'format' => "!la_title_Coupons! (#coup_recordcount#)", ), 'coupons_edit'=>Array( 'prefixes' => Array('coup'), 'format' => "#coup_status# '#coup_titlefield#' - !la_title_General!", ), 'coupons_items'=>Array('prefixes' => Array('coup','coupi_List'), 'format' => "#coup_status# '#coup_titlefield#' - !la_title_CouponItems! (#coupi_recordcount#)", ), 'coupons_clone'=>Array('prefixes' => Array('coup'), 'format' => "!la_CloneCoupon!", ), ), 'PermSection' => Array('main' => 'in-commerce:coupons'), 'Sections' => Array( 'in-commerce:coupons' => Array( 'parent' => 'in-commerce:discounts_folder', 'icon' => 'discounts', 'label' => 'la_tab_Coupons', 'url' => Array('t' => 'in-commerce/discounts/coupons_list', 'pass' => 'm'), 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:approve', 'advanced:decline'), 'priority' => 2.2, 'type' => stTAB, ), ), 'FilterMenu' => Array( 'Groups' => Array( Array('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER), Array('mode' => 'AND', 'filters' => Array(4,5/*,6*/), 'type' => WHERE_FILTER), ), 'Filters' => Array( 0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => 'Status != 1' ), 1 => Array('label' => 'la_Used', 'on_sql' => '', 'off_sql' => 'Status != 2' ), 2 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Status != 0' ), 3 => Array(), 4 => Array('label' => 'la_Flat', 'on_sql' => '', 'off_sql' => 'Type != 1' ), 5 => Array('label' => 'la_Percent', 'on_sql' => '', 'off_sql' => 'Type != 2' ), // 6 => Array('label' => 'la_FreeShipping', 'on_sql' => '', 'off_sql' => 'Type != 3' ), ) ), 'ListSQLs' => Array( ''=>'SELECT %1$s.* %2$s FROM %1$s', ), // key - special, value - list select sql 'ItemSQLs' => Array( ''=>'SELECT * FROM %1$s', ), 'ListSortings' => Array( '' => Array( 'Sorting' => Array('Name' => 'asc'), ) ), 'Fields' => Array( 'CouponId' => Array(), 'Status' => Array('options' => Array ( 1 => 'la_Enabled', 2 => 'la_Used', 0 => 'la_Disabled' ), 'default' => 1 ), 'Name' => Array('type'=>'string','required'=>1,'default'=>'', 'max_len'=>255), 'Code' => Array('type'=>'string','required'=>1,'default'=>'', 'max_len'=>255, 'unique'=>Array('Code')), 'Expiration' => Array('formatter' => 'kDateFormatter'), 'Type' => Array('formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array ( 1 => 'la_Flat', 2 => 'la_Percent' ), 'default' => 1 ), // options => (3 => 'la_FreeShipping') 'Amount' => Array('type'=>'double'), 'LastUsedBy' => Array('type'=>'int','formatter'=>'kLEFTFormatter','options'=>Array(-1=>'root',-2=>'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'','left_key_field'=>'PortalUserId','left_title_field'=>'Login','required'=>0,'default'=>0), 'LastUsedOn' => Array('formatter' => 'kDateFormatter'), 'NumberOfUses' => Array('type'=>'int', 'default'=>1,), ), 'Grids' => Array( 'Default' => Array( 'Icons' => Array('default'=>'icon16_custom.gif',1=>'icon16_discount.gif',2=>'icon16_discount_pending.gif',0=>'icon16_discount_disabled.gif'), 'Fields' => Array( 'CouponId' => Array ('title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td' ), 'Name' => Array( 'title'=>'la_col_Name'), 'Code' => Array( 'title'=>'la_col_CouponCode'), 'Expiration_formatted' => Array( 'title'=>'la_col_Expiration', 'sort_field' => 'Expiration' ), 'Type' => Array( 'title'=>'la_col_Type' ), 'Amount' => Array( 'title'=>'la_col_Amount' ), 'LastUsedBy' => Array('title'=>'la_col_LastUsedBy'), 'LastUsedOn_formatted' => Array('title'=>'la_col_LastUsedOn', 'sort_field' => 'LastUsedOn' ), 'NumberOfUses' => Array('title'=>'la_col_NumberOfUses'), ), ), 'Radio' => Array( 'Icons' => Array('default'=>'icon16_custom.gif',1=>'icon16_discount.gif',2=>'icon16_discount_pending.gif',0=>'icon16_discount_disabled.gif'), 'Fields' => Array( 'CouponId' => Array ('title'=>'la_col_Id', 'data_block' => 'grid_radio_td' ), 'Name' => Array( 'title'=>'la_col_Name'), 'Code' => Array( 'title'=>'la_col_CouponCode'), 'Expiration_formatted' => Array( 'title'=>'la_col_Expiration', 'sort_field' => 'Expiration' ), 'Type' => Array( 'title'=>'la_col_Type' ), 'Amount' => Array( 'title'=>'la_col_Amount' ), 'LastUsedBy' => Array('title'=>'la_col_LastUsedBy'), 'LastUsedOn_formatted' => Array('title'=>'la_col_LastUsedOn', 'sort_field' => 'LastUsedOn' ), 'NumberOfUses' => Array('title'=>'la_col_NumberOfUses'), ), ), ), ); ?>