include "ShippingZMessages.php";
}
// TEST all the files are all the same version
if (!(SHIPPINGZCLASSES_VERSION == SHIPPINGZOSCOMMERCE_VERSION && SHIPPINGZOSCOMMERCE_VERSION == SHIPPINGZMESSAGES_VERSION)) {
    echo "File version mismatch<br>";
    echo "ShippingZClasses.php [" . SHIPPINGZCLASSES_VERSION . "]<br>";
    echo "ShippingZOscommerce.php [" . SHIPPINGZOSCOMMERCE_VERSION . "]<br>";
    echo "ShippingZMessages.php [" . SHIPPINGZMESSAGES_VERSION . "]<br>";
    echo "Please, make sure all of the above files are same version.";
    exit;
}
// Check for Oscommerce include files
if (Check_Include_File('includes/application_top.php')) {
    require 'includes/application_top.php';
}
if (Check_Include_File(OSCOMMERCE_ADMIN_DIRECTORY . '/includes/classes/order.php')) {
    require OSCOMMERCE_ADMIN_DIRECTORY . '/includes/classes/order.php';
}
############################################## Always Enable Exception Handler ###############################################
error_reporting(E_ALL);
ini_set('display_errors', '1');
set_error_handler("ShippingZ_Exception_Error_Handler");
############################################## Class ShippingZOscommerce ######################################
class ShippingZOscommerce extends ShippingZGenericShoppingCart
{
    //cart specific functions goes here
    ############################################## Function Check_DB_Access #################################
    //Check Database access
    #######################################################################################################
    function Check_DB_Access()
    {
}
###############################################################################################################
//Zencart uses "zen_catalog_href_link()" function to prepare formatted links with different parameters.
//This is not required for displaying our order details.
//It is observed, sometimes due to alteration/customization "zen_catalog_href_link()" function becomes not accessible.
//Hence, define this function to make sure that our code does not break due to zencart undefined zen_catalog_href_link() error.
if (!function_exists(zen_catalog_href_link)) {
    function zen_catalog_href_link($page = '', $parameters = '', $connection = '')
    {
    }
}
###############################################################################################################
if (Check_Include_File(ZENCART_ADMIN_DIRECTORY . '/includes/classes/object_info.php')) {
    require ZENCART_ADMIN_DIRECTORY . '/includes/classes/object_info.php';
}
if (Check_Include_File(ZENCART_ADMIN_DIRECTORY . '/includes/classes/order.php')) {
    require ZENCART_ADMIN_DIRECTORY . '/includes/classes/order.php';
}
############################################## Always Enable Exception Handler ###############################################
error_reporting(E_ALL);
ini_set('display_errors', '1');
set_error_handler("ShippingZ_Exception_Error_Handler");
############################################## Class ShippingZZencart ######################################
class ShippingZZencart extends ShippingZGenericShoppingCart
{
    //cart specific functions goes here
    ############################################## Function Check_DB_Access #################################
    //Check Database access
    #######################################################################################################
    function Check_DB_Access()
    {
    include "ShippingZClasses.php";
}
if (Check_Include_File("ShippingZMessages.php")) {
    include "ShippingZMessages.php";
}
// TEST all the files are all the same version
if (!(SHIPPINGZCLASSES_VERSION == SHIPPINGZOPENCART_VERSION && SHIPPINGZOPENCART_VERSION == SHIPPINGZMESSAGES_VERSION)) {
    echo "File version mismatch<br>";
    echo "ShippingZClasses.php [" . SHIPPINGZCLASSES_VERSION . "]<br>";
    echo "ShippingZOpencart.php [" . SHIPPINGZOPENCART_VERSION . "]<br>";
    echo "ShippingZMessages.php [" . SHIPPINGZMESSAGES_VERSION . "]<br>";
    echo "Please, make sure all of the above files are same version.";
    exit;
}
// Check for bootstrap file and bootstrap the DB
if (Check_Include_File('ShippingZOpencartBootstrap.php')) {
    require 'ShippingZOpencartBootstrap.php';
}
// Can now access DB with Opencart functions
############################################## Always Enable Exception Handler ###############################################
error_reporting(E_ALL);
ini_set('display_errors', '1');
set_error_handler("ShippingZ_Exception_Error_Handler");
############################################## Class ShippingZOpencart ######################################
class ShippingZOpencart extends ShippingZGenericShoppingCart
{
    //cart specific functions goes here
    ############################################## Function Check_DB_Access #################################
    //Check Database access
    #######################################################################################################
    function Check_DB_Access()
}
if (Check_Include_File("ShippingZMessages.php")) {
    include "ShippingZMessages.php";
}
// TEST all the files are all the same version
if (!(SHIPPINGZCLASSES_VERSION == SHIPPINGZDRUPAL_VERSION && SHIPPINGZDRUPAL_VERSION == SHIPPINGZMESSAGES_VERSION)) {
    echo "File version mismatch<br>";
    echo "ShippingZClasses.php [" . SHIPPINGZCLASSES_VERSION . "]<br>";
    echo "ShippingZDrupal.php [" . SHIPPINGZDRUPAL_VERSION . "]<br>";
    echo "ShippingZMessages.php [" . SHIPPINGZMESSAGES_VERSION . "]<br>";
    echo "Please, make sure all of the above files are same version.";
    exit;
}
// Check for Drupal bootstrap file and bootstrap the DB
define("DRUPAL_ROOT", getcwd());
if (Check_Include_File('includes/bootstrap.inc')) {
    require 'includes/bootstrap.inc';
}
drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
// Can now access DB with Drupal functions
############################################## Always Enable Exception Handler ###############################################
error_reporting(E_ALL);
ini_set('display_errors', '1');
set_error_handler("ShippingZ_Exception_Error_Handler");
############################################## Class ShippingZDrupal ######################################
class ShippingZDrupal extends ShippingZGenericShoppingCart
{
    //cart specific functions goes here
    ############################################## Function Check_DB_Access #################################
    //Check Database access
    #######################################################################################################
{
    if (file_exists($filename)) {
        return true;
    } else {
        echo "\"{$filename}\" is not accessible.";
        exit;
    }
}
//Check for ShippingZ integration files
if (Check_Include_File("ShippingZSettings.php")) {
    include "ShippingZSettings.php";
}
if (Check_Include_File("ShippingZClasses.php")) {
    include "ShippingZClasses.php";
}
if (Check_Include_File("ShippingZMessages.php")) {
    include "ShippingZMessages.php";
}
// TEST all the files are all the same version
if (!(SHIPPINGZCLASSES_VERSION == SHIPPINGZMAGENTO_VERSION && SHIPPINGZMAGENTO_VERSION == SHIPPINGZMESSAGES_VERSION)) {
    echo "File version mismatch<br>";
    echo "ShippingZClasses.php [" . SHIPPINGZCLASSES_VERSION . "]<br>";
    echo "ShippingZMagento.php [" . SHIPPINGZMAGENTO_VERSION . "]<br>";
    echo "ShippingZMessages.php [" . SHIPPINGZMESSAGES_VERSION . "]<br>";
    echo "Please, make sure all of the above files are same version.";
    exit;
}
if (!defined("Magento_Store_Code_To_Service")) {
    define("Magento_Store_Code_To_Service", "-ALL-");
}
//Include mage model for gift messages
}
// TEST all the files are all the same version
if (!(SHIPPINGZCLASSES_VERSION == SHIPPINGZXCART_VERSION && SHIPPINGZXCART_VERSION == SHIPPINGZMESSAGES_VERSION)) {
    echo "File version mismatch<br>";
    echo "ShippingZClasses.php [" . SHIPPINGZCLASSES_VERSION . "]<br>";
    echo "ShippingZXcart.php [" . SHIPPINGZXCART_VERSION . "]<br>";
    echo "ShippingZMessages.php [" . SHIPPINGZMESSAGES_VERSION . "]<br>";
    echo "Please, make sure all of the above files are same version.";
    exit;
}
#########################################################################################################################
//Check for xcart include files
if (Check_Include_File("./top.inc.php")) {
    require "./top.inc.php";
}
if (Check_Include_File("./init.php")) {
    require "./init.php";
}
############################################## Always Enable Exception Handler ###############################################
error_reporting(E_ALL);
ini_set('display_errors', '1');
set_error_handler("ShippingZ_Exception_Error_Handler");
############################################## Class ShippingZXcart ######################################
class ShippingZXcart extends ShippingZGenericShoppingCart
{
    //cart specific functions goes here
    ############################################## Function Check_DB_Access #################################
    //Check Database access
    #######################################################################################################
    function Check_DB_Access()
    {
// TEST all the files are all the same version
if (!(SHIPPINGZCLASSES_VERSION == SHIPPINGZPRESTASHOP_VERSION && SHIPPINGZPRESTASHOP_VERSION == SHIPPINGZMESSAGES_VERSION)) {
    echo "File version mismatch<br>";
    echo "ShippingZClasses.php [" . SHIPPINGZCLASSES_VERSION . "]<br>";
    echo "ShippingZPrestaShop.php [" . SHIPPINGZPRESTASHOP_VERSION . "]<br>";
    echo "ShippingZMessages.php [" . SHIPPINGZMESSAGES_VERSION . "]<br>";
    echo "Please, make sure all of the above files are same version.";
    exit;
}
#########################################################################################################################
//Check for prestashop include files
$presta_library_file = 1;
if (Check_Include_File("PSWebServiceLibrary.php", $presta_library_file)) {
    require "PSWebServiceLibrary.php";
}
if (Check_Include_File(dirname(__FILE__) . '/config/config.inc.php')) {
    require dirname(__FILE__) . '/config/config.inc.php';
}
$db_pdo = new PDO("mysql:host=" . _DB_SERVER_ . ";dbname=" . _DB_NAME_, _DB_USER_, _DB_PASSWD_);
############################################## Always Enable Exception Handler ###############################################
error_reporting(E_ALL);
ini_set('display_errors', '1');
set_error_handler("ShippingZ_Exception_Error_Handler");
############################################## Class ShippingZPrestaShop ######################################
class ShippingZPrestaShop extends ShippingZGenericShoppingCart
{
    //cart specific functions goes here
    ############################################## Function Check_DB_Access #################################
    //Check Database access
    #######################################################################################################
    function Check_DB_Access()