Page 1 of 1

weigth_countries _zipCond zip: when using price_shipping

PostPosted: Tue Jun 03, 2014 2:50 pm
by admin
hello, if you experience a notice of:

weigth_countries _zipCond zip: ...

as logged in user and you are using price_shipping plugin (by Giang Dinh Truong Ossolution Team), you may need to comment a few lines in your file to get rid of this notice on your checkout:

\plugins\vmshipment\price_shipping\price_shipping.php

original code:
Code: Select all
/**
    * Private method to check the conditions on Zip code
    */
   private function _zipCond ($zip, $method) {
      $zip = (int)$zip;
      $zip_cond = true;
      if (!empty($zip) ) {
         if(!empty($method->zip_start) and !empty( $method->zip_stop)){
            $zip_cond = (($zip >= $method->zip_start AND $zip <= $method->zip_stop));
         } else if (!empty($method->zip_start)) {
            $zip_cond = ($zip >= $method->zip_start);
         } else if (!empty($method->zip_stop)) {
            $zip_cond = ($zip <= $method->zip_stop);
         }
      } else if(!empty($method->zip_start) or !empty( $method->zip_stop)){
         $zip_cond = false;
      }
      
      vmAdminInfo ('weigth_countries _zipCond zip:' . $zip, ' method->zip_start:' . $method->zip_start .
         ' method->zip_stop:' .
         $method->zip_stop . ' result:' . $zip_cond);
      
      return $zip_cond;
   }


updated code:
Code: Select all
/**
    * Private method to check the conditions on Zip code
    */
   private function _zipCond ($zip, $method) {
      $zip = (int)$zip;
      $zip_cond = true;
      if (!empty($zip) ) {
         if(!empty($method->zip_start) and !empty( $method->zip_stop)){
            $zip_cond = (($zip >= $method->zip_start AND $zip <= $method->zip_stop));
         } else if (!empty($method->zip_start)) {
            $zip_cond = ($zip >= $method->zip_start);
         } else if (!empty($method->zip_stop)) {
            $zip_cond = ($zip <= $method->zip_stop);
         }
      } else if(!empty($method->zip_start) or !empty( $method->zip_stop)){
         $zip_cond = false;
      }
      /*
      vmAdminInfo ('weigth_countries _zipCond zip:' . $zip, ' method->zip_start:' . $method->zip_start .
         ' method->zip_stop:' .
         $method->zip_stop . ' result:' . $zip_cond);
       */
      return $zip_cond;
   }


Please note the comments above.

Best Regards,
Stan