Page 82 of 82 FirstFirst ... 3272808182
Results 811 to 819 of 819
  1. #811
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,977
    Plugin Contributions
    96

    Default Re: Super Orders v4.0 Support Thread (for ZC v1.5.x)

    Quote Originally Posted by strelitzia View Post
    I don't know how many people still use Super Orders, but I'm in the testing phase with a much updated version that works on 2.1.0 and the upcoming 2.2.0 release.
    It's tested up to PHP 8.4.15 and many core file edits have been removed. admin/orders.php now only requires a couple of new notifier hooks to be added. Once initial testing is complete I'll upload to github and also submit it here.
    If you also PR those new notifier hooks to the Zen Cart base GitHub, those changes won't be needed for SO's use on zc220!

  2. #812
    Join Date
    Nov 2005
    Location
    France
    Posts
    600
    Plugin Contributions
    8

    Default Re: Super Orders v4.0 Support Thread (for ZC v1.5.x)

    An update regarding the ongoing work to drag Super Orders into the modern age and allow compatibility with Zen Cart 2.2.0

    One major step forward with the latest version is that it's now an encapsulated plugin.

    Popup windows have been retired and it now uses modal popups.

    Pages have been updated to use Zen Cart's modern Bootstrap styling.

    Does anyone have any objections if I identify this update as version 6.0.0?
    The version numbers in the files are all over the place. I think v5.0.0 is the highest I've seen listed in the files, but as this is such a major rewrite I'd prefer not to just make it 5.1.0

    Quote Originally Posted by lat9 View Post
    If you also PR those new notifier hooks to the Zen Cart base GitHub, those changes won't be needed for SO's use on zc220!
    I'll do a PR once I've finished testing and I'm sure I don't need to add any more.
    So far there are new notifiers in invoice.php, packingslip.php, and orders.php
    Managing Director of https://jsweb.uk

    Zen Cart developer since 2009

  3. #813
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,545
    Plugin Contributions
    127

    Default Re: Super Orders v4.0 Support Thread (for ZC v1.5.x)

    > Does anyone have any objections if I identify this update as version 6.0.0?

    Please do so. This is very much in line with the kind of Semantic versioning that we're trying to use in the product.

    And thanks for your hard work on Super Orders.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #814
    Join Date
    Nov 2005
    Location
    France
    Posts
    600
    Plugin Contributions
    8

    Default Batch Printing Fatal Error – currencies Class Redeclaration

    Hi @lat9 and @swguy,

    While testing recent Super Orders updates, I’ve encountered a fatal error during batch printing of invoices or packing slips and would appreciate some guidance.

    Issue Summary

    When batch-printing multiple invoices or packing slips, a fatal error occurs once the second order is processed:

    Code:
    PHP Fatal error: Cannot declare class currencies, because the name is already in use
    in /includes/classes/currencies.php on line 18
    Root Cause

    Batch printing loops through multiple order IDs and repeatedly requires the same invoice/packing slip file:

    Code:
    foreach ($batch_order_numbers as $_order_number) {
      $_GET['oID'] = $_order_number;
      require $target_file;  // invoice.php or packingslip.php
    }
    Both invoice.php and packingslip.php contain:

    Code:
    require('includes/application_top.php');
    ...
    $currencies = new currencies();
    On the first iteration, application_top.php loads normally and includes the currencies class.
    On subsequent iterations, require causes application_top.php to execute again, attempting to
    re-declare the currencies class and resulting in the fatal error.

    Proposed Solutions

    Solution 1: Notifier-Based Approach (Observer Pattern)

    In invoice.php and packingslip.php:

    Code:
    require('includes/application_top.php');
    
    $currencies_already_initialized = false;
    $zco_notifier->notify(
      'NOTIFY_ADMIN_INVOICE_CURRENCIES_INIT',
      $currencies_already_initialized
    );
    
    if (
      !$currencies_already_initialized &&
      (!isset($currencies) || !is_object($currencies))
    ) {
      $currencies = new currencies();
    }
    Observer example:

    Code:
    $zco_notifier->attach(
      $this,
      'NOTIFY_ADMIN_INVOICE_CURRENCIES_INIT',
      function (&$currencies_already_initialized) {
        global $currencies;
        if (isset($currencies) && is_object($currencies)) {
          $currencies_already_initialized = true;
        }
      }
    );
    Solution 2: Explicit require_once for currencies Class

    Code:
    require('includes/application_top.php');
    require_once(DIR_WS_CLASSES . 'currencies.php');
    $currencies = new currencies();
    Question

    From a core-development perspective, which approach would be preferred for addressing this
    batch printing issue: a notifier-based solution aligned with Zen Cart’s observer pattern, or a
    simpler require_once safeguard?

    Thanks for your guidance.
    Managing Director of https://jsweb.uk

    Zen Cart developer since 2009

  5. #815
    Join Date
    Nov 2005
    Location
    France
    Posts
    600
    Plugin Contributions
    8

    Default Re: Super Orders v4.0 Support Thread for ZC v1.5.x

    There was an error in this section
    Code:
    require('includes/application_top.php');
    require_once(DIR_WS_CLASSES . 'currencies.php');
    $currencies = new currencies();
    It would probably need to be more like
    Code:
    require('includes/application_top.php');
     
    // Ensure currencies class is available (use require_once to prevent redeclaration)
    require_once(DIR_WS_CLASSES . 'currencies.php');
    // $currencies = new currencies();
    Managing Director of https://jsweb.uk

    Zen Cart developer since 2009

  6. #816
    Join Date
    Nov 2005
    Location
    France
    Posts
    600
    Plugin Contributions
    8

    Default Re: Super Orders v4.0 Support Thread for ZC v1.5.x

    Having reviewed this further, would it be workable to attach an observer to NOTIFIER_CURRENCIES_CONSTRUCT_END that treats the first currencies instance as canonical, and on subsequent instantiations copies state from the original instance so repeated new currencies() calls are effectively idempotent.
    Managing Director of https://jsweb.uk

    Zen Cart developer since 2009

  7. #817
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    939
    Plugin Contributions
    9

    Default Re: Super Orders v4.0 Support Thread for ZC v1.5.x

    Quote Originally Posted by strelitzia View Post
    There was an error in this section
    Code:
    require('includes/application_top.php');
    require_once(DIR_WS_CLASSES . 'currencies.php');
    $currencies = new currencies();
    It would probably need to be more like
    Code:
    require('includes/application_top.php');
     
    // Ensure currencies class is available (use require_once to prevent redeclaration)
    require_once(DIR_WS_CLASSES . 'currencies.php');
    // $currencies = new currencies();
    You can leave the $currencies = new currencies line alone as all it does is just refresh it with the same data it already has. Messing around with the batch pages, I had the same bandaid fix as well. (Plus, a few more to get the page breaks to work too.)

  8. #818
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,545
    Plugin Contributions
    127

    Default Re: Super Orders v4.0 Support Thread for ZC v1.5.x

    Where does the update stand? I have customers who still use Super Batch Print. Thanks!
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  9. #819
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,545
    Plugin Contributions
    127

    Default Re: Super Orders v4.0 Support Thread for ZC v1.5.x

    Any updates on this plugin?
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 
Page 82 of 82 FirstFirst ... 3272808182

Similar Threads

  1. v150 Edit Orders v4.0 Support Thread
    By DivaVocals in forum Addon Admin Tools
    Replies: 1922
    Last Post: 22 Jul 2026, 08:43 PM
  2. Edit Orders v3.0 for ZC 1.3.9 [Support Thread]
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 656
    Last Post: 18 Apr 2016, 06:28 PM
  3. v139h Super Orders v3.0 Support Thread (for ZC v1.3.9)
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 1018
    Last Post: 28 Apr 2014, 11:38 PM
  4. OLD Super Orders 2.0 (See v3.0 thread instead)
    By BlindSide in forum All Other Contributions/Addons
    Replies: 2019
    Last Post: 17 Jan 2012, 05:43 AM
  5. RE: Super Orders v3.0 Support Thread
    By Johnnyd in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 22 Jun 2011, 09:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg