Zen Cart v1.5.4 Released!

 plugins, v1.5.4, zen-cart  Comments Off on Zen Cart v1.5.4 Released!
Jan 012015
 

Zen Cart v1.5.4 was released yesterday, primarily containing bugfixes and performance improvements over and above Zen Cart v1.5.3; this version (like v1.5.0) is PCI-compliant.

One change of note is the addition of an admin function: zen_record_admin_activity.  This function is now widely used within the various Zen Cart admin modules, especially in the (ever popular) /YOUR_ADMIN/orders.php.  I’ve developed a backward-compatibility script that any Zen Cart plugin author can use; this script enables authors to upgrade their admin-level core-file overwrites to use the Zen Cart v1.5.4 version without the need for Zen Cart version-specific instructions in their installations.  This script (two files) is posted here on the Zen Cart forums.

At this time, all of my Zen Cart plugins (both free and commerical) have either been updated or verified to operate with Zen Cart v1.5.4!

Testing Email Formatting (with “Live” Data)

 hints, v1.5.0, v1.5.1, zen-cart  Comments Off on Testing Email Formatting (with “Live” Data)
Nov 032013
 

When you’re working on your admin-level email formatting in a test installation with otherwise “live” date (i.e. copies of “real” customers and their orders) you don’t want your test emails to deluge your customer base!  I was digging through /includes/functions/functions_email.php last month and came across the constant DEVELOPER_OVERRIDE_EMAIL_ADDRESS.

If that variable is defined, then all email (both customer and admin) will be sent only to the email address(es) you’ve specified! The value is a packed, comma-separated of email addresses in the format

<Name-to-use>email_address[,<Name-to-use-2>email_address_2 …]

When I’ve used this trick, I created two files:

  1. An auto-loader (/MY_ADMIN/includes/auto_loaders/config.developer_override_email_address.php) that contains:
    <?php
    if (!defined('IS_ADMIN_FLAG')) {
      die('Illegal Access');
    } 
    $autoLoadConfig[200][] = array(
      'autoType'  => 'init_script',
      'loadFile'  => 'init_developer_override_email_address.php');
  2. An initialization file (/MY_ADMIN/includes/init_includes/init_developer_override_email_address.php) that contains:
    <?php
    define('DEVELOPER_OVERRIDE_EMAIL_ADDRESS', 'me@example.com);
    
    // -----
    // For testing purposes, if the following define is non-blank then it is used as the email address for *all*
    // emails.  Put up a notice to let the admin know that this override is active, if set.
    //
    if (defined('DEVELOPER_OVERRIDE_EMAIL_ADDRESS') && DEVELOPER_OVERRIDE_EMAIL_ADDRESS != '') {
      $messageStack->add(sprintf('<strong>Notice</strong>: Email address override is active! All emails will be sent to %s.', DEVELOPER_OVERRIDE_EMAIL_ADDRESS));
    
    }

Just change the me@example.com to your email address and it’s set; set the value to ” to disable the feature.  A message will appear in your admin’s header if the feature is active, notifying you where all the emails will be sent.

Happy testing!

 

Zen Cart Observers … They Work in the Admin, Too!

 hints, Uncategorized, v1.5.0, v1.5.1, zen-cart  Comments Off on Zen Cart Observers … They Work in the Admin, Too!
Sep 222013
 

The Zen Cart Observer Class is a great tool for plugin developers, allowing a plugin to watch for (“observe”) the occurrence of an event (a “notification”) and provide additional processing without making modifications to Zen Cart core files.  What hasn’t been stressed over the past years is that this notifier/observer interface also works in the Zen Cart admin panel!

It seems like every plugin (and its brother) need just a small update to /YOUR_ADMIN/orders.php, making the plugin installation (and Zen Cart upgrade) process just that more complex.  If plugin authors, myself included, would start adding a notifier at specific processing points in the popular (e.g. orders.php, customer.php) admin pages and providing observer code to insert their customizations, both the installation and upgrade processes would go much more smoothly.