Ejemplo n.º 1
0
 /**
  * @param mixed $products
  */
 protected function _setProducts($products)
 {
     $productsArray = $products->toArray();
     $productsToReturn = array();
     if ($productsArray) {
         foreach ($productsArray as $item) {
             $product = new \com\checkout\ApiServices\SharedModels\Product();
             $product->setName($item['name']);
             $product->setDescription($item['description']);
             $product->setSku($item['sku']);
             $product->setPrice($item['price']);
             $product->setQuantity($item['quantity']);
             $product->setImage($item['image']);
             $product->setShippingCost($item['shippingCost']);
             $product->setTrackingUrl($item['trackingUrl']);
             $productsToReturn[] = $product;
         }
     }
     $this->_products = $productsToReturn;
 }