Zen Cart custom software development, Zen Cart modules, Zen Cart Expert eCommerce with Zen Cart!

Responsive osCommerce and PHP7

Responsive osCommerce (aka Phoenix) is a community release which necessitates some tweaks to my software.

This work has been done for Better Together and Quantity Discounts. When people buy my paid mods for osCommerce, I'll do it there too.

  • The file includes/database_tables.php has been removed from this version, so you'll have to fix the table name definitions. Add to the top of includes/modules/order_total/my_module the following:
    if (!defined('TABLE_PRODUCTS')) { 
      define('TABLE_PRODUCTS', 'products');
    }
    if (!defined('TABLE_PRODUCTS_TO_CATEGORIES')) { 
      define('TABLE_PRODUCTS_TO_CATEGORIES', 'products_to_categories');
    }
    if (!defined('TABLE_TAX_RATES')) { 
      define('TABLE_TAX_RATES', 'tax_rates');
    }
    if (!defined('TABLE_CONFIGURATION')) {
      define('TABLE_CONFIGURATION', 'configuration');
    }
    if (!defined('TABLE_CATEGORIES_DESCRIPTION')) {
      define('TABLE_CATEGORIES_DESCRIPTION', 'categories_description');
    }
    etc. as required
    
  • The file includes/filenames.php has been removed from this version, so you'll have to fix the file name definitions. Add to the top of includes/modules/order_total/my_module the following:
    if (!defined('FILENAME_PRODUCT_INFO')) { 
      define('FILENAME_PRODUCT_INFO', 'product_info.php');
    }
    if (!defined('FILENAME_DEFAULT')) { 
      define('FILENAME_DEFAULT', 'index.php');
    }
    
  • PHP5 style constructors are now required in PHP7. So change the constructor name to __construct. For Better Together, this means changing
            function ot_better_together() {
        
    to
            function __construct() {
        
  • PHP7 now complains about missing defined variables, so do an early exit if the module is not installed right after the title and description are set. For Better Together, this would be
           $this->description = MODULE_ORDER_TOTAL_BETTER_TOGETHER_DESCRIPTION;
           $this->enabled = ((MODULE_ORDER_TOTAL_BETTER_TOGETHER_STATUS == 'true') ? true : false);
          if (!$this->enabled) return;