diff --git a/api/v1/classes/PowaTagOrders.php b/api/v1/classes/PowaTagOrders.php index 31170ec..88da73c 100644 --- a/api/v1/classes/PowaTagOrders.php +++ b/api/v1/classes/PowaTagOrders.php @@ -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; @@ -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); diff --git a/classes/PowaTagProductHelper.php b/classes/PowaTagProductHelper.php index 9b2beae..24ffede 100644 --- a/classes/PowaTagProductHelper.php +++ b/classes/PowaTagProductHelper.php @@ -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 @@ -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; }