Difference between revisions of "X-Cart:Integration with third party modules"

From X-Cart 4 Classic
Jump to: navigation, search
(Created page with 'In version 4.4.3, the module initialization routine has been changed and optimized. Unlike in versions 4.4.0-4.4.2, initialization order now does matter. For the standard module…')
 
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
== 3rd party module initialization ==
 +
 
In version 4.4.3, the module initialization routine has been changed and optimized. Unlike in versions 4.4.0-4.4.2, initialization order now does matter.
 
In version 4.4.3, the module initialization routine has been changed and optimized. Unlike in versions 4.4.0-4.4.2, initialization order now does matter.
  
Line 14: Line 16:
 
+++ include/data_cache.php 2011-05-16 14:11:37.000000000 +0400
 
+++ include/data_cache.php 2011-05-16 14:11:37.000000000 +0400
 
@@ -144,6 +144,7 @@
 
@@ -144,6 +144,7 @@
        'Image_Verification' => 33,# Image_Verification depends on Survey/News_Management
+
'Image_Verification' => 33,# Image_Verification depends on Survey/News_Management
        'Manufacturers' => 23,
+
'Manufacturers' => 23,
        'XAffiliate' => 24, #XAffiliate depends on Manufacturers
+
'XAffiliate' => 24, #XAffiliate depends on Manufacturers
 
+ '3dPartyModule1' => 2000,
 
+ '3dPartyModule1' => 2000,
    );
+
);
    $key_a = isset($sort_order[$a]) ? -$sort_order[$a] : -1000;
+
$key_a = isset($sort_order[$a]) ? -$sort_order[$a] : -1000;
    $key_b = isset($sort_order[$b]) ? -$sort_order[$b] : -1001;
+
$key_b = isset($sort_order[$b]) ? -$sort_order[$b] : -1001;
 
</source>
 
</source>
  
Line 27: Line 29:
 
If the order number of a certain module is not defined, it is assumed to be 1000.
 
If the order number of a certain module is not defined, it is assumed to be 1000.
 
The initialization order for modules with identical module numbers is undefined.
 
The initialization order for modules with identical module numbers is undefined.
 +
 +
== Reserved service names ==
 +
 +
Below is a list of service names used by Qualiteam solutions:
 +
 +
'''Service names of X-Cart modules:'''
 +
* Add_to_cart_popup
 +
* Advanced_Customer_Reviews
 +
* Advanced_Order_Management
 +
* Advanced_Statistics
 +
* Amazon_Checkout
 +
* Anti_Fraud
 +
* Banner_System
 +
* Benchmark
 +
* Bestsellers
 +
* Customer_Reviews
 +
* Detailed_Product_Images
 +
* Discount_Coupons
 +
* EU_Cookie_Law
 +
* Egoods
 +
* Extra_Fields
 +
* Fast_Lane_Checkout
 +
* Feature_Comparison
 +
* Flyout_Menus
 +
* Froogle
 +
* Gift_Certificates
 +
* Gift_Registry
 +
* Google_Analytics
 +
* Google_Checkout
 +
* Greet_Visitor
 +
* HTML_Editor
 +
* Image_Verification
 +
* Interneka
 +
* Lexity
 +
* Magnifier
 +
* Mailchimp_Subscription
 +
* Maintenance_Agent
 +
* Manufacturers
 +
* New_Arrivals
 +
* News_Management
 +
* On_Sale
 +
* Order_Tracking
 +
* PayPalAuth
 +
* Product_Configurator
 +
* Product_Options
 +
* Products_Map
 +
* QuickBooks
 +
* Quick_Reorder
 +
* RMA
 +
* Recently_Viewed
 +
* Recommended_Products
 +
* Shipping_Label_Generator
 +
* Simple_Mode
 +
* Sitemap
 +
* SnS_connector
 +
* Socialize
 +
* Special_Offers
 +
* Stop_List
 +
* Subscriptions
 +
* Survey
 +
* TaxCloud
 +
* UPS_OnLine_Tools
 +
* Upselling_Products
 +
* Users_online
 +
* Wholesale_Trading
 +
* Wishlist
 +
* XAffiliate
 +
* XPayments_Connector
 +
