Skip to content

Commit

Permalink
Dynamically set shipment as picked, default is true
Browse files Browse the repository at this point in the history
  • Loading branch information
kg-bot committed Mar 6, 2020
1 parent f175579 commit 8082c08
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
4 changes: 1 addition & 3 deletions src/Models/Lot.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ public function variations( $variation_id = 1001 )

$response = $this->request->client->get("variations/{$this->url_friendly_id}/variation-matrix");

$html = (string) $response->getBody();

return $html;
return (string)$response->getBody();
} );
}

Expand Down
16 changes: 12 additions & 4 deletions src/Models/OrderShipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,26 @@

class OrderShipment extends Model
{
protected $entity = 'order-shipments';
protected $entity = 'order-shipments';
protected $primaryKey = 'id';

public function markShipped()
/**
* Mark shipment as shipped
*
* @param bool $pick Mark all shipment lines as picked
* @return mixed
* @throws \Rackbeat\Exceptions\RackbeatClientException
* @throws \Rackbeat\Exceptions\RackbeatRequestException
*/
public function markShipped($pick = true)
{
return $this->request->handleWithExceptions(function () {
return $this->request->handleWithExceptions(function () use ($pick) {

return $this->request->client->post("orders/shipments/{$this->url_friendly_id}/mark-shipped", [

'json' => [

'pick' => true,
'pick' => $pick,
],
])
->getBody()
Expand Down
8 changes: 2 additions & 6 deletions src/Models/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ public function inventoryMatrix( $location_id = null, array $filter = null )
$response = $this->request->client->get("{$this->entity}/{$this->url_friendly_id}/variation-matrix" .
$query);

$html = (string) $response->getBody();

return $html;
return (string)$response->getBody();
} );

}
Expand All @@ -60,9 +58,7 @@ public function variations( $variation_id = 1001 )

$response = $this->request->client->get("variations/{$this->url_friendly_id}/variation-matrix");

$html = (string) $response->getBody();

return $html;
return (string)$response->getBody();
} );
}

Expand Down

0 comments on commit 8082c08

Please sign in to comment.