Skip to content

Commit

Permalink
Version 0.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
dmattke committed Mar 1, 2018
1 parent 19f00e9 commit c6e890a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
11 changes: 6 additions & 5 deletions admin/CargonizerOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,13 @@ function getTransportAgreements($force_update=false){
if ( !$transport_agreements or $force_update ){
_log('update transport agreements');
$Api = new CargonizerApi(true);
$agreements = $Api->TransportAgreements->xpath('/transport-agreements/transport-agreement');
if ( is_object($Api) && isset($Api->TransportAgreements) ){
$agreements = $Api->TransportAgreements->xpath('/transport-agreements/transport-agreement');

if ( $ta = $this->extractTransportAgreements($agreements) ){
$this->saveTransportAgreements( $ta );

$transport_agreements = $ta;
if ( $ta = $this->extractTransportAgreements($agreements) ){
$this->saveTransportAgreements( $ta );
$transport_agreements = $ta;
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion include/api/CargonizerApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ function postConsignment($xml){
'Content-Type' => 'application/xml'
);

return $this->rest('consignments.xml', $headers, 'POST', $xml, $debug=false, $force_response=true );
_log($xml);
return $this->rest('consignments.xml', $headers, 'POST', $xml, $debug=true, $force_response=true );
}


Expand Down
2 changes: 1 addition & 1 deletion include/controllers/ConsignmentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static function createConsignment( $post_id ){
$CargonizeXml = new CargonizeXml( $Consignment->prepareExport() );
$CargonizerApi = new CargonizerApi();
$result = null;
_log('post consignment');

$result = $CargonizerApi->postConsignment($CargonizeXml->Xml);
if ( $result ){
// check if response is object
Expand Down
2 changes: 1 addition & 1 deletion woocommerce-cargonizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*woo
Plugin Name: Woocommerce Cargonizer
Description:
Version: 0.4.6
Version: 0.4.7
Author: Mediebruket AS
Author URI: http://mediebruket.no
*/
Expand Down

0 comments on commit c6e890a

Please sign in to comment.