VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Payment Modules => Topic started by: malaikax on April 10, 2010, 05:30:33 AM

Title: Creating payment module
Post by: malaikax on April 10, 2010, 05:30:33 AM
hello all,
I want to ask for the variable product name, product price, product quantity and subtotals for use in payment module.

I use a payment gateway opals from Brunei, and they provide the configuration of their value to the payment gateway, one of which is a basket containing 4 values like this.

ITEM   UPRICE   QTY   STOTAL
Palm Vx   600.00   1   600.00
Palm V   400.00   1   400.00

how to set it in VirtueMart, I need help, I've tried in many ways but always failed
Title: Re: Creating payment module
Post by: coderxo on April 18, 2010, 23:34:59 PM
      $q  = "SELECT * FROM #__vm_order_item WHERE order_id='$order_id'";
       $dbbt = new ps_DB;
         $dbbt->setQuery($q);
         $dbbt->query();
         $i = 1;
         $formvars = array();
      while( $dbbt->next_record()   )
         {   
             $name = $dbbt->f("order_item_name");
               $price = number_format($dbbt->f("product_item_price"),2,'.','');
               $quantity = $dbbt->f("product_quantity");
               
                  }
Title: Re: Creating payment module
Post by: rwcorbett on April 19, 2010, 13:45:00 PM
Quote from: coderxo on April 18, 2010, 23:34:59 PM
      $q  = "SELECT * FROM #__vm_order_item WHERE order_id='$order_id'";
       $dbbt = new ps_DB;
         $dbbt->setQuery($q);
         $dbbt->query();
         $i = 1;
         $formvars = array();
      while( $dbbt->next_record()   )
         {   
             $name = $dbbt->f("order_item_name");
               $price = number_format($dbbt->f("product_item_price"),2,'.','');
               $quantity = $dbbt->f("product_quantity");
               
                  }
like he said - and the STOTAL looks like a subtotal maybe? that var is
$dbbt->f("order_subtotal")
Title: Re: Creating payment module
Post by: coderxo on April 19, 2010, 14:04:28 PM
Maybe you should read his post and see what STOTAL is.

From the above posted code, you have the item price, and quantity.

STOTAL for each item is: $price * $quantity