Zen Cart Logo
Forums / Addon Admin Tools / Edit Orders v4.0 Support Thread

Edit Orders v4.0 Support Thread

Views: 346,083

Results 1,701 to 1,720 of 1,927
17 Jun 2021, 4:59 PM
#1701
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,955
Plugin Contributions:
8

Edit Orders v4.0 Support Thread

wsworx:

How is it that they are showing up in the My Store menu though?
Attachment 19636

a few items:

  • in your posting of the debug logs above, did you *** all of that stuff, or did the board do that? if it was you, only change the admin directory. else i (and others) need to make guesses about what file we are looking at.
  • line 79 of the guessed file above, looks to be actually line 78 in the repo. so something looks to be modified. (red herring, though...)
  • your posted image proves nothing to me. other than there are config values that have the description associated with those constants.
  • you need to look at the database and see what those values are. i changed mine and i still see the same image that you posted.
  • the image below shows that i changed the config value by adding a _2 to it.
  • what is in the database for the 2 items that you posted?

Attachment 19637

17 Jun 2021, 5:00 PM
#1702
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

lat9:

I'm agreeing with @carlwhat here. @wsworx, within your admin, append the following to the admin's base URL:

/index.php?cmd=configuration&gID=6

... which will bring up the 'hidden' modules settings. Be very, very careful since some of those changes are programmatic!

Find the setting Admin configuration_key shows and change its value to 1. Then head back to Configuration :: My Store and select the Display Product with Tax setting.

What configuration key is identified?

Configuration :: My Store and select the Display Product with Tax doesn't exist

Did you mean Configuration :: My Store and select the Display Price with Tax

17 Jun 2021, 5:03 PM
#1703
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

carlwhat:

a few items:

  • in your posting of the debug logs above, did you *** all of that stuff, or did the board do that? if it was you, only change the admin directory. else i (and others) need to make guesses about what file we are looking at.
  • line 79 of the guessed file above, looks to be actually line 78 in the repo. so something looks to be modified. (red herring, though...)
  • your posted image proves nothing to me. other than there are config values that have the description associated with those constants.
  • you need to look at the database and see what those values are. i changed mine and i still see the same image that you posted.
  • the image below shows that i changed the config value by adding a _2 to it.
  • what is in the database for the 2 items that you posted?

Attachment 19637

Okay, that seems to be the issue as I cannot find those two configuration keys in the configuration table.
I will work on that issue first and get back.

Thank You for steering me in the right direction folks.

17 Jun 2021, 5:03 PM
#1704
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,955
Plugin Contributions:
8

Re: Edit Orders v4.0 Support Thread

lat9:

Find the setting Admin configuration_key shows and change its value to 1. Then head back to Configuration :: My Store and select the Display Product with Tax setting.

oh my, that explains my confusion!

you learn something new every day!

thanks @lat9.

17 Jun 2021, 5:17 PM
#1705
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,069
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

carlwhat:

oh my, that explains my confusion!

you learn something new every day!

thanks @lat9.
That's what life's about!

18 Jun 2021, 3:56 PM
#1706
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

So after I cleared my head and thought more through it I went back through my configuration table and I found that I do have these configuration keys in the configuration table of the database. When I attempt to access a customer in Customers:Orders:Edit Orders I get a blank screen and below is the only log file I get. It is titled as a warning not an actual error "myDEBUG-adm-20210618-093749-913692-warning.log". I can change the settings for the two in Configuration:My Store and the database will reflect that change so they are working correctly.

Any ideas or thoughts would be greatly appreciated?

I tried doing a new installation and copying my data over to the new tables but I can't resolve a MYSql error about there being duplicate records in the addressbook table for the customerid primary key.

[18-Jun-2021 09:37:49 America/Boise] Request URI: /ADMIN/index.php?cmd=edit_orders&oID=7929&action=edit, IP address: ...
#1 require(/home2//public_html/ADMIN/edit_orders.php) called at [/home2//public_html/ADMIN/index.php:11]
--> PHP Warning: Use of undefined constant DISPLAY_PRICE_WITH_TAX_ADMIN - assumed 'DISPLAY_PRICE_WITH_TAX_ADMIN' (this will throw an Error in a future version of PHP) in /home2/*****/public_html/ADMIN/edit_orders.php on line 79.

