Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Location
    Taiwan
    Posts
    241
    Plugin Contributions
    0

    Default [Done v1.5.6] PHP Warning: A non-numeric value encountered in perweightunit.php

    ZC v 155f

    Just upgraded to PHP7.1

    Code:
    [27-Apr-2018 09:22:19 America/Toronto] Request URI: /index.php?main_page=shopping_cart, IP address: xxx.xxx.x.xx
    #1  perweightunit->quote() called at [/home/xxx/public_html/includes/classes/shipping.php:171]
    #2  shipping->quote() called at [/home/xxx/public_html/includes/modules/shipping_estimator.php:140]
    #3  require(/home/xxx/public_html/includes/modules/shipping_estimator.php) called at [/home/xxx/public_html    /includes/templates/xxx/templates/tpl_shopping_cart_default.php:184]
    #4  require(/home/xxx/public_html/includes/templates/xxx/templates/tpl_shopping_cart_default.php) called at [/home/xxx/public_html/includes/templates/xxx/common/tpl_main_page.php:247]
    #5  require(/home/xxx/public_html/includes/templates/xxx/common/tpl_main_page.php) called at [/home/xxx/public_html/index.php:97]
    
    [27-Apr-2018 09:22:19 America/Toronto] PHP Warning:  A non-numeric value encountered in /home/xxx/public_html/includes/modules/shipping/perweightunit.php on line 105
    Line 105 of perweightunit.php:

    Code:
       $this->quotes = array('id' => $this->code,
    The whole section is:

    Code:
      function quote($method = '') {
        global $order, $shipping_weight, $shipping_num_boxes;
     
        $total_weight_units = $shipping_weight;
         $this->quotes = array('id' => $this->code,
                               'module' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_TITLE,
                               'methods' => array(array('id' => $this->code,
                                                        'title' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_WAY,
                                                        'cost' => MODULE_SHIPPING_PERWEIGHTUNIT_COST * ($total_weight_units * $shipp    ing_num_boxes) +
                                                        (MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_PE    RWEIGHTUNIT_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING) ) ));
     
    
         if ($this->tax_class > 0) {
          $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id'])    ;
         }
     
        if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);
     
         return $this->quotes;
    }
    I've seen other posts that suggest declaring the variable as float(); but I'm not sure how to proceed here.

    Thanks for any help with this.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Re: PHP Warning: A non-numeric value encountered in perweightunit.php on line 105

    I'll guess that the issue lies in the following section of that line:

    Code:
    'cost' => MODULE_SHIPPING_PERWEIGHTUNIT_COST * ($total_weight_units * $shipping_num_boxes) + 
    (MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING) ) ));
    One of $total_weight_units, $shipping_num_boxes, MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING or MODULE_SHIPPING_PERWEIGHTUNIT_COST is a non-numeric value. My hunch is that it's one of those configuration items.

  3. #3
    Join Date
    Mar 2007
    Location
    Taiwan
    Posts
    241
    Plugin Contributions
    0

    Default Re: PHP Warning: A non-numeric value encountered in perweightunit.php on line 105

    It turns out that I didn't have a value in the "Handling Fee" section of the perweightunit shipping module.

    Putting 0 for the Handling Fee solved the problem.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 15 Dec 2018, 10:54 PM
  2. Replies: 38
    Last Post: 1 Nov 2018, 09:28 PM
  3. Replies: 0
    Last Post: 18 Feb 2018, 06:26 PM
  4. Replies: 20
    Last Post: 7 Dec 2014, 11:29 AM
  5. Replies: 0
    Last Post: 27 Sep 2012, 11:57 PM

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