Skip to content

Commit

Permalink
Bugfix for custom Format
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Schapfl committed Apr 25, 2019
1 parent 84a6154 commit d545c77
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/client/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,14 @@ public function findProductByQuantityId($quantityId)

/**
* @param $quantityId
* @param $width
* @param $height
* @return bool
* @internal param Product $product
*/
private function addProductToCart($quantityId)
private function addProductToCart($quantityId, $width, $height)
{
$result = $this->api_client->addProductToCart((int) $quantityId);
$result = $this->api_client->addProductToCart((int) $quantityId, $width, $height);

return $result;
}
Expand All @@ -281,7 +283,7 @@ public function getShippingTypeList(Product $product)
{
try {
$this->login();
$result = $this->addProductToCart($product->getQuantityId());
$result = $this->addProductToCart($product->getQuantityId(), null, null);
} catch (\Exception $e) {
throw new SoapCallException("FLYERALARM API Call: Unable to get ShippingTypes.", 5116, $e);
}
Expand All @@ -299,7 +301,7 @@ public function getAvailableProductOptions(Order $order)
{
try {
$this->login();
$this->addProductToCart($order->getQuantityId());
$this->addProductToCart($order->getQuantityId(), $order->getCustomWidth(), $order->getCustomHeight());
$this->addShippingTypeToProduct($order->getShippingTypeId());
$array = $this->api_client->getAvailableProductOptions();
} catch (\Exception $e) {
Expand Down Expand Up @@ -344,7 +346,7 @@ public function getAvailableShippingOptions(Order $order)
{
try {
$this->login();
$this->addProductToCart($order->getQuantityId());
$this->addProductToCart($order->getQuantityId(), $order->getCustomWidth(), $order->getCustomHeight());
$return = $this->api_client->getAvailableShippingOptions();
} catch (\Exception $e) {
throw new SoapCallException("FLYERALARM API Call: Unable to get available ShippingOptions.", 5118, $e);
Expand Down Expand Up @@ -389,7 +391,7 @@ public function getAvailablePaymentOptions(Order $order)
{
try {
$this->login();
$this->addProductToCart($order->getQuantityId());
$this->addProductToCart($order->getQuantityId(), $order->getCustomWidth(), $order->getCustomHeight());
$this->addShippingTypeToProduct($order->getShippingTypeId());
$this->addProductOptions($order->getProductOptionsArray());
$this->addShippingOptions(
Expand Down

0 comments on commit d545c77

Please sign in to comment.