title: Prestashop get access to cart variables in the custom module
body: <p>In prestashop I want to get the exact payment details step data in my payment module. So I just made copy the code from order-payment.tpl and used that in my payment execution smarty file. It showed couple of errors. So I just go through the codes and get those values from the cart and made it assign from my payment controller to the smarty template. Everything works fine but still I am getting one error named as</p>
  
  <pre><code>Undefined index: gift_products .
  </code></pre>
  
  <p>When I checked the code in Cart.php I got it like this</p>
  
  <pre><code>$gift_products = array();
  $gift_product = $product;
  $gift_product['cart_quantity'] = 1;
  $gift_product['price'] = 0;
  $gift_product['price_wt'] = 0;
  $gift_product['total_wt'] = 0;
  $gift_product['total'] = 0;
  $gift_product['gift'] = true;
  $gift_products[] = $gift_product;
  
  I tried to assign the value of gift_products to the smarty like this
  
  public function initContent()
  {
      parent::initContent();
  
      $cart = $this-&gt;context-&gt;cart;
      $this-&gt;context-&gt;smarty-&gt;assign(array(
          'gift_products' =&gt; $cart-&gt;gift_products,
      ));
  
      $this-&gt;setTemplate('payment_execution.tpl');
  }
  </code></pre>
  
  <p>But its not working at all. Can someone tell me how to use the variable/array of cart in my module? Any help and suggestions will be really appreciable. Thanks.</p>