Forums / Addon Shipping Modules / Please HELP ME , need a fast Response I would be grateful

Please HELP ME , need a fast Response I would be grateful

Locked

Views: 705

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
30 Jan 2013, 2:59 PM
#1
nootropics avatar

nootropics

New Zenner

Join Date:
Jan 2013
Posts:
5
Plugin Contributions:
0

Please HELP ME , need a fast Response I would be grateful

I have made some modification to a usps module ( * @version $Id: usps.php 15881 2010-04-11 16:32:39Z wilt $) :

The idea was: if the cart total value is > than $50 then FREE SHIPPING.
If the weight is egual or less than 13 oz ( 0.82 lbs) than CALCULATE USPS.
If the weight grater than 13 oz ( 0.82 lbs) than $5 flat fee.


The lines are these:

line: 390 .

$cartShowTotal = $_SESSION['cart']->show_total();
		  $shipping_weight = $_SESSION['cart']->show_weight();
		
		  if (($cartShowTotal<=49.99) && ($shipping_weight>0.82)) 
		  {
		
		 
		  	$methods[] = array('id' => $type,
                             'title' => $title,
                                'cost' => ($cost *0 + 5) + 0*(MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * 0*$shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );	
		
		  }
	 if (($cartShowTotal<=49.99) && ($shipping_weight<=0.82)) 
		  {
		 
		  $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );	

in function function _getQuote() :

line 412: ```
if ($cartShowTotal < 50) {

line 705 : 

else
{
return -1 ;


Now the clients it getting the error stored in MODULE_SHIPPING_USPS_TEXT_ERROR for weight values between 0.1 and 0.89 lbs which is weird. 
I don't see the problem ... and we are losing clients... 
Please help. 

Thanks!
30 Jan 2013, 4:39 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Please HELP ME , need a fast Response I would be grateful

Is the new update of USPS really necessarily ?
Yes as they have changed some things

Zen-Venom Get Bitten

30 Jan 2013, 5:32 PM
#5
nootropics avatar

nootropics

New Zenner

Join Date:
Jan 2013
Posts:
5
Plugin Contributions:
0

Re: Please HELP ME , need a fast Response I would be grateful

kobra:

Yes as they have changed some things

Ok... I have a question ... how can I hide an option like First Class or Priority if weight is less than 0.82 ? I used this code to hide the Priority but I get an error that they can not give a quote... :( what am I doing wrong ?

if ($shipping_weight <0.82)
{
}

else
{
	  
		  if ($key == 'PRIORITY'){
            $this->container = ''; // Blank, Flate Rate Envelope, or Flat Rate Box // Sm Flat Rate Box, Md Flat Rate Box and Lg Flat Rate Box 	
		   }   
{

 

Original code:

  if ($key == 'FIRST CLASS') {
            $this->FirstClassMailType = '<FirstClassMailType>LETTER</FirstClassMailType>';
          } else {
            $this->FirstClassMailType = '';
          }
          //PRIORITY MAIL OPTIONS
		  
		  if ($key == 'PRIORITY'){
            $this->container = ''; // Blank, Flate Rate Envelope, or Flat Rate Box // Sm Flat Rate Box, Md Flat Rate Box and Lg Flat Rate Box 	
		   }   

          
          //EXPRESS MAIL OPTIONS
          if ($key == 'EXPRESS'){
            $this->container = '';  // Blank, or Flate Rate Envelope
          }
          //PARCEL POST OPTIONS
          if ($key == 'PARCEL'){
            $this->container = 'Regular';
            $this->machinable = 'true';