<?php

$cw_allowed_tunnels[] = 'cw_payment_is_authorized';
cw_include('addons/payment_system/include/func.payment.php');
cw_addons_set_template(array('post', 'customer/cart/buttons.tpl', 'addons/payment_system/customer/buttons.tpl'));
cw_addons_set_controllers(array('replace', 'admin/payments.php', 'addons/payment_system/admin/payments.php'), array('replace', 'customer/place_order.php', 'addons/payment_system/customer/place_order.php'));
cw_addons_set_hooks(array('post', 'cw_checkout_login_prepare', 'cw_payment_checkout_login_prepare'), array('post', 'cw_checkout_prepare', 'cw_payment_checkout_prepare'));
// Capture/Decline button for Authorized orders
cw_set_controller('admin/docs_O.php', 'addons/payment_system/admin/docs_O.php', EVENT_PRE);
cw_addons_set_template(array('post', 'main/docs/notes.tpl@doc_process_buttons', 'addons/payment_system/admin/doc_process_buttons.tpl'));
cw_event_listen('on_sessions_delete', 'cw_payment_data_delete');
<?php

if (APP_AREA == 'customer') {
    cw_set_controller('customer/ajax_product_search.php', 'addons/ajax_search/customer/ajax_search.php', EVENT_REPLACE);
    cw_addons_set_template(array('post', 'js/presets_js.tpl', 'addons/ajax_search/ajax_search.tpl'));
    cw_addons_add_js('addons/ajax_search/ajax_search.js');
    cw_addons_add_css('addons/ajax_search/ajax_search.css');
}
<?php

$tables['linked_products'] = 'cw_linked_products';
require $app_main_dir . '/addons/accessories/func.php';
require $app_main_dir . '/addons/accessories/func.hooks.php';
if (APP_AREA == 'admin') {
    cw_addons_set_controllers(array('pre', 'include/products/modify.php', 'addons/accessories/product_modify_accessories.php'));
    cw_addons_set_hooks(array('post', 'cw_tabs_js_abstract', 'cw_ac_tabs_js_abstract'));
    cw_set_hook('cw_product_clone', 'cw_ac_product_clone', EVENT_POST);
    cw_set_hook('cw_delete_product', 'cw_ac_delete_product', EVENT_POST);
}
if (APP_AREA == 'customer') {
    //cw_addons_add_js('addons/accessories/func.js');
    cw_addons_set_controllers(array('post', 'customer/product.php', 'addons/accessories/product_accessories.php'));
    cw_set_controller('customer/product.php', 'addons/accessories/rv_product.php', EVENT_POST);
    cw_set_controller('customer/cart.php', 'addons/accessories/rv_products_list.php', EVENT_POST);
    cw_set_controller('customer/cart.php', 'addons/accessories/cab_products_list.php', EVENT_POST);
    cw_addons_set_template(array('post', 'customer/cart/cart.tpl', 'addons/accessories/cart_recently_viewed_products.tpl'), array('post', 'customer/cart/cart.tpl', 'addons/accessories/cab_products_list.tpl'));
    cw_addons_set_hooks(array('post', 'cw_tabs_js_abstract', 'cw_ac_tabs_js_abstract'));
    // Integration with ajax_add2cart addon {
    if (defined('IS_AJAX') && constant('IS_AJAX')) {
        cw_event_listen('on_add_cart', 'cw_ac_on_add_to_cart');
        cw_addons_set_template(array('post', 'addons/ajax_add2cart/add2cart_popup.tpl', 'addons/accessories/add2cart_popup.tpl'));
    }
    // } Integration with ajax_add2cart addon
    cw_addons_add_css('addons/accessories/accessories.css');
}
<?php

$tables['products_reviews_reminder'] = 'cw_products_reviews_reminder';
$tables['products_reviews_ratings'] = 'cw_products_reviews_ratings';
$tables['products_reviews_rating_types'] = 'cw_products_reviews_rating_types';
$cw_allowed_tunnels[] = 'cw_review_get_quick_global_info';
cw_include('addons/estore_products_review/include/func.review.php');
# kornev, TOFIX - move all of the css from general
cw_addons_add_css('addons/estore_products_review/general.css');
cw_addons_add_js('addons/estore_products_review/js/jquery.raty.min.js');
cw_addons_set_controllers(array('post', 'customer/product.php', 'addons/estore_products_review/customer/product.php'), array('replace', 'customer/top_rated.php', 'addons/estore_products_review/customer/top_rated.php'), array('replace', 'customer/estore_testimonials.php', 'addons/estore_products_review/customer/testimonials.php'), array('replace', 'admin/estore_stop_list.php', 'addons/estore_products_review/admin/estore_stop_list.php'), array('replace', APP_AREA . '/estore_reviews_management.php', 'addons/estore_products_review/' . APP_AREA . '/reviews_management.php'), array('replace', APP_AREA . '/estore_review_management.php', 'addons/estore_products_review/' . APP_AREA . '/review_management.php'), array('replace', 'admin/estore_execute_doc_action.php', 'addons/estore_products_review/admin/doc_action.php'), array('replace', 'customer/global_reviews.php', 'addons/estore_products_review/customer/global_reviews.php'));
cw_set_controller('customer/review_vote.php', 'addons/estore_products_review/customer/review_vote.php', EVENT_REPLACE);
if (APP_AREA == 'admin') {
    cw_addons_set_controllers(array('post', 'include/orders/order.php', 'addons/estore_products_review/admin/order.php'));
}
cw_set_hook('cw_delete_product', 'cw_review_delete_product', EVENT_POST);
# kornev, select rating to show it on the category page
cw_addons_set_hooks(array('post', 'cw_product_search', 'cw_review_product_search'), array('post', 'cw_product_get', 'cw_review_product_get'), array('post', 'cw_product_filter_get_slider_value', 'cw_review_product_filter_get_slider_value'), array('pre', 'cw_cron_get_targets', 'cw_review_prepare_and_send_reminder'), array('post', 'cw_attributes_delete', 'cw_review_delete_product_votes'), array('post', 'cw_attributes_get_types', 'cw_review_attributes_get_types'));
cw_addons_set_template(array('replace', 'main/attributes/show.tpl', 'addons/estore_products_review/main/attributes/show.tpl', 'cw_review_is_rating_attribute'), array('post', 'help/menu-list.tpl', 'addons/estore_products_review/menu-list.tpl'), array('replace', 'customer/help/estore_testimonials.tpl', 'addons/estore_products_review/testimonials.tpl'), array('replace', 'admin/main/estore_stop_list.tpl', 'addons/estore_products_review/admin_stop_list.tpl'), array('replace', 'admin/main/estore_reviews_management.tpl', 'addons/estore_products_review/admin_reviews_management.tpl'), array('replace', APP_AREA . '/main/estore_review_management.tpl', 'addons/estore_products_review/' . APP_AREA . '_review_management.tpl'), array('post', 'main/docs/additional_actions.tpl', 'addons/estore_products_review/additional_doc_action.tpl'), array('post', 'main/docs/additional_search_field.tpl', 'addons/estore_products_review/additional_doc_search_field.tpl'), array('replace', 'customer/main/global_reviews.tpl', 'addons/estore_products_review/global_reviews.tpl'));
cw_event_listen('on_prepare_search_orders', 'cw_review_prepare_search_orders');
cw_set_hook('cw_web_get_product_layout_elements', 'cw_review_get_product_layout_elements');
cw_set_hook('cw_doc_get', 'cw_review_doc_get');
<?php

