eccen Posted September 2, 2009 Share Posted September 2, 2009 I am having trouble with actionhook... I need to retrieve 'invoice' id from AfterShoppingCartCheckout hook. My code looks like this: function updateinfo($vars) { $invoiceid = $vars["InvoiceID"]; // Access Database include "/home/etc/user/public_html/oamysql.class.php"; $mysqldb = new mysqlClass("localhost", "dbuser", "password","dbname"); $mysqldb->connect(); $mysqldb->select(); $mysqldb->query("INSERT INTO customdbtable SET invoiceid='$invoiceid'"); mysql_close(); } add_hook("AfterShoppingCartCheckout",1,"updateinfo",""); what am I doing wrong? 0 Quote Link to comment Share on other sites More sharing options...
skyknight Posted September 2, 2009 Share Posted September 2, 2009 Don't use $invoiceid = $vars["InvoiceID"], use this $invoiceid = $vars[0]; To know the number u must print itu using print_r($vars); Sample: $vars = func_get_args(); $OrderID = $vars[0]; $OrderNumber = $vars[1]; $InvoiceID = $vars[2]; 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.