Page 172 of 179 FirstFirst ... 72122162170171172173174 ... LastLast
Results 1,711 to 1,720 of 1784
  1. #1711
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,625
    Plugin Contributions
    123

    Default 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?
    That Software Guy. My Store: Zen Cart Modifications
    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.

  2. #1712
    Join Date
    Jun 2012
    Posts
    407
    Plugin Contributions
    0

    Default 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

  3. #1713
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,403
    Plugin Contributions
    87

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by Dave224 View Post
    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:
    Code:
    <?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[999][] = [
        'autoType'  => 'class',
        'loadFile'  => 'observers/EditOrdersAdminObserver.php',
        'classPath' => DIR_WS_CLASSES
    ];
    $autoLoadConfig[999][] = [
        'autoType'   => 'classInstantiate',
        'className'  => 'EditOrdersAdminObserver',
        'objectName' => 'EditOrdersAdminObserver'
    ];

  4. #1714
    Join Date
    Jun 2012
    Posts
    407
    Plugin Contributions
    0

    Default 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

  5. #1715
    Join Date
    Jun 2012
    Posts
    407
    Plugin Contributions
    0

    Default 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

  6. #1716
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,403
    Plugin Contributions
    87

    Default Re: Edit Orders v4.0 Support Thread

    EO adds that button via its observer's methods:
    Code:
        
        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 . '&nbsp;' . $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 '&nbsp;<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.

  7. #1717
    Join Date
    Jun 2012
    Posts
    407
    Plugin Contributions
    0

    Default 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

  8. #1718
    Join Date
    Jun 2012
    Posts
    407
    Plugin Contributions
    0

    Default Re: Edit Orders v4.0 Support Thread

    I encountered the following notice when deleting an order from the admin orders listing page:
    PHP Notice: Undefined offset: 3 in ...admin/includes/classes/observers/EditOrdersAdminObserver.php on line 69
    Also, should the edit order button appear in the delete order confirmation area after the delete button is clicked on the orders listing page? It seems out of place to me there.

    Thanks for a great add-on!
    Dave
    zc257c, php 7.3.x, eo 4.6.0

  9. #1719
    Join Date
    Jun 2012
    Posts
    407
    Plugin Contributions
    0

    Default Re: Edit Orders v4.0 Support Thread

    Edit Orders 4.5.7 recalculates tax differently than store side. Specifically, the store side calculates tax on the product subtotal minus group discount (which is what I want), but edit orders calculates the tax on the product subtotal before the discount is applied. Please help. Log attached.
    Dave
    zc v155f, php 7.3.x
    Attached Files Attached Files

  10. #1720
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,403
    Plugin Contributions
    87

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by Dave224 View Post
    Edit Orders 4.5.7 recalculates tax differently than store side. Specifically, the store side calculates tax on the product subtotal minus group discount (which is what I want), but edit orders calculates the tax on the product subtotal before the discount is applied. Please help. Log attached.
    Dave
    zc v155f, php 7.3.x
    Thanks for the log, it'll help to determine what's going on. I've created an issue (https://github.com/lat9/edit_orders/issues/207) in EO's GitHub repository to track the change needed.

    Please note that my time is currently devoted to paid-clients' requests, but I'll try to work this in over the next weeks.

 

 

Similar Threads

  1. v150 Super Orders v4.0 Support Thread for ZC v1.5.x
    By DivaVocals in forum Addon Admin Tools
    Replies: 797
    Last Post: 23 Mar 2024, 06:51 AM
  2. v150 Orders Status History -- Updated By [Support Thread]
    By lat9 in forum Addon Admin Tools
    Replies: 34
    Last Post: 29 Jul 2019, 07:05 PM
  3. 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
  4. 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
  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

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR