Page 156 of 179 FirstFirst ... 56106146154155156157158166 ... LastLast
Results 1,551 to 1,560 of 1787
  1. #1551
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,671
    Plugin Contributions
    123

    Default Re: Edit Orders v4.0 Support Thread

    admin/includes/classes/editOrders.php lines 270, 274: should $this->shipping_tax_rate be cast as a float in case it's null?
    (Getting SQL error on line 270)
    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. #1552
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,472
    Plugin Contributions
    88

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by swguy View Post
    Investigating ...

    admin/includes/functions/extra_functions/edit_orders_functions.php lines 1429-1445 you are referencing $order->totals[$i]['class'].
    This should be $order->totals[$i]['code'] shouldn't it?

    (lines are same between EO 4.5.0 and 4.5.1)
    Nope, the $order->totals array is 'indexed' by its class element.

    The $order_total_modules, just to make life interesting, returns each module's entry with a reference to its code (aka the order's class) element.

  3. #1553
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,671
    Plugin Contributions
    123

    Default Re: Edit Orders v4.0 Support Thread

    As created by the class, yes - but by the time it gets to eo_update_database_order_totals, the array entries have been changed. See screenshot.
    Attached Images Attached Images  
    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.

  4. #1554
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,472
    Plugin Contributions
    88

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by swguy View Post
    The root cause of the deleted tax line is in the block that handles the "rogue" ot_tax value.
    (Around 1449 of ./includes/functions/extra_functions/edit_orders_functions.php).

    My tax title is Sales tax (if any) + Shipping Tax (0.0000%) + Tax:

    which does not work for the clause

    `title` NOT IN ($tax_groups)

    Perhaps a LIKE would be better - something like

    Code:
    foreach ($tax_groups as &$tax_group) {
       $tax_group = '%' . $db->prepareInput($tax_group) .'%'. ':';
    }
    $tax_groups = "'" . implode("', '", $tax_groups) . "'";
    ...
    $query = 
                    "DELETE FROM " . TABLE_ORDERS_TOTAL . "
                      WHERE orders_id = $oID
                        AND `class` = 'ot_tax'
                        AND `title` NOT IN (";  
    for ($i = 0; $i < count($tax_groups); $i++) {
       if ($i > 0) $query .= ","; 
       $query .= $tax_groups[$i]; 
    }
    $query .= ")";
    Hmm, looks like you've got My Store::Show Split Tax Lines set to false. Let me investigate further.

  5. #1555
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,472
    Plugin Contributions
    88

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by swguy View Post
    As created by the class, yes - but by the time it gets to eo_update_database_order_totals, the array entries have been changed. See screenshot.
    You're displaying the contents of the $order_totals array, as returned by $order_total_modules->process, not the contents of $order->totals.

  6. #1556
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,671
    Plugin Contributions
    123

    Default Re: Edit Orders v4.0 Support Thread

    Aside: sorry, that suggested code didn't come out quite right - I was thinking a LIKE with all strings concatenated with % between strings (and before and after).
    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.

  7. #1557
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,671
    Plugin Contributions
    123

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by lat9 View Post
    You're displaying the contents of the $order_totals array, as returned by $order_total_modules->process, not the contents of $order->totals.
    CRAP! You are correct, sorry for the false report.
    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.

  8. #1558
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,472
    Plugin Contributions
    88

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by swguy View Post
    admin/includes/classes/editOrders.php lines 270, 274: should $this->shipping_tax_rate be cast as a float in case it's null?
    (Getting SQL error on line 270)
    It's taken a long time to get all those other float-casts out of EO (trying to get rid of those penny-off calculations), but I'll update this section of the class' initializeOrderShippingTax method:
    Code:
            switch ($action) {
                case 'update_order':
                    $this->shipping_tax_rate = $_POST['shipping_tax'];
                    $order->info['shipping_tax'] = $this->calculateOrderShippingTax(true);
                    break;
                case 'add_prdct':
                    $this->shipping_tax_rate = $tax_rate->fields['shipping_tax_rate'];
                    $order->info['shipping_tax'] = $this->eoRoundCurrencyValue(zen_calculate_tax($order->info['shipping_cost'], $this->shipping_tax_rate));
                    break;
                default:
                    $this->shipping_tax_rate = $tax_rate->fields['shipping_tax_rate'];
                    $order->info['shipping_tax'] = $this->calculateOrderShippingTax(false);
                    break;
            }
    to sanitize that value on entry.

    See this GitHub issue for follow-on: https://github.com/lat9/edit_orders/issues/157
    Last edited by lat9; 22 Jun 2020 at 12:38 PM. Reason: Referrence GitHub issue

  9. #1559
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,671
    Plugin Contributions
    123

    Default Re: Edit Orders v4.0 Support Thread

    As an alternative, you could not do the update when the value is null. But I'm ok with either solution. Thanks!
    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.

  10. #1560
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,472
    Plugin Contributions
    88

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by lat9 View Post
    It's taken a long time to get all those other float-casts out of EO (trying to get rid of those penny-off calculations), but I'll update this section of the class' initializeOrderShippingTax method:
    Code:
            switch ($action) {
                case 'update_order':
                    $this->shipping_tax_rate = $_POST['shipping_tax'];
                    $order->info['shipping_tax'] = $this->calculateOrderShippingTax(true);
                    break;
                case 'add_prdct':
                    $this->shipping_tax_rate = $tax_rate->fields['shipping_tax_rate'];
                    $order->info['shipping_tax'] = $this->eoRoundCurrencyValue(zen_calculate_tax($order->info['shipping_cost'], $this->shipping_tax_rate));
                    break;
                default:
                    $this->shipping_tax_rate = $tax_rate->fields['shipping_tax_rate'];
                    $order->info['shipping_tax'] = $this->calculateOrderShippingTax(false);
                    break;
            }
    to sanitize that value on entry.

    See this GitHub issue for follow-on: https://github.com/lat9/edit_orders/issues/157
    Update provided; see that issue for the change required.

 

 

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