cw_include('addons/mailchimp_subscription/include/MCAPI.class.php');
cw_include('addons/mailchimp_subscription/include/func.mailchimp.php');
cw_set_controller('include/settings.php', 'addons/mailchimp_subscription/admin/settings.php', EVENT_PRE);
cw_addons_set_hooks(array('pre', 'cw_payment_run_processor', 'cw_post_mailchimp_subscribe'));
cw_addons_set_template(array('post', 'customer/checkout/notes.tpl', 'addons/mailchimp_subscription/mailchimp_subscription.tpl'));
/*
 * Vendor:	CW
 * addon:	catalog_product
 * description:	
 *  New product type "Catalog" means that product is only listed on this site but can be bought on another site
 *  For this type of products the URL to real shop is required
 *  This product has special "buy" button in customer area, which may differ by appearance and text from normal products. For example it cat say "Buy from artist's site"
 *  Statistic about redirections to target site can be gathered as add_to_cart statistic (see "New statistic couner" spec)
 *  "Report as sold" feature is for this type of products only
 */
namespace CW\catalog_product;

const addon_name = 'catalog_product';
const addon_target = '';
const addon_version = '0.3';
define('PRODUCT_TYPE_CATALOG', 4);
cw_include('addons/' . addon_name . '/func.php');
if (APP_AREA == 'admin' && $target == 'products') {
    // Hook product modify to require Original URL attr for catalog product type
    cw_set_hook('cw_error_check', 'CW\\catalog_product\\cw_error_check', EVENT_POST);
    // Hook product modify to hide Original URL attr for other product types
    cw_addons_set_hooks(array('post', 'cw_attributes_get', 'CW\\catalog_product\\cw_attributes_get'));
}
if (APP_AREA == 'customer') {
    // Hook special catalog_redirect controller to redirect to original_url
    cw_set_controller('customer/catalog_redirect.php', 'addons/' . addon_name . '/customer/catalog_redirect.php', EVENT_REPLACE);
    cw_set_controller('customer/product.php', 'addons/' . addon_name . '/customer/product.php', EVENT_POST);
    cw_set_controller('customer/report_about_sold.php', 'addons/' . addon_name . '/customer/report_about_sold.php', EVENT_REPLACE);
    // hook for add_to_cart button to replace form, text and action
    cw_addons_set_template(array('pre', 'buttons/add_to_cart.tpl', 'addons/' . addon_name . '/add_to_cart.tpl', 'CW\\catalog_product\\cw_is_catalog_product'), array('pre', 'buttons/buy_now.tpl', 'addons/' . addon_name . '/buy_now.tpl', 'CW\\catalog_product\\cw_is_catalog_product'), array('replace', 'customer/products/product-amount.tpl', '', 'CW\\catalog_product\\cw_is_catalog_product'), array('pre', 'customer/products/product-fields.tpl', 'addons/' . addon_name . '/report_as_sold.tpl'));
}
<?php

if (APP_AREA == 'admin') {
    cw_addons_set_controllers(array('replace', 'admin/sitemap_xml.php', 'addons/sitemap_xml/admin/sitemap_xml.php'), array('replace', 'admin/cron_sitemap_xml.php', 'addons/sitemap_xml/cron/cron_sitemap_xml.php'));
    cw_addons_set_template(array('replace', 'admin/sitemap_xml/sitemap_xml.tpl', 'addons/sitemap_xml/sitemap_xml.tpl'));
}
if (APP_AREA == 'customer' && $target == 'sitemap') {
    cw_set_controller('customer/sitemap.php', 'addons/sitemap_xml/customer/sitemap.php', EVENT_REPLACE);
}
if (APP_AREA == 'cron') {
    cw_include('addons/sitemap_xml/include/func.php');
    cw_set_controller('init/abstract.php', 'addons/sitemap_xml/include/abstract.php', EVENT_POST);
}
function cw_addons_set_controllers()
{
    global $ars_hooks;
    $params = func_get_args();
    if (is_array($params)) {
        foreach ($params as $v) {
            $ars_hooks['incl'][$v[1]][$v[0]][] = $v[2];
            // Duplicate hook for new notation so it can be also called thru cw_include()
            $type = $v[0] == 'replace' ? EVENT_REPLACE : ($v[0] == 'pre' ? EVENT_PRE : EVENT_POST);
            cw_set_controller($v[1], $v[2], $type);
        }
    }
}
cw_event_listen('on_collect_discounts', 'cw_ps_on_collect_discounts');
// Function adds offer discounts applied to a product in cart
cw_event_listen('on_product_from_scratch', 'cw_apply_special_offer_discount');
/* Hooks for coupon bonus */
cw_event_listen('on_place_order_extra', 'cw_ps_on_place_order_extra');
// CMS
cw_event_listen('on_cms_check_restrictions', 'cw_ps_on_cms_check_restrictions_PS');
// cw_delete_from_cart
// $product_id = cw_delete_from_cart($cart, $productindex);
if (APP_AREA == 'admin') {
    cw_addons_set_controllers(array('replace', 'admin/promosuite.php', 'addons/promotion_suite/admin/promosuite.php'), array('replace', 'admin/discount_bundles.php', 'addons/promotion_suite/admin/discount_bundles.php'), array('post', 'include/auth.php', 'addons/promotion_suite/include/auth.php'));
    cw_set_controller('include/products/modify.php', 'addons/promotion_suite/admin/product_modify.php', EVENT_PRE);
    cw_addons_set_hooks(array('post', 'cw_tabs_js_abstract', 'cw_ps_tabs_js_abstract'));
    cw_addons_set_template(array('replace', 'admin/main/promosuite.tpl', 'addons/promotion_suite/admin/main.tpl'), array('replace', 'admin/main/discount_bundles.tpl', 'addons/promotion_suite/admin/discount_bundles.tpl'));
    if ($target == 'cms') {
        cw_addons_set_template(array('pre', 'main/attributes/object_modify.tpl', 'addons/promotion_suite/addons/cms/cms_details.tpl'));
        cw_event_listen('on_cms_update', 'cw_ps_on_cms_update');
        cw_set_controller('addons/cms/cs_banner.php', 'addons/promotion_suite/addons/cms/cs_banner.php', EVENT_POST);
        cw_set_controller('addons/cms/cs_banners.php', 'addons/promotion_suite/addons/cms/cs_banner.php', EVENT_POST);
    }
    cw_addons_add_css('addons/promotion_suite/admin/promosuite.css');
}
if (APP_AREA == 'customer') {
    cw_addons_add_css('addons/promotion_suite/customer/promosuite.css');
    cw_addons_set_hooks(array('post', 'cw_tabs_js_abstract', 'cw_ps_tabs_js_abstract'));
}
/* PS tables */
$_addon_tables = array('ps_offers', 'ps_conditions', 'ps_bonuses', 'ps_offer_images', 'ps_bonus_details', 'ps_cond_details');
foreach ($_addon_tables as $_table) {
    $tables[$_table] = 'cw_' . $_table;
}
<?php

