title: prestashop get products of an order
body: <p>I get all data that I want from delivery address with this:</p>
  
  <pre><code>public function getOrderShippingCost($params, $shipping_cost)
      {
          global $smarty;
  $url = Tools::getHttpHost(true).__PS_BASE_URI__;
  $address = new Address($this-&gt;context-&gt;cart-&gt;id_address_delivery);
          $state = new State ($address-&gt;id_state);
          $country = new Country ($address-&gt;id_country);
  
  echo $address-&gt;postcode;
  
          echo $address-&gt;country;
  
          echo $address-&gt;address1;
  
          echo $address-&gt;address2;
  
          echo $state-&gt;name;
  
          echo $country-&gt;iso_code;
  </code></pre>
  
  <p>And the result is fine, but now how can I get the products of an order?</p>
  
  <p>I try this code: </p>
  
  <p><code>$products = $params['cart']-&gt;getProducts(true);</code> </p>
  
  <p>but the result of this is <code>Fatal error: Cannot use object of type Cart as array in</code></p>
  
  <p>If I try with something like this:</p>
  
  <pre><code>$order = new Order($this-&gt;context-&gt;order-&gt;id_order);
  </code></pre>
  
  <p>the result are two error:</p>
  
  <pre><code>Notice: Undefined property: Context::$order in /var/www/prestashop/modules/mycarrier/mycarrier.php on line 325
  
  Notice: Trying to get property of non-object in /var/www/prestashop/modules/mycarrier/mycarrier.php on line 325
  </code></pre>
  
  <p>How can get the products?</p>