I can't seem to get shipping working using either UPS or USPS. Right now I have USPS enabled but I get the following error: Warning: No Shipping options are available. Please contact us for assistance!
When I check the log it appears its trying to communicate and gets an answer from USPS (below). I've been browsing all the boards and believe all my settings are correct.
This is a new installation of version 3.0.3.2 on a hosted server.
Any assistance is appreciated.
2019-08-24 0:36:06 - USPS DATA SENT: API=RateV4&XML=<RateV4Request USERID="880TROYN4341"> <Package ID="1"> <Service>ALL</Service> <ZipOrigination>20180</ZipOrigination> <ZipDestination>20180</ZipDestination> <Pounds>10</Pounds> <Ounces>0</Ounces> <Container>VARIABLE</Container> <Size>REGULAR</Size> <Width>10</Width> <Length>10</Length> <Height>10</Height> <Girth>50</Girth> <Machinable>false</Machinable> </Package></RateV4Request>
2019-08-24 0:36:06 - USPS DATA RECV: <?xml version="1.0" encoding="UTF-8"?>
<RateV4Response><Package ID="1"><ZipOrigination>20180</ZipOrigination><ZipDestination>20180</ZipDestination><Pounds>10</Pounds><Ounces>0</Ounces><Machinable>FALSE</Machinable><Zone>1</Zone><Postage CLASSID="3"><MailService>Priority Mail Express 2-Day</MailService><Rate>40.75</Rate></Postage><Postage CLASSID="2"><MailService>Priority Mail Express 2-Day Hold For Pickup</MailService><Rate>40.75</Rate></Postage><Postage CLASSID="23"><MailService>Priority Mail Express 2-Day Sunday/Holiday Delivery</MailService><Rate>53.25</Rate></Postage><Postage CLASSID="1"><MailService>Priority Mail 1-Day</MailService><Rate>13.10</Rate></Postage><Postage CLASSID="6"><MailService>Media Mail Parcel</MailService><Rate>7.43</Rate></Postage><Postage CLASSID="7"><MailService>Library Mail Parcel</MailService><Rate>7.02</Rate></Postage></Package></RateV4Response>
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<RateV4Response>
<Package ID="1">
<ZipOrigination>20180</ZipOrigination>
<ZipDestination>20180</ZipDestination>
<Pounds>10</Pounds>
<Ounces>0</Ounces>
<Machinable>FALSE</Machinable>
<Zone>1</Zone>
<Postage CLASSID="3">
<MailService>Priority Mail Express 2-Day</MailService>
<Rate>40.75</Rate>
</Postage>
<Postage CLASSID="2">
<MailService>Priority Mail Express 2-Day Hold For Pickup</MailService>
<Rate>40.75</Rate>
</Postage>
<Postage CLASSID="23">
<MailService>Priority Mail Express 2-Day Sunday/Holiday Delivery</MailService>
<Rate>53.25</Rate>
</Postage>
<Postage CLASSID="1">
<MailService>Priority Mail 1-Day</MailService>
<Rate>13.10</Rate>
</Postage>
<Postage CLASSID="6">
<MailService>Media Mail Parcel</MailService>
<Rate>7.43</Rate>
</Postage>
<Postage CLASSID="7">
<MailService>Library Mail Parcel</MailService>
<Rate>7.02</Rate>
</Postage>
</Package>
</RateV4Response>
you could add:
Code: Select all
error_log(print_r($quote_data,true));
Code: Select all
if ($quote_data) {
in catalog/model/extension/shipping/usps.php
that should print out the quotes it parsed from the above xml, if any, in your php error log.
that should tell you if the problem is in the parsing or somewhere else.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
you could extend the debug info like below:
Code: Select all
if ($rate_response || $intl_rate_response) {
if ($this->config->get('shipping_usps_debug')) $this->log->write("USPS DATA 1: RATE RESPONSE");
if ($address['iso_code_2'] == 'US') {
if ($this->config->get('shipping_usps_debug')) $this->log->write("USPS DATA: US ISO");
$allowed = array(0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 16, 17, 18, 19, 22, 23, 25, 27, 28);
$package = $rate_response->getElementsByTagName('Package')->item(0);
$postages = $package->getElementsByTagName('Postage');
if ($postages->length) {
if ($this->config->get('shipping_usps_debug')) $this->log->write("USPS DATA 2: POSTAGES");
foreach ($postages as $postage) {
$classid = $postage->getAttribute('CLASSID');
if ($this->config->get('shipping_usps_debug')) $this->log->write("USPS DATA 3: CLASSID: ".$classid);
if (in_array($classid, $allowed)) {
if ($this->config->get('shipping_usps_debug')) $this->log->write("USPS DATA 4: CLASSID: ".$classid." ALLOWED");
if ($classid == '0') {
if ($this->config->get('shipping_usps_debug')) $this->log->write("USPS DATA 5: CLASSID: 0");
$mailservice = $postage->getElementsByTagName('MailService')->item(0)->nodeValue;
foreach ($firstclasses as $k => $firstclass) {
if ($firstclass == $mailservice) {
$classid = $classid . $k;
break;
}
}
if ($this->config->get('shipping_usps_debug')) $this->log->write("USPS DATA 6: FIRST CLASS: ".$classid);
if (($this->config->get('shipping_usps_domestic_' . $classid))) {
$cost = $postage->getElementsByTagName('Rate')->item(0)->nodeValue;
if ($this->config->get('shipping_usps_debug')) $this->log->write("USPS DATA 7: DOMESTIC CLASSID: ".$classid." SET, QUOTE");
$quote_data[$classid] = array(
'code' => 'usps.' . $classid,
'title' => $postage->getElementsByTagName('MailService')->item(0)->nodeValue,
'cost' => $this->currency->convert($cost, 'USD', $this->config->get('config_currency')),
'tax_class_id' => $this->config->get('shipping_usps_tax_class_id'),
'text' => $this->currency->format($this->tax->calculate($this->currency->convert($cost, 'USD', $this->session->data['currency']), $this->config->get('shipping_usps_tax_class_id'), $this->config->get('config_tax')), $this->session->data['currency'], 1.0000000)
);
}
} elseif ($this->config->get('shipping_usps_domestic_' . $classid)) {
if ($this->config->get('shipping_usps_debug')) $this->log->write("USPS DATA 8: DOMESTIC CLASSID: ".$classid." SET QUOTE");
$cost = $postage->getElementsByTagName('Rate')->item(0)->nodeValue;
$quote_data[$classid] = array(
'code' => 'usps.' . $classid,
'title' => $postage->getElementsByTagName('MailService')->item(0)->nodeValue,
'cost' => $this->currency->convert($cost, 'USD', $this->config->get('config_currency')),
'tax_class_id' => $this->config->get('shipping_usps_tax_class_id'),
'text' => $this->currency->format($this->tax->calculate($this->currency->convert($cost, 'USD', $this->session->data['currency']), $this->config->get('shipping_usps_tax_class_id'), $this->config->get('config_tax')), $this->session->data['currency'], 1.0000000)
);
}
}
}
} else {
Code: Select all
if ($this->config->get('shipping_usps_debug')) $this->log->write("USPS DATA 1: RATE RESPONSE");
Code: Select all
if ($this->config->get('shipping_usps_debug')) $this->log->write("USPS DATA 2: POSTAGES");
so you can see why the module does not accept the received quotes from usps.
These will go into your OC error log if debug is enabled.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Seems, to be Opencart UPS shipping problem... I hope it would be fixed in next Opencart version.
To fix it, please, follow next steps:
1. Enter your website file directory through FTP or CPanel
2. Find the file catalog/model/extension/shipping/ups.php
3. In this file you should find this line: if ($this->config->get('ups_' . strtolower($this->config->get('shipping_ups_origin')) . '_' . $code)) {
4. Replace it with this one: if ($this->config->get('shipping_ups_' . strtolower($this->config->get('shipping_ups_origin')) . '_' . $code)) {
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Users browsing this forum: No registered users and 391 guests