// @TODO: remove second condition after ajax product_filter rework
if (APP_AREA == 'customer' && (!defined('IS_AJAX') && $target != 'image' || isset($ajax_filter) && $ajax_filter && defined('IS_AJAX') && $target != 'image')) {
    cw_include('addons/top_menu/func.php');
    cw_set_controller('customer/auth.php', 'addons/top_menu/cust.php', EVENT_POST);
    cw_addons_set_template(array('replace', 'customer/top_categories.tpl', 'addons/top_menu/menu.tpl'));
    cw_addons_add_js('jquery/jquery.ui.potato.menu.js');
    cw_addons_add_css('jquery/jquery.ui.potato.menu.css');
    cw_addons_add_css('menu.css');
    cw_addons_add_css('addons/top_menu/menu.css');
}
if (APP_AREA == 'admin' && $target == 'top_menu') {
    cw_include('addons/top_menu/func.php');
    cw_set_controller('admin/top_menu.php', 'addons/top_menu/admin/top_menu.php', EVENT_REPLACE);
    cw_addons_set_template(array('replace', 'admin/products/top_menu.tpl', 'addons/top_menu/admin_main.tpl'));
}
$tables['top_menu_user_categories'] = 'cw_top_menu_user_categories';
// TODO: register on_category_delete handler, otherwise cw_top_menu_user_categories will have orphaned links
    if (!file_exists($app_main_dir . '/seller')) {
        // There is no symlink /core/seller, map all files explicitly
        if (!($addon_hooks = cw_cache_get('seller', 'addon_hooks')) || defined('DEV_MODE')) {
            $addon_hooks = array();
            $files = cw_files_get_dir($app_main_dir . '/addons/seller/core', 1, false);
            foreach ($files as $file) {
                if (strpos($file, '.php') !== false) {
                    $file = str_replace($app_main_dir . '/addons/seller/core/', '', $file);
                    $addon_hooks[] = $file;
                }
            }
            cw_cache_save($addon_hooks, 'seller', 'addon_hooks');
        }
        foreach ($addon_hooks as $h) {
            cw_set_controller("seller/{$h}", 'addons/' . seller_addon_name . "/core/{$h}", EVENT_REPLACE);
        }
    } else {
        // Symlink is used, everything mapped by filesystem
    }
    cw_set_controller(APP_AREA . '/products_clients.php', 'admin/products_clients.php', EVENT_REPLACE);
    cw_set_controller(APP_AREA . '/products.php', 'addons/' . seller_addon_name . '/core/search.php', EVENT_PRE);
    cw_addons_set_hooks(array('pre', 'cw_product_search', 'cw_seller_product_search'), array('replace', 'cw_auth_check_security_targets', 'cw_seller_auth_check_security_targets'));
    cw_addons_set_template(array('replace', APP_AREA . '/main/main.tpl', 'addons/' . seller_addon_name . '/main/main.tpl'), array('replace', 'elements/auth_admin.tpl', 'addons/' . seller_addon_name . '/elements/auth.tpl'), array('replace', 'main/products/search_form.tpl', 'addons/' . seller_addon_name . '/products/search_form.tpl'), array('replace', 'menu/items.tpl', 'addons/' . seller_addon_name . '/menu/items.tpl'), array('replace', APP_AREA . '/products/product_modify.tpl', 'addons/' . seller_addon_name . '/products/product_modify.tpl'), array('replace', APP_AREA . '/products/product_add.tpl', 'addons/' . seller_addon_name . '/products/product_add.tpl'), array('replace', APP_AREA . '/products/search.tpl', 'addons/' . seller_addon_name . '/products/search.tpl'), array('replace', APP_AREA . '/products/customers.tpl', 'admin/products/customers.tpl'), array());
    // Orders
    cw_addons_set_template(array('replace', APP_AREA . '/orders/orders.tpl', 'admin/orders/orders.tpl'), array('replace', APP_AREA . '/orders/document.tpl', 'admin/orders/document.tpl'), array('replace', 'main/docs/notes.tpl', 'addons/' . seller_addon_name . '/orders/notes.tpl'));
    // Profile
    cw_addons_set_template(array('replace', 'main/users/sections/basic.tpl', 'addons/' . seller_addon_name . '/sections/basic.tpl'), array('replace', APP_AREA . '/acc_manager/acc_manager.tpl', 'addons/' . seller_addon_name . '/acc_manager/acc_manager.tpl'), array('replace', APP_AREA . '/acc_manager/modify.tpl', 'addons/' . seller_addon_name . '/acc_manager/modify.tpl'), array());
    if ($target == 'products' && $mode == 'details') {
        cw_addons_set_template(array('replace', 'main/select/availability.tpl', 'addons/' . seller_addon_name . '/main/select/availability.tpl', 'cw_seller_product_is_pending'));
    }
}
<?php

