Hello,
I am a total newbie to php, and i found an example of some code that i wanted to use in combination with Joomla and Virtuemart shopping system, anyyways the idea behind the system is that users get karma points for participation in the community, and these points can be redeemed through an online shop, the php is essentially the code for the payment processor, i have gone through and i had lots of errors in this script however most of them have been worked out, the followed the lines of unexpected T_Strings or otherwise however these have been debugged, now hopefully this is the last message that needs fixing however i have no idea where to start, if anyone could have a look over it and make suggestions or modifications needed it would be most appreciated.
Thanks again to anyone who can help out,
I have attached the error message i got, and the php code below
Error message:
Parse error: parse error, unexpected $end in W:\www\administrator\components\com_virtuemart\html\checkout.thankyou.php(83) : eval()'d code on line 32
Error: The code of the payment method Credit Points (Credits) contains a Parse Error!
Please correct that first
<?php
$tax_total = $db->f("order_tax\") + $db->f(\"order_shipping_tax\");
$discount_total = $db->f(\"coupon_discount\") + $db->f(\"order_discount\");
$amount = round( $db->f(\"order_subtotal\")+$tax_total-$discount_total, 2);
$order_id = $db->f(\"order_id\") ;
$order_item_sku = $db->f(\"order_item_sku\") ;
$order_item_name = $db->f(\"order_item_name\") ;
$b = round( $db->f(\"order_subtotal\")+$tax_total-$discount_total, 2);
$row = null;
$database->setQuery( "SELECT * FROM #__karma_tb WHERE userid='$my->id'" );
$database->loadObject($row);
if ($row->credit > $b) {
$database->setQuery( "UPDATE #__karma_tb SET total_karma=total_karma-'$amount' WHERE userid='$my->id' " );
$database->query();
echo '<br />Credit Deduction Successful';
$database->setQuery( "UPDATE `jos_vm_orders` SET `order_status` = 'C' WHERE `jos_vm_orders`.`order_id` = '$order_id' " );
$database->query();
// extra
//parameter for function order_status_update
$d = array ("order_id" => $order_id,
"notify_customer" => "Y",
"order_status" => "C",
"current_order_status" => "P");
require_once ($mosConfig_absolute_path.'/administrator/components/com_virtuemart/classes/ps_order.php');
$ps_order = new ps_order;
$ps_order->order_status_update($d);
//end
} else {
$database->setQuery( "UPDATE `jos_vm_orders` SET `order_status` = 'X' WHERE `jos_vm_orders`.`order_id` = '$order_id' " );
$database->query();
echo '<br /><b/>INSUFFICIENT CREDITS AVAILABLE - You can increase your credits by further participation in the community, ';
}
?>