title: Magento save order total in checkout page
body: <p>We have a system like gift cards balance usage in the checkout page.While customers on the checkout page customers can use their Gift card balance amount to buy products. </p>
  
  <p>So i have added a a tab before payment tab in which customers have option to enter the amount o use from their gift card balance amount so when they say proceed am getting the entered value in custom Onepage controller and pass it to Onepage.php(Model class) to reduce the total amount.</p>
  
  <p>This is what am doing on the model class.</p>
  
  <pre><code>public function saveCustomDiscount($discount=0)
  {       
      $this-&gt;getQuote()-&gt;setGrandTotal($this-&gt;getQuote()-&gt;getGrandTotal() - $discount);
      $this-&gt;getQuote()-&gt;setBaseGrandTotal($this-&gt;getQuote()-&gt;getBaseGrandTotal() - $discount);
      $this-&gt;getQuote()-&gt;save();
      //$this-&gt;getQuote()-&gt;collectTotals()-&gt;save();
      $order = $this-&gt;getQuote()-&gt;getData();  
      Zend_Debug::dump($order);      
      return array();
  }
  </code></pre>
  
  <p>And am calling this function from the controller Action function were am getting the user input. </p>
  
  <p>Here what ever am passing as discount the total amount and base total is not reducing. Its same as original. </p>
  
  <p>Note : 
   Before custom order save.</p>
  
  <pre><code>array(51) {
     ---------------
    ["grand_total"] =&gt; string(8) "243.7200"
    ["base_grand_total"] =&gt; string(8) "243.7200"
    ----------------- 
  }
  </code></pre>
  
  <p>After custom order save.</p>
  
  <pre><code>array(51) {
     ---------------
     ["grand_total"] =&gt; float(223.72)
     ["base_grand_total"] =&gt; float(223.72)
    ----------------- 
  }
  </code></pre>
  
  <p>The data type is changed from string to float when am doing debug. What i have to do, to reduce the order total from the custom discount. Please help me.</p>
  
  <p>Thanks</p>