$tables['domains'] = 'cw_domains';
$tables['domains_config'] = 'cw_domains_config';
cw_include('addons/multi_domains/include/func.md.php');
cw_addons_set_controllers(array('replace', 'admin/domains.php', 'addons/multi_domains/admin/domains.php'), array('post', 'init/abstract.php', 'addons/multi_domains/init/domains.php'), array('post', 'include/auth.php', 'addons/multi_domains/include/auth.php'));
if ($target != 'image') {
    cw_set_controller('init/post_init.php', 'addons/multi_domains/init/get_host_data.php', EVENT_POST);
    cw_set_controller('init/post_init.php', 'addons/multi_domains/post_init.php', EVENT_POST);
}
cw_set_hook('cw_core_get_config', 'cw_md_core_get_config', EVENT_POST);
cw_set_hook('cw_attributes_save', 'cw_md_attributes_save', EVENT_POST);
// additional function for the category attributes
cw_addons_set_hooks(array('pre', 'cw_product_search', 'cw_md_product_search'), array('pre', 'cw_category_search', 'cw_md_category_search'), array('pre', 'cw_manufacturer_search', 'cw_md_manufacturer_search'), array('pre', 'cw_pages_search', 'cw_md_pages_search'), array('pre', 'cw_speed_bar_search', 'cw_md_speed_bar_search'), array('pre', 'cw_shipping_search', 'cw_md_shipping_search'), array('pre', 'cw_payment_search', 'cw_md_payment_search'), array('pre', 'cw_product_get', 'cw_md_product_search'), array('pre', 'cw_category_get', 'cw_md_category_search'), array('pre', 'cw_manufacturer_get', 'cw_md_manufacturer_search'), array('pre', 'cw_pages_get', 'cw_md_pages_search'), array('pre', 'cw_doc_place_order', 'cw_md_doc_place_order'), array('post', 'cw_code_get_template_dir', 'cw_md_code_get_template_dir'));
if (APP_AREA == 'admin') {
    cw_event_listen('on_prepare_search_orders', 'cw_md_prepare_search_orders');
    cw_set_hook('cw_send_mail', 'cw_md_send_mail', EVENT_PRE);
    // This hook adds altskin as source of email templates
    cw_set_hook('cw_spam', 'cw_md_send_mail', EVENT_PRE);
    cw_addons_set_template(array('pre', 'main/docs/additional_search_field.tpl', 'addons/multi_domains/admin/additional_domain_selector.tpl'), array('post', 'common/navigation_counter.tpl', 'addons/multi_domains/common/current_domain_warning.tpl'));
}
if (APP_AREA == 'customer') {
    # kornev, languages per domain
    cw_addons_set_controllers(array('pre', 'init/lng.php', 'addons/multi_domains/init/lng.php'), array('pre', 'customer/referer.php', 'addons/multi_domains/customer/referer.php'));
    cw_addons_set_hooks(array('replace', 'cw_core_get_available_languages', 'cw_md_get_available_languages'));
}
cw_addons_set_template(array('post', 'main/attributes/default_types.tpl', 'addons/multi_domains/types/domain-selector.tpl'), array('post', 'common/top-filters.tpl', 'addons/multi_domains/common/top-filters.tpl'));
cw_addons_add_css('addons/multi_domains/general.css', 'A');
$tables['product_video'] = 'cw_product_video';
// Include functions
cw_include('addons/' . addon_name . '/include/func.php');
/*
// You can define different hooks depending on area or $target or use common init sequence. 
if (APP_AREA == 'admin') {
    // Define own controller which does not exists yet using EVENT_REPLACE
     cw_set_controller(APP_AREA.'/'.addon_target.'.php','addons/'.addon_name.'/admin/'.addon_target.'.php', EVENT_REPLACE);
}
if (APP_AREA == 'customer') {
    // Add own controller to existing one using EVENT_POST or EVENT_PRE
     cw_set_controller(APP_AREA.'/index.php','addons/'.addon_name.'/customer/index.php', EVENT_POST);
}
*/
cw_set_controller('include/products/modify.php', 'addons/' . addon_name . '/admin/product.php', EVENT_PRE);
cw_set_controller('customer/product.php', 'addons/' . addon_name . '/customer/product.php', EVENT_PRE);
/*
// Event handlers
cw_event_listen('on_login','cw\\'.addon_name.'\\on_login'); // specify full function name for event handlers including namespace
*/
// Function hooks
cw_set_hook('cw_delete_product', 'cw\\' . addon_name . '\\cw_delete_product', EVENT_POST);
cw_set_hook('cw_product_clone', 'cw\\' . addon_name . '\\cw_product_clone', EVENT_POST);
cw_addons_set_hooks(array('post', 'cw_tabs_js_abstract', 'cw\\' . addon_name . '\\cw_tabs_js_abstract'));
/*
// Hook templates
cw_addons_set_template(
    array('replace','admin/main/'.addon_target.'.tpl', 'addons/'.addon_name.'/admin/'.addon_target.'.tpl'),
    array('post', 'elements/bottom.tpl', 'addons/'.addon_name.'/customer/my_bottom.tpl'),
    array('pre', 'elements/bottom_admin.tpl', 'addons/'.addon_name.'/admin/my_bottom_admin.tpl')
);
<?php

# faq
$tables['faq_comments'] = 'cw_faq_comments';
$tables['faq_questions'] = 'cw_faq_questions';
$tables['faq_questions_lng'] = 'cw_faq_questions_lng';
$tables['faq_rubrik'] = 'cw_faq_rubrik';
$tables['faq_rubrik_parents'] = 'cw_faq_rubrik_parents';
$tables['faq_rubrik_count'] = 'cw_faq_rubrik_count';
$tables['faq_visits'] = 'cw_faq_visits';
$tables['faq_voting'] = 'cw_faq_voting';
$tables['faq_files'] = 'cw_faq_files';
$var_dirs['faq'] = $app_dir . '/files/faq';
$var_dirs_web['faq'] = '/files/faq';
cw_set_controller('customer/faq.php', 'addons/faq/customer/faq.php', EVENT_REPLACE);
cw_set_controller('customer/faq_membership.php', 'addons/faq/customer/faq_membership.php', EVENT_REPLACE);
cw_set_controller('customer/faq_printing.php', 'addons/faq/customer/faq_printing.php', EVENT_REPLACE);
cw_set_controller('customer/faq_popup.php', 'addons/faq/customer/faq_popup.php', EVENT_REPLACE);
cw_set_controller('salesman/faq.php', 'addons/faq/salesman/faq.php', EVENT_REPLACE);
cw_set_controller('salesman/faq_printing.php', 'addons/faq/salesman/faq_printing.php', EVENT_REPLACE);
cw_set_controller('salesman/faq_popup.php', 'addons/faq/salesman/faq_popup.php', EVENT_REPLACE);
cw_set_controller('admin/faq.php', 'addons/faq/admin/faq.php', EVENT_REPLACE);
$tpls_repl = array('admin/faq/categories.tpl', 'admin/faq/category.tpl', 'admin/faq/question.tpl', 'admin/faq/questions.tpl', 'customer/faq.tpl', 'main/faq/add_comment.tpl', 'main/faq/article.tpl', 'main/faq/ask.tpl', 'main/faq/printing.tpl', 'main/faq/product_article.tpl', 'main/faq/product.tpl', 'main/faq/send2friend.tpl');
foreach ($tpls_repl as $tpl_repl) {
    cw_addons_set_template(array('replace', $tpl_repl, 'addons/faq/' . $tpl_repl));
}
cw_addons_add_css('addons/faq/faq.css');
<?php

/*
 * Vendor: CW
 * addon: bookmarks
 */
namespace CW\bookmarks;