[18-Jun-2021 09:37:49 America/Boise] Request URI: /ADMIN/index.php?cmd=edit_orders&oID=7929&action=edit, IP address: ...
#1 require(/home2//public_html/ADMIN/edit_orders.php) called at [/home2//public_html/ADMIN/index.php:11]
--> PHP Warning: Use of undefined constant DISPLAY_PRICE_WITH_TAX - assumed 'DISPLAY_PRICE_WITH_TAX' (this will throw an Error in a future version of PHP) in /home2/*****/public_html/ADMIN/edit_orders.php on line 79.

18 Jun 2021, 5:18 PM
#1707
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

wsworx:

So after I cleared my head and thought more through it I went back through my configuration table and I found that I do have these configuration keys in the configuration table of the database. When I attempt to access a customer in Customers:Orders:Edit Orders I get a blank screen and below is the only log file I get. It is titled as a warning not an actual error "myDEBUG-adm-20210618-093749-913692-warning.log". I can change the settings for the two in Configuration:My Store and the database will reflect that change so they are working correctly.

Any ideas or thoughts would be greatly appreciated?

I tried doing a new installation and copying my data over to the new tables but I can't resolve a MYSql error about there being duplicate records in the addressbook table for the customerid primary key.

[18-Jun-2021 09:37:49 America/Boise] Request URI: /ADMIN/index.php?cmd=edit_orders&oID=7929&action=edit, IP address: ...
#1 require(/home2//public_html/ADMIN/edit_orders.php) called at [/home2//public_html/ADMIN/index.php:11]
--> PHP Warning: Use of undefined constant DISPLAY_PRICE_WITH_TAX_ADMIN - assumed 'DISPLAY_PRICE_WITH_TAX_ADMIN' (this will throw an Error in a future version of PHP) in /home2/*****/public_html/ADMIN/edit_orders.php on line 79.

[18-Jun-2021 09:37:49 America/Boise] Request URI: /ADMIN/index.php?cmd=edit_orders&oID=7929&action=edit, IP address: ...
#1 require(/home2//public_html/ADMIN/edit_orders.php) called at [/home2//public_html/ADMIN/index.php:11]
--> PHP Warning: Use of undefined constant DISPLAY_PRICE_WITH_TAX - assumed 'DISPLAY_PRICE_WITH_TAX' (this will throw an Error in a future version of PHP) in /home2/*****/public_html/ADMIN/edit_orders.php on line 79.

I am really confused with these two constants. If they are constants don't they have to be declared somewhere, I would think in a language file but, and if they are what file is it that they are declared in because I have looked and looked and cannot find it. And what really whacks me out is they are used in a bunch of other places and none of that code is having issues....lol.
The other thing I notice is everywhere else it is coded like this which I understand:

if (DISPLAY_PRICE_WITH_TAX == 'true')

but in the Admin/editorders.php file it is coded like this in the define statement:

(DISPLAY_PRICE_WITH_TAX_ADMIN != 'true' ? 'out ' : ' ')

18 Jun 2021, 5:21 PM
#1708
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,069
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

wsworx:

I am really confused with these two constants. If they are constants don't they have to be declared somewhere, I would think in a language file but, and if they are what file is it that they are declared in because I have looked and looked and cannot find it. And what really whacks me out is they are used in a bunch of other places and none of that code is having issues....lol.
Each of the configuration_key values present in the ***configuration ***table in the database are present both admin/storefront as constants of the same name.

18 Jun 2021, 5:25 PM
#1709
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

lat9:

Each of the configuration_key values present in the ***configuration ***table in the database are present both admin/storefront as constants of the same name.

But how and where are they defined?
Only in the database?

18 Jun 2021, 5:41 PM
#1710
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,069
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

