Current File : //var/www/vinorea/modules/ipcatalogexportimport/sql/install.php
<?php
/**
 *
 * NOTICE OF LICENSE
 *
 *  @author    SmartPresta <tehran.alishov@gmail.com>
 *  @copyright 2024 SmartPresta
 *  @license   Commercial License
 */

if (!defined('_PS_VERSION_')) {
    exit;
}

$sql = array();

$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ipcatalogexport` (
    `id_ipcatalogexport` int(11) NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(100) NULL,
    `configuration` TEXT NULL,
    `datatables` TEXT NULL,
    PRIMARY KEY  (`id_ipcatalogexport`),
    UNIQUE INDEX `uniq` (`name`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8;';

$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ipcatalogimport` (
    `id_ipcatalogimport` int(11) NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(100) NULL,
    `configuration` TEXT NULL,
    `datatables` TEXT NULL,
    PRIMARY KEY  (`id_ipcatalogimport`),
    UNIQUE INDEX `uniq` (`name`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8;';

$sql[] = 'INSERT IGNORE INTO `' . _DB_PREFIX_ . 'ipcatalogexport` (`name`, `configuration`) VALUES ("catalog_default", '
        . '\'{"product":{"inputs":"export=product&as=csv&doc_name=Products&csv_separator=;&multivalue_separator=,&language=1&sort=product.id_product&sort_way=1&decimals=-1&speed=4&date=no_date&from_date=&to_date=&availability=all&price_operator=none&price=&quantity_operator=none&quantity=&discount=all&category_whether_filter=0&category_without=1&conditions[new]=1&conditions[used]=1&conditions[refurbished]=1&visibility[both]=1&visibility[catalog]=1&visibility[search]=1&visibility[none]=1&ctrl-show-selected-products=all&products_table_length=10&feature_without=1&ctrl-show-selected-features=all&features_table_length=10&manufacturer_without=1&ctrl-show-selected-manufacturers=all&manufacturers_table_length=10&supplier_without=1&ctrl-show-selected-suppliers=all&suppliers_table_length=10&carrier_without=1&ctrl-show-selected-carriers=all&carriers_table_length=10","columns":{"product.id_product":["Product ID",true],"product.reference":["Reference",true],"product_shop.active":["Active (0 = No, 1 = Yes)",true],"product_lang.name":["Name",true],"product_link":["Link",false],"product.ean13":["EAN13",true],"product.upc":["UPC",true],"product.isbn":["ISBN",true],"product.mpn":["MPN",true],"product_shop.visibility":["Visibility",true],"product_shop.condition":["Condition",true],"product_shop.show_condition":["Show Condition (0 = No, 1 = Yes)",true],"product.cache_is_pack":["Is Pack (0 = No, 1 = Yes)",true],"product_lang.description_short":["Summary",true],"product_lang.description":["Description",true],"product_tag.tags":["Tags (x,y,z...)",true],"product_shop.available_for_order":["Available for Order (0 = No, 1 = Yes)",true],"product_shop.available_date":["Availability Date",true],"product_shop.show_price":["Show Price (0 = No, 1 = Yes)",true],"product_shop.date_add":["Creation Date",true],"product_shop.date_upd":["Updates Date",false],"product_shop.online_only":["Available Online Only (0 = No, 1 = Yes)",true],"product.is_virtual":["Is Virtual Product (0 = No, 1 = Yes)",true],"file_url":["Virtual File URL",true],"product_download.display_filename":["Virtual File Displayed Name",true],"product_download.filename":["Virtual File Name",false],"product_download.nb_downloadable":["Number of Allowed Downloads",true],"product_download.date_expiration":["Expiration Date of Download",true],"product_download.nb_days_accessible":["Number of Days Accessible",true],"product_shop.pack_stock_type":["Pack Quantity Type",true],"shop.id_shop":["Shop ID",false],"shop.name":["Shop Name",false],"shop_group.id_shop_group":["Shop Group ID",false],"shop_group.name":["Shop Group Name",false],"product_shop.price":["Price (Tax Excluded)",true],"product_price_tax_incl":["Price (Tax Included)",false],"product_shop.wholesale_price":["Cost (Wholesale) Price",true],"product_shop.on_sale":["On Sale Badge (0 = No, 1 = Yes)",true],"specific_price_priority.priority":["Priority Management",true],"product_shop.id_tax_rules_group":["Tax Rule ID",false],"tax_rules_group.name":["Tax Rule Name",true],"product_shop.ecotax":["Ecotax",true],"product_shop.unity":["Unity",true],"product_shop.unit_price_ratio":["Unit Price Ratio",true],"product_lang.meta_title":["Meta Title",true],"product_lang.meta_keywords":["Meta Keywords",true],"product_lang.meta_description":["Meta Description",true],"product_lang.link_rewrite":["Rewritten URL",true],"product_shop.redirect_type":["Redirect Type",true],"product_shop.id_product_redirected":["Target Redirect ID",false],"target_product.name":["Target Redirect Name",true],"default_category.id_category":["Default Category ID",true],"default_category.name":["Default Category Name",true],"category.ids":["Category IDs (x,y,z...)",true],"category.names":["Category Names (x,y,z...)",true],"manufacturer.id_manufacturer":["Brand ID",false],"manufacturer.name":["Brand Name",true],"related_products.ids":["Related Product IDs (x,y,z...)",false],"related_products.names":["Related Product Names (x,y,z...)",true],"pack.product_ids":["Products IDs in Pack (x,y,z...)",false],"pack.product_names":["Product Names in Pack (x,y,z...)",true],"pack.quantity":["Product Quantities in Pack (x,y,z...)",true],"carrier.ids":["Carrier IDs (x,y,z...)",false],"carrier.names":["Carrier Names (x,y,z...)",true],"product.width":["Width",true],"product.height":["Height",true],"product.depth":["Depth",true],"product.weight":["Weight",true],"product_lang.delivery_in_stock":["Delivery Time of In-stock Products",true],"product_lang.delivery_out_stock":["Delivery Time of Out-of-stock Products",true],"product_shop.additional_shipping_cost":["Additional Shipping Fees",true],"product.additional_delivery_times":["Delivery Time",true],"product_sale.quantity":["Sold Quantity",true],"product_sale.sale_nbr":["Number of Sales",true],"stock_available.quantity":["Quantity",true],"product.quantity":["Quantity (old versions)",false],"product_shop.minimal_quantity":["Minimal Quantity",true],"product.location":["Location",true],"product_shop.low_stock_threshold":["Low Stock Level",true],"product_shop.low_stock_alert":["Low Stock Alert (0 = No, 1 = Yes)",true],"product_lang.available_now":["Label When in Stock",true],"product_lang.available_later":["Label When Backorder Allowed",true],"stock_available.out_of_stock":["Action When out of Stock",true],"stock_available.depends_on_stock":["Depends on Stock",true],"product_shop.advanced_stock_management":["Advanced Stock Management (0 = No, 1 = Yes)",true],"warehouse.name_ref_loc":["Warehouses (Reference:Name:Location) (x,y,z...)",true],"product.quantity_discount":["Quantity Discount (0 = No, 1 = Yes)",true],"cover_image":["Cover Image",false],"image.cover_id":["Cover Image ID",false],"image.ids":["Image IDs",false],"cover_image_url":["Cover Image URL",true],"image_urls":["Image URLs (x,y,z...)",true],"image.texts":["Image Alt Texts (x,y,z...)",true],"feature.name_value_custom":["Features (Name:Value:Custom) (x,y,z...)",true],"product_shop.customizable":["Is Customizable (0 = No, 1 = Yes)",true],"customization_field.name_type_req":["Customization Fields (Label:Type:Required) (x,y,z...)",true],"product_shop.uploadable_files":["Uploadable Files (0 = No, 1 = Yes)",true],"product_shop.text_fields":["Text Fields (0 = No, 1 = Yes)",true],"product.cache_has_attachments":["Has Attachments (0 = No, 1 = Yes)",true],"attachment.id_attachment":["Attachment IDs (x,y,z...)",false],"attachment_url":["Attachment URLs (x,y,z...)",true],"attachment.name":["Attachment Names (x,y,z...)",true],"attachment.description":["Attachment Descriptions (x,y,z...)",true],"default_supplier.id_supplier":["Default Supplier ID",false],"default_supplier.name":["Default Supplier Name",true],"product.supplier_reference":["Default Supplier Reference",true],"supplier.id_supplier":["Supplier IDs (x,y,z...)",false],"supplier.name":["Supplier Names (x,y,z...)",true],"supplier.product_supplier_reference":["Supplier References (x,y,z...)",true],"supplier.product_supplier_price_te":["Supplier Prices (x,y,z...)",true],"supplier.id_currency":["Supplier Currency IDs (x,y,z...)",false],"supplier.currency_iso_code":["Supplier Currency ISO Codes (x,y,z...)",true]}},"combination":{"inputs":"export=combination&as=csv&doc_name=Combinations&csv_separator=;&multivalue_separator=,&language=1&sort=combination.id_product_attribute&sort_way=1&decimals=-1&speed=4&date=no_date&from_date=&to_date=&discount=all&ctrl-show-selected-combinations=all&combinations_table_length=10&ctrl-show-selected-attributes=all&attributes_table_length=10","columns":{"combination.id_product_attribute":["Combination ID",true],"combination.reference":["Combination Reference",true],"combination.id_product":["Product ID",true],"product.reference":["Product Reference",true],"product_lang.name":["Product Name",true],"attributes.name_values":["Combination",false],"attributes.types":["Attribute Type (x,y,z...)",true],"attributes.groups":["Attribute Name (x,y,z...)",true],"attributes.public_name":["Attribute Public Name (x,y,z...)",true],"attributes.values":["Value:Color / Value (x,y,z...)",true],"combination.supplier_reference":["Supplier Reference",true]' . (version_compare(_PS_VERSION_, 8, '<') ? ',"combination.location":["Location",true]' : '') . ',"combination.ean13":["EAN13",true],"combination.upc":["UPC",true],"combination.isbn":["ISBN",true],"combination.mpn":["MPN",true],"combination_shop.wholesale_price":["Cost (Wholesale) Price",true],"combination_shop.price":["Impact on Price",true],"combination_shop.unit_price_impact":["Impact on Unit Price",true],"combination_shop.ecotax":["Ecotax",true],"stock_available.quantity":["Quantity",true],"combination.quantity":["Quantity (old versions)",false],"combination_shop.minimal_quantity":["Minimal Quantity",true],"combination_shop.low_stock_threshold":["Low Stock Level",true],"combination_shop.low_stock_alert":["Low Stock Alert (0 = No, 1 = Yes)",true],"combination_shop.weight":["Impact on Weight",true],"combination_shop.default_on":["Is Default (0 = No, 1 = Yes)",true],"combination_shop.available_date":["Availability Date",true],"image_urls":["Image URLs (x,y,z...)",true],"image.texts":["Image Alt Texts (x,y,z...)",true],"stock_available.out_of_stock":["Action When out of Stock",true],"stock_available.depends_on_stock":["Depends on Stock",true],"warehouse.name_ref_loc":["Warehouses (Reference:Name:Location) (x,y,z...)",true]}},"pack":{"inputs":"export=pack&as=csv&doc_name=Packs&csv_separator=;&multivalue_separator=,&language=1&sort=pack.id_product_pack&sort_way=1&decimals=-1&speed=4&ctrl-show-selected-packs=all&packs_table_length=10","columns":{"pack.id_product_pack":["Pack ID",true],"pack.id_product_item":["Product ID",true],"product_lang.name":["Product Name",true],"product.reference":["Product Reference",true],"pack.id_product_attribute_item":["Combination ID",true],"combination.reference":["Combination Reference",true],"attributes.values":["Attributes (x,y,z...)",true],"pack.quantity":["Quantity",true]}},"discount":{"inputs":"export=discount&as=csv&doc_name=Discounts&csv_separator=;&multivalue_separator=,&language=1&sort=discount.id_specific_price&sort_way=1&decimals=-1&speed=4&from_date=no_date&from_from_date=&from_to_date=&to_date=no_date&to_from_date=&to_to_date=&ctrl-show-selected-discounts=all&discounts_table_length=10","columns":{"discount.id_specific_price":["Specific Price ID",false],"discount.id_specific_price_rule":["Catalog Price Rule ID",false],"discount.spr_name":["Catalog Price Rule Name",true],"discount.conds":["Catalog Price Rule Conditions",true],"discount.id_product":["Product ID",false],"discount.prod_reference":["Product Reference",true],"discount.prod_name":["Product Name",true],"discount.comb_reference":["Combination Reference",true],"discount.comb_values":["Combination Attributes",true],"discount.reduction":["Reduction",true],"discount.reduction_type":["Reduction Type",true],"discount.reduction_tax":["Reduction Tax (0 = No, 1 = Yes)",true],"discount.from":["From",true],"discount.to":["To",true],"discount.price":["Price",true],"discount.from_quantity":["From Quantity",true],"discount.id_customer":["Customer ID",false],"discount.firstname":["Customer Firstname",false],"discount.lastname":["Customer Lastname",false],"discount.email":["Customer Email",true],"discount.id_group":["Group ID",false],"discount.group_name":["Group Name",true],"discount.id_country":["Country ID",true],"discount.country_name":["Country Name",false],"discount.id_currency":["Currency ID",false],"discount.currency_iso_code":["Currency ISO Code",true],"discount.is_rule":["Is Rule",true]}},"category":{"inputs":"export=category&as=csv&doc_name=Categories&csv_separator=;&multivalue_separator=,&language=1&sort=category.id_category&sort_way=1&decimals=-1&speed=4&date=no_date&from_date=&to_date=&availability=all&category_whether_filter=0","columns":{"category.id_category":["Category ID",true],"category.active":["Active (0 = No, 1 = Yes)",true],"category_lang.name":["Name",true],"category_link":["Link",false],"category.id_parent":["Parent Category ID",true],"parent.name":["Parent Category Name",true],"category_lang.description":["Description",true],"category_lang.link_rewrite":["Rewritten URL",true],"category_lang.meta_title":["Meta Title",true],"category_lang.meta_keywords":["Meta Keywords",true],"category_lang.meta_description":["Meta Description",true],"category.position":["Position",true],"category_image":["Image",false],"image_url":["Image URL",true],"category.date_add":["Creation Date",true],"category.date_upd":["Update Date",false],"category.is_root_category":["Is Root (0 = No, 1 = Yes)",false],"category_group.ids":["Group IDs (x,y,z...)",false],"category_group.names":["Group Names (x,y,z...)",true],"group_reduction.reductions":["Group Reductions (x,y,z...)",true]}},"brand":{"inputs":"export=brand&as=csv&doc_name=Brands&csv_separator=;&multivalue_separator=,&language=1&sort=manufacturer.id_manufacturer&sort_way=1&decimals=-1&speed=4&date=no_date&from_date=&to_date=&availability=all&ctrl-show-selected-brands=all&brands_table_length=10","columns":{"manufacturer.id_manufacturer":["Brand ID",true],"manufacturer.active":["Active (0 = No, 1 = Yes)",true],"manufacturer.name":["Name",true],"manufacturer_lang.description":["Description",true],"manufacturer_lang.short_description":["Short Description",true],"manufacturer_lang.meta_title":["Meta Title",true],"manufacturer_lang.meta_keywords":["Meta Keywords",true],"manufacturer_lang.meta_description":["Meta Description",true],"brand_image":["Image",false],"image_url":["Image URL",true],"manufacturer.date_add":["Creation Date",true],"manufacturer.date_upd":["Update date",false]}},"supplier":{"inputs":"export=supplier&as=csv&doc_name=Suppliers&csv_separator=;&multivalue_separator=,&language=1&sort=supplier.id_supplier&sort_way=1&decimals=-1&speed=4&date=no_date&from_date=&to_date=&availability=all&ctrl-show-selected-suppliers2=all&suppliers2_table_length=10","columns":{"supplier.id_supplier":["Supplier ID",true],"supplier.active":["Active (0 = No, 1 = Yes)",true],"supplier.name":["Name",true],"supplier_lang.description":["Description",true],"supplier_lang.meta_title":["Meta Title",true],"supplier_lang.meta_keywords":["Meta Keywords",true],"supplier_lang.meta_description":["Meta Description",true],"supplier_image":["Image",false],"image_url":["Image URL",true],"supplier.date_add":["Creation Date",true],"supplier.date_upd":["Update Date",false]}},"carrier":{"inputs":"export=carrier&as=csv&doc_name=Carriers&csv_separator=;&multivalue_separator=,&language=1&sort=carrier.id_carrier&sort_way=1&decimals=-1&speed=4&availability=all&ctrl-show-selected-carriers2=all&carriers2_table_length=10","columns":{"carrier.id_carrier":["Carrier ID",true],"carrier.id_reference":["Reference ID",true],"carrier.active":["Active (0 = No, 1 = Yes)",true],"carrier.name":["Name",true],"carrier_lang.delay":["Transit Time",true],"carrier.id_tax_rules_group":["Tax Rule ID",false],"trg.name":["Tax Rule Name",true],"carrier.url":["Tracking URL",true],"carrier_logo":["Logo",false],"logo_url":["Logo URL",true],"carrier.shipping_handling":["Shipping Handling (0 = No, 1 = Yes)",true],"carrier.range_behavior":["Range Behavior (0/1)",true],"carrier.is_module":["Is Module (0 = No, 1 = Yes)",true],"carrier.is_free":["Is Free (0 = No, 1 = Yes)",true],"carrier.shipping_external":["External Shipping (0 = No, 1 = Yes)",true],"carrier.external_module_name":["External Module Name",true],"carrier.shipping_method":["Shipping Method (0/1/2)",true],"carrier.position":["Position",true],"carrier.max_width":["Max Width",true],"carrier.max_height":["Max Height",true],"carrier.max_depth":["Max Depth",true],"carrier.max_weight":["Max Weight",true],"carrier.grade":["Speed Grade",true],"carrier_group.ids":["Group IDs (x,y,z...)",false],"carrier_group.names":["Group Names (x,y,z...)",true],"carrier_zone.ids":["Zone IDs (x,y,z...)",false],"carrier_zone.names":["Zone Names (Name:Active) (x,y,z...)",true]}},"group":{"inputs":"export=group&as=csv&doc_name=Groups&csv_separator=;&csv_enclosure=quot&multivalue_separator=,&language=1&sort=groupp.id_group&sort_way=1&decimals=-1&speed=4&date=no_date&from_date=&to_date=&ctrl-show-selected-groups2=all&groups2_table_length=10","columns":{"groupp.id_group":["Group ID",true],"group_lang.name":["Name",true],"groupp.reduction":["Reduction",true],"groupp.price_display_method":["Price Display Method (0 = Tax Included, 1 = Tax Excluded)",true],"groupp.show_prices":["Show Prices (0 = No, 1 = Yes)",true],"groupp.date_add":["Creation Date",true],"groupp.date_upd":["Update Date",false]}},"customer":{"inputs":"export=customer&as=csv&doc_name=Customers&csv_separator=;&multivalue_separator=,&language=1&sort=customer.id_customer&sort_way=1&decimals=-1&speed=4&date=no_date&from_date=&to_date=&availability=all&ctrl-show-selected-customers=all&customers_table_length=10&group_without=1&ctrl-show-selected-groups=all&groups_table_length=10","columns":{"customer.id_customer":["Customer ID",true],"customer.active":["Active (0 = No, 1 = Yes)",true],"customer.id_gender":["Title ID (1 = Mr, 2 = Mrs, 0 = else)",true],"customer.email":["Email",true],"customer.passwd":["Current Password (Encrypted)",true],"new_passwd":["New Password",true],"customer.firstname":["First Name",true],"customer.lastname":["Last Name",true],"customer.birthday":["Birthday",true],"customer.date_add":["Registration Date",true],"customer.date_upd":["Update Date",false],"customer.is_guest":["Is Guest (0 = No, 1 = Yes)",true],"customer.id_lang":["Language ID",false],"lang.name":["Language Name",false],"lang.iso_code":["Customer Language (ISO)",true],"customer.newsletter":["Newsletter (0 = No, 1 = Yes)",true],"customer.newsletter_date_add":["Newsletter Subscription Date",true],"customer.optin":["Opt-in (0 = No, 1 = Yes)",true],"customer.secure_key":["Secure Key",false],"customer.id_default_group":["Default Group ID",false],"default_group_lang.name":["Default Group Name",true],"groupp.ids":["Group IDs (x,y,z...)",false],"groupp.names":["Group Names (x,y,z...)",true]}},"address":{"inputs":"export=address&as=csv&doc_name=Addresses&csv_separator=;&multivalue_separator=,&language=1&sort=address.id_address&sort_way=1&decimals=-1&speed=4&date=no_date&from_date=&to_date=&availability=all&ctrl-show-selected-addresses=all&addresses_table_length=10","columns":{"address.id_address":["Address ID",true],"address.active":["Active (0 = No, 1 = Yes)",true],"address.address1":["Address",true],"address.address2":["Address 2",true],"address.alias":["Alias",true],"address.company":["Company",true],"address.firstname":["First Name",true],"address.lastname":["Last Name",true],"customer.email":["Customer Email",true],"customer.firstname":["Customer First Name",false],"customer.lastname":["Customer Last Name",false],"address.id_manufacturer":["Brand ID",false],"manufacturer.name":["Brand Name",true],"address.id_supplier":["Supplier ID",false],"supplier.name":["Supplier Name",true],"address.postcode":["Zip/Postal code",true],"address.city":["City",true],"address.id_country":["Country ID",false],"country_lang.name":["Country Name",true],"state.id_state":["State ID",false],"state.name":["State Name",true],"address.other":["Other",true],"address.phone":["Phone",true],"address.phone_mobile":["Mobile Phone",true],"address.vat_number":["VAT Number",true],"address.dni":["DNI (Identification Number)",true],"address.date_add":["Creation Date",true],"address.date_upd":["Update Date",false]}},"store":{"inputs":"export=store&as=csv&doc_name=Stores&csv_separator=;&multivalue_separator=,&language=1&sort=store.id_store&sort_way=1&decimals=-1&speed=4&date=no_date&from_date=&to_date=&availability=all&ctrl-show-selected-stores=all&stores_table_length=10","columns":{"store.id_store":["Store ID",true],"store.active":["Active (0 = No, 1 = Yes)",true],"store.name":["Name",true],"store.address1":["Address",true],"store.address2":["Address 2",true],"store.city":["City",true],"store.id_country":["Country ID",true],"store.country_name":["Country Name",false],"store.id_state":["State ID",true],"store.state_name":["State Name",false],"store.latitude":["Latitude",true],"store.longitude":["Longitude",true],"store.postcode":["Zip/Postal Code",true],"store.phone":["Phone",true],"store.fax":["Fax",true],"store.email":["Email",true],"store.note":["Note",true],"store.hours":["Hours (x,y,z...)",true],"image_url":["Image URL",true],"store_image":["Image",false],"store.date_add":["Creation Date",true],"store.date_upd":["Update Date",false]}},"alias":{"inputs":"export=alias&as=csv&doc_name=Aliases&csv_separator=;&multivalue_separator=,&sort=alias.id_alias&sort_way=1&decimals=-1&speed=4&ctrl-show-selected-aliases=all&aliases_table_length=10","columns":{"alias.id_alias":["Alias ID",true],"alias.active":["Active (0 = No, 1 = Yes)",true],"alias.alias":["Alias",true],"alias.search":["Search",true]}},"warehouse":{"inputs":"export=warehouse&as=csv&doc_name=Warehouses&csv_separator=;&multivalue_separator=,&language=1&sort=warehouse.id_warehouse&sort_way=1&decimals=-1&speed=4&ctrl-show-selected-warehouses=all&warehouses_table_length=10","columns":{"warehouse.id_warehouse":["Warehouse ID",true],"warehouse.reference":["Reference",true],"warehouse.name":["Name",true],"warehouse.management_type":["Management Type",true],"warehouse.id_currency":["Currency ID",false],"currency.iso_code":["Currency ISO",true],"address.phone":["Phone",true],"address.phone_mobile":["Mobile Phone",true],"address.address1":["Address",true],"address.address2":["Address 2",true],"address.postcode":["ZIP/Postal Code",true],"address.city":["City",true],"address.id_country":["Country ID",true],"country_lang.name":["Country Name",false],"address.id_state":["State ID",true],"state.name":["State Name",false],"employee.email":["Manager Email",true],"employee.firstname":["Manager First Name",false],"employee.lastname":["Manager Last Name",false],"carrier.ids":["Carrier IDs (x,y,z...)",false],"carrier.names":["Carrier Names (x,y,z...)",true]}}}\')';

$sql[] = 'INSERT IGNORE INTO `' . _DB_PREFIX_ . 'ipcatalogimport` (`name`, `configuration`) VALUES ("catalog_default", '
        . '\'{"products":"entity=products&filename=&id_employee=1&import_source=file_upload&products=Choose file&upload_history_table_products_length=10&file_url=&ftp_type=ftp&ftp_url=&ftp_port=&ftp_username=&ftp_password=&ftp_filepath=&language=1&csv_separator=;&multivalue_separator=,&truncate=0&delete_images=0&regenerate=1&keep_id=0&name_exists=ignore&send_email=0&skip=1&type_value[0]=id&type_value[1]=reference&type_value[2]=active&type_value[3]=name&type_value[4]=ean13&type_value[5]=upc&type_value[6]=isbn&type_value[7]=mpn&type_value[8]=visibility&type_value[9]=condition&type_value[10]=show_condition&type_value[11]=cache_is_pack&type_value[12]=description_short&type_value[13]=description&type_value[14]=tags&type_value[15]=available_for_order&type_value[16]=available_date&type_value[17]=show_price&type_value[18]=date_add&type_value[19]=online_only&type_value[20]=is_virtual&type_value[21]=file_url&type_value[22]=display_filename&type_value[23]=nb_downloadable&type_value[24]=date_expiration&type_value[25]=nb_days_accessible&type_value[26]=pack_stock_type&type_value[27]=price_tex&type_value[28]=wholesale_price&type_value[29]=on_sale&type_value[30]=specific_price_priority&type_value[31]=id_tax_rules_group&type_value[32]=ecotax&type_value[33]=unity&type_value[34]=unit_price_ratio&type_value[35]=meta_title&type_value[36]=meta_keywords&type_value[37]=meta_description&type_value[38]=link_rewrite&type_value[39]=redirect_type&type_value[40]=id_type_redirected&type_value[41]=id_category_default&type_value[42]=category_default&type_value[43]=id_category&type_value[44]=category&type_value[45]=manufacturer&type_value[46]=accessories&type_value[47]=pack_products&type_value[48]=pack_product_quantity&type_value[49]=carriers&type_value[50]=width&type_value[51]=height&type_value[52]=depth&type_value[53]=weight&type_value[54]=delivery_in_stock&type_value[55]=delivery_out_stock&type_value[56]=additional_shipping_cost&type_value[57]=additional_delivery_times&type_value[58]=sold_quantity&type_value[59]=sale_nbr&type_value[60]=quantity&type_value[61]=minimal_quantity&type_value[62]=location&type_value[63]=low_stock_threshold&type_value[64]=low_stock_alert&type_value[65]=available_now&type_value[66]=available_later&type_value[67]=out_of_stock&type_value[68]=depends_on_stock&type_value[69]=advanced_stock_management&type_value[70]=warehouse&type_value[71]=quantity_discount&type_value[72]=cover_image&type_value[73]=image&type_value[74]=image_alt&type_value[75]=features&type_value[76]=customizable&type_value[77]=customization_fields&type_value[78]=uploadable_files&type_value[79]=text_fields&type_value[80]=cache_has_attachments&type_value[81]=attachment_url&type_value[82]=attachment_name&type_value[83]=attachment_desc&type_value[84]=supplier&type_value[85]=supplier_reference&type_value[86]=supplier_names&type_value[87]=supplier_references&type_value[88]=supplier_prices&type_value[89]=supplier_currencies","combinations":"entity=combinations&filename=20220623123239-Combinations (3).xlsx&id_employee=1&import_source=file_upload&combinations=Combinations (3).xlsx&upload_history_table_combinations_length=10&file_url=&ftp_type=ftp&ftp_url=&ftp_port=&ftp_username=&ftp_password=&ftp_filepath=&language=1&csv_separator=;&multivalue_separator=,&truncate=0&regenerate=1&keep_id=0&name_exists=ignore&send_email=0&skip=1&type_value[0]=id&type_value[1]=reference&type_value[2]=id_product&type_value[3]=product_reference&type_value[4]=product_name&type_value[5]=group_public_name&type_value[6]=group&type_value[7]=attribute&type_value[8]=supplier_reference&type_value[9]=location&type_value[10]=ean13&type_value[11]=upc&type_value[12]=isbn&type_value[13]=mpn&type_value[14]=wholesale_price&type_value[15]=price&type_value[16]=unit_price_impact&type_value[17]=ecotax&type_value[18]=quantity&type_value[19]=minimal_quantity&type_value[20]=low_stock_threshold&type_value[21]=low_stock_alert&type_value[22]=weight&type_value[23]=default_on&type_value[24]=available_date&type_value[25]=image_url&type_value[26]=image_alt&type_value[27]=out_of_stock&type_value[28]=depends_on_stock&type_value[29]=warehouse","packs":"entity=packs&filename=&id_employee=1&import_source=file_upload&packs=Choose file&upload_history_table_packs_length=10&file_url=&ftp_type=ftp&ftp_url=&ftp_port=&ftp_username=&ftp_password=&ftp_filepath=&language=1&csv_separator=;&multivalue_separator=,&truncate=0&keep_id=0&send_email=0&skip=1&type_value[0]=id&type_value[1]=id_product&type_value[2]=product_name&type_value[3]=product_reference&type_value[4]=combination_id&type_value[5]=combination_reference&type_value[6]=attribute&type_value[7]=quantity","discounts":"entity=discounts&filename=&id_employee=1&import_source=file_upload&discounts=Choose file&upload_history_table_discounts_length=10&file_url=&ftp_type=ftp&ftp_url=&ftp_port=&ftp_username=&ftp_password=&ftp_filepath=&language=1&csv_separator=;&multivalue_separator=,&truncate=0&send_email=0&skip=1&type_value[0]=spr_name&type_value[1]=conds&type_value[2]=product_reference&type_value[3]=product_name&type_value[4]=comb_reference&type_value[5]=comb_values&type_value[6]=reduction&type_value[7]=reduction_type&type_value[8]=reduction_tax&type_value[9]=from&type_value[10]=to&type_value[11]=price&type_value[12]=from_quantity&type_value[13]=id_customer&type_value[14]=id_group&type_value[15]=id_country&type_value[16]=id_currency&type_value[17]=is_rule","categories":"entity=categories&filename=&id_employee=1&import_source=file_upload&categories=Choose file&upload_history_table_categories_length=10&file_url=&ftp_type=ftp&ftp_url=&ftp_port=&ftp_username=&ftp_password=&ftp_filepath=&language=1&csv_separator=;&multivalue_separator=,&truncate=0&regenerate=1&keep_id=0&name_exists=ignore&send_email=0&skip=3&type_value[0]=id&type_value[1]=active&type_value[2]=name&type_value[3]=id_parent&type_value[4]=parent&type_value[5]=description&type_value[6]=link_rewrite&type_value[7]=meta_title&type_value[8]=meta_keywords&type_value[9]=meta_description&type_value[10]=position&type_value[11]=image&type_value[12]=date_add&type_value[13]=groups&type_value[14]=reductions","brands":"entity=brands&filename=&id_employee=1&import_source=file_upload&brands=Choose file&upload_history_table_brands_length=10&file_url=&ftp_type=ftp&ftp_url=&ftp_port=&ftp_username=&ftp_password=&ftp_filepath=&language=1&csv_separator=;&multivalue_separator=,&truncate=0&regenerate=1&keep_id=0&name_exists=ignore&send_email=0&skip=1&type_value[0]=id&type_value[1]=active&type_value[2]=name&type_value[3]=description&type_value[4]=short_description&type_value[5]=meta_title&type_value[6]=meta_keywords&type_value[7]=meta_description&type_value[8]=image&type_value[9]=date_add","suppliers":"entity=suppliers&filename=&id_employee=1&import_source=file_upload&suppliers=Choose file&upload_history_table_suppliers_length=10&file_url=&ftp_type=ftp&ftp_url=&ftp_port=&ftp_username=&ftp_password=&ftp_filepath=&language=1&csv_separator=;&multivalue_separator=,&truncate=0&regenerate=1&keep_id=0&name_exists=ignore&send_email=0&skip=1&type_value[0]=id&type_value[1]=active&type_value[2]=name&type_value[3]=description&type_value[4]=meta_title&type_value[5]=meta_keywords&type_value[6]=meta_description&type_value[7]=image&type_value[8]=date_add","carriers":"entity=carriers&filename=&id_employee=1&import_source=file_upload&carriers=Choose file&upload_history_table_carriers_length=10&file_url=&ftp_type=ftp&ftp_url=&ftp_port=&ftp_username=&ftp_password=&ftp_filepath=&language=1&csv_separator=;&multivalue_separator=,&truncate=0&keep_id=0&name_exists=ignore&send_email=0&skip=1&type_value[0]=id&type_value[1]=id_reference&type_value[2]=active&type_value[3]=name&type_value[4]=delay&type_value[5]=id_tax_rules_group&type_value[6]=url&type_value[7]=logo_url&type_value[8]=shipping_handling&type_value[9]=range_behavior&type_value[10]=is_module&type_value[11]=is_free&type_value[12]=shipping_external&type_value[13]=external_module_name&type_value[14]=shipping_method&type_value[15]=position&type_value[16]=max_width&type_value[17]=max_height&type_value[18]=max_depth&type_value[19]=max_weight&type_value[20]=grade&type_value[21]=groups&type_value[22]=zones","groups":"entity=groups&filename=&id_employee=1&import_source=file_upload&groups=Choose file&upload_history_table_groups_length=10&file_url=&ftp_type=ftp&ftp_url=&ftp_port=&ftp_username=&ftp_password=&ftp_filepath=&language=1&csv_separator=;&multivalue_separator=,&truncate=0&keep_id=0&name_exists=ignore&send_email=0&skip=1&type_value[0]=id&type_value[1]=name&type_value[2]=reduction&type_value[3]=price_display_method&type_value[4]=show_prices&type_value[5]=date_add","customers":"entity=customers&filename=&id_employee=1&import_source=file_upload&customers=Choose file&upload_history_table_customers_length=10&file_url=&ftp_type=ftp&ftp_url=&ftp_port=&ftp_username=&ftp_password=&ftp_filepath=&language=1&csv_separator=;&multivalue_separator=,&truncate=0&keep_id=0&name_exists=ignore&send_email=0&skip=1&type_value[0]=id&type_value[1]=active&type_value[2]=id_gender&type_value[3]=email&type_value[4]=passwd&type_value[5]=new_passwd&type_value[6]=firstname&type_value[7]=lastname&type_value[8]=birthday&type_value[9]=date_add&type_value[10]=is_guest&type_value[11]=id_lang&type_value[12]=newsletter&type_value[13]=newsletter_date_add&type_value[14]=optin&type_value[15]=id_default_group&type_value[16]=groups","addresses":"entity=addresses&filename=&id_employee=1&import_source=file_upload&addresses=Choose file&upload_history_table_addresses_length=10&file_url=&ftp_type=ftp&ftp_url=&ftp_port=&ftp_username=&ftp_password=&ftp_filepath=&language=1&csv_separator=;&multivalue_separator=,&truncate=0&keep_id=0&send_email=0&skip=1&type_value[0]=id&type_value[1]=active&type_value[2]=address1&type_value[3]=address2&type_value[4]=alias&type_value[5]=company&type_value[6]=firstname&type_value[7]=lastname&type_value[8]=customer_email&type_value[9]=manufacturer&type_value[10]=supplier&type_value[11]=postcode&type_value[12]=city&type_value[13]=country&type_value[14]=state&type_value[15]=other&type_value[16]=phone&type_value[17]=phone_mobile&type_value[18]=vat_number&type_value[19]=dni&type_value[20]=date_add","stores":"entity=stores&filename=&id_employee=1&import_source=file_upload&stores=Choose file&upload_history_table_stores_length=10&file_url=&ftp_type=ftp&ftp_url=&ftp_port=&ftp_username=&ftp_password=&ftp_filepath=&language=1&csv_separator=;&multivalue_separator=,&truncate=0&regenerate=1&keep_id=0&name_exists=ignore&send_email=0&skip=1&type_value[0]=id&type_value[1]=active&type_value[2]=name&type_value[3]=address1&type_value[4]=address2&type_value[5]=city&type_value[6]=country&type_value[7]=state&type_value[8]=latitude&type_value[9]=longitude&type_value[10]=postcode&type_value[11]=phone&type_value[12]=fax&type_value[13]=email&type_value[14]=note&type_value[15]=hours&type_value[16]=image&type_value[17]=date_add","aliases":"entity=aliases&filename=&id_employee=1&import_source=file_upload&aliases=Choose file&upload_history_table_aliases_length=10&file_url=&ftp_type=ftp&ftp_url=&ftp_port=&ftp_username=&ftp_password=&ftp_filepath=&csv_separator=;&multivalue_separator=,&truncate=0&keep_id=0&name_exists=ignore&send_email=0&skip=1&type_value[0]=id&type_value[1]=active&type_value[2]=alias&type_value[3]=search","warehouses":"entity=warehouses&filename=&id_employee=1&import_source=file_upload&warehouses=Choose file&upload_history_table_warehouses_length=10&file_url=&ftp_type=ftp&ftp_url=&ftp_port=&ftp_username=&ftp_password=&ftp_filepath=&language=1&csv_separator=;&multivalue_separator=,&truncate=0&keep_id=0&name_exists=ignore&send_email=0&skip=1&type_value[0]=id&type_value[1]=reference&type_value[2]=name&type_value[3]=management_type&type_value[4]=id_currency&type_value[5]=phone&type_value[6]=phone_mobile&type_value[7]=address1&type_value[8]=address2&type_value[9]=postcode&type_value[10]=city&type_value[11]=id_country&type_value[12]=id_state&type_value[13]=id_employee&type_value[14]=carriers"}\')';

$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ipcatalogexport_email` (
	`id_ipcatalogexport_email` INT(11) NOT NULL AUTO_INCREMENT,
	`template` VARCHAR(100) NULL,
	`address` VARCHAR(255) NULL DEFAULT NULL,
        `timestamp` TINYINT(1) NULL DEFAULT 1,
	`entities` VARCHAR(255) NULL DEFAULT NULL,
	`active` TINYINT(1) NULL DEFAULT 1,
	PRIMARY KEY (`id_ipcatalogexport_email`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8;';

$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ipcatalogexport_ftp` (
	`id_ipcatalogexport_ftp` INT(11) NOT NULL AUTO_INCREMENT,
	`template` VARCHAR(100) NULL,
        `type` ENUM(\'ftp\',\'ftps\',\'sftp\') NULL DEFAULT NULL,
	`url` VARCHAR(255) NULL DEFAULT NULL,
        `port` VARCHAR(10) NULL DEFAULT NULL,
	`username` VARCHAR(255) NULL DEFAULT NULL,
	`password` VARCHAR(255) NULL DEFAULT NULL,
	`timestamp` TINYINT(1) NULL DEFAULT 1,
        `entities` VARCHAR(1000) NULL DEFAULT NULL,
	`active` TINYINT(1) NULL DEFAULT 1,
    PRIMARY KEY (`id_ipcatalogexport_ftp`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8;';

$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ipcatalogimport_ftp` (
	`id_ipcatalogimport_ftp` INT(11) NOT NULL AUTO_INCREMENT,
	`template` VARCHAR(100) NULL,
        `type` ENUM(\'ftp\',\'ftps\',\'sftp\') NULL DEFAULT NULL,
	`url` VARCHAR(255) NULL DEFAULT NULL,
        `port` VARCHAR(10) NULL DEFAULT NULL,
	`username` VARCHAR(255) NULL DEFAULT NULL,
	`password` VARCHAR(255) NULL DEFAULT NULL,
        `entities` VARCHAR(1000) NULL DEFAULT NULL,
	`active` TINYINT(1) NULL DEFAULT 1,
    PRIMARY KEY (`id_ipcatalogimport_ftp`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8;';

$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ipcatalogimport_url` (
	`id_ipcatalogimport_url` INT(11) NOT NULL AUTO_INCREMENT,
	`template` VARCHAR(100) NULL,
	`url` VARCHAR(250) NULL,
	`entity` VARCHAR(100) NULL,
	`active` TINYINT(1) NULL DEFAULT 1,
    PRIMARY KEY (`id_ipcatalogimport_url`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8;';

$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ipcatalogimport_history` (
	`id_ipcatalogimport_history` INT(11) NOT NULL AUTO_INCREMENT,
	`entity` VARCHAR(50) NOT NULL,
	`file` VARCHAR(255) NOT NULL,
        `date_add` DATETIME NULL DEFAULT NULL,
    PRIMARY KEY (`id_ipcatalogimport_history`),
    UNIQUE KEY `entity` (`entity`, `file`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8;';

foreach ($sql as $query) {
    if (Db::getInstance()->execute($query) == false) {
        return false;
    }
}

Configuration::deleteByName('IPEI_SECURE_KEY');
Configuration::updateGlobalValue('IPEI_SECURE_KEY', uniqid());