const addon_name = 'bookmarks';
const addon_target = 'bookmarks';
$tables['bookmarks'] = 'cw_bookmarks';
if (APP_AREA != 'admin') {
    return true;
}
cw_include('addons/' . addon_name . '/func.php');
if ($target == addon_target) {
    cw_set_controller(APP_AREA . '/' . addon_target . '.php', 'addons/' . addon_name . '/' . addon_target . '.php', EVENT_REPLACE);
}
cw_addons_set_template(array('post', 'elements/bottom.tpl', 'addons/' . addon_name . '/bookmarks.tpl'), array('post', 'elements/bottom_admin.tpl', 'addons/' . addon_name . '/bookmarks.tpl'));
cw_event_listen('on_login', 'CW\\bookmarks\\on_login');
cw_event_listen('on_customer_delete', 'CW\\bookmarks\\on_customer_delete');
cw_event_listen('on_sessions_delete', 'CW\\bookmarks\\on_sessions_delete');
cw_addons_add_css('addons/' . addon_name . '/bookmarks.css');
cw_addons_add_js('addons/' . addon_name . '/bookmarks.js');
cw_set_controller('addons/mobile/init/mobile.php', 'addons/' . addon_name . '/addons/mobile.php', EVENT_POST);
<?php

$cw_allowed_tunnels[] = 'cw_shipping_search';
$cw_allowed_tunnels[] = 'cw_shipping_doc_trackable';
cw_include('addons/shipping_system/include/func.shipping.php');
cw_addons_add_css('addons/shipping_system/css/main.css');
cw_addons_set_controllers(array('replace', 'admin/shipping_carriers.php', 'addons/shipping_system/admin/shipping_carriers.php'), array('replace', 'admin/cod_types.php', 'addons/shipping_system/admin/cod_types.php'), array('replace', 'admin/shipping_zones.php', 'addons/shipping_system/admin/shipping_zones.php'), array('replace', 'admin/shipping.php', 'addons/shipping_system/admin/shipping.php'), array('replace', 'admin/shipping_rates.php', 'addons/shipping_system/admin/shipping_rates.php'), array('post', 'include/orders/order_edit.php', 'addons/shipping_system/include/orders/order_edit.php'), array('replace', 'customer/popup-shipping.php', 'addons/shipping_system/customer/popup-shipping.php'));
cw_addons_set_hooks(array('post', 'cw_checkout_login_prepare', 'cw_shipping_checkout_login_prepare'), array('pre', 'cw_cart_actions', 'cw_shipping_cart_actions'), array('post', 'cw_cart_get_warehouses_cart', 'cw_shipping_cart_get_warehouses_cart'), array('post', 'cw_cart_calc_single', 'cw_shipping_cart_calc_single'), array('pre', 'cw_cart_summarize', 'cw_shipping_cart_summarize'), array('post', 'cw_product_get', 'cw_shipping_product_get'));
cw_addons_set_template(array('pre', 'customer/cart/totals.tpl', 'addons/shipping_system/customer/cart/totals.tpl'), array('post', 'customer/checkout/shipping_methods.tpl', 'addons/shipping_system/customer/checkout/shipping_methods.tpl'), array('post', 'customer/products/product-fields.tpl', 'addons/shipping_system/customer/products/product-fields.tpl'), array('replace', 'customer/products/estimate-fields.tpl', 'addons/shipping_system/customer/products/product-fields.tpl'), array('post', 'customer/products/products-info.tpl', 'addons/shipping_system/customer/products/shipping_estimator.tpl'), array('post', 'customer/products/our_price.tpl', 'addons/shipping_system/customer/products/free-shipping.tpl'));
if (APP_AREA == 'customer') {
    cw_addons_add_js('addons/shipping_system/js/dialog.js');
    cw_set_controller('customer/shipping_estimator.php', 'addons/shipping_system/customer/shipping_estimator.php', EVENT_REPLACE);
    cw_set_controller('customer/order_tracking.php', 'addons/shipping_system/customer/order_tracking.php', EVENT_REPLACE);
    cw_addons_set_template(array('post', 'customer/products/product.tpl', 'addons/shipping_system/customer/products/estimate.tpl'), array('post', 'customer/products/subcategories.tpl', 'addons/shipping_system/customer/products/estimate.tpl'));
}
<?php

define('CHECK_UNIQ_ID', true);
// Check or not the uniqueness of gift certificate ID
$tables['wishlist'] = 'cw_wishlist';
$tables['giftreg_events'] = 'cw_giftreg_events';
$tables['giftreg_maillist'] = 'cw_giftreg_maillist';
$tables['giftreg_guestbooks'] = 'cw_giftreg_guestbooks';
cw_include('addons/estore_gift/include/func.gift.php');
cw_addons_set_controllers(array('replace', 'admin/giftcerts.php', 'addons/estore_gift/admin/giftcerts.php'), array('replace', 'customer/gifts.php', 'addons/estore_gift/customer/gifts.php'), array('pre', 'customer/cart.php', 'addons/estore_gift/customer/cart.php'));
cw_addons_set_template(array('post', 'customer/cart/content.tpl', 'addons/estore_gift/content.tpl'));
cw_addons_set_hooks(array('post', 'cw_payment_get_methods', 'cw_gift_payment_get_methods'), array('post', 'cw_payment_run_processor', 'cw_gift_payment_run_processor'));
cw_set_hook('cw_delete_product', 'cw_gift_delete_product', EVENT_POST);
cw_set_hook('cw_doc_update_item', 'cw_gift_doc_update_item', EVENT_PRE);
cw_set_hook('cw_doc_update', 'cw_gift_doc_update', EVENT_POST);
if (APP_AREA == 'customer') {
    cw_event_listen('on_cart_menu_build', 'cw_gift_get_menu_list');
    cw_event_listen('on_login', 'cw_gift_on_login');
}
if (APP_AREA == 'admin') {
    cw_set_controller('admin/giftcert_user_data.php', 'addons/estore_gift/admin/giftcert_user_data.php', EVENT_REPLACE);
}
<?php

/*
 * Vendor:	CW
 * addon:	wordpress
 * description:	
 *  addon prepares dynamic layout elements for 3-rd party software, such as heade, minicart, footer
 */
namespace CW\wordpress;

const addon_namespace = 'CW\\wordpress';
const addon_name = 'wordpress';
if (APP_AREA == 'customer') {
    cw_include('addons/' . addon_name . '/func.php');
    cw_set_controller('customer/' . addon_name . '.php', 'addons/' . addon_name . '/elements.php', EVENT_REPLACE);
}
<?php

if (APP_AREA == 'customer') {
    cw_set_controller('customer/index.php', 'addons/google_remarketing/customer/google_remarketing.php', EVENT_POST);
    cw_set_controller('customer/product.php', 'addons/google_remarketing/customer/google_remarketing.php', EVENT_POST);
    cw_set_controller('customer/cart.php', 'addons/google_remarketing/customer/google_remarketing.php', EVENT_POST);
    cw_addons_set_template(array('post', 'elements/bottom.tpl', 'addons/google_remarketing/google_remarketing.tpl'));
}
<?php

/*
 * Vendor: cw
 * addon: linkedin_login
 */
/*
 * init.php
 * this file only defines constants, variables, functinos, hooks and event hanlers
 * no real routine must be here on init stage
 */
// Use namespace for your own addon as vendor\addon_name
//namespace cw\linkedin_login;
// Constants definition
// these constants are defined in scope of addon's namespace
//const addon_name    = 'linkedin_login';
// Include functions
cw_include('addons/linkedin_login/include/func.php');
if (APP_AREA == 'customer') {
    cw_set_controller('include/check_useraccount.php', 'addons/linkedin_login/post_init.php', EVENT_POST);
    cw_set_controller(APP_AREA . '/login_with_linkedin.php', 'addons/linkedin_login/customer/login_with_linkedin.php', EVENT_REPLACE);
    cw_event_listen('on_logout', 'cw_linkedin_on_logout');
    cw_addons_set_template(array('post', 'buttons/social_media_panel.tpl', 'addons/linkedin_login/customer/auth-button.tpl'));
}
// Use namespace for your own addon as vendor\addon_name
namespace cw\product_stages;

// Constants definition
// these constants are defined in scope of addon's namespace
const addon_name = 'product_stages';
const addon_target = 'product_stages';
// Main target of addon, useful but of course addon can handle several targets
$cw_allowed_tunnels[] = 'cw\\' . addon_name . '\\cw_product_stages_get_doc_stages_history';
// New tables definition
$tables['product_stages_library'] = 'cw_product_stages_library';
$tables['product_stages_product_settings'] = 'cw_product_stages_product_settings';
$tables['docs_statuses_log'] = 'cw_docs_statuses_log';
$tables['product_stages_process_log'] = 'cw_product_stages_process_log';
// Include functions
cw_include('addons/' . addon_name . '/include/func.php');
// You can define different hooks depending on area or $target or use common init sequence.
if (APP_AREA == 'admin') {
    // Define own controller which does not exists yet using EVENT_REPLACE
    cw_set_controller(APP_AREA . '/' . addon_target . '.php', 'addons/' . addon_name . '/admin/' . addon_target . '.php', EVENT_REPLACE);
    cw_set_controller('include/products/modify.php', 'addons/' . addon_name . '/admin/include/products/modify.php', EVENT_POST);
    cw_set_controller('include/products/modify.php', 'addons/' . addon_name . '/admin/include/products/modify.php', EVENT_PRE);
    cw_set_controller(APP_AREA . '/stage_email_test.php', 'addons/' . addon_name . '/admin/stage_email_test.php', EVENT_REPLACE);
}
cw_addons_set_hooks(array('post', 'cw_tabs_js_abstract', 'cw\\' . addon_name . '\\cw_product_stages_tabs_js_abstract'));
// Cron handlers. See docs/core.cron.txt and core/cron/cron.php
cw_event_listen('on_cron_daily', 'cw\\' . addon_name . '\\on_cron_daily');
cw_event_listen('on_doc_change_status', 'cw\\' . addon_name . '\\cw_product_stages_on_doc_change_status');
// Hook templates
cw_addons_set_template(array('replace', 'admin/main/' . addon_target . '.tpl', 'addons/' . addon_name . '/admin/' . addon_target . '.tpl'));
cw_addons_set_template(array('replace', 'admin/main/stage_email_test.tpl', 'addons/' . addon_name . '/admin/stage_email_test.tpl'));
<?php

/*
 * Vendor: cw
 * addon: mslive_login
 */
/*
 * init.php
 * this file only defines constants, variables, functinos, hooks and event hanlers
 * no real routine must be here on init stage
 */
// Use namespace for your own addon as vendor\addon_name
//namespace cw\mslive_login;
// Constants definition
// these constants are defined in scope of addon's namespace
//const addon_name    = 'mslive_login';
// Include functions
cw_include('addons/mslive_login/include/func.php');
if (APP_AREA == 'customer') {
    cw_set_controller('include/check_useraccount.php', 'addons/mslive_login/post_init.php', EVENT_POST);
    cw_set_controller(APP_AREA . '/mslive_login.php', 'addons/mslive_login/customer/mslive_login.php', EVENT_REPLACE);
    cw_event_listen('on_logout', 'cw_mslive_on_logout');
    cw_addons_set_template(array('post', 'buttons/social_media_panel.tpl', 'addons/mslive_login/customer/auth-button.tpl'));
}
<?php

/*
 * Vendor: CW
 * addon: Feedback report
 */
const feedback_addon_name = 'feedback_report';
const feedback_our_email_to_send = '*****@*****.**';
const feedback_files_folder_name = 'feedback';
const feedback_image_type = 'jpeg';
// png/jpeg (also need change type in feedback.min.js and html2canvas.min.js)
cw_include('addons/' . feedback_addon_name . '/include/func.feedback.php');
cw_event_listen('on_build_var_dirs', 'cw_fbr_build_var_dirs');
cw_event_listen('on_log_add', 'cw_fbr_log_add');
cw_set_controller(APP_AREA . '/save_feedback_data.php', 'addons/' . feedback_addon_name . '/common/save_feedback_data.php', EVENT_REPLACE);
cw_set_controller('init/numbers.php', 'addons/' . feedback_addon_name . '/common/error_handler.php', EVENT_POST);
cw_set_controller('customer/feedback.php', 'addons/' . feedback_addon_name . '/common/feedback.php', EVENT_REPLACE);
cw_event_listen('on_cron_hourly', 'cw_fbr_prepare_and_send_feedbacks');
cw_addons_set_template(array('post', APP_AREA . '/elements/bottom_links.tpl', 'addons/' . feedback_addon_name . '/bottom_links.tpl'), array('post', 'customer/main/feedback_image.tpl', 'addons/' . feedback_addon_name . '/feedback_image.tpl'));
cw_addons_add_css('addons/' . feedback_addon_name . '/css/feedback.css');
cw_addons_add_js('addons/' . feedback_addon_name . '/js/feedback.min.js');
cw_addons_add_js('addons/' . feedback_addon_name . '/js/html2canvas.min.js');
// Register function which is allowed for call from smarty via {tunnel}
$cw_allowed_tunnels[] = 'cw\\addon_skeleton\\get_available_entries_list';
// Include functions
cw_include('addons/' . addon_name . '/include/func.php');
// Sometimes some part of initialization must be after all addons init - in post_init.php
cw_set_controller('init/post_init.php', 'addons/' . addon_name . '/post_init.php', EVENT_POST);
// You can define different hooks depending on area or $target or use common init sequence.
if (APP_AREA == 'admin') {
    // Define own controller which does not exists yet using EVENT_REPLACE
    /* Place comment here with description of functionality provided by this additional controller */
    cw_set_controller(APP_AREA . '/' . addon_target . '.php', 'addons/' . addon_name . '/admin/' . addon_target . '.php', EVENT_REPLACE);
}
if (APP_AREA == 'customer') {
    // Add own controller to existing one using EVENT_POST or EVENT_PRE
    /* Place comment here with description of functionality provided by this additional controller */
    cw_set_controller(APP_AREA . '/index.php', 'addons/' . addon_name . '/customer/index.php', EVENT_POST);
}
// Event handlers
/* Place comment here with description of functionality provided by this event handler */
cw_event_listen('on_login', 'cw\\' . addon_name . '\\on_login');
// specify full function name for event handlers including namespace
// Cron handlers. See docs/core.cron.txt and core/cron/cron.php
cw_event_listen('on_cron_daily', 'cw\\' . addon_name . '\\on_cron_daily');
// Function hooks. Note you can use same function name under scope of addon's namespace
/* Place comment here with description of functionality provided by this hook or how it alters default function */
cw_set_hook('cw_products_in_cart', 'cw\\' . addon_name . '\\cw_products_in_cart', EVENT_POST);
// Hook templates
cw_addons_set_template(array('replace', 'admin/main/' . addon_target . '.tpl', 'addons/' . addon_name . '/admin/' . addon_target . '.tpl'), array('post', 'elements/bottom.tpl', 'addons/' . addon_name . '/customer/my_bottom.tpl'), array('pre', 'elements/bottom_admin.tpl@label', 'addons/' . addon_name . '/admin/my_bottom_admin.tpl'));
// Add addon CSS style
cw_addons_add_css('addons/' . addon_name . '/my_addon.css');
// Add addon JS
<?php