They're 'converted' from database definitions to PHP define's via /includes/init_includes/init_db_config_read.php.

19 Jun 2021, 12:44 PM
#1711
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,069
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

lat9:

I've just submitted v4.6.0 of Edit Orders for the Zen Cart moderators' review; I'll post back here when it's available for download.

 This release contains changes associated with the following GitHub issues:

#45: Remove Ty Package Tracker integration, now provided by a separate plugin.
#189: Drop support for Zen Cart versions prior to 1.5.6.
#190: Refactoring for zc156+ and restructuring.
#191: Eliminate product-price input fields when pricing method is Auto or AutoSpecials.
#193: Correct MySQL error when tax isn't set.
#195: Make EO more 'screen-reader friendly'.
#198: Correct order-update when an order-total's value is taxed.
#200: eo_get_new_product now returns all products and products_description fields.
#201: eo_get_country now returns its input value, if that value is an array.
#202: Correct PHP notice issued during product addition if ot_loworder_fee or ot_cod_fee is active.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=1513

20 Jul 2021, 11:51 PM
#1712
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,689
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

One of my custom discounts disappears on order edit in Zen Cart 1.5.7c / EO 4.6.0. Any ideas? I have custom fees which are retained correctly over order edits but the discount vanishes from the orders_total table and from the Total.

21 Jul 2021, 5:40 AM
#1713
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,689
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

Ugh sorry this was my fault. Please disregard.

21 Jul 2021, 4:53 PM
#1714
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,689
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

I'm wondering about the function is_product_valid().

Edit Orders has to redefine it because it's a catalog side function. But what if someone has modified the function on the catalog side to consider other characteristics of a product that might exempt it from being couponed? Then the behavior at checkout of a coupon is different from the behavior during edit orders.

A couple of options:

  • Introduce a notifier to is_product_valid() so custom checks could be added. The downside is that the associated notifiers would also need to be added to the admin.

  • Move is_product_valid into the ot_coupon.php file. The downside here is that some people might want to use this function for other discounts to exempt products from discounting.

  • Move the function to includes/functions/functions_general_shared.php in 1.5.7 so that the same definition is available to the storefront and the admin?

  • Move the function to includes/functions/functions_gvcoupons.php and start sharing that file between storefront and admin?

15 Sep 2021, 2:40 PM
#1715
dave224 avatar

dave224

Zen Follower

Join Date:
Jun 2012
Posts:
481
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

I'm trying to add some data to the end of the admin orders listing page below the lower Details and Edit buttons on the right side of the page. I'm using the NOTIFY_ADMIN_ORDERS_MENU_BUTTONS_END notifier to trigger the code. But your Edit button gets displayed last, after my data is displayed.

How can I force my code to display last? I guess the basic question I have, which has arisen before and I have found no solution yet, is how to control the execution order of observers when multiple observers are triggered by the same notifier. I would like the solution to be elegant, but any solution that works would be appreciated.

My observer is auto loaded and contains code for multiple notifiers in admin/orders.php. zc157c, PHP 7.3, Edit Orders, SBA addon's in admin.

Dave

15 Sep 2021, 3:36 PM
#1716
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,069
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

Dave224:

I'm trying to add some data to the end of the admin orders listing page below the lower Details and Edit buttons on the right side of the page. I'm using the NOTIFY_ADMIN_ORDERS_MENU_BUTTONS_END notifier to trigger the code. But your Edit button gets displayed last, after my data is displayed.

How can I force my code to display last? I guess the basic question I have, which has arisen before and I have found no solution yet, is how to control the execution order of observers when multiple observers are triggered by the same notifier. I would like the solution to be elegant, but any solution that works would be appreciated.

My observer is auto loaded and contains code for multiple notifiers in admin/orders.php. zc157c, PHP 7.3, Edit Orders, SBA addon's in admin.

Dave
Auto-loaded observers 'come in' at load point 175 and EO loads its observer at load point 999; that's why EO's button shows last. You can either modify your observer to have a specific load point or modify /admin/includes/auto_loaders/config.eo.php to move its load-point prior to 175:

