Skip to content

Commit

Permalink
Merge pull request #3731 from DaveMcW/master
Browse files Browse the repository at this point in the history
Weight limit error check
  • Loading branch information
danielkerr committed Dec 10, 2015
2 parents 0284184 + ec4acd1 commit be2a038
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions upload/catalog/model/shipping/usps.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ public function getQuote($address) {
$status = false;
}

$weight = $this->weight->convert($this->cart->getWeight(), $this->config->get('config_weight_class_id'), $this->config->get('usps_weight_class_id'));

// 70 pound limit
if ($weight > 70) {
$status = false;
}

$method_data = array();

if ($status) {
$this->load->model('localisation/country');

$quote_data = array();

$weight = $this->weight->convert($this->cart->getWeight(), $this->config->get('config_weight_class_id'), $this->config->get('usps_weight_class_id'));

$weight = ($weight < 0.1 ? 0.1 : $weight);
$pounds = floor($weight);
$ounces = round(16 * ($weight - $pounds), 2); // max 5 digits
Expand Down

0 comments on commit be2a038

Please sign in to comment.