Zen Follower
- Join Date:
- Aug 2010
- Location:
- Grand Blanc, MI
- Posts:
- 305
- Plugin Contributions:
- 1
Admin Add Customer
Just upgraded to v1.1.0, no change. Still not showing in customers menu, and same result/errors if I type in the url.
Views: 535
Zen Follower
Just upgraded to v1.1.0, no change. Still not showing in customers menu, and same result/errors if I type in the url.
Zen Follower
One file try to use the function zen_config() that is part of ZC v3. Older version don't have it, it is why you have some trouble. You can fix it by changing line 58 of file ../zc_plugins/AdminAddUser/v1.0.0/admin/includes/classes/addCustomers.php from:
return zen_config('WHOLESALE_PRICING_CONFIG') !== 'false';
To
return WHOLESALE_PRICING_CONFIG !== 'false';
This should fix it as this is the only place where this function is used.
@dbltoe, you need to update the plugin this way or add the zen_config function in the extra_function folder.
ZC v2.2.2 PHP 8.4+ MySQL 8.4+
Zen Follower
pilou2:
One file try to use the function zen_config() that is part of ZC v3. Older version don't have it, it is why you have some trouble. You can fix it by changing line 58 of file ../zc_plugins/AdminAddUser/v1.0.0/admin/includes/classes/addCustomers.php from:
return zen_config('WHOLESALE_PRICING_CONFIG') !== 'false';
> To
> ```php
return WHOLESALE_PRICING_CONFIG !== 'false';
This should fix it as this is the only place where this function is used.
@dbltoe, you need to update the plugin this way or add the zen_config function in the extra_function folder.
Thank you, that got rid of that error, but it still isn't showing up in the Customers menu and I am now getting this error when I type in the CMD (url/admin/index.php?cmd=add_customers)
[03-Aug-2026 14:19:09 America/New_York] PHP Fatal error: Uncaught Error: Undefined constant "FILENAME_ADD_CUSTOMERS" in /zc_plugins/AdminAddUser/v1.1.0/admin/add_customers.php:305
Stack trace:
#0 /GreEEn-kITtEn-713ziK/index.php(28): require()
#1 {main}
thrown in /zc_plugins/AdminAddUser/v1.1.0/admin/add_customers.php on line 305
[03-Aug-2026 14:19:09 America/New_York] Request URI: /xxxx/index.php?cmd=add_customers, IP address: 2603:3015:bb2:8200:a064:e62a:e530:faa7
--> PHP Fatal error: Uncaught Error: Undefined constant "FILENAME_ADD_CUSTOMERS" in /zc_plugins/AdminAddUser/v1.1.0/admin/add_customers.php:305
Stack trace:
#0 /xxxx/index.php(28): require()
#1 {main}
thrown in /zc_plugins/AdminAddUser/v1.1.0/admin/add_customers.php on line 305.
[03-Aug-2026 14:19:09 America/New_York] Request URI: /xxxx/index.php?cmd=add_customers, IP address: 2603:3015:bb2:8200:a064:e62a:e530:faa7
--> PHP Fatal error: Uncaught Error: Undefined constant "FILENAME_ADD_CUSTOMERS" in /zc_plugins/AdminAddUser/v1.1.0/admin/add_customers.php:305
Stack trace:
#0 /GreEEn-kITtEn-713ziK/index.php(28): require()
#1 {main}
thrown in /zc_plugins/AdminAddUser/v1.1.0/admin/add_customers.php on line 305.
Something definitely isn't installing like it should be... I have an idea I'll try tonight, I have orders to get shipped out before scheduled pickups.
Zen Follower
A quick fix is to copy the file ../zc_plugins/AdminAddUser/v1.1.0/filenames.php to a new folder :
../zc_plugins/AdminAddUser/v1.1.0/admin/includes/extra_datafiles/filenames.php
ZC v2.2.2 PHP 8.4+ MySQL 8.4+
Totally Zenned
If you were using ZCA Bootstrap, that could have been part of your problem as well. Before ZC version 2.2.0, Bootstrap did not automatically load its own filenames.
The use of zen_config() already had the workaround for 2.0.0 through 2.3 in previous trials but apparently got lost in one of the shuffles.
@pilou2 - As usual, both fixes were spot on
Until in downloads - https://github.com/dbltoe/admin_add_customer/releases/tag/v1.1.1
Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com
Totally Zenned
Too late to edit above. Found a third glitch after the other two prompted a full audit.
The new version is 1.2.0 at https://github.com/dbltoe/admin_add_customer/releases/tag/v1.2.0
Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com
Administrator
dbltoe:
If you were using ZCA Bootstrap, that could have been part of your problem as well. Before ZC version 2.2.0, Bootstrap did not automatically load its own filenames.
The use of zen_config() already had the workaround for 2.0.0 through 2.3 in previous trials but apparently got lost in one of the shuffles.
@pilou2 - As usual, both fixes were spot on
Until in downloads - https://github.com/dbltoe/admin_add_customer/releases/tag/v1.1.1
Would you explain the highlighted comment? Bootstrap's admin filenames have been delivered forever in an extra_datafiles file, which is always loaded by the base Zen Cart.
Zen Follower
1.2.0 is up and running. Thank you!
Totally Zenned
Sorry, that was probably a Grammarly rewrite that lost the actual point — let me restate it plainly.
I had the information needed for the mod's performance with bootstrap in the root.
The gap wasn't in extra_datafiles/ — you're right that it's been auto-loaded by core forever, and that's confirmed against the actual source at every tag from v2.0.0 through master. The gap was that this plugin's filenames.php was only sitting at its own root (zc_plugins/AdminAddUser/v1.1.0/filenames.php), not inside admin/includes/extra_datafiles/. And a plugin's own root-level filenames.php is a newer convenience — core only started auto-loading that directly starting at v2.2.0.
Before that, it simply wasn't picked up at all unless it also lived in extra_datafiles/.
So this was a bug in how the plugin was packaged, not anything wrong with Zen Cart's loading order or Bootstrap operation. It's fixed now by putting a copy in admin/includes/extra_datafiles/ (and catalog/includes/extra_datafiles/, for the storefront-side activation page) — exactly the traditional pattern you're describing, which apparently I should have used from the start instead of leaning on the newer root-level auto-load.
To be succinct, we didn't give the mod what it needed to work with pre-2.2.0 ZC and Bootstrap.
Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com
Totally Zenned
Version 1.2.1 is now up, and it's worth updating regardless of which version you're on.
First, thank you to the two of you who reported problems - both were real, and both were our errors.
The "won't install" report on 2.1.0 came down to packaging. This plugin shipped its filenames.php only at its own root, and Zen Cart core only began auto-loading a plugin's root-level filenames.php at v2.2.0. Before that, nothing picked it up, so FILENAME_ADD_CUSTOMERS and friends were simply never defined - the admin menu entry broke after install, and the
activation link in every welcome email broke along with it. The fix is the traditional one we should have used from the start: a copy in admin/includes/extra_datafiles/ (and catalog/includes/extra_datafiles/ for the storefront side), which core has loaded for plugins since v2.0.0.
Apologies also for my earlier remark in this thread about ZCA Bootstrap - that was wrong, and I should retract it. Bootstrap ships its admin filenames in an extra_datafiles file, which core has always loaded, and it has nothing to do with this. The fault was entirely in how we packaged ours.
Second, wholesaleEnabled() called zen_config(). That helper is new in Zen Cart 3.0.0, so on earlier versions, it failed outright with "Call to undefined function." We claimed 2.0.0-3.0.0 support and then called a 3.0.0-only function; there's no excuse for that one, and thanks for pinning it to the exact line.
Those two prompted an audit of every core function this plugin calls against its actual @since in core source, which turned up a third: create_coupon_code(). That function has never existed in Zen Cart under that name in any version; it was inherited from the original mod and was never exercised because it only runs on stores with the New Signup Gift Voucher setting enabled. Those stores were failing on every single customer ad. It now uses Coupon::generateRandomCouponCode().
Finally, 1.2.1 also includes three security fixes identified during a scan of the entire plugin before packaging. All three need an authenticated admin session to reach, so this is hardening rather than an open door, but they're real: error messages were being written to the page without escaping and could carry a submitted value verbatim; the CSV upload used the client-supplied
filename as its on-disk path; and the admin class was missing the IS_ADMIN_FLAG guard, which core's zc_plugins/.htaccess only covers on Apache.
No database changes, so upgrading is just the usual: upload the new version folder alongside the old one and run the upgrade from Tools->Install Plugins.
Full details in the readme's version history, and on GitHub at https://github.com/dbltoe/admin_add_customer
Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com
Totally Zenned
v1.2.2 is a hardening and correctness release. We recommend it for everyone, though nothing in it is as urgent as the fixes in v1.2.1.
SECURITY: Customer names shown in the admin's own confirmation messages are now escaped when displayed. The names this plugin writes were already stripped of angle brackets on the way in, so this was never a problem for them. The "Resend the Welcome E-Mail" message does not only show those, though: its drop-down lists every customer still awaiting activation, including customers who registered through the storefront on an approval-required store, and customers whose details were edited elsewhere in the admin. We cannot vouch for names this plugin did not write, so we no longer try to. They are escaped at the point of display instead, which is correct, regardless of their origin. Reaching this required an unusual combination: an approval-required store, a customer created outside this plugin with markup in their name, and an admin using Resend on that customer, so it is hardening rather than an open door.
FIXED: The printable sign-up sheets were documented as something you had to supply. The readme said "you supply them yourself" and the pdf folder's README said "Add exactly these two files here before deploying", but both PDFs have shipped with the plugin since v1.0.0. Anyone following those instructions would have already gone looking for files sitting in their downloads. Both files now say the sheets ship and work as soon as you install them, and explain how to replace either one with your own.
CHANGED: The "Welcome E-Mail Header Image" heading and its "E-Mail Header to Import:" field said "Email," whereas Zen Cart core uses "E-Mail". Core's own ENTRY_EMAIL_ADDRESS is "E-Mail Address:", so these now match it, along with everything that quotes them. The readme and the CSV formatting guide were also misquoting core's Configuration->Minimum Values->E-Mail Address setting, which is corrected.
CHANGED: The message shown when a bulk-upload file has a bad header row said "recognised". It now reads "recognized", matching the American spelling used everywhere else in the plugin.
CHANGED: The plugin's Plugins Library ID is now declared as an integer rather than a quoted string, matching how Zen Cart's own bundled plugins declare theirs. Nothing behaved differently either way, and the id itself is unchanged.
There are no database changes in this release. Upload the new version folder alongside the old one and run the upgrade from Tools->Install Plugins.
Until approved: https://github.com/dbltoe/admin_add_customer/releases/tag/v1.2.2
Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com
Tell staff why this post should be reviewed.