<?php
// -----
// Admin-level auto-loader for the Edit Orders plugin for Zen Cart, provided by lat9 and others.
//
// Last updated 20210305-lat9 for EO v4.6.0
// 
if (!defined ('IS_ADMIN_FLAG')) { 
    die ('Illegal Access'); 
}

$autoLoadConfig[0][] = [
    'autoType' => 'class',
    'loadFile' => 'mock_cart.php',
    'classPath' => DIR_FS_ADMIN . DIR_WS_CLASSES
];

$autoLoadConfig[200][] = [
    'autoType' => 'init_script',
    'loadFile' => 'init_eo_config.php'
];

// -----
// Instantiate EO's admin observer-class (hopefully!) as the last observer to be loaded.  This
// allows other observers of the ot_shipping's NOTIFY_OT_SHIPPING_TAX_CALCS notification to do
// their thing first.
//
$autoLoadConfig[[B]999[/B]][] = [
    'autoType'  => 'class',
    'loadFile'  => 'observers/EditOrdersAdminObserver.php',
    'classPath' => DIR_WS_CLASSES
];
$autoLoadConfig[[B]999[/B]][] = [
    'autoType'   => 'classInstantiate',
    'className'  => 'EditOrdersAdminObserver',
    'objectName' => 'EditOrdersAdminObserver'
];
15 Sep 2021, 5:17 PM
#1717
dave224 avatar

dave224

Zen Follower

Join Date:
Jun 2012
Posts:
481
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Thanks lat9! I made a separate observer for the data I want after your lower edit order button and instantiated it at 1000. My observer doesn't involve tax or tax calculations so it shouldn't interfere with EO.
Thanks again!
Dave

17 Sep 2021, 6:19 PM
#1718
dave224 avatar

dave224

Zen Follower

Join Date:
Jun 2012
Posts:
481
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

I would like to reduce the size of the edit order button in the action column on the orders listing page (the one between the green "e" and pointer or "i" buttons on the left side of the page) so I can add more buttons using the observer provided for that purpose. I can reduce wrench size by changing the font size, but am not having any luck changing the green button background size. My overall goal is to add extra action buttons using font-awesome icons. Any help would be appreciated.
Dave

17 Sep 2021, 8:01 PM
#1719
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,069
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

EO adds that button via its observer's methods:

    
    protected function addEditOrderButton($orders_id, $button_list)
    {
        $updated_button_list = str_replace(
            [
                EO_IMAGE_BUTTON_EDIT,
                IMAGE_EDIT,
            ],
            [
                EO_IMAGE_BUTTON_DETAILS,
                IMAGE_DETAILS
            ],
            $button_list
        );
        return $updated_button_list . ' ' . $this->createEditOrdersLink($orders_id, zen_image_button(EO_IMAGE_BUTTON_EDIT, IMAGE_EDIT), IMAGE_EDIT);
    }

    protected function createEditOrdersLink($orders_id, $link_button, $link_text, $include_zc156_parms = true)
    {
        $link_parms = '';
        if ($include_zc156_parms) {
            $link_parms = ' class="btn btn-primary" role="button"';
        } elseif ($this->is157OrLaterZenCart) {
            $link_parms = ' class="btn btn-default btn-edit"';
        }
        return ' <a href="' . zen_href_link(FILENAME_EDIT_ORDERS, zen_get_all_get_params(['oID', 'action']) . "oID=$orders_id&action=edit", 'NONSSL') . "\"$link_parms>$link_text</a>";
    }

I'm guessing that changing that btn-edit class will change the coloring.

18 Sep 2021, 4:36 PM
#1720
dave224 avatar

dave224

Zen Follower

Join Date:
Jun 2012
Posts:
481
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Yes, I was working in the CSS for btn-edit. Forgot height and width did not include padding, borders and margins. Looks great now with padding at 0 and height and width set at 20px. I moved the symbol up with vertical-align:2px to center it in the background.
Dave