/*
 * Vendor: CW
 * addon: ebay
 */
namespace CW\ebay;

const addon_name = 'ebay';
const addon_target = 'ebay_export';
const addon_version = '0.1';
const addon_files_location_path = 'files/ebay/';
const addon_conditions_data_file_name = 'ConditionIDs_by_Category.csv';
if (APP_AREA == 'admin' && $target == addon_target && !empty($addons[addon_name])) {
    $ebay_config = array('ebay_action' => 'Add', 'ebay_category' => 1, 'ebay_condition_id' => 1000, 'ebay_duration' => 1, 'ebay_format' => 'Auction (default)', 'ebay_immediate_pay_required' => 0, 'ebay_location' => '', 'ebay_paypal_accepted' => 0, 'ebay_paypal_email_address' => '', 'ebay_dispatch_time_max' => 1, 'ebay_returns_accepted_option' => 'ReturnsAccepted');
    cw_addons_set_controllers(array('replace', 'admin/' . addon_target . '.php', 'addons/' . addon_name . '/' . addon_target . '.php'));
    cw_include('addons/' . addon_name . '/func.php');
    cw_addons_set_template(array('replace', 'admin/main/ebay_export.tpl', 'addons/ebay/ebay_export.tpl'), array('replace', 'admin/import_export/ebay_export.tpl', 'addons/ebay/ebay_export.tpl'));
}
if (APP_AREA == 'admin') {
    cw_set_controller('admin/ajax_ebay_category_select.php', 'addons/ebay/ebay_attributes_modify.php', EVENT_REPLACE);
    cw_addons_set_template(array('post', 'main/attributes/default_types.tpl', 'addons/ebay/types/ebay_category_selector.tpl'));
    cw_addons_add_js('jquery/dynatree-1.2.4/jquery.dynatree.min.js');
    cw_addons_add_css('jquery/dynatree-1.2.4/ui.dynatree.css');
}
<?php

/*
 * Vendor: cw
 * addon: googleplus_login
 */
/*
 * init.php
 * this file only defines constants, variables, functinos, hooks and event hanlers
 * no real routine must be here on init stage
 */
// Use namespace for your own addon as vendor\addon_name
//namespace cw\googleplus_login;
// Constants definition
// these constants are defined in scope of addon's namespace
//const addon_name    = 'googleplus_login';
// Include functions
cw_include('addons/googleplus_login/include/func.php');
/*
if (APP_AREA == 'admin') {
    // Define own controller which does not exists yet using EVENT_REPLACE
     cw_set_controller(APP_AREA.'/'.addon_target.'.php','addons/'.addon_name.'/admin/'.addon_target.'.php', EVENT_REPLACE);
}
*/
if (APP_AREA == 'customer') {
    // Sometimes some part of initialization must be after all addons init - in post_init.php
    cw_set_controller('include/check_useraccount.php', 'addons/googleplus_login/post_init.php', EVENT_POST);
    cw_event_listen('on_logout', 'cw_googleplus_on_logout');
    cw_addons_set_template(array('post', 'buttons/social_media_panel.tpl', 'addons/googleplus_login/customer/auth-button.tpl'));
}
<?php

