lbennett Posted March 25, 2010 Posted March 25, 2010 Whilst this refers to a credit card payment module I think my problem is my lack of understanding of PHP variables and syntax. I have SPPC installed, therefore, DISPLAY_PRICE_WITH_TAX which was originally in line 4 of the code below always has to be set to true. Whether prices are displayed including or excluding tax under SPPC is dependant on CUSTOMERS_GROUP_SHOW_TAX, a field in the customers_group table of the database. Searching through the code I also came across $sppc_customers_group_show_tax. I've tried replacing DISPLAY_PRICE_WITH_TAX with both CUSTOMERS_GROUP_SHOW_TAX and $sppc_customers_group_show_tax but in each case the results indicate the value is "false". Following is the section of code in question which should pass $0 if CUSTOMERS_GROUP_SHOW_TAX == 'true' but passes the tax amount as if CUSTOMERS_GROUP_SHOW_TAX == 'false'. //Taxes foreach($order->info['tax_groups'] as $name => $value) { if ((float)$value > 0){ if (CUSTOMERS_GROUP_SHOW_TAX == 'true'){ //If the prices are displayed with tax add the description of the tax as a product with $0 value //This will make sure the tax details are displayed in the payment page //$0 value will make sure the tax is not added AGAIN to the order total $gateway_vars[number_format((float)$value, 2, '.', '').' '.$name.' '.MODULE_PAYMENT_NAB_TRANSACT_HPP_PROD_DESC_TAX_INCLUDED] = '1,0'; } else { $gateway_vars[MODULE_PAYMENT_NAB_TRANSACT_HPP_PROD_DESC_TAX.': '.$name] = '1,'.number_format((float)$value, 2, '.', ''); } } } Any help would be appreiciated. Quote
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.
Note: Your post will require moderator approval before it will be visible.