* XSEO
 +
 +
'''Names of sql tables:'''
 +
* prefixed with "xcart_"
 +
 +
'''Names of sql config variables:'''
 +
* See: sql/xcart_data.sql
 +
 +
'''Names of sql labels:'''
 +
* See: sql/xcart_languages_US.sql
 +
 +
To avoid service name conflicts with Qualiteam solutions, developers of 3rd party add-on modules should avoid using the above listed service names for the purpose of naming entities pertaining to their work.<br />
 +
It is strongly recommended that a unique prefix be used for your add-on module in all labels, sql-xcart_config, sql-xcart_languages, sql-xcart_modules, global variables, module name and names of module files.

Latest revision as of 15:48, 31 July 2012

3rd party module initialization

In version 4.4.3, the module initialization routine has been changed and optimized. Unlike in versions 4.4.0-4.4.2, initialization order now does matter.

For the standard modules, dependencies of the modules on one another are described in the function include/data_cache.php:func_sort_active_modules

If your 3rd-party module depends on other modules, and no other modules depend on it, you can place the initialization of that module to the very end of the module initialization queue.

Here is how you do that.

Index: include/data_cache.php

--- include/data_cache.php 2011-05-16 14:11:41.000000000 +0400
+++ include/data_cache.php 2011-05-16 14:11:37.000000000 +0400
@@ -144,6 +144,7 @@
'Image_Verification' => 33,# Image_Verification depends on Survey/News_Management
'Manufacturers' => 23,
'XAffiliate' => 24, #XAffiliate depends on Manufacturers
+ '3dPartyModule1' => 2000,
);
$key_a = isset($sort_order[$a]) ? -$sort_order[$a] : -1000;
$key_b = isset($sort_order[$b]) ? -$sort_order[$b] : -1001;

This patch means that 3dPartyModule1 will be initialized last for this array of modules.

If the order number of a certain module is not defined, it is assumed to be 1000. The initialization order for modules with identical module numbers is undefined.

Reserved service names

Below is a list of service names used by Qualiteam solutions:

Service names of X-Cart modules:

  • Add_to_cart_popup
  • Advanced_Customer_Reviews
  • Advanced_Order_Management
  • Advanced_Statistics
  • Amazon_Checkout
  • Anti_Fraud
  • Banner_System
  • Benchmark
  • Bestsellers
  • Customer_Reviews
  • Detailed_Product_Images
  • Discount_Coupons
  • EU_Cookie_Law
  • Egoods
  • Extra_Fields
  • Fast_Lane_Checkout
  • Feature_Comparison
  • Flyout_Menus
  • Froogle
  • Gift_Certificates
  • Gift_Registry
  • Google_Analytics
  • Google_Checkout
  • Greet_Visitor
  • HTML_Editor
  • Image_Verification
  • Interneka
  • Lexity
  • Magnifier
  • Mailchimp_Subscription
  • Maintenance_Agent
  • Manufacturers
  • New_Arrivals
  • News_Management
  • On_Sale
  • Order_Tracking
  • PayPalAuth
  • Product_Configurator
  • Product_Options
  • Products_Map
  • QuickBooks
  • Quick_Reorder
  • RMA
  • Recently_Viewed
  • Recommended_Products
  • Shipping_Label_Generator
  • Simple_Mode
  • Sitemap
  • SnS_connector
  • Socialize
  • Special_Offers
  • Stop_List
  • Subscriptions
  • Survey
  • TaxCloud
  • UPS_OnLine_Tools
  • Upselling_Products
  • Users_online
  • Wholesale_Trading
  • Wishlist
  • XAffiliate
  • XPayments_Connector
  • XSEO

Names of sql tables:

  • prefixed with "xcart_"

Names of sql config variables:

  • See: sql/xcart_data.sql

Names of sql labels:

  • See: sql/xcart_languages_US.sql

To avoid service name conflicts with Qualiteam solutions, developers of 3rd party add-on modules should avoid using the above listed service names for the purpose of naming entities pertaining to their work.
It is strongly recommended that a unique prefix be used for your add-on module in all labels, sql-xcart_config, sql-xcart_languages, sql-xcart_modules, global variables, module name and names of module files.