Skip to content

Commit

Permalink
[*] MO - paypal : added phone and fix #32 (int != string)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbigueres committed Nov 20, 2014
1 parent fe2b95e commit d04581e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion api/v1/classes/PowaTagOrders.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public function __construct(stdClass $datas)
$order = current($this->datas->orders);

$this->datas->customer = $order->customer;
$this->datas->customer->shippingAddress->phone = $order->customer->phone;
if(isset($this->datas->customer->billingAddress))
$this->datas->customer->billingAddress->phone = $order->customer->phone;

$this->datas->orderLineItems = $order->orderLineItems;

Expand Down Expand Up @@ -409,7 +412,7 @@ private function addProductsToCart($cart, $codeCountry)

return false;
}
if($p->quantity < $product->minimal_quantity || ($combination && $combination->minimal_quantity > $product->minimal_quantity))
if($p->quantity < $product->minimal_quantity || ($combination && $combination->minimal_quantity > $product->minimal_quantity))
{
$this->addError(sprintf($this->module->l('Quantity < minimal quantity for product')), PowaTagAbstract::$NOT_IN_STOCK);

Expand Down
4 changes: 3 additions & 1 deletion classes/PowaTagProductHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static function getProductByCode($code, $id_lang)
$id_product = (int)self::getProductIdByIdProduct($code);
break;
}

$product = new Product($id_product, true, (int)$id_lang);

//Check if multishop is enabled
Expand All @@ -97,6 +97,8 @@ public static function getProductByCode($code, $id_lang)

private static function getProductIdByIdProduct($code)
{
if((string)(int)$code !== $code)
return false;
return $code;
}

Expand Down

0 comments on commit d04581e

Please sign in to comment.