$tables['flexible_import_profiles'] = 'cw_flexible_import_profiles';
$tables['flexible_import_files'] = 'cw_flexible_import_files';
$var_dirs['flex_import_test'] = $app_dir . '/files/flex_import_test';
define("fi_files_path", "./files/flexible_import/");
global $csvxc_field_types;
$csvxc_field_types = array('PRICE' => "decimal(12,2) NOT NULL DEFAULT '0.00'", 'PRICE_MODIFIER' => "decimal(12,2) NOT NULL DEFAULT '0.00'", 'DESCR' => "text NOT NULL DEFAULT ''", 'FULLDESCR' => "text NOT NULL DEFAULT ''", 'PRODUCTID' => "int(11) NOT NULL DEFAULT '0'", 'PRODUCTID_TO' => "int(11) NOT NULL DEFAULT '0'", 'OPTIONID' => "int(11) NOT NULL DEFAULT '0'", 'CLASSID' => "int(11) NOT NULL DEFAULT '0'", 'ADD_DATE' => "int(11) NOT NULL DEFAULT '0'", 'WEIGHT' => "decimal(12,2) NOT NULL DEFAULT '0.00'", 'LIST_PRICE' => "decimal(12,2) NOT NULL DEFAULT '0.00'", 'AVAIL' => "int(11) NOT NULL DEFAULT '0'", 'MIN_AMOUNT' => "int(11) NOT NULL DEFAULT '0'", 'LOW_AVAIL_LIMIT' => "int(11) NOT NULL DEFAULT '0'", 'default' => "varchar(255) NOT NULL DEFAULT ''");
global $tmp_load_tables;
$tmp_load_tables = array('CATEGORIES' => array('CATEGORYID' => array('type' => 'int', 'key' => true), 'CATEGORY' => array('type' => 'text', 'key' => true), 'DESCR' => array('type' => 'longtext'), 'META_DESCR' => array('type' => 'longtext'), 'AVAIL' => array('type' => 'bool'), 'ORDERBY' => array('type' => 'int'), 'META_KEYWORDS' => array('type' => 'text'), 'ICON' => array('type' => 'text', 'file_path' => true)), 'PRODUCTS' => array('PRODUCTID' => array('type' => 'int', 'key' => true), 'PRODUCTCODE' => array('type' => 'text', 'key' => true), 'PRODUCT' => array('type' => 'text', 'key' => true), 'WEIGHT' => array('type' => 'text'), 'LIST_PRICE' => array('type' => 'text'), 'DESCR' => array('type' => 'longtext'), 'FULLDESCR' => array('type' => 'longtext'), 'KEYWORDS' => array('type' => 'text'), 'AVAIL' => array('type' => 'text'), 'RATING' => array('type' => 'text'), 'FORSALE' => array('type' => 'text'), 'SHIPPING_FREIGHT' => array('type' => 'text'), 'FREE_SHIPPING' => array('type' => 'text'), 'DISCOUNT_AVAIL' => array('type' => 'text'), 'MIN_AMOUNT' => array('type' => 'text'), 'DIM_X' => array('type' => 'text'), 'DIM_Y' => array('type' => 'text'), 'DIM_Z' => array('type' => 'text'), 'LOW_AVAIL_LIMIT' => array('type' => 'text'), 'FREE_TAX' => array('type' => 'text'), 'CATEGORYID' => array('type' => 'int', 'grouped_key' => array('CATEGORY')), 'CATEGORY' => array('type' => 'text', 'grouped_key' => array('CATEGORYID')), 'MEMBERSHIP' => array('type' => 'text', 'grouped_key' => array('MEMBERSHIPID')), 'PRICE' => array('type' => 'text'), 'THUMBNAIL' => array('type' => 'text'), 'IMAGE' => array('type' => 'text'), 'TAXES' => array('type' => 'text'), 'ADD_DATE' => array('type' => 'text'), 'MANUFACTURERID' => array('type' => 'int', 'grouped_key' => array('MANUFACTURER')), 'MANUFACTURER' => array('type' => 'text', 'grouped_key' => array('MANUFACTURERID')), 'MEMBERSHIPID' => array('type' => 'int', 'grouped_key' => array('MEMBERSHIP')), 'SUPPLIERID' => array('type' => 'text'), 'COST' => array('type' => 'text')), 'PRODUCTS_EXTRA_FIELD_VALUES' => array('PRODUCTID' => array('type' => 'int', 'key' => true), 'PRODUCTCODE' => array('type' => 'text', 'key' => true), 'PRODUCT' => array('type' => 'text', 'key' => true), 'dynamic_field_set' => array('query' => "select field from {$tables['attributes']} where item_type='P' and addon in ('', 'custom_saratogawine_magazines','custom_saratogawine_backorder','clean_urls')")));
if (APP_AREA == 'admin') {
    cw_include('addons/flexible_import/include/func.flexible_import.php');
    cw_include('addons/flexible_import/include/func.import.csvxcart.php');
    cw_include('addons/flexible_import/include/csv_def_arrays.php');
    cw_set_controller('admin/import.php', 'addons/flexible_import/admin/flexible_import.php', EVENT_POST);
    cw_set_controller('admin/import.php', 'addons/flexible_import/admin/flexible_import_profile.php', EVENT_POST);
    cw_addons_set_template(array('replace', 'admin/import_export/flexible_import.tpl', 'addons/flexible_import/flexible_import.tpl'), array('replace', 'admin/import_export/flexible_import_profile.tpl', 'addons/flexible_import/add_modify_import_profile.tpl'));
    cw_addons_add_js('addons/flexible_import/flexible_import.js');
    cw_addons_add_css('addons/flexible_import/flexible_import.css');
    cw_set_hook('cw_error_check', 'cw_flexible_import_validate_import_file', EVENT_POST);
}
<?php

/*
 * Vendor: cw
 * addon: instagram_login
 */
/*
 * init.php
 * this file only defines constants, variables, functinos, hooks and event hanlers
 * no real routine must be here on init stage
 */
// Use namespace for your own addon as vendor\addon_name
//namespace cw\instagram_login;
// Constants definition
// these constants are defined in scope of addon's namespace
//const addon_name    = 'instagram_login';
// Include functions
cw_include('addons/instagram_login/include/func.php');
if (APP_AREA == 'customer') {
    cw_set_controller('include/check_useraccount.php', 'addons/instagram_login/post_init.php', EVENT_POST);
    cw_event_listen('on_logout', 'cw_instagram_on_logout');
    cw_addons_set_template(array('post', 'buttons/social_media_panel.tpl', 'addons/instagram_login/customer/auth-button.tpl'));
}
<?php

/*
 * Vendor: cw
 * addon: twitter_login
 */
/*
 * init.php
 * this file only defines constants, variables, functinos, hooks and event hanlers
 * no real routine must be here on init stage
 */
// Use namespace for your own addon as vendor\addon_name
//namespace cw\twitter_login;
// Constants definition
// these constants are defined in scope of addon's namespace
//const addon_name    = 'twitter_login';
// Include functions
cw_include('addons/twitter_login/include/func.php');
if (APP_AREA == 'customer') {
    cw_set_controller('include/check_useraccount.php', 'addons/twitter_login/post_init.php', EVENT_POST);
    cw_set_controller(APP_AREA . '/twitter_login_verified.php', 'addons/twitter_login/customer/twitter_login_verified.php', EVENT_REPLACE);
    cw_event_listen('on_logout', 'cw_twitter_on_logout');
    cw_addons_set_template(array('post', 'buttons/social_media_panel.tpl', 'addons/twitter_login/customer/auth-button.tpl'));
}
<?php

cw_include('addons/product_tabs/include/func.hooks.php');
cw_addons_set_controllers(array('pre', 'include/products/modify.php', 'addons/product_tabs/admin/tabs.php'), array('pre', 'customer/product.php', 'addons/product_tabs/customer/tabs.php'));
cw_addons_set_hooks(array('post', 'cw_tabs_js_abstract', 'cw_pt_tabs_js_abstract'));
cw_set_hook('cw_delete_product', 'cw_pt_delete_product', EVENT_POST);
cw_set_hook('cw_product_clone', 'cw_pt_product_clone', EVENT_POST);
if (APP_AREA == 'admin') {
    cw_set_controller('admin/product_tabs.php', 'addons/product_tabs/admin/tabs.php', EVENT_REPLACE);
    cw_addons_set_template(array('replace', 'admin/products/product_tabs.tpl', 'addons/product_tabs/admin/main.tpl'));
    cw_addons_add_css('addons/product_tabs/admin/main.css');
}
global $_pt_addon_tables;
$_pt_addon_tables = array('product' => 'product_tabs', 'global' => 'tabs');
foreach ($_pt_addon_tables as $_table) {
    $tables[$_table] = 'cw_' . $_table;
}